Update generated binapi to v22.02 & makefile changes
[govpp.git] / internal / testbinapi / binapi2001 / map / map.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.5.0-dev
4 //  VPP:              20.01
5 // source: .vppapi/plugins/map.api.json
6
7 // Package maps contains generated bindings for API file map.api.
8 //
9 // Contents:
10 //   6 aliases
11 //  10 enums
12 //   6 structs
13 //   1 union
14 //  30 messages
15 //
16 package maps
17
18 import (
19         "fmt"
20         "net"
21         "strconv"
22         "strings"
23
24         api "git.fd.io/govpp.git/api"
25         codec "git.fd.io/govpp.git/codec"
26 )
27
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
33
34 const (
35         APIFile    = "map"
36         APIVersion = "4.1.1"
37         VersionCrc = 0x42c84657
38 )
39
40 // AddressFamily defines enum 'address_family'.
41 type AddressFamily uint32
42
43 const (
44         ADDRESS_IP4 AddressFamily = 0
45         ADDRESS_IP6 AddressFamily = 1
46 )
47
48 var (
49         AddressFamily_name = map[uint32]string{
50                 0: "ADDRESS_IP4",
51                 1: "ADDRESS_IP6",
52         }
53         AddressFamily_value = map[string]uint32{
54                 "ADDRESS_IP4": 0,
55                 "ADDRESS_IP6": 1,
56         }
57 )
58
59 func (x AddressFamily) String() string {
60         s, ok := AddressFamily_name[uint32(x)]
61         if ok {
62                 return s
63         }
64         return "AddressFamily(" + strconv.Itoa(int(x)) + ")"
65 }
66
67 // IfStatusFlags defines enum 'if_status_flags'.
68 type IfStatusFlags uint32
69
70 const (
71         IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
72         IF_STATUS_API_FLAG_LINK_UP  IfStatusFlags = 2
73 )
74
75 var (
76         IfStatusFlags_name = map[uint32]string{
77                 1: "IF_STATUS_API_FLAG_ADMIN_UP",
78                 2: "IF_STATUS_API_FLAG_LINK_UP",
79         }
80         IfStatusFlags_value = map[string]uint32{
81                 "IF_STATUS_API_FLAG_ADMIN_UP": 1,
82                 "IF_STATUS_API_FLAG_LINK_UP":  2,
83         }
84 )
85
86 func (x IfStatusFlags) String() string {
87         s, ok := IfStatusFlags_name[uint32(x)]
88         if ok {
89                 return s
90         }
91         str := func(n uint32) string {
92                 s, ok := IfStatusFlags_name[uint32(n)]
93                 if ok {
94                         return s
95                 }
96                 return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
97         }
98         for i := uint32(0); i <= 32; i++ {
99                 val := uint32(x)
100                 if val&(1<<i) != 0 {
101                         if s != "" {
102                                 s += "|"
103                         }
104                         s += str(1 << i)
105                 }
106         }
107         if s == "" {
108                 return str(uint32(x))
109         }
110         return s
111 }
112
113 // IfType defines enum 'if_type'.
114 type IfType uint32
115
116 const (
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
121 )
122
123 var (
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",
129         }
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,
135         }
136 )
137
138 func (x IfType) String() string {
139         s, ok := IfType_name[uint32(x)]
140         if ok {
141                 return s
142         }
143         return "IfType(" + strconv.Itoa(int(x)) + ")"
144 }
145
146 // IPDscp defines enum 'ip_dscp'.
147 type IPDscp uint8
148
149 const (
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
171 )
172
173 var (
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",
196         }
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,
219         }
220 )
221
222 func (x IPDscp) String() string {
223         s, ok := IPDscp_name[uint8(x)]
224         if ok {
225                 return s
226         }
227         return "IPDscp(" + strconv.Itoa(int(x)) + ")"
228 }
229
230 // IPEcn defines enum 'ip_ecn'.
231 type IPEcn uint8
232
233 const (
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
238 )
239
240 var (
241         IPEcn_name = map[uint8]string{
242                 0: "IP_API_ECN_NONE",
243                 1: "IP_API_ECN_ECT0",
244                 2: "IP_API_ECN_ECT1",
245                 3: "IP_API_ECN_CE",
246         }
247         IPEcn_value = map[string]uint8{
248                 "IP_API_ECN_NONE": 0,
249                 "IP_API_ECN_ECT0": 1,
250                 "IP_API_ECN_ECT1": 2,
251                 "IP_API_ECN_CE":   3,
252         }
253 )
254
255 func (x IPEcn) String() string {
256         s, ok := IPEcn_name[uint8(x)]
257         if ok {
258                 return s
259         }
260         return "IPEcn(" + strconv.Itoa(int(x)) + ")"
261 }
262
263 // IPProto defines enum 'ip_proto'.
264 type IPProto uint32
265
266 const (
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
279 )
280
281 var (
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",
295         }
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,
309         }
310 )
311
312 func (x IPProto) String() string {
313         s, ok := IPProto_name[uint32(x)]
314         if ok {
315                 return s
316         }
317         return "IPProto(" + strconv.Itoa(int(x)) + ")"
318 }
319
320 // LinkDuplex defines enum 'link_duplex'.
321 type LinkDuplex uint32
322
323 const (
324         LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
325         LINK_DUPLEX_API_HALF    LinkDuplex = 1
326         LINK_DUPLEX_API_FULL    LinkDuplex = 2
327 )
328
329 var (
330         LinkDuplex_name = map[uint32]string{
331                 0: "LINK_DUPLEX_API_UNKNOWN",
332                 1: "LINK_DUPLEX_API_HALF",
333                 2: "LINK_DUPLEX_API_FULL",
334         }
335         LinkDuplex_value = map[string]uint32{
336                 "LINK_DUPLEX_API_UNKNOWN": 0,
337                 "LINK_DUPLEX_API_HALF":    1,
338                 "LINK_DUPLEX_API_FULL":    2,
339         }
340 )
341
342 func (x LinkDuplex) String() string {
343         s, ok := LinkDuplex_name[uint32(x)]
344         if ok {
345                 return s
346         }
347         return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
348 }
349
350 // MtuProto defines enum 'mtu_proto'.
351 type MtuProto uint32
352
353 const (
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
359 )
360
361 var (
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",
368         }
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,
375         }
376 )
377
378 func (x MtuProto) String() string {
379         s, ok := MtuProto_name[uint32(x)]
380         if ok {
381                 return s
382         }
383         return "MtuProto(" + strconv.Itoa(int(x)) + ")"
384 }
385
386 // RxMode defines enum 'rx_mode'.
387 type RxMode uint32
388
389 const (
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
395 )
396
397 var (
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",
404         }
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,
411         }
412 )
413
414 func (x RxMode) String() string {
415         s, ok := RxMode_name[uint32(x)]
416         if ok {
417                 return s
418         }
419         return "RxMode(" + strconv.Itoa(int(x)) + ")"
420 }
421
422 // SubIfFlags defines enum 'sub_if_flags'.
423 type SubIfFlags uint32
424
425 const (
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
436 )
437
438 var (
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",
450         }
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,
462         }
463 )
464
465 func (x SubIfFlags) String() string {
466         s, ok := SubIfFlags_name[uint32(x)]
467         if ok {
468                 return s
469         }
470         str := func(n uint32) string {
471                 s, ok := SubIfFlags_name[uint32(n)]
472                 if ok {
473                         return s
474                 }
475                 return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
476         }
477         for i := uint32(0); i <= 32; i++ {
478                 val := uint32(x)
479                 if val&(1<<i) != 0 {
480                         if s != "" {
481                                 s += "|"
482                         }
483                         s += str(1 << i)
484                 }
485         }
486         if s == "" {
487                 return str(uint32(x))
488         }
489         return s
490 }
491
492 // AddressWithPrefix defines alias 'address_with_prefix'.
493 type AddressWithPrefix Prefix
494
495 func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
496         prefix, err := ParsePrefix(s)
497         if err != nil {
498                 return AddressWithPrefix{}, err
499         }
500         return AddressWithPrefix(prefix), nil
501 }
502
503 func (x AddressWithPrefix) String() string {
504         return Prefix(x).String()
505 }
506
507 func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
508         return []byte(x.String()), nil
509 }
510
511 func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
512         prefix, err := ParseAddressWithPrefix(string(text))
513         if err != nil {
514                 return err
515         }
516         *x = prefix
517         return nil
518 }
519
520 // InterfaceIndex defines alias 'interface_index'.
521 type InterfaceIndex uint32
522
523 // IP4Address defines alias 'ip4_address'.
524 type IP4Address [4]uint8
525
526 func ParseIP4Address(s string) (IP4Address, error) {
527         ip := net.ParseIP(s).To4()
528         if ip == nil {
529                 return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
530         }
531         var ipaddr IP4Address
532         copy(ipaddr[:], ip.To4())
533         return ipaddr, nil
534 }
535
536 func (x IP4Address) ToIP() net.IP {
537         return net.IP(x[:]).To4()
538 }
539
540 func (x IP4Address) String() string {
541         return x.ToIP().String()
542 }
543
544 func (x *IP4Address) MarshalText() ([]byte, error) {
545         return []byte(x.String()), nil
546 }
547
548 func (x *IP4Address) UnmarshalText(text []byte) error {
549         ipaddr, err := ParseIP4Address(string(text))
550         if err != nil {
551                 return err
552         }
553         *x = ipaddr
554         return nil
555 }
556
557 // IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
558 type IP4AddressWithPrefix IP4Prefix
559
560 // IP6Address defines alias 'ip6_address'.
561 type IP6Address [16]uint8
562
563 func ParseIP6Address(s string) (IP6Address, error) {
564         ip := net.ParseIP(s).To16()
565         if ip == nil {
566                 return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
567         }
568         var ipaddr IP6Address
569         copy(ipaddr[:], ip.To16())
570         return ipaddr, nil
571 }
572
573 func (x IP6Address) ToIP() net.IP {
574         return net.IP(x[:]).To16()
575 }
576
577 func (x IP6Address) String() string {
578         return x.ToIP().String()
579 }
580
581 func (x *IP6Address) MarshalText() ([]byte, error) {
582         return []byte(x.String()), nil
583 }
584
585 func (x *IP6Address) UnmarshalText(text []byte) error {
586         ipaddr, err := ParseIP6Address(string(text))
587         if err != nil {
588                 return err
589         }
590         *x = ipaddr
591         return nil
592 }
593
594 // IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
595 type IP6AddressWithPrefix IP6Prefix
596
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"`
601 }
602
603 func ParseAddress(s string) (Address, error) {
604         ip := net.ParseIP(s)
605         if ip == nil {
606                 return Address{}, fmt.Errorf("invalid address: %s", s)
607         }
608         return AddressFromIP(ip), nil
609 }
610
611 func AddressFromIP(ip net.IP) Address {
612         var addr Address
613         if ip.To4() == nil {
614                 addr.Af = ADDRESS_IP6
615                 var ip6 IP6Address
616                 copy(ip6[:], ip.To16())
617                 addr.Un.SetIP6(ip6)
618         } else {
619                 addr.Af = ADDRESS_IP4
620                 var ip4 IP4Address
621                 copy(ip4[:], ip.To4())
622                 addr.Un.SetIP4(ip4)
623         }
624         return addr
625 }
626
627 func (x Address) ToIP() net.IP {
628         if x.Af == ADDRESS_IP6 {
629                 ip6 := x.Un.GetIP6()
630                 return net.IP(ip6[:]).To16()
631         } else {
632                 ip4 := x.Un.GetIP4()
633                 return net.IP(ip4[:]).To4()
634         }
635 }
636
637 func (x Address) String() string {
638         return x.ToIP().String()
639 }
640
641 func (x *Address) MarshalText() ([]byte, error) {
642         return []byte(x.String()), nil
643 }
644
645 func (x *Address) UnmarshalText(text []byte) error {
646         addr, err := ParseAddress(string(text))
647         if err != nil {
648                 return err
649         }
650         *x = addr
651         return nil
652 }
653
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"`
658 }
659
660 func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
661         hasPrefix := strings.Contains(s, "/")
662         if hasPrefix {
663                 ip, network, err := net.ParseCIDR(s)
664                 if err != nil {
665                         return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
666                 }
667                 maskSize, _ := network.Mask.Size()
668                 prefix.Len = byte(maskSize)
669                 prefix.Address, err = ParseIP4Address(ip.String())
670                 if err != nil {
671                         return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
672                 }
673         } else {
674                 ip := net.ParseIP(s)
675                 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
676                 if ip.To4() == nil {
677                         defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
678                 }
679                 prefix.Len = byte(defaultMaskSize)
680                 prefix.Address, err = ParseIP4Address(ip.String())
681                 if err != nil {
682                         return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
683                 }
684         }
685         return prefix, nil
686 }
687
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}
691         return ipnet
692 }
693
694 func (x IP4Prefix) String() string {
695         ip := x.Address.String()
696         return ip + "/" + strconv.Itoa(int(x.Len))
697 }
698
699 func (x *IP4Prefix) MarshalText() ([]byte, error) {
700         return []byte(x.String()), nil
701 }
702
703 func (x *IP4Prefix) UnmarshalText(text []byte) error {
704         prefix, err := ParseIP4Prefix(string(text))
705         if err != nil {
706                 return err
707         }
708         *x = prefix
709         return nil
710 }
711
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"`
716 }
717
718 func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
719         hasPrefix := strings.Contains(s, "/")
720         if hasPrefix {
721                 ip, network, err := net.ParseCIDR(s)
722                 if err != nil {
723                         return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
724                 }
725                 maskSize, _ := network.Mask.Size()
726                 prefix.Len = byte(maskSize)
727                 prefix.Address, err = ParseIP6Address(ip.String())
728                 if err != nil {
729                         return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
730                 }
731         } else {
732                 ip := net.ParseIP(s)
733                 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
734                 if ip.To4() == nil {
735                         defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
736                 }
737                 prefix.Len = byte(defaultMaskSize)
738                 prefix.Address, err = ParseIP6Address(ip.String())
739                 if err != nil {
740                         return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
741                 }
742         }
743         return prefix, nil
744 }
745
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}
749         return ipnet
750 }
751
752 func (x IP6Prefix) String() string {
753         ip := x.Address.String()
754         return ip + "/" + strconv.Itoa(int(x.Len))
755 }
756
757 func (x *IP6Prefix) MarshalText() ([]byte, error) {
758         return []byte(x.String()), nil
759 }
760
761 func (x *IP6Prefix) UnmarshalText(text []byte) error {
762         prefix, err := ParseIP6Prefix(string(text))
763         if err != nil {
764                 return err
765         }
766         *x = prefix
767         return nil
768 }
769
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"`
776 }
777
778 // Prefix defines type 'prefix'.
779 type Prefix struct {
780         Address Address `binapi:"address,name=address" json:"address,omitempty"`
781         Len     uint8   `binapi:"u8,name=len" json:"len,omitempty"`
782 }
783
784 func ParsePrefix(ip string) (prefix Prefix, err error) {
785         hasPrefix := strings.Contains(ip, "/")
786         if hasPrefix {
787                 netIP, network, err := net.ParseCIDR(ip)
788                 if err != nil {
789                         return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
790                 }
791                 maskSize, _ := network.Mask.Size()
792                 prefix.Len = byte(maskSize)
793                 prefix.Address, err = ParseAddress(netIP.String())
794                 if err != nil {
795                         return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
796                 }
797         } else {
798                 netIP := net.ParseIP(ip)
799                 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
800                 if netIP.To4() == nil {
801                         defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
802                 }
803                 prefix.Len = byte(defaultMaskSize)
804                 prefix.Address, err = ParseAddress(netIP.String())
805                 if err != nil {
806                         return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
807                 }
808         }
809         return prefix, nil
810 }
811
812 func (x Prefix) ToIPNet() *net.IPNet {
813         var mask net.IPMask
814         if x.Address.Af == ADDRESS_IP4 {
815                 mask = net.CIDRMask(int(x.Len), 32)
816         } else {
817                 mask = net.CIDRMask(int(x.Len), 128)
818         }
819         ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
820         return ipnet
821 }
822
823 func (x Prefix) String() string {
824         ip := x.Address.String()
825         return ip + "/" + strconv.Itoa(int(x.Len))
826 }
827
828 func (x *Prefix) MarshalText() ([]byte, error) {
829         return []byte(x.String()), nil
830 }
831
832 func (x *Prefix) UnmarshalText(text []byte) error {
833         prefix, err := ParsePrefix(string(text))
834         if err != nil {
835                 return err
836         }
837         *x = prefix
838         return nil
839 }
840
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"`
845 }
846
847 // AddressUnion defines union 'address_union'.
848 type AddressUnion struct {
849         // AddressUnion can be one of:
850         // - IP4 *IP4Address
851         // - IP6 *IP6Address
852         XXX_UnionData [16]byte
853 }
854
855 func AddressUnionIP4(a IP4Address) (u AddressUnion) {
856         u.SetIP4(a)
857         return
858 }
859 func (u *AddressUnion) SetIP4(a IP4Address) {
860         buf := codec.NewBuffer(u.XXX_UnionData[:])
861         buf.EncodeBytes(a[:], 4)
862 }
863 func (u *AddressUnion) GetIP4() (a IP4Address) {
864         buf := codec.NewBuffer(u.XXX_UnionData[:])
865         copy(a[:], buf.DecodeBytes(4))
866         return
867 }
868
869 func AddressUnionIP6(a IP6Address) (u AddressUnion) {
870         u.SetIP6(a)
871         return
872 }
873 func (u *AddressUnion) SetIP6(a IP6Address) {
874         buf := codec.NewBuffer(u.XXX_UnionData[:])
875         buf.EncodeBytes(a[:], 16)
876 }
877 func (u *AddressUnion) GetIP6() (a IP6Address) {
878         buf := codec.NewBuffer(u.XXX_UnionData[:])
879         copy(a[:], buf.DecodeBytes(16))
880         return
881 }
882
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"`
889 }
890
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
896 }
897
898 func (m *MapAddDelRule) Size() (size int) {
899         if m == nil {
900                 return 0
901         }
902         size += 4      // m.Index
903         size += 1      // m.IsAdd
904         size += 1 * 16 // m.IP6Dst
905         size += 2      // m.Psid
906         return size
907 }
908 func (m *MapAddDelRule) Marshal(b []byte) ([]byte, error) {
909         if b == nil {
910                 b = make([]byte, m.Size())
911         }
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
918 }
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()
925         return nil
926 }
927
928 // MapAddDelRuleReply defines message 'map_add_del_rule_reply'.
929 type MapAddDelRuleReply struct {
930         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
931 }
932
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
938 }
939
940 func (m *MapAddDelRuleReply) Size() (size int) {
941         if m == nil {
942                 return 0
943         }
944         size += 4 // m.Retval
945         return size
946 }
947 func (m *MapAddDelRuleReply) Marshal(b []byte) ([]byte, error) {
948         if b == nil {
949                 b = make([]byte, m.Size())
950         }
951         buf := codec.NewBuffer(b)
952         buf.EncodeInt32(m.Retval)
953         return buf.Bytes(), nil
954 }
955 func (m *MapAddDelRuleReply) Unmarshal(b []byte) error {
956         buf := codec.NewBuffer(b)
957         m.Retval = buf.DecodeInt32()
958         return nil
959 }
960
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"`
971 }
972
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
978 }
979
980 func (m *MapAddDomain) Size() (size int) {
981         if m == nil {
982                 return 0
983         }
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
993         size += 2      // m.Mtu
994         size += 64     // m.Tag
995         return size
996 }
997 func (m *MapAddDomain) Marshal(b []byte) ([]byte, error) {
998         if b == nil {
999                 b = make([]byte, m.Size())
1000         }
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
1014 }
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)
1028         return nil
1029 }
1030
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"`
1035 }
1036
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
1042 }
1043
1044 func (m *MapAddDomainReply) Size() (size int) {
1045         if m == nil {
1046                 return 0
1047         }
1048         size += 4 // m.Index
1049         size += 4 // m.Retval
1050         return size
1051 }
1052 func (m *MapAddDomainReply) Marshal(b []byte) ([]byte, error) {
1053         if b == nil {
1054                 b = make([]byte, m.Size())
1055         }
1056         buf := codec.NewBuffer(b)
1057         buf.EncodeUint32(m.Index)
1058         buf.EncodeInt32(m.Retval)
1059         return buf.Bytes(), nil
1060 }
1061 func (m *MapAddDomainReply) Unmarshal(b []byte) error {
1062         buf := codec.NewBuffer(b)
1063         m.Index = buf.DecodeUint32()
1064         m.Retval = buf.DecodeInt32()
1065         return nil
1066 }
1067
1068 // MapDelDomain defines message 'map_del_domain'.
1069 type MapDelDomain struct {
1070         Index uint32 `binapi:"u32,name=index" json:"index,omitempty"`
1071 }
1072
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
1078 }
1079
1080 func (m *MapDelDomain) Size() (size int) {
1081         if m == nil {
1082                 return 0
1083         }
1084         size += 4 // m.Index
1085         return size
1086 }
1087 func (m *MapDelDomain) Marshal(b []byte) ([]byte, error) {
1088         if b == nil {
1089                 b = make([]byte, m.Size())
1090         }
1091         buf := codec.NewBuffer(b)
1092         buf.EncodeUint32(m.Index)
1093         return buf.Bytes(), nil
1094 }
1095 func (m *MapDelDomain) Unmarshal(b []byte) error {
1096         buf := codec.NewBuffer(b)
1097         m.Index = buf.DecodeUint32()
1098         return nil
1099 }
1100
1101 // MapDelDomainReply defines message 'map_del_domain_reply'.
1102 type MapDelDomainReply struct {
1103         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1104 }
1105
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
1111 }
1112
1113 func (m *MapDelDomainReply) Size() (size int) {
1114         if m == nil {
1115                 return 0
1116         }
1117         size += 4 // m.Retval
1118         return size
1119 }
1120 func (m *MapDelDomainReply) Marshal(b []byte) ([]byte, error) {
1121         if b == nil {
1122                 b = make([]byte, m.Size())
1123         }
1124         buf := codec.NewBuffer(b)
1125         buf.EncodeInt32(m.Retval)
1126         return buf.Bytes(), nil
1127 }
1128 func (m *MapDelDomainReply) Unmarshal(b []byte) error {
1129         buf := codec.NewBuffer(b)
1130         m.Retval = buf.DecodeInt32()
1131         return nil
1132 }
1133
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"`
1146 }
1147
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
1153 }
1154
1155 func (m *MapDomainDetails) Size() (size int) {
1156         if m == nil {
1157                 return 0
1158         }
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
1170         size += 2      // m.Mtu
1171         size += 64     // m.Tag
1172         return size
1173 }
1174 func (m *MapDomainDetails) Marshal(b []byte) ([]byte, error) {
1175         if b == nil {
1176                 b = make([]byte, m.Size())
1177         }
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
1193 }
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)
1209         return nil
1210 }
1211
1212 // MapDomainDump defines message 'map_domain_dump'.
1213 type MapDomainDump struct{}
1214
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
1220 }
1221
1222 func (m *MapDomainDump) Size() (size int) {
1223         if m == nil {
1224                 return 0
1225         }
1226         return size
1227 }
1228 func (m *MapDomainDump) Marshal(b []byte) ([]byte, error) {
1229         if b == nil {
1230                 b = make([]byte, m.Size())
1231         }
1232         buf := codec.NewBuffer(b)
1233         return buf.Bytes(), nil
1234 }
1235 func (m *MapDomainDump) Unmarshal(b []byte) error {
1236         return nil
1237 }
1238
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"`
1244 }
1245
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
1251 }
1252
1253 func (m *MapIfEnableDisable) Size() (size int) {
1254         if m == nil {
1255                 return 0
1256         }
1257         size += 4 // m.SwIfIndex
1258         size += 1 // m.IsEnable
1259         size += 1 // m.IsTranslation
1260         return size
1261 }
1262 func (m *MapIfEnableDisable) Marshal(b []byte) ([]byte, error) {
1263         if b == nil {
1264                 b = make([]byte, m.Size())
1265         }
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
1271 }
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()
1277         return nil
1278 }
1279
1280 // MapIfEnableDisableReply defines message 'map_if_enable_disable_reply'.
1281 type MapIfEnableDisableReply struct {
1282         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1283 }
1284
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
1290 }
1291
1292 func (m *MapIfEnableDisableReply) Size() (size int) {
1293         if m == nil {
1294                 return 0
1295         }
1296         size += 4 // m.Retval
1297         return size
1298 }
1299 func (m *MapIfEnableDisableReply) Marshal(b []byte) ([]byte, error) {
1300         if b == nil {
1301                 b = make([]byte, m.Size())
1302         }
1303         buf := codec.NewBuffer(b)
1304         buf.EncodeInt32(m.Retval)
1305         return buf.Bytes(), nil
1306 }
1307 func (m *MapIfEnableDisableReply) Unmarshal(b []byte) error {
1308         buf := codec.NewBuffer(b)
1309         m.Retval = buf.DecodeInt32()
1310         return nil
1311 }
1312
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"`
1318 }
1319
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
1325 }
1326
1327 func (m *MapParamAddDelPreResolve) Size() (size int) {
1328         if m == nil {
1329                 return 0
1330         }
1331         size += 1      // m.IsAdd
1332         size += 1 * 4  // m.IP4NhAddress
1333         size += 1 * 16 // m.IP6NhAddress
1334         return size
1335 }
1336 func (m *MapParamAddDelPreResolve) Marshal(b []byte) ([]byte, error) {
1337         if b == nil {
1338                 b = make([]byte, m.Size())
1339         }
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
1345 }
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))
1351         return nil
1352 }
1353
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"`
1357 }
1358
1359 func (m *MapParamAddDelPreResolveReply) Reset() { *m = MapParamAddDelPreResolveReply{} }
1360 func (*MapParamAddDelPreResolveReply) GetMessageName() string {
1361         return "map_param_add_del_pre_resolve_reply"
1362 }
1363 func (*MapParamAddDelPreResolveReply) GetCrcString() string { return "e8d4e804" }
1364 func (*MapParamAddDelPreResolveReply) GetMessageType() api.MessageType {
1365         return api.ReplyMessage
1366 }
1367
1368 func (m *MapParamAddDelPreResolveReply) Size() (size int) {
1369         if m == nil {
1370                 return 0
1371         }
1372         size += 4 // m.Retval
1373         return size
1374 }
1375 func (m *MapParamAddDelPreResolveReply) Marshal(b []byte) ([]byte, error) {
1376         if b == nil {
1377                 b = make([]byte, m.Size())
1378         }
1379         buf := codec.NewBuffer(b)
1380         buf.EncodeInt32(m.Retval)
1381         return buf.Bytes(), nil
1382 }
1383 func (m *MapParamAddDelPreResolveReply) Unmarshal(b []byte) error {
1384         buf := codec.NewBuffer(b)
1385         m.Retval = buf.DecodeInt32()
1386         return nil
1387 }
1388
1389 // MapParamGet defines message 'map_param_get'.
1390 type MapParamGet struct{}
1391
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
1397 }
1398
1399 func (m *MapParamGet) Size() (size int) {
1400         if m == nil {
1401                 return 0
1402         }
1403         return size
1404 }
1405 func (m *MapParamGet) Marshal(b []byte) ([]byte, error) {
1406         if b == nil {
1407                 b = make([]byte, m.Size())
1408         }
1409         buf := codec.NewBuffer(b)
1410         return buf.Bytes(), nil
1411 }
1412 func (m *MapParamGet) Unmarshal(b []byte) error {
1413         return nil
1414 }
1415
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"`
1433 }
1434
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
1440 }
1441
1442 func (m *MapParamGetReply) Size() (size int) {
1443         if m == nil {
1444                 return 0
1445         }
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
1461         return size
1462 }
1463 func (m *MapParamGetReply) Marshal(b []byte) ([]byte, error) {
1464         if b == nil {
1465                 b = make([]byte, m.Size())
1466         }
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
1484 }
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()
1502         return nil
1503 }
1504
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"`
1509 }
1510
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
1516 }
1517
1518 func (m *MapParamSetFragmentation) Size() (size int) {
1519         if m == nil {
1520                 return 0
1521         }
1522         size += 1 // m.Inner
1523         size += 1 // m.IgnoreDf
1524         return size
1525 }
1526 func (m *MapParamSetFragmentation) Marshal(b []byte) ([]byte, error) {
1527         if b == nil {
1528                 b = make([]byte, m.Size())
1529         }
1530         buf := codec.NewBuffer(b)
1531         buf.EncodeBool(m.Inner)
1532         buf.EncodeBool(m.IgnoreDf)
1533         return buf.Bytes(), nil
1534 }
1535 func (m *MapParamSetFragmentation) Unmarshal(b []byte) error {
1536         buf := codec.NewBuffer(b)
1537         m.Inner = buf.DecodeBool()
1538         m.IgnoreDf = buf.DecodeBool()
1539         return nil
1540 }
1541
1542 // MapParamSetFragmentationReply defines message 'map_param_set_fragmentation_reply'.
1543 type MapParamSetFragmentationReply struct {
1544         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1545 }
1546
1547 func (m *MapParamSetFragmentationReply) Reset() { *m = MapParamSetFragmentationReply{} }
1548 func (*MapParamSetFragmentationReply) GetMessageName() string {
1549         return "map_param_set_fragmentation_reply"
1550 }
1551 func (*MapParamSetFragmentationReply) GetCrcString() string { return "e8d4e804" }
1552 func (*MapParamSetFragmentationReply) GetMessageType() api.MessageType {
1553         return api.ReplyMessage
1554 }
1555
1556 func (m *MapParamSetFragmentationReply) Size() (size int) {
1557         if m == nil {
1558                 return 0
1559         }
1560         size += 4 // m.Retval
1561         return size
1562 }
1563 func (m *MapParamSetFragmentationReply) Marshal(b []byte) ([]byte, error) {
1564         if b == nil {
1565                 b = make([]byte, m.Size())
1566         }
1567         buf := codec.NewBuffer(b)
1568         buf.EncodeInt32(m.Retval)
1569         return buf.Bytes(), nil
1570 }
1571 func (m *MapParamSetFragmentationReply) Unmarshal(b []byte) error {
1572         buf := codec.NewBuffer(b)
1573         m.Retval = buf.DecodeInt32()
1574         return nil
1575 }
1576
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"`
1580 }
1581
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
1587 }
1588
1589 func (m *MapParamSetICMP) Size() (size int) {
1590         if m == nil {
1591                 return 0
1592         }
1593         size += 1 * 4 // m.IP4ErrRelaySrc
1594         return size
1595 }
1596 func (m *MapParamSetICMP) Marshal(b []byte) ([]byte, error) {
1597         if b == nil {
1598                 b = make([]byte, m.Size())
1599         }
1600         buf := codec.NewBuffer(b)
1601         buf.EncodeBytes(m.IP4ErrRelaySrc[:], 4)
1602         return buf.Bytes(), nil
1603 }
1604 func (m *MapParamSetICMP) Unmarshal(b []byte) error {
1605         buf := codec.NewBuffer(b)
1606         copy(m.IP4ErrRelaySrc[:], buf.DecodeBytes(4))
1607         return nil
1608 }
1609
1610 // MapParamSetICMP6 defines message 'map_param_set_icmp6'.
1611 type MapParamSetICMP6 struct {
1612         EnableUnreachable bool `binapi:"bool,name=enable_unreachable" json:"enable_unreachable,omitempty"`
1613 }
1614
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
1620 }
1621
1622 func (m *MapParamSetICMP6) Size() (size int) {
1623         if m == nil {
1624                 return 0
1625         }
1626         size += 1 // m.EnableUnreachable
1627         return size
1628 }
1629 func (m *MapParamSetICMP6) Marshal(b []byte) ([]byte, error) {
1630         if b == nil {
1631                 b = make([]byte, m.Size())
1632         }
1633         buf := codec.NewBuffer(b)
1634         buf.EncodeBool(m.EnableUnreachable)
1635         return buf.Bytes(), nil
1636 }
1637 func (m *MapParamSetICMP6) Unmarshal(b []byte) error {
1638         buf := codec.NewBuffer(b)
1639         m.EnableUnreachable = buf.DecodeBool()
1640         return nil
1641 }
1642
1643 // MapParamSetICMP6Reply defines message 'map_param_set_icmp6_reply'.
1644 type MapParamSetICMP6Reply struct {
1645         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1646 }
1647
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
1653 }
1654
1655 func (m *MapParamSetICMP6Reply) Size() (size int) {
1656         if m == nil {
1657                 return 0
1658         }
1659         size += 4 // m.Retval
1660         return size
1661 }
1662 func (m *MapParamSetICMP6Reply) Marshal(b []byte) ([]byte, error) {
1663         if b == nil {
1664                 b = make([]byte, m.Size())
1665         }
1666         buf := codec.NewBuffer(b)
1667         buf.EncodeInt32(m.Retval)
1668         return buf.Bytes(), nil
1669 }
1670 func (m *MapParamSetICMP6Reply) Unmarshal(b []byte) error {
1671         buf := codec.NewBuffer(b)
1672         m.Retval = buf.DecodeInt32()
1673         return nil
1674 }
1675
1676 // MapParamSetICMPReply defines message 'map_param_set_icmp_reply'.
1677 type MapParamSetICMPReply struct {
1678         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1679 }
1680
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
1686 }
1687
1688 func (m *MapParamSetICMPReply) Size() (size int) {
1689         if m == nil {
1690                 return 0
1691         }
1692         size += 4 // m.Retval
1693         return size
1694 }
1695 func (m *MapParamSetICMPReply) Marshal(b []byte) ([]byte, error) {
1696         if b == nil {
1697                 b = make([]byte, m.Size())
1698         }
1699         buf := codec.NewBuffer(b)
1700         buf.EncodeInt32(m.Retval)
1701         return buf.Bytes(), nil
1702 }
1703 func (m *MapParamSetICMPReply) Unmarshal(b []byte) error {
1704         buf := codec.NewBuffer(b)
1705         m.Retval = buf.DecodeInt32()
1706         return nil
1707 }
1708
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"`
1713 }
1714
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
1720 }
1721
1722 func (m *MapParamSetSecurityCheck) Size() (size int) {
1723         if m == nil {
1724                 return 0
1725         }
1726         size += 1 // m.Enable
1727         size += 1 // m.Fragments
1728         return size
1729 }
1730 func (m *MapParamSetSecurityCheck) Marshal(b []byte) ([]byte, error) {
1731         if b == nil {
1732                 b = make([]byte, m.Size())
1733         }
1734         buf := codec.NewBuffer(b)
1735         buf.EncodeBool(m.Enable)
1736         buf.EncodeBool(m.Fragments)
1737         return buf.Bytes(), nil
1738 }
1739 func (m *MapParamSetSecurityCheck) Unmarshal(b []byte) error {
1740         buf := codec.NewBuffer(b)
1741         m.Enable = buf.DecodeBool()
1742         m.Fragments = buf.DecodeBool()
1743         return nil
1744 }
1745
1746 // MapParamSetSecurityCheckReply defines message 'map_param_set_security_check_reply'.
1747 type MapParamSetSecurityCheckReply struct {
1748         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1749 }
1750
1751 func (m *MapParamSetSecurityCheckReply) Reset() { *m = MapParamSetSecurityCheckReply{} }
1752 func (*MapParamSetSecurityCheckReply) GetMessageName() string {
1753         return "map_param_set_security_check_reply"
1754 }
1755 func (*MapParamSetSecurityCheckReply) GetCrcString() string { return "e8d4e804" }
1756 func (*MapParamSetSecurityCheckReply) GetMessageType() api.MessageType {
1757         return api.ReplyMessage
1758 }
1759
1760 func (m *MapParamSetSecurityCheckReply) Size() (size int) {
1761         if m == nil {
1762                 return 0
1763         }
1764         size += 4 // m.Retval
1765         return size
1766 }
1767 func (m *MapParamSetSecurityCheckReply) Marshal(b []byte) ([]byte, error) {
1768         if b == nil {
1769                 b = make([]byte, m.Size())
1770         }
1771         buf := codec.NewBuffer(b)
1772         buf.EncodeInt32(m.Retval)
1773         return buf.Bytes(), nil
1774 }
1775 func (m *MapParamSetSecurityCheckReply) Unmarshal(b []byte) error {
1776         buf := codec.NewBuffer(b)
1777         m.Retval = buf.DecodeInt32()
1778         return nil
1779 }
1780
1781 // MapParamSetTCP defines message 'map_param_set_tcp'.
1782 type MapParamSetTCP struct {
1783         TCPMss uint16 `binapi:"u16,name=tcp_mss" json:"tcp_mss,omitempty"`
1784 }
1785
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
1791 }
1792
1793 func (m *MapParamSetTCP) Size() (size int) {
1794         if m == nil {
1795                 return 0
1796         }
1797         size += 2 // m.TCPMss
1798         return size
1799 }
1800 func (m *MapParamSetTCP) Marshal(b []byte) ([]byte, error) {
1801         if b == nil {
1802                 b = make([]byte, m.Size())
1803         }
1804         buf := codec.NewBuffer(b)
1805         buf.EncodeUint16(m.TCPMss)
1806         return buf.Bytes(), nil
1807 }
1808 func (m *MapParamSetTCP) Unmarshal(b []byte) error {
1809         buf := codec.NewBuffer(b)
1810         m.TCPMss = buf.DecodeUint16()
1811         return nil
1812 }
1813
1814 // MapParamSetTCPReply defines message 'map_param_set_tcp_reply'.
1815 type MapParamSetTCPReply struct {
1816         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1817 }
1818
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
1824 }
1825
1826 func (m *MapParamSetTCPReply) Size() (size int) {
1827         if m == nil {
1828                 return 0
1829         }
1830         size += 4 // m.Retval
1831         return size
1832 }
1833 func (m *MapParamSetTCPReply) Marshal(b []byte) ([]byte, error) {
1834         if b == nil {
1835                 b = make([]byte, m.Size())
1836         }
1837         buf := codec.NewBuffer(b)
1838         buf.EncodeInt32(m.Retval)
1839         return buf.Bytes(), nil
1840 }
1841 func (m *MapParamSetTCPReply) Unmarshal(b []byte) error {
1842         buf := codec.NewBuffer(b)
1843         m.Retval = buf.DecodeInt32()
1844         return nil
1845 }
1846
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"`
1851 }
1852
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
1858 }
1859
1860 func (m *MapParamSetTrafficClass) Size() (size int) {
1861         if m == nil {
1862                 return 0
1863         }
1864         size += 1 // m.Copy
1865         size += 1 // m.TcClass
1866         return size
1867 }
1868 func (m *MapParamSetTrafficClass) Marshal(b []byte) ([]byte, error) {
1869         if b == nil {
1870                 b = make([]byte, m.Size())
1871         }
1872         buf := codec.NewBuffer(b)
1873         buf.EncodeBool(m.Copy)
1874         buf.EncodeUint8(m.TcClass)
1875         return buf.Bytes(), nil
1876 }
1877 func (m *MapParamSetTrafficClass) Unmarshal(b []byte) error {
1878         buf := codec.NewBuffer(b)
1879         m.Copy = buf.DecodeBool()
1880         m.TcClass = buf.DecodeUint8()
1881         return nil
1882 }
1883
1884 // MapParamSetTrafficClassReply defines message 'map_param_set_traffic_class_reply'.
1885 type MapParamSetTrafficClassReply struct {
1886         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1887 }
1888
1889 func (m *MapParamSetTrafficClassReply) Reset() { *m = MapParamSetTrafficClassReply{} }
1890 func (*MapParamSetTrafficClassReply) GetMessageName() string {
1891         return "map_param_set_traffic_class_reply"
1892 }
1893 func (*MapParamSetTrafficClassReply) GetCrcString() string { return "e8d4e804" }
1894 func (*MapParamSetTrafficClassReply) GetMessageType() api.MessageType {
1895         return api.ReplyMessage
1896 }
1897
1898 func (m *MapParamSetTrafficClassReply) Size() (size int) {
1899         if m == nil {
1900                 return 0
1901         }
1902         size += 4 // m.Retval
1903         return size
1904 }
1905 func (m *MapParamSetTrafficClassReply) Marshal(b []byte) ([]byte, error) {
1906         if b == nil {
1907                 b = make([]byte, m.Size())
1908         }
1909         buf := codec.NewBuffer(b)
1910         buf.EncodeInt32(m.Retval)
1911         return buf.Bytes(), nil
1912 }
1913 func (m *MapParamSetTrafficClassReply) Unmarshal(b []byte) error {
1914         buf := codec.NewBuffer(b)
1915         m.Retval = buf.DecodeInt32()
1916         return nil
1917 }
1918
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"`
1923 }
1924
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
1930 }
1931
1932 func (m *MapRuleDetails) Size() (size int) {
1933         if m == nil {
1934                 return 0
1935         }
1936         size += 1 * 16 // m.IP6Dst
1937         size += 2      // m.Psid
1938         return size
1939 }
1940 func (m *MapRuleDetails) Marshal(b []byte) ([]byte, error) {
1941         if b == nil {
1942                 b = make([]byte, m.Size())
1943         }
1944         buf := codec.NewBuffer(b)
1945         buf.EncodeBytes(m.IP6Dst[:], 16)
1946         buf.EncodeUint16(m.Psid)
1947         return buf.Bytes(), nil
1948 }
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()
1953         return nil
1954 }
1955
1956 // MapRuleDump defines message 'map_rule_dump'.
1957 type MapRuleDump struct {
1958         DomainIndex uint32 `binapi:"u32,name=domain_index" json:"domain_index,omitempty"`
1959 }
1960
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
1966 }
1967
1968 func (m *MapRuleDump) Size() (size int) {
1969         if m == nil {
1970                 return 0
1971         }
1972         size += 4 // m.DomainIndex
1973         return size
1974 }
1975 func (m *MapRuleDump) Marshal(b []byte) ([]byte, error) {
1976         if b == nil {
1977                 b = make([]byte, m.Size())
1978         }
1979         buf := codec.NewBuffer(b)
1980         buf.EncodeUint32(m.DomainIndex)
1981         return buf.Bytes(), nil
1982 }
1983 func (m *MapRuleDump) Unmarshal(b []byte) error {
1984         buf := codec.NewBuffer(b)
1985         m.DomainIndex = buf.DecodeUint32()
1986         return nil
1987 }
1988
1989 // MapSummaryStats defines message 'map_summary_stats'.
1990 type MapSummaryStats struct{}
1991
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
1997 }
1998
1999 func (m *MapSummaryStats) Size() (size int) {
2000         if m == nil {
2001                 return 0
2002         }
2003         return size
2004 }
2005 func (m *MapSummaryStats) Marshal(b []byte) ([]byte, error) {
2006         if b == nil {
2007                 b = make([]byte, m.Size())
2008         }
2009         buf := codec.NewBuffer(b)
2010         return buf.Bytes(), nil
2011 }
2012 func (m *MapSummaryStats) Unmarshal(b []byte) error {
2013         return nil
2014 }
2015
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"`
2024 }
2025
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
2031 }
2032
2033 func (m *MapSummaryStatsReply) Size() (size int) {
2034         if m == nil {
2035                 return 0
2036         }
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
2043         return size
2044 }
2045 func (m *MapSummaryStatsReply) Marshal(b []byte) ([]byte, error) {
2046         if b == nil {
2047                 b = make([]byte, m.Size())
2048         }
2049         buf := codec.NewBuffer(b)
2050         buf.EncodeInt32(m.Retval)
2051         buf.EncodeUint64(m.TotalBindings)
2052         for i := 0; i < 2; i++ {
2053                 var x uint64
2054                 if i < len(m.TotalPkts) {
2055                         x = uint64(m.TotalPkts[i])
2056                 }
2057                 buf.EncodeUint64(x)
2058         }
2059         for i := 0; i < 2; i++ {
2060                 var x uint64
2061                 if i < len(m.TotalBytes) {
2062                         x = uint64(m.TotalBytes[i])
2063                 }
2064                 buf.EncodeUint64(x)
2065         }
2066         buf.EncodeUint64(m.TotalIP4Fragments)
2067         for i := 0; i < 2; i++ {
2068                 var x uint64
2069                 if i < len(m.TotalSecurityCheck) {
2070                         x = uint64(m.TotalSecurityCheck[i])
2071                 }
2072                 buf.EncodeUint64(x)
2073         }
2074         return buf.Bytes(), nil
2075 }
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()
2083         }
2084         m.TotalBytes = make([]uint64, 2)
2085         for i := 0; i < len(m.TotalBytes); i++ {
2086                 m.TotalBytes[i] = buf.DecodeUint64()
2087         }
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()
2092         }
2093         return nil
2094 }
2095
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")
2128 }
2129
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),
2163         }
2164 }