1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.5.0-dev
5 // source: .vppapi/plugins/map.api.json
7 // Package maps contains generated bindings for API file map.api.
24 api "git.fd.io/govpp.git/api"
25 codec "git.fd.io/govpp.git/codec"
28 // This is a compile-time assertion to ensure that this generated file
29 // is compatible with the GoVPP api package it is being compiled against.
30 // A compilation error at this line likely means your copy of the
31 // GoVPP api package needs to be updated.
32 const _ = api.GoVppAPIPackageIsVersion2
37 VersionCrc = 0x42c84657
40 // AddressFamily defines enum 'address_family'.
41 type AddressFamily uint32
44 ADDRESS_IP4 AddressFamily = 0
45 ADDRESS_IP6 AddressFamily = 1
49 AddressFamily_name = map[uint32]string{
53 AddressFamily_value = map[string]uint32{
59 func (x AddressFamily) String() string {
60 s, ok := AddressFamily_name[uint32(x)]
64 return "AddressFamily(" + strconv.Itoa(int(x)) + ")"
67 // IfStatusFlags defines enum 'if_status_flags'.
68 type IfStatusFlags uint32
71 IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
72 IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
76 IfStatusFlags_name = map[uint32]string{
77 1: "IF_STATUS_API_FLAG_ADMIN_UP",
78 2: "IF_STATUS_API_FLAG_LINK_UP",
80 IfStatusFlags_value = map[string]uint32{
81 "IF_STATUS_API_FLAG_ADMIN_UP": 1,
82 "IF_STATUS_API_FLAG_LINK_UP": 2,
86 func (x IfStatusFlags) String() string {
87 s, ok := IfStatusFlags_name[uint32(x)]
91 str := func(n uint32) string {
92 s, ok := IfStatusFlags_name[uint32(n)]
96 return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
98 for i := uint32(0); i <= 32; i++ {
108 return str(uint32(x))
113 // IfType defines enum 'if_type'.
117 IF_API_TYPE_HARDWARE IfType = 1
118 IF_API_TYPE_SUB IfType = 2
119 IF_API_TYPE_P2P IfType = 3
120 IF_API_TYPE_PIPE IfType = 4
124 IfType_name = map[uint32]string{
125 1: "IF_API_TYPE_HARDWARE",
126 2: "IF_API_TYPE_SUB",
127 3: "IF_API_TYPE_P2P",
128 4: "IF_API_TYPE_PIPE",
130 IfType_value = map[string]uint32{
131 "IF_API_TYPE_HARDWARE": 1,
132 "IF_API_TYPE_SUB": 2,
133 "IF_API_TYPE_P2P": 3,
134 "IF_API_TYPE_PIPE": 4,
138 func (x IfType) String() string {
139 s, ok := IfType_name[uint32(x)]
143 return "IfType(" + strconv.Itoa(int(x)) + ")"
146 // IPDscp defines enum 'ip_dscp'.
150 IP_API_DSCP_CS0 IPDscp = 0
151 IP_API_DSCP_CS1 IPDscp = 8
152 IP_API_DSCP_AF11 IPDscp = 10
153 IP_API_DSCP_AF12 IPDscp = 12
154 IP_API_DSCP_AF13 IPDscp = 14
155 IP_API_DSCP_CS2 IPDscp = 16
156 IP_API_DSCP_AF21 IPDscp = 18
157 IP_API_DSCP_AF22 IPDscp = 20
158 IP_API_DSCP_AF23 IPDscp = 22
159 IP_API_DSCP_CS3 IPDscp = 24
160 IP_API_DSCP_AF31 IPDscp = 26
161 IP_API_DSCP_AF32 IPDscp = 28
162 IP_API_DSCP_AF33 IPDscp = 30
163 IP_API_DSCP_CS4 IPDscp = 32
164 IP_API_DSCP_AF41 IPDscp = 34
165 IP_API_DSCP_AF42 IPDscp = 36
166 IP_API_DSCP_AF43 IPDscp = 38
167 IP_API_DSCP_CS5 IPDscp = 40
168 IP_API_DSCP_EF IPDscp = 46
169 IP_API_DSCP_CS6 IPDscp = 48
170 IP_API_DSCP_CS7 IPDscp = 50
174 IPDscp_name = map[uint8]string{
175 0: "IP_API_DSCP_CS0",
176 8: "IP_API_DSCP_CS1",
177 10: "IP_API_DSCP_AF11",
178 12: "IP_API_DSCP_AF12",
179 14: "IP_API_DSCP_AF13",
180 16: "IP_API_DSCP_CS2",
181 18: "IP_API_DSCP_AF21",
182 20: "IP_API_DSCP_AF22",
183 22: "IP_API_DSCP_AF23",
184 24: "IP_API_DSCP_CS3",
185 26: "IP_API_DSCP_AF31",
186 28: "IP_API_DSCP_AF32",
187 30: "IP_API_DSCP_AF33",
188 32: "IP_API_DSCP_CS4",
189 34: "IP_API_DSCP_AF41",
190 36: "IP_API_DSCP_AF42",
191 38: "IP_API_DSCP_AF43",
192 40: "IP_API_DSCP_CS5",
193 46: "IP_API_DSCP_EF",
194 48: "IP_API_DSCP_CS6",
195 50: "IP_API_DSCP_CS7",
197 IPDscp_value = map[string]uint8{
198 "IP_API_DSCP_CS0": 0,
199 "IP_API_DSCP_CS1": 8,
200 "IP_API_DSCP_AF11": 10,
201 "IP_API_DSCP_AF12": 12,
202 "IP_API_DSCP_AF13": 14,
203 "IP_API_DSCP_CS2": 16,
204 "IP_API_DSCP_AF21": 18,
205 "IP_API_DSCP_AF22": 20,
206 "IP_API_DSCP_AF23": 22,
207 "IP_API_DSCP_CS3": 24,
208 "IP_API_DSCP_AF31": 26,
209 "IP_API_DSCP_AF32": 28,
210 "IP_API_DSCP_AF33": 30,
211 "IP_API_DSCP_CS4": 32,
212 "IP_API_DSCP_AF41": 34,
213 "IP_API_DSCP_AF42": 36,
214 "IP_API_DSCP_AF43": 38,
215 "IP_API_DSCP_CS5": 40,
216 "IP_API_DSCP_EF": 46,
217 "IP_API_DSCP_CS6": 48,
218 "IP_API_DSCP_CS7": 50,
222 func (x IPDscp) String() string {
223 s, ok := IPDscp_name[uint8(x)]
227 return "IPDscp(" + strconv.Itoa(int(x)) + ")"
230 // IPEcn defines enum 'ip_ecn'.
234 IP_API_ECN_NONE IPEcn = 0
235 IP_API_ECN_ECT0 IPEcn = 1
236 IP_API_ECN_ECT1 IPEcn = 2
237 IP_API_ECN_CE IPEcn = 3
241 IPEcn_name = map[uint8]string{
242 0: "IP_API_ECN_NONE",
243 1: "IP_API_ECN_ECT0",
244 2: "IP_API_ECN_ECT1",
247 IPEcn_value = map[string]uint8{
248 "IP_API_ECN_NONE": 0,
249 "IP_API_ECN_ECT0": 1,
250 "IP_API_ECN_ECT1": 2,
255 func (x IPEcn) String() string {
256 s, ok := IPEcn_name[uint8(x)]
260 return "IPEcn(" + strconv.Itoa(int(x)) + ")"
263 // IPProto defines enum 'ip_proto'.
267 IP_API_PROTO_HOPOPT IPProto = 0
268 IP_API_PROTO_ICMP IPProto = 1
269 IP_API_PROTO_IGMP IPProto = 2
270 IP_API_PROTO_TCP IPProto = 6
271 IP_API_PROTO_UDP IPProto = 17
272 IP_API_PROTO_GRE IPProto = 47
273 IP_API_PROTO_AH IPProto = 50
274 IP_API_PROTO_ESP IPProto = 51
275 IP_API_PROTO_EIGRP IPProto = 88
276 IP_API_PROTO_OSPF IPProto = 89
277 IP_API_PROTO_SCTP IPProto = 132
278 IP_API_PROTO_RESERVED IPProto = 255
282 IPProto_name = map[uint32]string{
283 0: "IP_API_PROTO_HOPOPT",
284 1: "IP_API_PROTO_ICMP",
285 2: "IP_API_PROTO_IGMP",
286 6: "IP_API_PROTO_TCP",
287 17: "IP_API_PROTO_UDP",
288 47: "IP_API_PROTO_GRE",
289 50: "IP_API_PROTO_AH",
290 51: "IP_API_PROTO_ESP",
291 88: "IP_API_PROTO_EIGRP",
292 89: "IP_API_PROTO_OSPF",
293 132: "IP_API_PROTO_SCTP",
294 255: "IP_API_PROTO_RESERVED",
296 IPProto_value = map[string]uint32{
297 "IP_API_PROTO_HOPOPT": 0,
298 "IP_API_PROTO_ICMP": 1,
299 "IP_API_PROTO_IGMP": 2,
300 "IP_API_PROTO_TCP": 6,
301 "IP_API_PROTO_UDP": 17,
302 "IP_API_PROTO_GRE": 47,
303 "IP_API_PROTO_AH": 50,
304 "IP_API_PROTO_ESP": 51,
305 "IP_API_PROTO_EIGRP": 88,
306 "IP_API_PROTO_OSPF": 89,
307 "IP_API_PROTO_SCTP": 132,
308 "IP_API_PROTO_RESERVED": 255,
312 func (x IPProto) String() string {
313 s, ok := IPProto_name[uint32(x)]
317 return "IPProto(" + strconv.Itoa(int(x)) + ")"
320 // LinkDuplex defines enum 'link_duplex'.
321 type LinkDuplex uint32
324 LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
325 LINK_DUPLEX_API_HALF LinkDuplex = 1
326 LINK_DUPLEX_API_FULL LinkDuplex = 2
330 LinkDuplex_name = map[uint32]string{
331 0: "LINK_DUPLEX_API_UNKNOWN",
332 1: "LINK_DUPLEX_API_HALF",
333 2: "LINK_DUPLEX_API_FULL",
335 LinkDuplex_value = map[string]uint32{
336 "LINK_DUPLEX_API_UNKNOWN": 0,
337 "LINK_DUPLEX_API_HALF": 1,
338 "LINK_DUPLEX_API_FULL": 2,
342 func (x LinkDuplex) String() string {
343 s, ok := LinkDuplex_name[uint32(x)]
347 return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
350 // MtuProto defines enum 'mtu_proto'.
354 MTU_PROTO_API_L3 MtuProto = 1
355 MTU_PROTO_API_IP4 MtuProto = 2
356 MTU_PROTO_API_IP6 MtuProto = 3
357 MTU_PROTO_API_MPLS MtuProto = 4
358 MTU_PROTO_API_N MtuProto = 5
362 MtuProto_name = map[uint32]string{
363 1: "MTU_PROTO_API_L3",
364 2: "MTU_PROTO_API_IP4",
365 3: "MTU_PROTO_API_IP6",
366 4: "MTU_PROTO_API_MPLS",
367 5: "MTU_PROTO_API_N",
369 MtuProto_value = map[string]uint32{
370 "MTU_PROTO_API_L3": 1,
371 "MTU_PROTO_API_IP4": 2,
372 "MTU_PROTO_API_IP6": 3,
373 "MTU_PROTO_API_MPLS": 4,
374 "MTU_PROTO_API_N": 5,
378 func (x MtuProto) String() string {
379 s, ok := MtuProto_name[uint32(x)]
383 return "MtuProto(" + strconv.Itoa(int(x)) + ")"
386 // RxMode defines enum 'rx_mode'.
390 RX_MODE_API_UNKNOWN RxMode = 0
391 RX_MODE_API_POLLING RxMode = 1
392 RX_MODE_API_INTERRUPT RxMode = 2
393 RX_MODE_API_ADAPTIVE RxMode = 3
394 RX_MODE_API_DEFAULT RxMode = 4
398 RxMode_name = map[uint32]string{
399 0: "RX_MODE_API_UNKNOWN",
400 1: "RX_MODE_API_POLLING",
401 2: "RX_MODE_API_INTERRUPT",
402 3: "RX_MODE_API_ADAPTIVE",
403 4: "RX_MODE_API_DEFAULT",
405 RxMode_value = map[string]uint32{
406 "RX_MODE_API_UNKNOWN": 0,
407 "RX_MODE_API_POLLING": 1,
408 "RX_MODE_API_INTERRUPT": 2,
409 "RX_MODE_API_ADAPTIVE": 3,
410 "RX_MODE_API_DEFAULT": 4,
414 func (x RxMode) String() string {
415 s, ok := RxMode_name[uint32(x)]
419 return "RxMode(" + strconv.Itoa(int(x)) + ")"
422 // SubIfFlags defines enum 'sub_if_flags'.
423 type SubIfFlags uint32
426 SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
427 SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
428 SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
429 SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
430 SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
431 SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
432 SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
433 SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
434 SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
435 SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
439 SubIfFlags_name = map[uint32]string{
440 1: "SUB_IF_API_FLAG_NO_TAGS",
441 2: "SUB_IF_API_FLAG_ONE_TAG",
442 4: "SUB_IF_API_FLAG_TWO_TAGS",
443 8: "SUB_IF_API_FLAG_DOT1AD",
444 16: "SUB_IF_API_FLAG_EXACT_MATCH",
445 32: "SUB_IF_API_FLAG_DEFAULT",
446 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
447 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
448 254: "SUB_IF_API_FLAG_MASK_VNET",
449 256: "SUB_IF_API_FLAG_DOT1AH",
451 SubIfFlags_value = map[string]uint32{
452 "SUB_IF_API_FLAG_NO_TAGS": 1,
453 "SUB_IF_API_FLAG_ONE_TAG": 2,
454 "SUB_IF_API_FLAG_TWO_TAGS": 4,
455 "SUB_IF_API_FLAG_DOT1AD": 8,
456 "SUB_IF_API_FLAG_EXACT_MATCH": 16,
457 "SUB_IF_API_FLAG_DEFAULT": 32,
458 "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY": 64,
459 "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY": 128,
460 "SUB_IF_API_FLAG_MASK_VNET": 254,
461 "SUB_IF_API_FLAG_DOT1AH": 256,
465 func (x SubIfFlags) String() string {
466 s, ok := SubIfFlags_name[uint32(x)]
470 str := func(n uint32) string {
471 s, ok := SubIfFlags_name[uint32(n)]
475 return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
477 for i := uint32(0); i <= 32; i++ {
487 return str(uint32(x))
492 // AddressWithPrefix defines alias 'address_with_prefix'.
493 type AddressWithPrefix Prefix
495 func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
496 prefix, err := ParsePrefix(s)
498 return AddressWithPrefix{}, err
500 return AddressWithPrefix(prefix), nil
503 func (x AddressWithPrefix) String() string {
504 return Prefix(x).String()
507 func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
508 return []byte(x.String()), nil
511 func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
512 prefix, err := ParseAddressWithPrefix(string(text))
520 // InterfaceIndex defines alias 'interface_index'.
521 type InterfaceIndex uint32
523 // IP4Address defines alias 'ip4_address'.
524 type IP4Address [4]uint8
526 func ParseIP4Address(s string) (IP4Address, error) {
527 ip := net.ParseIP(s).To4()
529 return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
531 var ipaddr IP4Address
532 copy(ipaddr[:], ip.To4())
536 func (x IP4Address) ToIP() net.IP {
537 return net.IP(x[:]).To4()
540 func (x IP4Address) String() string {
541 return x.ToIP().String()
544 func (x *IP4Address) MarshalText() ([]byte, error) {
545 return []byte(x.String()), nil
548 func (x *IP4Address) UnmarshalText(text []byte) error {
549 ipaddr, err := ParseIP4Address(string(text))
557 // IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
558 type IP4AddressWithPrefix IP4Prefix
560 // IP6Address defines alias 'ip6_address'.
561 type IP6Address [16]uint8
563 func ParseIP6Address(s string) (IP6Address, error) {
564 ip := net.ParseIP(s).To16()
566 return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
568 var ipaddr IP6Address
569 copy(ipaddr[:], ip.To16())
573 func (x IP6Address) ToIP() net.IP {
574 return net.IP(x[:]).To16()
577 func (x IP6Address) String() string {
578 return x.ToIP().String()
581 func (x *IP6Address) MarshalText() ([]byte, error) {
582 return []byte(x.String()), nil
585 func (x *IP6Address) UnmarshalText(text []byte) error {
586 ipaddr, err := ParseIP6Address(string(text))
594 // IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
595 type IP6AddressWithPrefix IP6Prefix
597 // Address defines type 'address'.
598 type Address struct {
599 Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
600 Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
603 func ParseAddress(s string) (Address, error) {
606 return Address{}, fmt.Errorf("invalid address: %s", s)
608 return AddressFromIP(ip), nil
611 func AddressFromIP(ip net.IP) Address {
614 addr.Af = ADDRESS_IP6
616 copy(ip6[:], ip.To16())
619 addr.Af = ADDRESS_IP4
621 copy(ip4[:], ip.To4())
627 func (x Address) ToIP() net.IP {
628 if x.Af == ADDRESS_IP6 {
630 return net.IP(ip6[:]).To16()
633 return net.IP(ip4[:]).To4()
637 func (x Address) String() string {
638 return x.ToIP().String()
641 func (x *Address) MarshalText() ([]byte, error) {
642 return []byte(x.String()), nil
645 func (x *Address) UnmarshalText(text []byte) error {
646 addr, err := ParseAddress(string(text))
654 // IP4Prefix defines type 'ip4_prefix'.
655 type IP4Prefix struct {
656 Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
657 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
660 func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
661 hasPrefix := strings.Contains(s, "/")
663 ip, network, err := net.ParseCIDR(s)
665 return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
667 maskSize, _ := network.Mask.Size()
668 prefix.Len = byte(maskSize)
669 prefix.Address, err = ParseIP4Address(ip.String())
671 return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
675 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
677 defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
679 prefix.Len = byte(defaultMaskSize)
680 prefix.Address, err = ParseIP4Address(ip.String())
682 return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
688 func (x IP4Prefix) ToIPNet() *net.IPNet {
689 mask := net.CIDRMask(int(x.Len), 32)
690 ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
694 func (x IP4Prefix) String() string {
695 ip := x.Address.String()
696 return ip + "/" + strconv.Itoa(int(x.Len))
699 func (x *IP4Prefix) MarshalText() ([]byte, error) {
700 return []byte(x.String()), nil
703 func (x *IP4Prefix) UnmarshalText(text []byte) error {
704 prefix, err := ParseIP4Prefix(string(text))
712 // IP6Prefix defines type 'ip6_prefix'.
713 type IP6Prefix struct {
714 Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
715 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
718 func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
719 hasPrefix := strings.Contains(s, "/")
721 ip, network, err := net.ParseCIDR(s)
723 return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
725 maskSize, _ := network.Mask.Size()
726 prefix.Len = byte(maskSize)
727 prefix.Address, err = ParseIP6Address(ip.String())
729 return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
733 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
735 defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
737 prefix.Len = byte(defaultMaskSize)
738 prefix.Address, err = ParseIP6Address(ip.String())
740 return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
746 func (x IP6Prefix) ToIPNet() *net.IPNet {
747 mask := net.CIDRMask(int(x.Len), 128)
748 ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
752 func (x IP6Prefix) String() string {
753 ip := x.Address.String()
754 return ip + "/" + strconv.Itoa(int(x.Len))
757 func (x *IP6Prefix) MarshalText() ([]byte, error) {
758 return []byte(x.String()), nil
761 func (x *IP6Prefix) UnmarshalText(text []byte) error {
762 prefix, err := ParseIP6Prefix(string(text))
770 // Mprefix defines type 'mprefix'.
771 type Mprefix struct {
772 Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
773 GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
774 GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
775 SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
778 // Prefix defines type 'prefix'.
780 Address Address `binapi:"address,name=address" json:"address,omitempty"`
781 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
784 func ParsePrefix(ip string) (prefix Prefix, err error) {
785 hasPrefix := strings.Contains(ip, "/")
787 netIP, network, err := net.ParseCIDR(ip)
789 return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
791 maskSize, _ := network.Mask.Size()
792 prefix.Len = byte(maskSize)
793 prefix.Address, err = ParseAddress(netIP.String())
795 return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
798 netIP := net.ParseIP(ip)
799 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
800 if netIP.To4() == nil {
801 defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
803 prefix.Len = byte(defaultMaskSize)
804 prefix.Address, err = ParseAddress(netIP.String())
806 return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
812 func (x Prefix) ToIPNet() *net.IPNet {
814 if x.Address.Af == ADDRESS_IP4 {
815 mask = net.CIDRMask(int(x.Len), 32)
817 mask = net.CIDRMask(int(x.Len), 128)
819 ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
823 func (x Prefix) String() string {
824 ip := x.Address.String()
825 return ip + "/" + strconv.Itoa(int(x.Len))
828 func (x *Prefix) MarshalText() ([]byte, error) {
829 return []byte(x.String()), nil
832 func (x *Prefix) UnmarshalText(text []byte) error {
833 prefix, err := ParsePrefix(string(text))
841 // PrefixMatcher defines type 'prefix_matcher'.
842 type PrefixMatcher struct {
843 Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
844 Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
847 // AddressUnion defines union 'address_union'.
848 type AddressUnion struct {
849 // AddressUnion can be one of:
852 XXX_UnionData [16]byte
855 func AddressUnionIP4(a IP4Address) (u AddressUnion) {
859 func (u *AddressUnion) SetIP4(a IP4Address) {
860 buf := codec.NewBuffer(u.XXX_UnionData[:])
861 buf.EncodeBytes(a[:], 4)
863 func (u *AddressUnion) GetIP4() (a IP4Address) {
864 buf := codec.NewBuffer(u.XXX_UnionData[:])
865 copy(a[:], buf.DecodeBytes(4))
869 func AddressUnionIP6(a IP6Address) (u AddressUnion) {
873 func (u *AddressUnion) SetIP6(a IP6Address) {
874 buf := codec.NewBuffer(u.XXX_UnionData[:])
875 buf.EncodeBytes(a[:], 16)
877 func (u *AddressUnion) GetIP6() (a IP6Address) {
878 buf := codec.NewBuffer(u.XXX_UnionData[:])
879 copy(a[:], buf.DecodeBytes(16))
883 // MapAddDelRule defines message 'map_add_del_rule'.
884 type MapAddDelRule struct {
885 Index uint32 `binapi:"u32,name=index" json:"index,omitempty"`
886 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
887 IP6Dst IP6Address `binapi:"ip6_address,name=ip6_dst" json:"ip6_dst,omitempty"`
888 Psid uint16 `binapi:"u16,name=psid" json:"psid,omitempty"`
891 func (m *MapAddDelRule) Reset() { *m = MapAddDelRule{} }
892 func (*MapAddDelRule) GetMessageName() string { return "map_add_del_rule" }
893 func (*MapAddDelRule) GetCrcString() string { return "c65b32f7" }
894 func (*MapAddDelRule) GetMessageType() api.MessageType {
895 return api.RequestMessage
898 func (m *MapAddDelRule) Size() (size int) {
904 size += 1 * 16 // m.IP6Dst
908 func (m *MapAddDelRule) Marshal(b []byte) ([]byte, error) {
910 b = make([]byte, m.Size())
912 buf := codec.NewBuffer(b)
913 buf.EncodeUint32(m.Index)
914 buf.EncodeBool(m.IsAdd)
915 buf.EncodeBytes(m.IP6Dst[:], 16)
916 buf.EncodeUint16(m.Psid)
917 return buf.Bytes(), nil
919 func (m *MapAddDelRule) Unmarshal(b []byte) error {
920 buf := codec.NewBuffer(b)
921 m.Index = buf.DecodeUint32()
922 m.IsAdd = buf.DecodeBool()
923 copy(m.IP6Dst[:], buf.DecodeBytes(16))
924 m.Psid = buf.DecodeUint16()
928 // MapAddDelRuleReply defines message 'map_add_del_rule_reply'.
929 type MapAddDelRuleReply struct {
930 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
933 func (m *MapAddDelRuleReply) Reset() { *m = MapAddDelRuleReply{} }
934 func (*MapAddDelRuleReply) GetMessageName() string { return "map_add_del_rule_reply" }
935 func (*MapAddDelRuleReply) GetCrcString() string { return "e8d4e804" }
936 func (*MapAddDelRuleReply) GetMessageType() api.MessageType {
937 return api.ReplyMessage
940 func (m *MapAddDelRuleReply) Size() (size int) {
944 size += 4 // m.Retval
947 func (m *MapAddDelRuleReply) Marshal(b []byte) ([]byte, error) {
949 b = make([]byte, m.Size())
951 buf := codec.NewBuffer(b)
952 buf.EncodeInt32(m.Retval)
953 return buf.Bytes(), nil
955 func (m *MapAddDelRuleReply) Unmarshal(b []byte) error {
956 buf := codec.NewBuffer(b)
957 m.Retval = buf.DecodeInt32()
961 // MapAddDomain defines message 'map_add_domain'.
962 type MapAddDomain struct {
963 IP6Prefix IP6Prefix `binapi:"ip6_prefix,name=ip6_prefix" json:"ip6_prefix,omitempty"`
964 IP4Prefix IP4Prefix `binapi:"ip4_prefix,name=ip4_prefix" json:"ip4_prefix,omitempty"`
965 IP6Src IP6Prefix `binapi:"ip6_prefix,name=ip6_src" json:"ip6_src,omitempty"`
966 EaBitsLen uint8 `binapi:"u8,name=ea_bits_len" json:"ea_bits_len,omitempty"`
967 PsidOffset uint8 `binapi:"u8,name=psid_offset" json:"psid_offset,omitempty"`
968 PsidLength uint8 `binapi:"u8,name=psid_length" json:"psid_length,omitempty"`
969 Mtu uint16 `binapi:"u16,name=mtu" json:"mtu,omitempty"`
970 Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"`
973 func (m *MapAddDomain) Reset() { *m = MapAddDomain{} }
974 func (*MapAddDomain) GetMessageName() string { return "map_add_domain" }
975 func (*MapAddDomain) GetCrcString() string { return "7a5a18c9" }
976 func (*MapAddDomain) GetMessageType() api.MessageType {
977 return api.RequestMessage
980 func (m *MapAddDomain) Size() (size int) {
984 size += 1 * 16 // m.IP6Prefix.Address
985 size += 1 // m.IP6Prefix.Len
986 size += 1 * 4 // m.IP4Prefix.Address
987 size += 1 // m.IP4Prefix.Len
988 size += 1 * 16 // m.IP6Src.Address
989 size += 1 // m.IP6Src.Len
990 size += 1 // m.EaBitsLen
991 size += 1 // m.PsidOffset
992 size += 1 // m.PsidLength
997 func (m *MapAddDomain) Marshal(b []byte) ([]byte, error) {
999 b = make([]byte, m.Size())
1001 buf := codec.NewBuffer(b)
1002 buf.EncodeBytes(m.IP6Prefix.Address[:], 16)
1003 buf.EncodeUint8(m.IP6Prefix.Len)
1004 buf.EncodeBytes(m.IP4Prefix.Address[:], 4)
1005 buf.EncodeUint8(m.IP4Prefix.Len)
1006 buf.EncodeBytes(m.IP6Src.Address[:], 16)
1007 buf.EncodeUint8(m.IP6Src.Len)
1008 buf.EncodeUint8(m.EaBitsLen)
1009 buf.EncodeUint8(m.PsidOffset)
1010 buf.EncodeUint8(m.PsidLength)
1011 buf.EncodeUint16(m.Mtu)
1012 buf.EncodeString(m.Tag, 64)
1013 return buf.Bytes(), nil
1015 func (m *MapAddDomain) Unmarshal(b []byte) error {
1016 buf := codec.NewBuffer(b)
1017 copy(m.IP6Prefix.Address[:], buf.DecodeBytes(16))
1018 m.IP6Prefix.Len = buf.DecodeUint8()
1019 copy(m.IP4Prefix.Address[:], buf.DecodeBytes(4))
1020 m.IP4Prefix.Len = buf.DecodeUint8()
1021 copy(m.IP6Src.Address[:], buf.DecodeBytes(16))
1022 m.IP6Src.Len = buf.DecodeUint8()
1023 m.EaBitsLen = buf.DecodeUint8()
1024 m.PsidOffset = buf.DecodeUint8()
1025 m.PsidLength = buf.DecodeUint8()
1026 m.Mtu = buf.DecodeUint16()
1027 m.Tag = buf.DecodeString(64)
1031 // MapAddDomainReply defines message 'map_add_domain_reply'.
1032 type MapAddDomainReply struct {
1033 Index uint32 `binapi:"u32,name=index" json:"index,omitempty"`
1034 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1037 func (m *MapAddDomainReply) Reset() { *m = MapAddDomainReply{} }
1038 func (*MapAddDomainReply) GetMessageName() string { return "map_add_domain_reply" }
1039 func (*MapAddDomainReply) GetCrcString() string { return "3e6d4e2c" }
1040 func (*MapAddDomainReply) GetMessageType() api.MessageType {
1041 return api.ReplyMessage
1044 func (m *MapAddDomainReply) Size() (size int) {
1048 size += 4 // m.Index
1049 size += 4 // m.Retval
1052 func (m *MapAddDomainReply) Marshal(b []byte) ([]byte, error) {
1054 b = make([]byte, m.Size())
1056 buf := codec.NewBuffer(b)
1057 buf.EncodeUint32(m.Index)
1058 buf.EncodeInt32(m.Retval)
1059 return buf.Bytes(), nil
1061 func (m *MapAddDomainReply) Unmarshal(b []byte) error {
1062 buf := codec.NewBuffer(b)
1063 m.Index = buf.DecodeUint32()
1064 m.Retval = buf.DecodeInt32()
1068 // MapDelDomain defines message 'map_del_domain'.
1069 type MapDelDomain struct {
1070 Index uint32 `binapi:"u32,name=index" json:"index,omitempty"`
1073 func (m *MapDelDomain) Reset() { *m = MapDelDomain{} }
1074 func (*MapDelDomain) GetMessageName() string { return "map_del_domain" }
1075 func (*MapDelDomain) GetCrcString() string { return "8ac76db6" }
1076 func (*MapDelDomain) GetMessageType() api.MessageType {
1077 return api.RequestMessage
1080 func (m *MapDelDomain) Size() (size int) {
1084 size += 4 // m.Index
1087 func (m *MapDelDomain) Marshal(b []byte) ([]byte, error) {
1089 b = make([]byte, m.Size())
1091 buf := codec.NewBuffer(b)
1092 buf.EncodeUint32(m.Index)
1093 return buf.Bytes(), nil
1095 func (m *MapDelDomain) Unmarshal(b []byte) error {
1096 buf := codec.NewBuffer(b)
1097 m.Index = buf.DecodeUint32()
1101 // MapDelDomainReply defines message 'map_del_domain_reply'.
1102 type MapDelDomainReply struct {
1103 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1106 func (m *MapDelDomainReply) Reset() { *m = MapDelDomainReply{} }
1107 func (*MapDelDomainReply) GetMessageName() string { return "map_del_domain_reply" }
1108 func (*MapDelDomainReply) GetCrcString() string { return "e8d4e804" }
1109 func (*MapDelDomainReply) GetMessageType() api.MessageType {
1110 return api.ReplyMessage
1113 func (m *MapDelDomainReply) Size() (size int) {
1117 size += 4 // m.Retval
1120 func (m *MapDelDomainReply) Marshal(b []byte) ([]byte, error) {
1122 b = make([]byte, m.Size())
1124 buf := codec.NewBuffer(b)
1125 buf.EncodeInt32(m.Retval)
1126 return buf.Bytes(), nil
1128 func (m *MapDelDomainReply) Unmarshal(b []byte) error {
1129 buf := codec.NewBuffer(b)
1130 m.Retval = buf.DecodeInt32()
1134 // MapDomainDetails defines message 'map_domain_details'.
1135 type MapDomainDetails struct {
1136 DomainIndex uint32 `binapi:"u32,name=domain_index" json:"domain_index,omitempty"`
1137 IP6Prefix IP6Prefix `binapi:"ip6_prefix,name=ip6_prefix" json:"ip6_prefix,omitempty"`
1138 IP4Prefix IP4Prefix `binapi:"ip4_prefix,name=ip4_prefix" json:"ip4_prefix,omitempty"`
1139 IP6Src IP6Prefix `binapi:"ip6_prefix,name=ip6_src" json:"ip6_src,omitempty"`
1140 EaBitsLen uint8 `binapi:"u8,name=ea_bits_len" json:"ea_bits_len,omitempty"`
1141 PsidOffset uint8 `binapi:"u8,name=psid_offset" json:"psid_offset,omitempty"`
1142 PsidLength uint8 `binapi:"u8,name=psid_length" json:"psid_length,omitempty"`
1143 Flags uint8 `binapi:"u8,name=flags" json:"flags,omitempty"`
1144 Mtu uint16 `binapi:"u16,name=mtu" json:"mtu,omitempty"`
1145 Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"`
1148 func (m *MapDomainDetails) Reset() { *m = MapDomainDetails{} }
1149 func (*MapDomainDetails) GetMessageName() string { return "map_domain_details" }
1150 func (*MapDomainDetails) GetCrcString() string { return "fc1859dd" }
1151 func (*MapDomainDetails) GetMessageType() api.MessageType {
1152 return api.ReplyMessage
1155 func (m *MapDomainDetails) Size() (size int) {
1159 size += 4 // m.DomainIndex
1160 size += 1 * 16 // m.IP6Prefix.Address
1161 size += 1 // m.IP6Prefix.Len
1162 size += 1 * 4 // m.IP4Prefix.Address
1163 size += 1 // m.IP4Prefix.Len
1164 size += 1 * 16 // m.IP6Src.Address
1165 size += 1 // m.IP6Src.Len
1166 size += 1 // m.EaBitsLen
1167 size += 1 // m.PsidOffset
1168 size += 1 // m.PsidLength
1169 size += 1 // m.Flags
1174 func (m *MapDomainDetails) Marshal(b []byte) ([]byte, error) {
1176 b = make([]byte, m.Size())
1178 buf := codec.NewBuffer(b)
1179 buf.EncodeUint32(m.DomainIndex)
1180 buf.EncodeBytes(m.IP6Prefix.Address[:], 16)
1181 buf.EncodeUint8(m.IP6Prefix.Len)
1182 buf.EncodeBytes(m.IP4Prefix.Address[:], 4)
1183 buf.EncodeUint8(m.IP4Prefix.Len)
1184 buf.EncodeBytes(m.IP6Src.Address[:], 16)
1185 buf.EncodeUint8(m.IP6Src.Len)
1186 buf.EncodeUint8(m.EaBitsLen)
1187 buf.EncodeUint8(m.PsidOffset)
1188 buf.EncodeUint8(m.PsidLength)
1189 buf.EncodeUint8(m.Flags)
1190 buf.EncodeUint16(m.Mtu)
1191 buf.EncodeString(m.Tag, 64)
1192 return buf.Bytes(), nil
1194 func (m *MapDomainDetails) Unmarshal(b []byte) error {
1195 buf := codec.NewBuffer(b)
1196 m.DomainIndex = buf.DecodeUint32()
1197 copy(m.IP6Prefix.Address[:], buf.DecodeBytes(16))
1198 m.IP6Prefix.Len = buf.DecodeUint8()
1199 copy(m.IP4Prefix.Address[:], buf.DecodeBytes(4))
1200 m.IP4Prefix.Len = buf.DecodeUint8()
1201 copy(m.IP6Src.Address[:], buf.DecodeBytes(16))
1202 m.IP6Src.Len = buf.DecodeUint8()
1203 m.EaBitsLen = buf.DecodeUint8()
1204 m.PsidOffset = buf.DecodeUint8()
1205 m.PsidLength = buf.DecodeUint8()
1206 m.Flags = buf.DecodeUint8()
1207 m.Mtu = buf.DecodeUint16()
1208 m.Tag = buf.DecodeString(64)
1212 // MapDomainDump defines message 'map_domain_dump'.
1213 type MapDomainDump struct{}
1215 func (m *MapDomainDump) Reset() { *m = MapDomainDump{} }
1216 func (*MapDomainDump) GetMessageName() string { return "map_domain_dump" }
1217 func (*MapDomainDump) GetCrcString() string { return "51077d14" }
1218 func (*MapDomainDump) GetMessageType() api.MessageType {
1219 return api.RequestMessage
1222 func (m *MapDomainDump) Size() (size int) {
1228 func (m *MapDomainDump) Marshal(b []byte) ([]byte, error) {
1230 b = make([]byte, m.Size())
1232 buf := codec.NewBuffer(b)
1233 return buf.Bytes(), nil
1235 func (m *MapDomainDump) Unmarshal(b []byte) error {
1239 // MapIfEnableDisable defines message 'map_if_enable_disable'.
1240 type MapIfEnableDisable struct {
1241 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1242 IsEnable bool `binapi:"bool,name=is_enable" json:"is_enable,omitempty"`
1243 IsTranslation bool `binapi:"bool,name=is_translation" json:"is_translation,omitempty"`
1246 func (m *MapIfEnableDisable) Reset() { *m = MapIfEnableDisable{} }
1247 func (*MapIfEnableDisable) GetMessageName() string { return "map_if_enable_disable" }
1248 func (*MapIfEnableDisable) GetCrcString() string { return "59bb32f4" }
1249 func (*MapIfEnableDisable) GetMessageType() api.MessageType {
1250 return api.RequestMessage
1253 func (m *MapIfEnableDisable) Size() (size int) {
1257 size += 4 // m.SwIfIndex
1258 size += 1 // m.IsEnable
1259 size += 1 // m.IsTranslation
1262 func (m *MapIfEnableDisable) Marshal(b []byte) ([]byte, error) {
1264 b = make([]byte, m.Size())
1266 buf := codec.NewBuffer(b)
1267 buf.EncodeUint32(uint32(m.SwIfIndex))
1268 buf.EncodeBool(m.IsEnable)
1269 buf.EncodeBool(m.IsTranslation)
1270 return buf.Bytes(), nil
1272 func (m *MapIfEnableDisable) Unmarshal(b []byte) error {
1273 buf := codec.NewBuffer(b)
1274 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
1275 m.IsEnable = buf.DecodeBool()
1276 m.IsTranslation = buf.DecodeBool()
1280 // MapIfEnableDisableReply defines message 'map_if_enable_disable_reply'.
1281 type MapIfEnableDisableReply struct {
1282 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1285 func (m *MapIfEnableDisableReply) Reset() { *m = MapIfEnableDisableReply{} }
1286 func (*MapIfEnableDisableReply) GetMessageName() string { return "map_if_enable_disable_reply" }
1287 func (*MapIfEnableDisableReply) GetCrcString() string { return "e8d4e804" }
1288 func (*MapIfEnableDisableReply) GetMessageType() api.MessageType {
1289 return api.ReplyMessage
1292 func (m *MapIfEnableDisableReply) Size() (size int) {
1296 size += 4 // m.Retval
1299 func (m *MapIfEnableDisableReply) Marshal(b []byte) ([]byte, error) {
1301 b = make([]byte, m.Size())
1303 buf := codec.NewBuffer(b)
1304 buf.EncodeInt32(m.Retval)
1305 return buf.Bytes(), nil
1307 func (m *MapIfEnableDisableReply) Unmarshal(b []byte) error {
1308 buf := codec.NewBuffer(b)
1309 m.Retval = buf.DecodeInt32()
1313 // MapParamAddDelPreResolve defines message 'map_param_add_del_pre_resolve'.
1314 type MapParamAddDelPreResolve struct {
1315 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
1316 IP4NhAddress IP4Address `binapi:"ip4_address,name=ip4_nh_address" json:"ip4_nh_address,omitempty"`
1317 IP6NhAddress IP6Address `binapi:"ip6_address,name=ip6_nh_address" json:"ip6_nh_address,omitempty"`
1320 func (m *MapParamAddDelPreResolve) Reset() { *m = MapParamAddDelPreResolve{} }
1321 func (*MapParamAddDelPreResolve) GetMessageName() string { return "map_param_add_del_pre_resolve" }
1322 func (*MapParamAddDelPreResolve) GetCrcString() string { return "17008c66" }
1323 func (*MapParamAddDelPreResolve) GetMessageType() api.MessageType {
1324 return api.RequestMessage
1327 func (m *MapParamAddDelPreResolve) Size() (size int) {
1331 size += 1 // m.IsAdd
1332 size += 1 * 4 // m.IP4NhAddress
1333 size += 1 * 16 // m.IP6NhAddress
1336 func (m *MapParamAddDelPreResolve) Marshal(b []byte) ([]byte, error) {
1338 b = make([]byte, m.Size())
1340 buf := codec.NewBuffer(b)
1341 buf.EncodeBool(m.IsAdd)
1342 buf.EncodeBytes(m.IP4NhAddress[:], 4)
1343 buf.EncodeBytes(m.IP6NhAddress[:], 16)
1344 return buf.Bytes(), nil
1346 func (m *MapParamAddDelPreResolve) Unmarshal(b []byte) error {
1347 buf := codec.NewBuffer(b)
1348 m.IsAdd = buf.DecodeBool()
1349 copy(m.IP4NhAddress[:], buf.DecodeBytes(4))
1350 copy(m.IP6NhAddress[:], buf.DecodeBytes(16))
1354 // MapParamAddDelPreResolveReply defines message 'map_param_add_del_pre_resolve_reply'.
1355 type MapParamAddDelPreResolveReply struct {
1356 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1359 func (m *MapParamAddDelPreResolveReply) Reset() { *m = MapParamAddDelPreResolveReply{} }
1360 func (*MapParamAddDelPreResolveReply) GetMessageName() string {
1361 return "map_param_add_del_pre_resolve_reply"
1363 func (*MapParamAddDelPreResolveReply) GetCrcString() string { return "e8d4e804" }
1364 func (*MapParamAddDelPreResolveReply) GetMessageType() api.MessageType {
1365 return api.ReplyMessage
1368 func (m *MapParamAddDelPreResolveReply) Size() (size int) {
1372 size += 4 // m.Retval
1375 func (m *MapParamAddDelPreResolveReply) Marshal(b []byte) ([]byte, error) {
1377 b = make([]byte, m.Size())
1379 buf := codec.NewBuffer(b)
1380 buf.EncodeInt32(m.Retval)
1381 return buf.Bytes(), nil
1383 func (m *MapParamAddDelPreResolveReply) Unmarshal(b []byte) error {
1384 buf := codec.NewBuffer(b)
1385 m.Retval = buf.DecodeInt32()
1389 // MapParamGet defines message 'map_param_get'.
1390 type MapParamGet struct{}
1392 func (m *MapParamGet) Reset() { *m = MapParamGet{} }
1393 func (*MapParamGet) GetMessageName() string { return "map_param_get" }
1394 func (*MapParamGet) GetCrcString() string { return "51077d14" }
1395 func (*MapParamGet) GetMessageType() api.MessageType {
1396 return api.RequestMessage
1399 func (m *MapParamGet) Size() (size int) {
1405 func (m *MapParamGet) Marshal(b []byte) ([]byte, error) {
1407 b = make([]byte, m.Size())
1409 buf := codec.NewBuffer(b)
1410 return buf.Bytes(), nil
1412 func (m *MapParamGet) Unmarshal(b []byte) error {
1416 // MapParamGetReply defines message 'map_param_get_reply'.
1417 type MapParamGetReply struct {
1418 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1419 FragInner uint8 `binapi:"u8,name=frag_inner" json:"frag_inner,omitempty"`
1420 FragIgnoreDf uint8 `binapi:"u8,name=frag_ignore_df" json:"frag_ignore_df,omitempty"`
1421 ICMPIP4ErrRelaySrc IP4Address `binapi:"ip4_address,name=icmp_ip4_err_relay_src" json:"icmp_ip4_err_relay_src,omitempty"`
1422 ICMP6EnableUnreachable bool `binapi:"bool,name=icmp6_enable_unreachable" json:"icmp6_enable_unreachable,omitempty"`
1423 IP4NhAddress IP4Address `binapi:"ip4_address,name=ip4_nh_address" json:"ip4_nh_address,omitempty"`
1424 IP6NhAddress IP6Address `binapi:"ip6_address,name=ip6_nh_address" json:"ip6_nh_address,omitempty"`
1425 IP4LifetimeMs uint16 `binapi:"u16,name=ip4_lifetime_ms" json:"ip4_lifetime_ms,omitempty"`
1426 IP4PoolSize uint16 `binapi:"u16,name=ip4_pool_size" json:"ip4_pool_size,omitempty"`
1427 IP4Buffers uint32 `binapi:"u32,name=ip4_buffers" json:"ip4_buffers,omitempty"`
1428 IP4HtRatio float64 `binapi:"f64,name=ip4_ht_ratio" json:"ip4_ht_ratio,omitempty"`
1429 SecCheckEnable bool `binapi:"bool,name=sec_check_enable" json:"sec_check_enable,omitempty"`
1430 SecCheckFragments bool `binapi:"bool,name=sec_check_fragments" json:"sec_check_fragments,omitempty"`
1431 TcCopy bool `binapi:"bool,name=tc_copy" json:"tc_copy,omitempty"`
1432 TcClass uint8 `binapi:"u8,name=tc_class" json:"tc_class,omitempty"`
1435 func (m *MapParamGetReply) Reset() { *m = MapParamGetReply{} }
1436 func (*MapParamGetReply) GetMessageName() string { return "map_param_get_reply" }
1437 func (*MapParamGetReply) GetCrcString() string { return "28092156" }
1438 func (*MapParamGetReply) GetMessageType() api.MessageType {
1439 return api.ReplyMessage
1442 func (m *MapParamGetReply) Size() (size int) {
1446 size += 4 // m.Retval
1447 size += 1 // m.FragInner
1448 size += 1 // m.FragIgnoreDf
1449 size += 1 * 4 // m.ICMPIP4ErrRelaySrc
1450 size += 1 // m.ICMP6EnableUnreachable
1451 size += 1 * 4 // m.IP4NhAddress
1452 size += 1 * 16 // m.IP6NhAddress
1453 size += 2 // m.IP4LifetimeMs
1454 size += 2 // m.IP4PoolSize
1455 size += 4 // m.IP4Buffers
1456 size += 8 // m.IP4HtRatio
1457 size += 1 // m.SecCheckEnable
1458 size += 1 // m.SecCheckFragments
1459 size += 1 // m.TcCopy
1460 size += 1 // m.TcClass
1463 func (m *MapParamGetReply) Marshal(b []byte) ([]byte, error) {
1465 b = make([]byte, m.Size())
1467 buf := codec.NewBuffer(b)
1468 buf.EncodeInt32(m.Retval)
1469 buf.EncodeUint8(m.FragInner)
1470 buf.EncodeUint8(m.FragIgnoreDf)
1471 buf.EncodeBytes(m.ICMPIP4ErrRelaySrc[:], 4)
1472 buf.EncodeBool(m.ICMP6EnableUnreachable)
1473 buf.EncodeBytes(m.IP4NhAddress[:], 4)
1474 buf.EncodeBytes(m.IP6NhAddress[:], 16)
1475 buf.EncodeUint16(m.IP4LifetimeMs)
1476 buf.EncodeUint16(m.IP4PoolSize)
1477 buf.EncodeUint32(m.IP4Buffers)
1478 buf.EncodeFloat64(m.IP4HtRatio)
1479 buf.EncodeBool(m.SecCheckEnable)
1480 buf.EncodeBool(m.SecCheckFragments)
1481 buf.EncodeBool(m.TcCopy)
1482 buf.EncodeUint8(m.TcClass)
1483 return buf.Bytes(), nil
1485 func (m *MapParamGetReply) Unmarshal(b []byte) error {
1486 buf := codec.NewBuffer(b)
1487 m.Retval = buf.DecodeInt32()
1488 m.FragInner = buf.DecodeUint8()
1489 m.FragIgnoreDf = buf.DecodeUint8()
1490 copy(m.ICMPIP4ErrRelaySrc[:], buf.DecodeBytes(4))
1491 m.ICMP6EnableUnreachable = buf.DecodeBool()
1492 copy(m.IP4NhAddress[:], buf.DecodeBytes(4))
1493 copy(m.IP6NhAddress[:], buf.DecodeBytes(16))
1494 m.IP4LifetimeMs = buf.DecodeUint16()
1495 m.IP4PoolSize = buf.DecodeUint16()
1496 m.IP4Buffers = buf.DecodeUint32()
1497 m.IP4HtRatio = buf.DecodeFloat64()
1498 m.SecCheckEnable = buf.DecodeBool()
1499 m.SecCheckFragments = buf.DecodeBool()
1500 m.TcCopy = buf.DecodeBool()
1501 m.TcClass = buf.DecodeUint8()
1505 // MapParamSetFragmentation defines message 'map_param_set_fragmentation'.
1506 type MapParamSetFragmentation struct {
1507 Inner bool `binapi:"bool,name=inner" json:"inner,omitempty"`
1508 IgnoreDf bool `binapi:"bool,name=ignore_df" json:"ignore_df,omitempty"`
1511 func (m *MapParamSetFragmentation) Reset() { *m = MapParamSetFragmentation{} }
1512 func (*MapParamSetFragmentation) GetMessageName() string { return "map_param_set_fragmentation" }
1513 func (*MapParamSetFragmentation) GetCrcString() string { return "9ff54d90" }
1514 func (*MapParamSetFragmentation) GetMessageType() api.MessageType {
1515 return api.RequestMessage
1518 func (m *MapParamSetFragmentation) Size() (size int) {
1522 size += 1 // m.Inner
1523 size += 1 // m.IgnoreDf
1526 func (m *MapParamSetFragmentation) Marshal(b []byte) ([]byte, error) {
1528 b = make([]byte, m.Size())
1530 buf := codec.NewBuffer(b)
1531 buf.EncodeBool(m.Inner)
1532 buf.EncodeBool(m.IgnoreDf)
1533 return buf.Bytes(), nil
1535 func (m *MapParamSetFragmentation) Unmarshal(b []byte) error {
1536 buf := codec.NewBuffer(b)
1537 m.Inner = buf.DecodeBool()
1538 m.IgnoreDf = buf.DecodeBool()
1542 // MapParamSetFragmentationReply defines message 'map_param_set_fragmentation_reply'.
1543 type MapParamSetFragmentationReply struct {
1544 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1547 func (m *MapParamSetFragmentationReply) Reset() { *m = MapParamSetFragmentationReply{} }
1548 func (*MapParamSetFragmentationReply) GetMessageName() string {
1549 return "map_param_set_fragmentation_reply"
1551 func (*MapParamSetFragmentationReply) GetCrcString() string { return "e8d4e804" }
1552 func (*MapParamSetFragmentationReply) GetMessageType() api.MessageType {
1553 return api.ReplyMessage
1556 func (m *MapParamSetFragmentationReply) Size() (size int) {
1560 size += 4 // m.Retval
1563 func (m *MapParamSetFragmentationReply) Marshal(b []byte) ([]byte, error) {
1565 b = make([]byte, m.Size())
1567 buf := codec.NewBuffer(b)
1568 buf.EncodeInt32(m.Retval)
1569 return buf.Bytes(), nil
1571 func (m *MapParamSetFragmentationReply) Unmarshal(b []byte) error {
1572 buf := codec.NewBuffer(b)
1573 m.Retval = buf.DecodeInt32()
1577 // MapParamSetICMP defines message 'map_param_set_icmp'.
1578 type MapParamSetICMP struct {
1579 IP4ErrRelaySrc IP4Address `binapi:"ip4_address,name=ip4_err_relay_src" json:"ip4_err_relay_src,omitempty"`
1582 func (m *MapParamSetICMP) Reset() { *m = MapParamSetICMP{} }
1583 func (*MapParamSetICMP) GetMessageName() string { return "map_param_set_icmp" }
1584 func (*MapParamSetICMP) GetCrcString() string { return "58210cbf" }
1585 func (*MapParamSetICMP) GetMessageType() api.MessageType {
1586 return api.RequestMessage
1589 func (m *MapParamSetICMP) Size() (size int) {
1593 size += 1 * 4 // m.IP4ErrRelaySrc
1596 func (m *MapParamSetICMP) Marshal(b []byte) ([]byte, error) {
1598 b = make([]byte, m.Size())
1600 buf := codec.NewBuffer(b)
1601 buf.EncodeBytes(m.IP4ErrRelaySrc[:], 4)
1602 return buf.Bytes(), nil
1604 func (m *MapParamSetICMP) Unmarshal(b []byte) error {
1605 buf := codec.NewBuffer(b)
1606 copy(m.IP4ErrRelaySrc[:], buf.DecodeBytes(4))
1610 // MapParamSetICMP6 defines message 'map_param_set_icmp6'.
1611 type MapParamSetICMP6 struct {
1612 EnableUnreachable bool `binapi:"bool,name=enable_unreachable" json:"enable_unreachable,omitempty"`
1615 func (m *MapParamSetICMP6) Reset() { *m = MapParamSetICMP6{} }
1616 func (*MapParamSetICMP6) GetMessageName() string { return "map_param_set_icmp6" }
1617 func (*MapParamSetICMP6) GetCrcString() string { return "5d01f8c1" }
1618 func (*MapParamSetICMP6) GetMessageType() api.MessageType {
1619 return api.RequestMessage
1622 func (m *MapParamSetICMP6) Size() (size int) {
1626 size += 1 // m.EnableUnreachable
1629 func (m *MapParamSetICMP6) Marshal(b []byte) ([]byte, error) {
1631 b = make([]byte, m.Size())
1633 buf := codec.NewBuffer(b)
1634 buf.EncodeBool(m.EnableUnreachable)
1635 return buf.Bytes(), nil
1637 func (m *MapParamSetICMP6) Unmarshal(b []byte) error {
1638 buf := codec.NewBuffer(b)
1639 m.EnableUnreachable = buf.DecodeBool()
1643 // MapParamSetICMP6Reply defines message 'map_param_set_icmp6_reply'.
1644 type MapParamSetICMP6Reply struct {
1645 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1648 func (m *MapParamSetICMP6Reply) Reset() { *m = MapParamSetICMP6Reply{} }
1649 func (*MapParamSetICMP6Reply) GetMessageName() string { return "map_param_set_icmp6_reply" }
1650 func (*MapParamSetICMP6Reply) GetCrcString() string { return "e8d4e804" }
1651 func (*MapParamSetICMP6Reply) GetMessageType() api.MessageType {
1652 return api.ReplyMessage
1655 func (m *MapParamSetICMP6Reply) Size() (size int) {
1659 size += 4 // m.Retval
1662 func (m *MapParamSetICMP6Reply) Marshal(b []byte) ([]byte, error) {
1664 b = make([]byte, m.Size())
1666 buf := codec.NewBuffer(b)
1667 buf.EncodeInt32(m.Retval)
1668 return buf.Bytes(), nil
1670 func (m *MapParamSetICMP6Reply) Unmarshal(b []byte) error {
1671 buf := codec.NewBuffer(b)
1672 m.Retval = buf.DecodeInt32()
1676 // MapParamSetICMPReply defines message 'map_param_set_icmp_reply'.
1677 type MapParamSetICMPReply struct {
1678 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1681 func (m *MapParamSetICMPReply) Reset() { *m = MapParamSetICMPReply{} }
1682 func (*MapParamSetICMPReply) GetMessageName() string { return "map_param_set_icmp_reply" }
1683 func (*MapParamSetICMPReply) GetCrcString() string { return "e8d4e804" }
1684 func (*MapParamSetICMPReply) GetMessageType() api.MessageType {
1685 return api.ReplyMessage
1688 func (m *MapParamSetICMPReply) Size() (size int) {
1692 size += 4 // m.Retval
1695 func (m *MapParamSetICMPReply) Marshal(b []byte) ([]byte, error) {
1697 b = make([]byte, m.Size())
1699 buf := codec.NewBuffer(b)
1700 buf.EncodeInt32(m.Retval)
1701 return buf.Bytes(), nil
1703 func (m *MapParamSetICMPReply) Unmarshal(b []byte) error {
1704 buf := codec.NewBuffer(b)
1705 m.Retval = buf.DecodeInt32()
1709 // MapParamSetSecurityCheck defines message 'map_param_set_security_check'.
1710 type MapParamSetSecurityCheck struct {
1711 Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
1712 Fragments bool `binapi:"bool,name=fragments" json:"fragments,omitempty"`
1715 func (m *MapParamSetSecurityCheck) Reset() { *m = MapParamSetSecurityCheck{} }
1716 func (*MapParamSetSecurityCheck) GetMessageName() string { return "map_param_set_security_check" }
1717 func (*MapParamSetSecurityCheck) GetCrcString() string { return "6abe9836" }
1718 func (*MapParamSetSecurityCheck) GetMessageType() api.MessageType {
1719 return api.RequestMessage
1722 func (m *MapParamSetSecurityCheck) Size() (size int) {
1726 size += 1 // m.Enable
1727 size += 1 // m.Fragments
1730 func (m *MapParamSetSecurityCheck) Marshal(b []byte) ([]byte, error) {
1732 b = make([]byte, m.Size())
1734 buf := codec.NewBuffer(b)
1735 buf.EncodeBool(m.Enable)
1736 buf.EncodeBool(m.Fragments)
1737 return buf.Bytes(), nil
1739 func (m *MapParamSetSecurityCheck) Unmarshal(b []byte) error {
1740 buf := codec.NewBuffer(b)
1741 m.Enable = buf.DecodeBool()
1742 m.Fragments = buf.DecodeBool()
1746 // MapParamSetSecurityCheckReply defines message 'map_param_set_security_check_reply'.
1747 type MapParamSetSecurityCheckReply struct {
1748 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1751 func (m *MapParamSetSecurityCheckReply) Reset() { *m = MapParamSetSecurityCheckReply{} }
1752 func (*MapParamSetSecurityCheckReply) GetMessageName() string {
1753 return "map_param_set_security_check_reply"
1755 func (*MapParamSetSecurityCheckReply) GetCrcString() string { return "e8d4e804" }
1756 func (*MapParamSetSecurityCheckReply) GetMessageType() api.MessageType {
1757 return api.ReplyMessage
1760 func (m *MapParamSetSecurityCheckReply) Size() (size int) {
1764 size += 4 // m.Retval
1767 func (m *MapParamSetSecurityCheckReply) Marshal(b []byte) ([]byte, error) {
1769 b = make([]byte, m.Size())
1771 buf := codec.NewBuffer(b)
1772 buf.EncodeInt32(m.Retval)
1773 return buf.Bytes(), nil
1775 func (m *MapParamSetSecurityCheckReply) Unmarshal(b []byte) error {
1776 buf := codec.NewBuffer(b)
1777 m.Retval = buf.DecodeInt32()
1781 // MapParamSetTCP defines message 'map_param_set_tcp'.
1782 type MapParamSetTCP struct {
1783 TCPMss uint16 `binapi:"u16,name=tcp_mss" json:"tcp_mss,omitempty"`
1786 func (m *MapParamSetTCP) Reset() { *m = MapParamSetTCP{} }
1787 func (*MapParamSetTCP) GetMessageName() string { return "map_param_set_tcp" }
1788 func (*MapParamSetTCP) GetCrcString() string { return "87a825d9" }
1789 func (*MapParamSetTCP) GetMessageType() api.MessageType {
1790 return api.RequestMessage
1793 func (m *MapParamSetTCP) Size() (size int) {
1797 size += 2 // m.TCPMss
1800 func (m *MapParamSetTCP) Marshal(b []byte) ([]byte, error) {
1802 b = make([]byte, m.Size())
1804 buf := codec.NewBuffer(b)
1805 buf.EncodeUint16(m.TCPMss)
1806 return buf.Bytes(), nil
1808 func (m *MapParamSetTCP) Unmarshal(b []byte) error {
1809 buf := codec.NewBuffer(b)
1810 m.TCPMss = buf.DecodeUint16()
1814 // MapParamSetTCPReply defines message 'map_param_set_tcp_reply'.
1815 type MapParamSetTCPReply struct {
1816 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1819 func (m *MapParamSetTCPReply) Reset() { *m = MapParamSetTCPReply{} }
1820 func (*MapParamSetTCPReply) GetMessageName() string { return "map_param_set_tcp_reply" }
1821 func (*MapParamSetTCPReply) GetCrcString() string { return "e8d4e804" }
1822 func (*MapParamSetTCPReply) GetMessageType() api.MessageType {
1823 return api.ReplyMessage
1826 func (m *MapParamSetTCPReply) Size() (size int) {
1830 size += 4 // m.Retval
1833 func (m *MapParamSetTCPReply) Marshal(b []byte) ([]byte, error) {
1835 b = make([]byte, m.Size())
1837 buf := codec.NewBuffer(b)
1838 buf.EncodeInt32(m.Retval)
1839 return buf.Bytes(), nil
1841 func (m *MapParamSetTCPReply) Unmarshal(b []byte) error {
1842 buf := codec.NewBuffer(b)
1843 m.Retval = buf.DecodeInt32()
1847 // MapParamSetTrafficClass defines message 'map_param_set_traffic_class'.
1848 type MapParamSetTrafficClass struct {
1849 Copy bool `binapi:"bool,name=copy" json:"copy,omitempty"`
1850 TcClass uint8 `binapi:"u8,name=tc_class" json:"tc_class,omitempty"`
1853 func (m *MapParamSetTrafficClass) Reset() { *m = MapParamSetTrafficClass{} }
1854 func (*MapParamSetTrafficClass) GetMessageName() string { return "map_param_set_traffic_class" }
1855 func (*MapParamSetTrafficClass) GetCrcString() string { return "9cac455c" }
1856 func (*MapParamSetTrafficClass) GetMessageType() api.MessageType {
1857 return api.RequestMessage
1860 func (m *MapParamSetTrafficClass) Size() (size int) {
1865 size += 1 // m.TcClass
1868 func (m *MapParamSetTrafficClass) Marshal(b []byte) ([]byte, error) {
1870 b = make([]byte, m.Size())
1872 buf := codec.NewBuffer(b)
1873 buf.EncodeBool(m.Copy)
1874 buf.EncodeUint8(m.TcClass)
1875 return buf.Bytes(), nil
1877 func (m *MapParamSetTrafficClass) Unmarshal(b []byte) error {
1878 buf := codec.NewBuffer(b)
1879 m.Copy = buf.DecodeBool()
1880 m.TcClass = buf.DecodeUint8()
1884 // MapParamSetTrafficClassReply defines message 'map_param_set_traffic_class_reply'.
1885 type MapParamSetTrafficClassReply struct {
1886 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1889 func (m *MapParamSetTrafficClassReply) Reset() { *m = MapParamSetTrafficClassReply{} }
1890 func (*MapParamSetTrafficClassReply) GetMessageName() string {
1891 return "map_param_set_traffic_class_reply"
1893 func (*MapParamSetTrafficClassReply) GetCrcString() string { return "e8d4e804" }
1894 func (*MapParamSetTrafficClassReply) GetMessageType() api.MessageType {
1895 return api.ReplyMessage
1898 func (m *MapParamSetTrafficClassReply) Size() (size int) {
1902 size += 4 // m.Retval
1905 func (m *MapParamSetTrafficClassReply) Marshal(b []byte) ([]byte, error) {
1907 b = make([]byte, m.Size())
1909 buf := codec.NewBuffer(b)
1910 buf.EncodeInt32(m.Retval)
1911 return buf.Bytes(), nil
1913 func (m *MapParamSetTrafficClassReply) Unmarshal(b []byte) error {
1914 buf := codec.NewBuffer(b)
1915 m.Retval = buf.DecodeInt32()
1919 // MapRuleDetails defines message 'map_rule_details'.
1920 type MapRuleDetails struct {
1921 IP6Dst IP6Address `binapi:"ip6_address,name=ip6_dst" json:"ip6_dst,omitempty"`
1922 Psid uint16 `binapi:"u16,name=psid" json:"psid,omitempty"`
1925 func (m *MapRuleDetails) Reset() { *m = MapRuleDetails{} }
1926 func (*MapRuleDetails) GetMessageName() string { return "map_rule_details" }
1927 func (*MapRuleDetails) GetCrcString() string { return "c7cbeea5" }
1928 func (*MapRuleDetails) GetMessageType() api.MessageType {
1929 return api.ReplyMessage
1932 func (m *MapRuleDetails) Size() (size int) {
1936 size += 1 * 16 // m.IP6Dst
1940 func (m *MapRuleDetails) Marshal(b []byte) ([]byte, error) {
1942 b = make([]byte, m.Size())
1944 buf := codec.NewBuffer(b)
1945 buf.EncodeBytes(m.IP6Dst[:], 16)
1946 buf.EncodeUint16(m.Psid)
1947 return buf.Bytes(), nil
1949 func (m *MapRuleDetails) Unmarshal(b []byte) error {
1950 buf := codec.NewBuffer(b)
1951 copy(m.IP6Dst[:], buf.DecodeBytes(16))
1952 m.Psid = buf.DecodeUint16()
1956 // MapRuleDump defines message 'map_rule_dump'.
1957 type MapRuleDump struct {
1958 DomainIndex uint32 `binapi:"u32,name=domain_index" json:"domain_index,omitempty"`
1961 func (m *MapRuleDump) Reset() { *m = MapRuleDump{} }
1962 func (*MapRuleDump) GetMessageName() string { return "map_rule_dump" }
1963 func (*MapRuleDump) GetCrcString() string { return "e43e6ff6" }
1964 func (*MapRuleDump) GetMessageType() api.MessageType {
1965 return api.RequestMessage
1968 func (m *MapRuleDump) Size() (size int) {
1972 size += 4 // m.DomainIndex
1975 func (m *MapRuleDump) Marshal(b []byte) ([]byte, error) {
1977 b = make([]byte, m.Size())
1979 buf := codec.NewBuffer(b)
1980 buf.EncodeUint32(m.DomainIndex)
1981 return buf.Bytes(), nil
1983 func (m *MapRuleDump) Unmarshal(b []byte) error {
1984 buf := codec.NewBuffer(b)
1985 m.DomainIndex = buf.DecodeUint32()
1989 // MapSummaryStats defines message 'map_summary_stats'.
1990 type MapSummaryStats struct{}
1992 func (m *MapSummaryStats) Reset() { *m = MapSummaryStats{} }
1993 func (*MapSummaryStats) GetMessageName() string { return "map_summary_stats" }
1994 func (*MapSummaryStats) GetCrcString() string { return "51077d14" }
1995 func (*MapSummaryStats) GetMessageType() api.MessageType {
1996 return api.RequestMessage
1999 func (m *MapSummaryStats) Size() (size int) {
2005 func (m *MapSummaryStats) Marshal(b []byte) ([]byte, error) {
2007 b = make([]byte, m.Size())
2009 buf := codec.NewBuffer(b)
2010 return buf.Bytes(), nil
2012 func (m *MapSummaryStats) Unmarshal(b []byte) error {
2016 // MapSummaryStatsReply defines message 'map_summary_stats_reply'.
2017 type MapSummaryStatsReply struct {
2018 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2019 TotalBindings uint64 `binapi:"u64,name=total_bindings" json:"total_bindings,omitempty"`
2020 TotalPkts []uint64 `binapi:"u64[2],name=total_pkts" json:"total_pkts,omitempty"`
2021 TotalBytes []uint64 `binapi:"u64[2],name=total_bytes" json:"total_bytes,omitempty"`
2022 TotalIP4Fragments uint64 `binapi:"u64,name=total_ip4_fragments" json:"total_ip4_fragments,omitempty"`
2023 TotalSecurityCheck []uint64 `binapi:"u64[2],name=total_security_check" json:"total_security_check,omitempty"`
2026 func (m *MapSummaryStatsReply) Reset() { *m = MapSummaryStatsReply{} }
2027 func (*MapSummaryStatsReply) GetMessageName() string { return "map_summary_stats_reply" }
2028 func (*MapSummaryStatsReply) GetCrcString() string { return "0e4ace0e" }
2029 func (*MapSummaryStatsReply) GetMessageType() api.MessageType {
2030 return api.ReplyMessage
2033 func (m *MapSummaryStatsReply) Size() (size int) {
2037 size += 4 // m.Retval
2038 size += 8 // m.TotalBindings
2039 size += 8 * 2 // m.TotalPkts
2040 size += 8 * 2 // m.TotalBytes
2041 size += 8 // m.TotalIP4Fragments
2042 size += 8 * 2 // m.TotalSecurityCheck
2045 func (m *MapSummaryStatsReply) Marshal(b []byte) ([]byte, error) {
2047 b = make([]byte, m.Size())
2049 buf := codec.NewBuffer(b)
2050 buf.EncodeInt32(m.Retval)
2051 buf.EncodeUint64(m.TotalBindings)
2052 for i := 0; i < 2; i++ {
2054 if i < len(m.TotalPkts) {
2055 x = uint64(m.TotalPkts[i])
2059 for i := 0; i < 2; i++ {
2061 if i < len(m.TotalBytes) {
2062 x = uint64(m.TotalBytes[i])
2066 buf.EncodeUint64(m.TotalIP4Fragments)
2067 for i := 0; i < 2; i++ {
2069 if i < len(m.TotalSecurityCheck) {
2070 x = uint64(m.TotalSecurityCheck[i])
2074 return buf.Bytes(), nil
2076 func (m *MapSummaryStatsReply) Unmarshal(b []byte) error {
2077 buf := codec.NewBuffer(b)
2078 m.Retval = buf.DecodeInt32()
2079 m.TotalBindings = buf.DecodeUint64()
2080 m.TotalPkts = make([]uint64, 2)
2081 for i := 0; i < len(m.TotalPkts); i++ {
2082 m.TotalPkts[i] = buf.DecodeUint64()
2084 m.TotalBytes = make([]uint64, 2)
2085 for i := 0; i < len(m.TotalBytes); i++ {
2086 m.TotalBytes[i] = buf.DecodeUint64()
2088 m.TotalIP4Fragments = buf.DecodeUint64()
2089 m.TotalSecurityCheck = make([]uint64, 2)
2090 for i := 0; i < len(m.TotalSecurityCheck); i++ {
2091 m.TotalSecurityCheck[i] = buf.DecodeUint64()
2096 func init() { file_maps_binapi_init() }
2097 func file_maps_binapi_init() {
2098 api.RegisterMessage((*MapAddDelRule)(nil), "map_add_del_rule_c65b32f7")
2099 api.RegisterMessage((*MapAddDelRuleReply)(nil), "map_add_del_rule_reply_e8d4e804")
2100 api.RegisterMessage((*MapAddDomain)(nil), "map_add_domain_7a5a18c9")
2101 api.RegisterMessage((*MapAddDomainReply)(nil), "map_add_domain_reply_3e6d4e2c")
2102 api.RegisterMessage((*MapDelDomain)(nil), "map_del_domain_8ac76db6")
2103 api.RegisterMessage((*MapDelDomainReply)(nil), "map_del_domain_reply_e8d4e804")
2104 api.RegisterMessage((*MapDomainDetails)(nil), "map_domain_details_fc1859dd")
2105 api.RegisterMessage((*MapDomainDump)(nil), "map_domain_dump_51077d14")
2106 api.RegisterMessage((*MapIfEnableDisable)(nil), "map_if_enable_disable_59bb32f4")
2107 api.RegisterMessage((*MapIfEnableDisableReply)(nil), "map_if_enable_disable_reply_e8d4e804")
2108 api.RegisterMessage((*MapParamAddDelPreResolve)(nil), "map_param_add_del_pre_resolve_17008c66")
2109 api.RegisterMessage((*MapParamAddDelPreResolveReply)(nil), "map_param_add_del_pre_resolve_reply_e8d4e804")
2110 api.RegisterMessage((*MapParamGet)(nil), "map_param_get_51077d14")
2111 api.RegisterMessage((*MapParamGetReply)(nil), "map_param_get_reply_28092156")
2112 api.RegisterMessage((*MapParamSetFragmentation)(nil), "map_param_set_fragmentation_9ff54d90")
2113 api.RegisterMessage((*MapParamSetFragmentationReply)(nil), "map_param_set_fragmentation_reply_e8d4e804")
2114 api.RegisterMessage((*MapParamSetICMP)(nil), "map_param_set_icmp_58210cbf")
2115 api.RegisterMessage((*MapParamSetICMP6)(nil), "map_param_set_icmp6_5d01f8c1")
2116 api.RegisterMessage((*MapParamSetICMP6Reply)(nil), "map_param_set_icmp6_reply_e8d4e804")
2117 api.RegisterMessage((*MapParamSetICMPReply)(nil), "map_param_set_icmp_reply_e8d4e804")
2118 api.RegisterMessage((*MapParamSetSecurityCheck)(nil), "map_param_set_security_check_6abe9836")
2119 api.RegisterMessage((*MapParamSetSecurityCheckReply)(nil), "map_param_set_security_check_reply_e8d4e804")
2120 api.RegisterMessage((*MapParamSetTCP)(nil), "map_param_set_tcp_87a825d9")
2121 api.RegisterMessage((*MapParamSetTCPReply)(nil), "map_param_set_tcp_reply_e8d4e804")
2122 api.RegisterMessage((*MapParamSetTrafficClass)(nil), "map_param_set_traffic_class_9cac455c")
2123 api.RegisterMessage((*MapParamSetTrafficClassReply)(nil), "map_param_set_traffic_class_reply_e8d4e804")
2124 api.RegisterMessage((*MapRuleDetails)(nil), "map_rule_details_c7cbeea5")
2125 api.RegisterMessage((*MapRuleDump)(nil), "map_rule_dump_e43e6ff6")
2126 api.RegisterMessage((*MapSummaryStats)(nil), "map_summary_stats_51077d14")
2127 api.RegisterMessage((*MapSummaryStatsReply)(nil), "map_summary_stats_reply_0e4ace0e")
2130 // Messages returns list of all messages in this module.
2131 func AllMessages() []api.Message {
2132 return []api.Message{
2133 (*MapAddDelRule)(nil),
2134 (*MapAddDelRuleReply)(nil),
2135 (*MapAddDomain)(nil),
2136 (*MapAddDomainReply)(nil),
2137 (*MapDelDomain)(nil),
2138 (*MapDelDomainReply)(nil),
2139 (*MapDomainDetails)(nil),
2140 (*MapDomainDump)(nil),
2141 (*MapIfEnableDisable)(nil),
2142 (*MapIfEnableDisableReply)(nil),
2143 (*MapParamAddDelPreResolve)(nil),
2144 (*MapParamAddDelPreResolveReply)(nil),
2145 (*MapParamGet)(nil),
2146 (*MapParamGetReply)(nil),
2147 (*MapParamSetFragmentation)(nil),
2148 (*MapParamSetFragmentationReply)(nil),
2149 (*MapParamSetICMP)(nil),
2150 (*MapParamSetICMP6)(nil),
2151 (*MapParamSetICMP6Reply)(nil),
2152 (*MapParamSetICMPReply)(nil),
2153 (*MapParamSetSecurityCheck)(nil),
2154 (*MapParamSetSecurityCheckReply)(nil),
2155 (*MapParamSetTCP)(nil),
2156 (*MapParamSetTCPReply)(nil),
2157 (*MapParamSetTrafficClass)(nil),
2158 (*MapParamSetTrafficClassReply)(nil),
2159 (*MapRuleDetails)(nil),
2160 (*MapRuleDump)(nil),
2161 (*MapSummaryStats)(nil),
2162 (*MapSummaryStatsReply)(nil),