1f00396c88faa881db0dfbee4c33ec38018fc507
[govpp.git] / internal / testbinapi / binapi2001 / gbp / gbp.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.4.0-dev
4 //  VPP:              20.01
5 // source: .vppapi/plugins/gbp.api.json
6
7 // Package gbp contains generated bindings for API file gbp.api.
8 //
9 // Contents:
10 //   8 aliases
11 //  17 enums
12 //  20 structs
13 //   1 union
14 //  48 messages
15 //
16 package gbp
17
18 import (
19         "fmt"
20         api "git.fd.io/govpp.git/api"
21         codec "git.fd.io/govpp.git/codec"
22         "net"
23         "strconv"
24         "strings"
25 )
26
27 // This is a compile-time assertion to ensure that this generated file
28 // is compatible with the GoVPP api package it is being compiled against.
29 // A compilation error at this line likely means your copy of the
30 // GoVPP api package needs to be updated.
31 const _ = api.GoVppAPIPackageIsVersion2
32
33 const (
34         APIFile    = "gbp"
35         APIVersion = "2.0.0"
36         VersionCrc = 0xa891d6ff
37 )
38
39 // AddressFamily defines enum 'address_family'.
40 type AddressFamily uint32
41
42 const (
43         ADDRESS_IP4 AddressFamily = 0
44         ADDRESS_IP6 AddressFamily = 1
45 )
46
47 var (
48         AddressFamily_name = map[uint32]string{
49                 0: "ADDRESS_IP4",
50                 1: "ADDRESS_IP6",
51         }
52         AddressFamily_value = map[string]uint32{
53                 "ADDRESS_IP4": 0,
54                 "ADDRESS_IP6": 1,
55         }
56 )
57
58 func (x AddressFamily) String() string {
59         s, ok := AddressFamily_name[uint32(x)]
60         if ok {
61                 return s
62         }
63         return "AddressFamily(" + strconv.Itoa(int(x)) + ")"
64 }
65
66 // GbpBridgeDomainFlags defines enum 'gbp_bridge_domain_flags'.
67 type GbpBridgeDomainFlags uint32
68
69 const (
70         GBP_BD_API_FLAG_NONE         GbpBridgeDomainFlags = 0
71         GBP_BD_API_FLAG_DO_NOT_LEARN GbpBridgeDomainFlags = 1
72         GBP_BD_API_FLAG_UU_FWD_DROP  GbpBridgeDomainFlags = 2
73         GBP_BD_API_FLAG_MCAST_DROP   GbpBridgeDomainFlags = 4
74         GBP_BD_API_FLAG_UCAST_ARP    GbpBridgeDomainFlags = 8
75 )
76
77 var (
78         GbpBridgeDomainFlags_name = map[uint32]string{
79                 0: "GBP_BD_API_FLAG_NONE",
80                 1: "GBP_BD_API_FLAG_DO_NOT_LEARN",
81                 2: "GBP_BD_API_FLAG_UU_FWD_DROP",
82                 4: "GBP_BD_API_FLAG_MCAST_DROP",
83                 8: "GBP_BD_API_FLAG_UCAST_ARP",
84         }
85         GbpBridgeDomainFlags_value = map[string]uint32{
86                 "GBP_BD_API_FLAG_NONE":         0,
87                 "GBP_BD_API_FLAG_DO_NOT_LEARN": 1,
88                 "GBP_BD_API_FLAG_UU_FWD_DROP":  2,
89                 "GBP_BD_API_FLAG_MCAST_DROP":   4,
90                 "GBP_BD_API_FLAG_UCAST_ARP":    8,
91         }
92 )
93
94 func (x GbpBridgeDomainFlags) String() string {
95         s, ok := GbpBridgeDomainFlags_name[uint32(x)]
96         if ok {
97                 return s
98         }
99         str := func(n uint32) string {
100                 s, ok := GbpBridgeDomainFlags_name[uint32(n)]
101                 if ok {
102                         return s
103                 }
104                 return "GbpBridgeDomainFlags(" + strconv.Itoa(int(n)) + ")"
105         }
106         for i := uint32(0); i <= 32; i++ {
107                 val := uint32(x)
108                 if val&(1<<i) != 0 {
109                         if s != "" {
110                                 s += "|"
111                         }
112                         s += str(1 << i)
113                 }
114         }
115         if s == "" {
116                 return str(uint32(x))
117         }
118         return s
119 }
120
121 // GbpEndpointFlags defines enum 'gbp_endpoint_flags'.
122 type GbpEndpointFlags uint32
123
124 const (
125         GBP_API_ENDPOINT_FLAG_NONE     GbpEndpointFlags = 0
126         GBP_API_ENDPOINT_FLAG_BOUNCE   GbpEndpointFlags = 1
127         GBP_API_ENDPOINT_FLAG_REMOTE   GbpEndpointFlags = 2
128         GBP_API_ENDPOINT_FLAG_LEARNT   GbpEndpointFlags = 4
129         GBP_API_ENDPOINT_FLAG_EXTERNAL GbpEndpointFlags = 8
130 )
131
132 var (
133         GbpEndpointFlags_name = map[uint32]string{
134                 0: "GBP_API_ENDPOINT_FLAG_NONE",
135                 1: "GBP_API_ENDPOINT_FLAG_BOUNCE",
136                 2: "GBP_API_ENDPOINT_FLAG_REMOTE",
137                 4: "GBP_API_ENDPOINT_FLAG_LEARNT",
138                 8: "GBP_API_ENDPOINT_FLAG_EXTERNAL",
139         }
140         GbpEndpointFlags_value = map[string]uint32{
141                 "GBP_API_ENDPOINT_FLAG_NONE":     0,
142                 "GBP_API_ENDPOINT_FLAG_BOUNCE":   1,
143                 "GBP_API_ENDPOINT_FLAG_REMOTE":   2,
144                 "GBP_API_ENDPOINT_FLAG_LEARNT":   4,
145                 "GBP_API_ENDPOINT_FLAG_EXTERNAL": 8,
146         }
147 )
148
149 func (x GbpEndpointFlags) String() string {
150         s, ok := GbpEndpointFlags_name[uint32(x)]
151         if ok {
152                 return s
153         }
154         str := func(n uint32) string {
155                 s, ok := GbpEndpointFlags_name[uint32(n)]
156                 if ok {
157                         return s
158                 }
159                 return "GbpEndpointFlags(" + strconv.Itoa(int(n)) + ")"
160         }
161         for i := uint32(0); i <= 32; i++ {
162                 val := uint32(x)
163                 if val&(1<<i) != 0 {
164                         if s != "" {
165                                 s += "|"
166                         }
167                         s += str(1 << i)
168                 }
169         }
170         if s == "" {
171                 return str(uint32(x))
172         }
173         return s
174 }
175
176 // GbpExtItfFlags defines enum 'gbp_ext_itf_flags'.
177 type GbpExtItfFlags uint32
178
179 const (
180         GBP_API_EXT_ITF_F_NONE GbpExtItfFlags = 0
181         GBP_API_EXT_ITF_F_ANON GbpExtItfFlags = 1
182 )
183
184 var (
185         GbpExtItfFlags_name = map[uint32]string{
186                 0: "GBP_API_EXT_ITF_F_NONE",
187                 1: "GBP_API_EXT_ITF_F_ANON",
188         }
189         GbpExtItfFlags_value = map[string]uint32{
190                 "GBP_API_EXT_ITF_F_NONE": 0,
191                 "GBP_API_EXT_ITF_F_ANON": 1,
192         }
193 )
194
195 func (x GbpExtItfFlags) String() string {
196         s, ok := GbpExtItfFlags_name[uint32(x)]
197         if ok {
198                 return s
199         }
200         str := func(n uint32) string {
201                 s, ok := GbpExtItfFlags_name[uint32(n)]
202                 if ok {
203                         return s
204                 }
205                 return "GbpExtItfFlags(" + strconv.Itoa(int(n)) + ")"
206         }
207         for i := uint32(0); i <= 32; i++ {
208                 val := uint32(x)
209                 if val&(1<<i) != 0 {
210                         if s != "" {
211                                 s += "|"
212                         }
213                         s += str(1 << i)
214                 }
215         }
216         if s == "" {
217                 return str(uint32(x))
218         }
219         return s
220 }
221
222 // GbpHashMode defines enum 'gbp_hash_mode'.
223 type GbpHashMode uint32
224
225 const (
226         GBP_API_HASH_MODE_SRC_IP    GbpHashMode = 1
227         GBP_API_HASH_MODE_DST_IP    GbpHashMode = 2
228         GBP_API_HASH_MODE_SYMMETRIC GbpHashMode = 3
229 )
230
231 var (
232         GbpHashMode_name = map[uint32]string{
233                 1: "GBP_API_HASH_MODE_SRC_IP",
234                 2: "GBP_API_HASH_MODE_DST_IP",
235                 3: "GBP_API_HASH_MODE_SYMMETRIC",
236         }
237         GbpHashMode_value = map[string]uint32{
238                 "GBP_API_HASH_MODE_SRC_IP":    1,
239                 "GBP_API_HASH_MODE_DST_IP":    2,
240                 "GBP_API_HASH_MODE_SYMMETRIC": 3,
241         }
242 )
243
244 func (x GbpHashMode) String() string {
245         s, ok := GbpHashMode_name[uint32(x)]
246         if ok {
247                 return s
248         }
249         return "GbpHashMode(" + strconv.Itoa(int(x)) + ")"
250 }
251
252 // GbpRuleAction defines enum 'gbp_rule_action'.
253 type GbpRuleAction uint32
254
255 const (
256         GBP_API_RULE_PERMIT   GbpRuleAction = 1
257         GBP_API_RULE_DENY     GbpRuleAction = 2
258         GBP_API_RULE_REDIRECT GbpRuleAction = 3
259 )
260
261 var (
262         GbpRuleAction_name = map[uint32]string{
263                 1: "GBP_API_RULE_PERMIT",
264                 2: "GBP_API_RULE_DENY",
265                 3: "GBP_API_RULE_REDIRECT",
266         }
267         GbpRuleAction_value = map[string]uint32{
268                 "GBP_API_RULE_PERMIT":   1,
269                 "GBP_API_RULE_DENY":     2,
270                 "GBP_API_RULE_REDIRECT": 3,
271         }
272 )
273
274 func (x GbpRuleAction) String() string {
275         s, ok := GbpRuleAction_name[uint32(x)]
276         if ok {
277                 return s
278         }
279         return "GbpRuleAction(" + strconv.Itoa(int(x)) + ")"
280 }
281
282 // GbpSubnetType defines enum 'gbp_subnet_type'.
283 type GbpSubnetType uint32
284
285 const (
286         GBP_API_SUBNET_TRANSPORT         GbpSubnetType = 1
287         GBP_API_SUBNET_STITCHED_INTERNAL GbpSubnetType = 2
288         GBP_API_SUBNET_STITCHED_EXTERNAL GbpSubnetType = 3
289         GBP_API_SUBNET_L3_OUT            GbpSubnetType = 4
290         GBP_API_SUBNET_ANON_L3_OUT       GbpSubnetType = 5
291 )
292
293 var (
294         GbpSubnetType_name = map[uint32]string{
295                 1: "GBP_API_SUBNET_TRANSPORT",
296                 2: "GBP_API_SUBNET_STITCHED_INTERNAL",
297                 3: "GBP_API_SUBNET_STITCHED_EXTERNAL",
298                 4: "GBP_API_SUBNET_L3_OUT",
299                 5: "GBP_API_SUBNET_ANON_L3_OUT",
300         }
301         GbpSubnetType_value = map[string]uint32{
302                 "GBP_API_SUBNET_TRANSPORT":         1,
303                 "GBP_API_SUBNET_STITCHED_INTERNAL": 2,
304                 "GBP_API_SUBNET_STITCHED_EXTERNAL": 3,
305                 "GBP_API_SUBNET_L3_OUT":            4,
306                 "GBP_API_SUBNET_ANON_L3_OUT":       5,
307         }
308 )
309
310 func (x GbpSubnetType) String() string {
311         s, ok := GbpSubnetType_name[uint32(x)]
312         if ok {
313                 return s
314         }
315         return "GbpSubnetType(" + strconv.Itoa(int(x)) + ")"
316 }
317
318 // GbpVxlanTunnelMode defines enum 'gbp_vxlan_tunnel_mode'.
319 type GbpVxlanTunnelMode uint32
320
321 const (
322         GBP_VXLAN_TUNNEL_MODE_L2 GbpVxlanTunnelMode = 1
323         GBP_VXLAN_TUNNEL_MODE_L3 GbpVxlanTunnelMode = 2
324 )
325
326 var (
327         GbpVxlanTunnelMode_name = map[uint32]string{
328                 1: "GBP_VXLAN_TUNNEL_MODE_L2",
329                 2: "GBP_VXLAN_TUNNEL_MODE_L3",
330         }
331         GbpVxlanTunnelMode_value = map[string]uint32{
332                 "GBP_VXLAN_TUNNEL_MODE_L2": 1,
333                 "GBP_VXLAN_TUNNEL_MODE_L3": 2,
334         }
335 )
336
337 func (x GbpVxlanTunnelMode) String() string {
338         s, ok := GbpVxlanTunnelMode_name[uint32(x)]
339         if ok {
340                 return s
341         }
342         return "GbpVxlanTunnelMode(" + strconv.Itoa(int(x)) + ")"
343 }
344
345 // IfStatusFlags defines enum 'if_status_flags'.
346 type IfStatusFlags uint32
347
348 const (
349         IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
350         IF_STATUS_API_FLAG_LINK_UP  IfStatusFlags = 2
351 )
352
353 var (
354         IfStatusFlags_name = map[uint32]string{
355                 1: "IF_STATUS_API_FLAG_ADMIN_UP",
356                 2: "IF_STATUS_API_FLAG_LINK_UP",
357         }
358         IfStatusFlags_value = map[string]uint32{
359                 "IF_STATUS_API_FLAG_ADMIN_UP": 1,
360                 "IF_STATUS_API_FLAG_LINK_UP":  2,
361         }
362 )
363
364 func (x IfStatusFlags) String() string {
365         s, ok := IfStatusFlags_name[uint32(x)]
366         if ok {
367                 return s
368         }
369         str := func(n uint32) string {
370                 s, ok := IfStatusFlags_name[uint32(n)]
371                 if ok {
372                         return s
373                 }
374                 return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
375         }
376         for i := uint32(0); i <= 32; i++ {
377                 val := uint32(x)
378                 if val&(1<<i) != 0 {
379                         if s != "" {
380                                 s += "|"
381                         }
382                         s += str(1 << i)
383                 }
384         }
385         if s == "" {
386                 return str(uint32(x))
387         }
388         return s
389 }
390
391 // IfType defines enum 'if_type'.
392 type IfType uint32
393
394 const (
395         IF_API_TYPE_HARDWARE IfType = 1
396         IF_API_TYPE_SUB      IfType = 2
397         IF_API_TYPE_P2P      IfType = 3
398         IF_API_TYPE_PIPE     IfType = 4
399 )
400
401 var (
402         IfType_name = map[uint32]string{
403                 1: "IF_API_TYPE_HARDWARE",
404                 2: "IF_API_TYPE_SUB",
405                 3: "IF_API_TYPE_P2P",
406                 4: "IF_API_TYPE_PIPE",
407         }
408         IfType_value = map[string]uint32{
409                 "IF_API_TYPE_HARDWARE": 1,
410                 "IF_API_TYPE_SUB":      2,
411                 "IF_API_TYPE_P2P":      3,
412                 "IF_API_TYPE_PIPE":     4,
413         }
414 )
415
416 func (x IfType) String() string {
417         s, ok := IfType_name[uint32(x)]
418         if ok {
419                 return s
420         }
421         return "IfType(" + strconv.Itoa(int(x)) + ")"
422 }
423
424 // IPDscp defines enum 'ip_dscp'.
425 type IPDscp uint8
426
427 const (
428         IP_API_DSCP_CS0  IPDscp = 0
429         IP_API_DSCP_CS1  IPDscp = 8
430         IP_API_DSCP_AF11 IPDscp = 10
431         IP_API_DSCP_AF12 IPDscp = 12
432         IP_API_DSCP_AF13 IPDscp = 14
433         IP_API_DSCP_CS2  IPDscp = 16
434         IP_API_DSCP_AF21 IPDscp = 18
435         IP_API_DSCP_AF22 IPDscp = 20
436         IP_API_DSCP_AF23 IPDscp = 22
437         IP_API_DSCP_CS3  IPDscp = 24
438         IP_API_DSCP_AF31 IPDscp = 26
439         IP_API_DSCP_AF32 IPDscp = 28
440         IP_API_DSCP_AF33 IPDscp = 30
441         IP_API_DSCP_CS4  IPDscp = 32
442         IP_API_DSCP_AF41 IPDscp = 34
443         IP_API_DSCP_AF42 IPDscp = 36
444         IP_API_DSCP_AF43 IPDscp = 38
445         IP_API_DSCP_CS5  IPDscp = 40
446         IP_API_DSCP_EF   IPDscp = 46
447         IP_API_DSCP_CS6  IPDscp = 48
448         IP_API_DSCP_CS7  IPDscp = 50
449 )
450
451 var (
452         IPDscp_name = map[uint8]string{
453                 0:  "IP_API_DSCP_CS0",
454                 8:  "IP_API_DSCP_CS1",
455                 10: "IP_API_DSCP_AF11",
456                 12: "IP_API_DSCP_AF12",
457                 14: "IP_API_DSCP_AF13",
458                 16: "IP_API_DSCP_CS2",
459                 18: "IP_API_DSCP_AF21",
460                 20: "IP_API_DSCP_AF22",
461                 22: "IP_API_DSCP_AF23",
462                 24: "IP_API_DSCP_CS3",
463                 26: "IP_API_DSCP_AF31",
464                 28: "IP_API_DSCP_AF32",
465                 30: "IP_API_DSCP_AF33",
466                 32: "IP_API_DSCP_CS4",
467                 34: "IP_API_DSCP_AF41",
468                 36: "IP_API_DSCP_AF42",
469                 38: "IP_API_DSCP_AF43",
470                 40: "IP_API_DSCP_CS5",
471                 46: "IP_API_DSCP_EF",
472                 48: "IP_API_DSCP_CS6",
473                 50: "IP_API_DSCP_CS7",
474         }
475         IPDscp_value = map[string]uint8{
476                 "IP_API_DSCP_CS0":  0,
477                 "IP_API_DSCP_CS1":  8,
478                 "IP_API_DSCP_AF11": 10,
479                 "IP_API_DSCP_AF12": 12,
480                 "IP_API_DSCP_AF13": 14,
481                 "IP_API_DSCP_CS2":  16,
482                 "IP_API_DSCP_AF21": 18,
483                 "IP_API_DSCP_AF22": 20,
484                 "IP_API_DSCP_AF23": 22,
485                 "IP_API_DSCP_CS3":  24,
486                 "IP_API_DSCP_AF31": 26,
487                 "IP_API_DSCP_AF32": 28,
488                 "IP_API_DSCP_AF33": 30,
489                 "IP_API_DSCP_CS4":  32,
490                 "IP_API_DSCP_AF41": 34,
491                 "IP_API_DSCP_AF42": 36,
492                 "IP_API_DSCP_AF43": 38,
493                 "IP_API_DSCP_CS5":  40,
494                 "IP_API_DSCP_EF":   46,
495                 "IP_API_DSCP_CS6":  48,
496                 "IP_API_DSCP_CS7":  50,
497         }
498 )
499
500 func (x IPDscp) String() string {
501         s, ok := IPDscp_name[uint8(x)]
502         if ok {
503                 return s
504         }
505         return "IPDscp(" + strconv.Itoa(int(x)) + ")"
506 }
507
508 // IPEcn defines enum 'ip_ecn'.
509 type IPEcn uint8
510
511 const (
512         IP_API_ECN_NONE IPEcn = 0
513         IP_API_ECN_ECT0 IPEcn = 1
514         IP_API_ECN_ECT1 IPEcn = 2
515         IP_API_ECN_CE   IPEcn = 3
516 )
517
518 var (
519         IPEcn_name = map[uint8]string{
520                 0: "IP_API_ECN_NONE",
521                 1: "IP_API_ECN_ECT0",
522                 2: "IP_API_ECN_ECT1",
523                 3: "IP_API_ECN_CE",
524         }
525         IPEcn_value = map[string]uint8{
526                 "IP_API_ECN_NONE": 0,
527                 "IP_API_ECN_ECT0": 1,
528                 "IP_API_ECN_ECT1": 2,
529                 "IP_API_ECN_CE":   3,
530         }
531 )
532
533 func (x IPEcn) String() string {
534         s, ok := IPEcn_name[uint8(x)]
535         if ok {
536                 return s
537         }
538         return "IPEcn(" + strconv.Itoa(int(x)) + ")"
539 }
540
541 // IPProto defines enum 'ip_proto'.
542 type IPProto uint32
543
544 const (
545         IP_API_PROTO_HOPOPT   IPProto = 0
546         IP_API_PROTO_ICMP     IPProto = 1
547         IP_API_PROTO_IGMP     IPProto = 2
548         IP_API_PROTO_TCP      IPProto = 6
549         IP_API_PROTO_UDP      IPProto = 17
550         IP_API_PROTO_GRE      IPProto = 47
551         IP_API_PROTO_AH       IPProto = 50
552         IP_API_PROTO_ESP      IPProto = 51
553         IP_API_PROTO_EIGRP    IPProto = 88
554         IP_API_PROTO_OSPF     IPProto = 89
555         IP_API_PROTO_SCTP     IPProto = 132
556         IP_API_PROTO_RESERVED IPProto = 255
557 )
558
559 var (
560         IPProto_name = map[uint32]string{
561                 0:   "IP_API_PROTO_HOPOPT",
562                 1:   "IP_API_PROTO_ICMP",
563                 2:   "IP_API_PROTO_IGMP",
564                 6:   "IP_API_PROTO_TCP",
565                 17:  "IP_API_PROTO_UDP",
566                 47:  "IP_API_PROTO_GRE",
567                 50:  "IP_API_PROTO_AH",
568                 51:  "IP_API_PROTO_ESP",
569                 88:  "IP_API_PROTO_EIGRP",
570                 89:  "IP_API_PROTO_OSPF",
571                 132: "IP_API_PROTO_SCTP",
572                 255: "IP_API_PROTO_RESERVED",
573         }
574         IPProto_value = map[string]uint32{
575                 "IP_API_PROTO_HOPOPT":   0,
576                 "IP_API_PROTO_ICMP":     1,
577                 "IP_API_PROTO_IGMP":     2,
578                 "IP_API_PROTO_TCP":      6,
579                 "IP_API_PROTO_UDP":      17,
580                 "IP_API_PROTO_GRE":      47,
581                 "IP_API_PROTO_AH":       50,
582                 "IP_API_PROTO_ESP":      51,
583                 "IP_API_PROTO_EIGRP":    88,
584                 "IP_API_PROTO_OSPF":     89,
585                 "IP_API_PROTO_SCTP":     132,
586                 "IP_API_PROTO_RESERVED": 255,
587         }
588 )
589
590 func (x IPProto) String() string {
591         s, ok := IPProto_name[uint32(x)]
592         if ok {
593                 return s
594         }
595         return "IPProto(" + strconv.Itoa(int(x)) + ")"
596 }
597
598 // LinkDuplex defines enum 'link_duplex'.
599 type LinkDuplex uint32
600
601 const (
602         LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
603         LINK_DUPLEX_API_HALF    LinkDuplex = 1
604         LINK_DUPLEX_API_FULL    LinkDuplex = 2
605 )
606
607 var (
608         LinkDuplex_name = map[uint32]string{
609                 0: "LINK_DUPLEX_API_UNKNOWN",
610                 1: "LINK_DUPLEX_API_HALF",
611                 2: "LINK_DUPLEX_API_FULL",
612         }
613         LinkDuplex_value = map[string]uint32{
614                 "LINK_DUPLEX_API_UNKNOWN": 0,
615                 "LINK_DUPLEX_API_HALF":    1,
616                 "LINK_DUPLEX_API_FULL":    2,
617         }
618 )
619
620 func (x LinkDuplex) String() string {
621         s, ok := LinkDuplex_name[uint32(x)]
622         if ok {
623                 return s
624         }
625         return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
626 }
627
628 // MtuProto defines enum 'mtu_proto'.
629 type MtuProto uint32
630
631 const (
632         MTU_PROTO_API_L3   MtuProto = 1
633         MTU_PROTO_API_IP4  MtuProto = 2
634         MTU_PROTO_API_IP6  MtuProto = 3
635         MTU_PROTO_API_MPLS MtuProto = 4
636         MTU_PROTO_API_N    MtuProto = 5
637 )
638
639 var (
640         MtuProto_name = map[uint32]string{
641                 1: "MTU_PROTO_API_L3",
642                 2: "MTU_PROTO_API_IP4",
643                 3: "MTU_PROTO_API_IP6",
644                 4: "MTU_PROTO_API_MPLS",
645                 5: "MTU_PROTO_API_N",
646         }
647         MtuProto_value = map[string]uint32{
648                 "MTU_PROTO_API_L3":   1,
649                 "MTU_PROTO_API_IP4":  2,
650                 "MTU_PROTO_API_IP6":  3,
651                 "MTU_PROTO_API_MPLS": 4,
652                 "MTU_PROTO_API_N":    5,
653         }
654 )
655
656 func (x MtuProto) String() string {
657         s, ok := MtuProto_name[uint32(x)]
658         if ok {
659                 return s
660         }
661         return "MtuProto(" + strconv.Itoa(int(x)) + ")"
662 }
663
664 // RxMode defines enum 'rx_mode'.
665 type RxMode uint32
666
667 const (
668         RX_MODE_API_UNKNOWN   RxMode = 0
669         RX_MODE_API_POLLING   RxMode = 1
670         RX_MODE_API_INTERRUPT RxMode = 2
671         RX_MODE_API_ADAPTIVE  RxMode = 3
672         RX_MODE_API_DEFAULT   RxMode = 4
673 )
674
675 var (
676         RxMode_name = map[uint32]string{
677                 0: "RX_MODE_API_UNKNOWN",
678                 1: "RX_MODE_API_POLLING",
679                 2: "RX_MODE_API_INTERRUPT",
680                 3: "RX_MODE_API_ADAPTIVE",
681                 4: "RX_MODE_API_DEFAULT",
682         }
683         RxMode_value = map[string]uint32{
684                 "RX_MODE_API_UNKNOWN":   0,
685                 "RX_MODE_API_POLLING":   1,
686                 "RX_MODE_API_INTERRUPT": 2,
687                 "RX_MODE_API_ADAPTIVE":  3,
688                 "RX_MODE_API_DEFAULT":   4,
689         }
690 )
691
692 func (x RxMode) String() string {
693         s, ok := RxMode_name[uint32(x)]
694         if ok {
695                 return s
696         }
697         return "RxMode(" + strconv.Itoa(int(x)) + ")"
698 }
699
700 // SubIfFlags defines enum 'sub_if_flags'.
701 type SubIfFlags uint32
702
703 const (
704         SUB_IF_API_FLAG_NO_TAGS           SubIfFlags = 1
705         SUB_IF_API_FLAG_ONE_TAG           SubIfFlags = 2
706         SUB_IF_API_FLAG_TWO_TAGS          SubIfFlags = 4
707         SUB_IF_API_FLAG_DOT1AD            SubIfFlags = 8
708         SUB_IF_API_FLAG_EXACT_MATCH       SubIfFlags = 16
709         SUB_IF_API_FLAG_DEFAULT           SubIfFlags = 32
710         SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
711         SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
712         SUB_IF_API_FLAG_MASK_VNET         SubIfFlags = 254
713         SUB_IF_API_FLAG_DOT1AH            SubIfFlags = 256
714 )
715
716 var (
717         SubIfFlags_name = map[uint32]string{
718                 1:   "SUB_IF_API_FLAG_NO_TAGS",
719                 2:   "SUB_IF_API_FLAG_ONE_TAG",
720                 4:   "SUB_IF_API_FLAG_TWO_TAGS",
721                 8:   "SUB_IF_API_FLAG_DOT1AD",
722                 16:  "SUB_IF_API_FLAG_EXACT_MATCH",
723                 32:  "SUB_IF_API_FLAG_DEFAULT",
724                 64:  "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
725                 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
726                 254: "SUB_IF_API_FLAG_MASK_VNET",
727                 256: "SUB_IF_API_FLAG_DOT1AH",
728         }
729         SubIfFlags_value = map[string]uint32{
730                 "SUB_IF_API_FLAG_NO_TAGS":           1,
731                 "SUB_IF_API_FLAG_ONE_TAG":           2,
732                 "SUB_IF_API_FLAG_TWO_TAGS":          4,
733                 "SUB_IF_API_FLAG_DOT1AD":            8,
734                 "SUB_IF_API_FLAG_EXACT_MATCH":       16,
735                 "SUB_IF_API_FLAG_DEFAULT":           32,
736                 "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY": 64,
737                 "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY": 128,
738                 "SUB_IF_API_FLAG_MASK_VNET":         254,
739                 "SUB_IF_API_FLAG_DOT1AH":            256,
740         }
741 )
742
743 func (x SubIfFlags) String() string {
744         s, ok := SubIfFlags_name[uint32(x)]
745         if ok {
746                 return s
747         }
748         str := func(n uint32) string {
749                 s, ok := SubIfFlags_name[uint32(n)]
750                 if ok {
751                         return s
752                 }
753                 return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
754         }
755         for i := uint32(0); i <= 32; i++ {
756                 val := uint32(x)
757                 if val&(1<<i) != 0 {
758                         if s != "" {
759                                 s += "|"
760                         }
761                         s += str(1 << i)
762                 }
763         }
764         if s == "" {
765                 return str(uint32(x))
766         }
767         return s
768 }
769
770 // AddressWithPrefix defines alias 'address_with_prefix'.
771 type AddressWithPrefix Prefix
772
773 func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
774         prefix, err := ParsePrefix(s)
775         if err != nil {
776                 return AddressWithPrefix{}, err
777         }
778         return AddressWithPrefix(prefix), nil
779 }
780 func (x AddressWithPrefix) String() string {
781         return Prefix(x).String()
782 }
783 func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
784         return []byte(x.String()), nil
785 }
786 func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
787         prefix, err := ParseAddressWithPrefix(string(text))
788         if err != nil {
789                 return err
790         }
791         *x = prefix
792         return nil
793 }
794
795 // GbpScope defines alias 'gbp_scope'.
796 type GbpScope uint16
797
798 // InterfaceIndex defines alias 'interface_index'.
799 type InterfaceIndex uint32
800
801 // IP4Address defines alias 'ip4_address'.
802 type IP4Address [4]uint8
803
804 func ParseIP4Address(s string) (IP4Address, error) {
805         ip := net.ParseIP(s).To4()
806         if ip == nil {
807                 return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
808         }
809         var ipaddr IP4Address
810         copy(ipaddr[:], ip.To4())
811         return ipaddr, nil
812 }
813
814 func (x IP4Address) ToIP() net.IP {
815         return net.IP(x[:]).To4()
816 }
817 func (x IP4Address) String() string {
818         return x.ToIP().String()
819 }
820 func (x *IP4Address) MarshalText() ([]byte, error) {
821         return []byte(x.String()), nil
822 }
823 func (x *IP4Address) UnmarshalText(text []byte) error {
824         ipaddr, err := ParseIP4Address(string(text))
825         if err != nil {
826                 return err
827         }
828         *x = ipaddr
829         return nil
830 }
831
832 // IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
833 type IP4AddressWithPrefix IP4Prefix
834
835 // IP6Address defines alias 'ip6_address'.
836 type IP6Address [16]uint8
837
838 func ParseIP6Address(s string) (IP6Address, error) {
839         ip := net.ParseIP(s).To16()
840         if ip == nil {
841                 return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
842         }
843         var ipaddr IP6Address
844         copy(ipaddr[:], ip.To16())
845         return ipaddr, nil
846 }
847
848 func (x IP6Address) ToIP() net.IP {
849         return net.IP(x[:]).To16()
850 }
851 func (x IP6Address) String() string {
852         return x.ToIP().String()
853 }
854 func (x *IP6Address) MarshalText() ([]byte, error) {
855         return []byte(x.String()), nil
856 }
857 func (x *IP6Address) UnmarshalText(text []byte) error {
858         ipaddr, err := ParseIP6Address(string(text))
859         if err != nil {
860                 return err
861         }
862         *x = ipaddr
863         return nil
864 }
865
866 // IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
867 type IP6AddressWithPrefix IP6Prefix
868
869 // MacAddress defines alias 'mac_address'.
870 type MacAddress [6]uint8
871
872 func ParseMacAddress(s string) (MacAddress, error) {
873         var macaddr MacAddress
874         mac, err := net.ParseMAC(s)
875         if err != nil {
876                 return macaddr, err
877         }
878         copy(macaddr[:], mac[:])
879         return macaddr, nil
880 }
881 func (x MacAddress) ToMAC() net.HardwareAddr {
882         return net.HardwareAddr(x[:])
883 }
884 func (x MacAddress) String() string {
885         return x.ToMAC().String()
886 }
887 func (x *MacAddress) MarshalText() ([]byte, error) {
888         return []byte(x.String()), nil
889 }
890 func (x *MacAddress) UnmarshalText(text []byte) error {
891         mac, err := ParseMacAddress(string(text))
892         if err != nil {
893                 return err
894         }
895         *x = mac
896         return nil
897 }
898
899 // Address defines type 'address'.
900 type Address struct {
901         Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
902         Un AddressUnion  `binapi:"address_union,name=un" json:"un,omitempty"`
903 }
904
905 func ParseAddress(s string) (Address, error) {
906         ip := net.ParseIP(s)
907         if ip == nil {
908                 return Address{}, fmt.Errorf("invalid address: %s", s)
909         }
910         var addr Address
911         if ip.To4() == nil {
912                 addr.Af = ADDRESS_IP6
913                 var ip6 IP6Address
914                 copy(ip6[:], ip.To16())
915                 addr.Un.SetIP6(ip6)
916         } else {
917                 addr.Af = ADDRESS_IP4
918                 var ip4 IP4Address
919                 copy(ip4[:], ip.To4())
920                 addr.Un.SetIP4(ip4)
921         }
922         return addr, nil
923 }
924 func (x Address) ToIP() net.IP {
925         if x.Af == ADDRESS_IP6 {
926                 ip6 := x.Un.GetIP6()
927                 return net.IP(ip6[:]).To16()
928         } else {
929                 ip4 := x.Un.GetIP4()
930                 return net.IP(ip4[:]).To4()
931         }
932 }
933 func (x Address) String() string {
934         return x.ToIP().String()
935 }
936 func (x *Address) MarshalText() ([]byte, error) {
937         return []byte(x.String()), nil
938 }
939 func (x *Address) UnmarshalText(text []byte) error {
940         addr, err := ParseAddress(string(text))
941         if err != nil {
942                 return err
943         }
944         *x = addr
945         return nil
946 }
947
948 // GbpBridgeDomain defines type 'gbp_bridge_domain'.
949 type GbpBridgeDomain struct {
950         BdID             uint32               `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
951         RdID             uint32               `binapi:"u32,name=rd_id" json:"rd_id,omitempty"`
952         Flags            GbpBridgeDomainFlags `binapi:"gbp_bridge_domain_flags,name=flags" json:"flags,omitempty"`
953         BviSwIfIndex     InterfaceIndex       `binapi:"interface_index,name=bvi_sw_if_index" json:"bvi_sw_if_index,omitempty"`
954         UuFwdSwIfIndex   InterfaceIndex       `binapi:"interface_index,name=uu_fwd_sw_if_index" json:"uu_fwd_sw_if_index,omitempty"`
955         BmFloodSwIfIndex InterfaceIndex       `binapi:"interface_index,name=bm_flood_sw_if_index" json:"bm_flood_sw_if_index,omitempty"`
956 }
957
958 // GbpContract defines type 'gbp_contract'.
959 type GbpContract struct {
960         Scope             GbpScope  `binapi:"gbp_scope,name=scope" json:"scope,omitempty"`
961         Sclass            uint16    `binapi:"u16,name=sclass" json:"sclass,omitempty"`
962         Dclass            uint16    `binapi:"u16,name=dclass" json:"dclass,omitempty"`
963         ACLIndex          uint32    `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
964         NEtherTypes       uint8     `binapi:"u8,name=n_ether_types" json:"n_ether_types,omitempty"`
965         AllowedEthertypes []uint16  `binapi:"u16[16],name=allowed_ethertypes" json:"allowed_ethertypes,omitempty"`
966         NRules            uint8     `binapi:"u8,name=n_rules" json:"-"`
967         Rules             []GbpRule `binapi:"gbp_rule[n_rules],name=rules" json:"rules,omitempty"`
968 }
969
970 // GbpEndpoint defines type 'gbp_endpoint'.
971 type GbpEndpoint struct {
972         SwIfIndex InterfaceIndex   `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
973         Sclass    uint16           `binapi:"u16,name=sclass" json:"sclass,omitempty"`
974         Flags     GbpEndpointFlags `binapi:"gbp_endpoint_flags,name=flags" json:"flags,omitempty"`
975         Mac       MacAddress       `binapi:"mac_address,name=mac" json:"mac,omitempty"`
976         Tun       GbpEndpointTun   `binapi:"gbp_endpoint_tun,name=tun" json:"tun,omitempty"`
977         NIps      uint8            `binapi:"u8,name=n_ips" json:"-"`
978         Ips       []Address        `binapi:"address[n_ips],name=ips" json:"ips,omitempty"`
979 }
980
981 // GbpEndpointGroup defines type 'gbp_endpoint_group'.
982 type GbpEndpointGroup struct {
983         Vnid            uint32               `binapi:"u32,name=vnid" json:"vnid,omitempty"`
984         Sclass          uint16               `binapi:"u16,name=sclass" json:"sclass,omitempty"`
985         BdID            uint32               `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
986         RdID            uint32               `binapi:"u32,name=rd_id" json:"rd_id,omitempty"`
987         UplinkSwIfIndex InterfaceIndex       `binapi:"interface_index,name=uplink_sw_if_index" json:"uplink_sw_if_index,omitempty"`
988         Retention       GbpEndpointRetention `binapi:"gbp_endpoint_retention,name=retention" json:"retention,omitempty"`
989 }
990
991 // GbpEndpointRetention defines type 'gbp_endpoint_retention'.
992 type GbpEndpointRetention struct {
993         RemoteEpTimeout uint32 `binapi:"u32,name=remote_ep_timeout" json:"remote_ep_timeout,omitempty"`
994 }
995
996 // GbpEndpointTun defines type 'gbp_endpoint_tun'.
997 type GbpEndpointTun struct {
998         Src Address `binapi:"address,name=src" json:"src,omitempty"`
999         Dst Address `binapi:"address,name=dst" json:"dst,omitempty"`
1000 }
1001
1002 // GbpExtItf defines type 'gbp_ext_itf'.
1003 type GbpExtItf struct {
1004         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1005         BdID      uint32         `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
1006         RdID      uint32         `binapi:"u32,name=rd_id" json:"rd_id,omitempty"`
1007         Flags     GbpExtItfFlags `binapi:"gbp_ext_itf_flags,name=flags" json:"flags,omitempty"`
1008 }
1009
1010 // GbpNextHop defines type 'gbp_next_hop'.
1011 type GbpNextHop struct {
1012         IP   Address    `binapi:"address,name=ip" json:"ip,omitempty"`
1013         Mac  MacAddress `binapi:"mac_address,name=mac" json:"mac,omitempty"`
1014         BdID uint32     `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
1015         RdID uint32     `binapi:"u32,name=rd_id" json:"rd_id,omitempty"`
1016 }
1017
1018 // GbpNextHopSet defines type 'gbp_next_hop_set'.
1019 type GbpNextHopSet struct {
1020         HashMode GbpHashMode   `binapi:"gbp_hash_mode,name=hash_mode" json:"hash_mode,omitempty"`
1021         NNhs     uint8         `binapi:"u8,name=n_nhs" json:"n_nhs,omitempty"`
1022         Nhs      [8]GbpNextHop `binapi:"gbp_next_hop[8],name=nhs" json:"nhs,omitempty"`
1023 }
1024
1025 // GbpRecirc defines type 'gbp_recirc'.
1026 type GbpRecirc struct {
1027         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1028         Sclass    uint16         `binapi:"u16,name=sclass" json:"sclass,omitempty"`
1029         IsExt     bool           `binapi:"bool,name=is_ext" json:"is_ext,omitempty"`
1030 }
1031
1032 // GbpRouteDomain defines type 'gbp_route_domain'.
1033 type GbpRouteDomain struct {
1034         RdID           uint32         `binapi:"u32,name=rd_id" json:"rd_id,omitempty"`
1035         IP4TableID     uint32         `binapi:"u32,name=ip4_table_id" json:"ip4_table_id,omitempty"`
1036         IP6TableID     uint32         `binapi:"u32,name=ip6_table_id" json:"ip6_table_id,omitempty"`
1037         IP4UuSwIfIndex InterfaceIndex `binapi:"interface_index,name=ip4_uu_sw_if_index" json:"ip4_uu_sw_if_index,omitempty"`
1038         IP6UuSwIfIndex InterfaceIndex `binapi:"interface_index,name=ip6_uu_sw_if_index" json:"ip6_uu_sw_if_index,omitempty"`
1039         Scope          GbpScope       `binapi:"gbp_scope,name=scope" json:"scope,omitempty"`
1040 }
1041
1042 // GbpRule defines type 'gbp_rule'.
1043 type GbpRule struct {
1044         Action GbpRuleAction `binapi:"gbp_rule_action,name=action" json:"action,omitempty"`
1045         NhSet  GbpNextHopSet `binapi:"gbp_next_hop_set,name=nh_set" json:"nh_set,omitempty"`
1046 }
1047
1048 // GbpSubnet defines type 'gbp_subnet'.
1049 type GbpSubnet struct {
1050         RdID      uint32         `binapi:"u32,name=rd_id" json:"rd_id,omitempty"`
1051         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1052         Sclass    uint16         `binapi:"u16,name=sclass" json:"sclass,omitempty"`
1053         Type      GbpSubnetType  `binapi:"gbp_subnet_type,name=type" json:"type,omitempty"`
1054         Prefix    Prefix         `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
1055 }
1056
1057 // GbpVxlanTunnel defines type 'gbp_vxlan_tunnel'.
1058 type GbpVxlanTunnel struct {
1059         Vni    uint32             `binapi:"u32,name=vni" json:"vni,omitempty"`
1060         Mode   GbpVxlanTunnelMode `binapi:"gbp_vxlan_tunnel_mode,name=mode" json:"mode,omitempty"`
1061         BdRdID uint32             `binapi:"u32,name=bd_rd_id" json:"bd_rd_id,omitempty"`
1062         Src    IP4Address         `binapi:"ip4_address,name=src" json:"src,omitempty"`
1063 }
1064
1065 // IP4Prefix defines type 'ip4_prefix'.
1066 type IP4Prefix struct {
1067         Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
1068         Len     uint8      `binapi:"u8,name=len" json:"len,omitempty"`
1069 }
1070
1071 func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
1072         hasPrefix := strings.Contains(s, "/")
1073         if hasPrefix {
1074                 ip, network, err := net.ParseCIDR(s)
1075                 if err != nil {
1076                         return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
1077                 }
1078                 maskSize, _ := network.Mask.Size()
1079                 prefix.Len = byte(maskSize)
1080                 prefix.Address, err = ParseIP4Address(ip.String())
1081                 if err != nil {
1082                         return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
1083                 }
1084         } else {
1085                 ip := net.ParseIP(s)
1086                 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
1087                 if ip.To4() == nil {
1088                         defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
1089                 }
1090                 prefix.Len = byte(defaultMaskSize)
1091                 prefix.Address, err = ParseIP4Address(ip.String())
1092                 if err != nil {
1093                         return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
1094                 }
1095         }
1096         return prefix, nil
1097 }
1098 func (x IP4Prefix) ToIPNet() *net.IPNet {
1099         mask := net.CIDRMask(int(x.Len), 32)
1100         ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
1101         return ipnet
1102 }
1103 func (x IP4Prefix) String() string {
1104         ip := x.Address.String()
1105         return ip + "/" + strconv.Itoa(int(x.Len))
1106 }
1107 func (x *IP4Prefix) MarshalText() ([]byte, error) {
1108         return []byte(x.String()), nil
1109 }
1110 func (x *IP4Prefix) UnmarshalText(text []byte) error {
1111         prefix, err := ParseIP4Prefix(string(text))
1112         if err != nil {
1113                 return err
1114         }
1115         *x = prefix
1116         return nil
1117 }
1118
1119 // IP6Prefix defines type 'ip6_prefix'.
1120 type IP6Prefix struct {
1121         Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
1122         Len     uint8      `binapi:"u8,name=len" json:"len,omitempty"`
1123 }
1124
1125 func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
1126         hasPrefix := strings.Contains(s, "/")
1127         if hasPrefix {
1128                 ip, network, err := net.ParseCIDR(s)
1129                 if err != nil {
1130                         return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
1131                 }
1132                 maskSize, _ := network.Mask.Size()
1133                 prefix.Len = byte(maskSize)
1134                 prefix.Address, err = ParseIP6Address(ip.String())
1135                 if err != nil {
1136                         return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
1137                 }
1138         } else {
1139                 ip := net.ParseIP(s)
1140                 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
1141                 if ip.To4() == nil {
1142                         defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
1143                 }
1144                 prefix.Len = byte(defaultMaskSize)
1145                 prefix.Address, err = ParseIP6Address(ip.String())
1146                 if err != nil {
1147                         return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
1148                 }
1149         }
1150         return prefix, nil
1151 }
1152 func (x IP6Prefix) ToIPNet() *net.IPNet {
1153         mask := net.CIDRMask(int(x.Len), 128)
1154         ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
1155         return ipnet
1156 }
1157 func (x IP6Prefix) String() string {
1158         ip := x.Address.String()
1159         return ip + "/" + strconv.Itoa(int(x.Len))
1160 }
1161 func (x *IP6Prefix) MarshalText() ([]byte, error) {
1162         return []byte(x.String()), nil
1163 }
1164 func (x *IP6Prefix) UnmarshalText(text []byte) error {
1165         prefix, err := ParseIP6Prefix(string(text))
1166         if err != nil {
1167                 return err
1168         }
1169         *x = prefix
1170         return nil
1171 }
1172
1173 // Mprefix defines type 'mprefix'.
1174 type Mprefix struct {
1175         Af               AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
1176         GrpAddressLength uint16        `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
1177         GrpAddress       AddressUnion  `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
1178         SrcAddress       AddressUnion  `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
1179 }
1180
1181 // Prefix defines type 'prefix'.
1182 type Prefix struct {
1183         Address Address `binapi:"address,name=address" json:"address,omitempty"`
1184         Len     uint8   `binapi:"u8,name=len" json:"len,omitempty"`
1185 }
1186
1187 func ParsePrefix(ip string) (prefix Prefix, err error) {
1188         hasPrefix := strings.Contains(ip, "/")
1189         if hasPrefix {
1190                 netIP, network, err := net.ParseCIDR(ip)
1191                 if err != nil {
1192                         return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
1193                 }
1194                 maskSize, _ := network.Mask.Size()
1195                 prefix.Len = byte(maskSize)
1196                 prefix.Address, err = ParseAddress(netIP.String())
1197                 if err != nil {
1198                         return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
1199                 }
1200         } else {
1201                 netIP := net.ParseIP(ip)
1202                 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
1203                 if netIP.To4() == nil {
1204                         defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
1205                 }
1206                 prefix.Len = byte(defaultMaskSize)
1207                 prefix.Address, err = ParseAddress(netIP.String())
1208                 if err != nil {
1209                         return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
1210                 }
1211         }
1212         return prefix, nil
1213 }
1214 func (x Prefix) ToIPNet() *net.IPNet {
1215         var mask net.IPMask
1216         if x.Address.Af == ADDRESS_IP4 {
1217                 mask = net.CIDRMask(int(x.Len), 32)
1218         } else {
1219                 mask = net.CIDRMask(int(x.Len), 128)
1220         }
1221         ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
1222         return ipnet
1223 }
1224 func (x Prefix) String() string {
1225         ip := x.Address.String()
1226         return ip + "/" + strconv.Itoa(int(x.Len))
1227 }
1228 func (x *Prefix) MarshalText() ([]byte, error) {
1229         return []byte(x.String()), nil
1230 }
1231 func (x *Prefix) UnmarshalText(text []byte) error {
1232         prefix, err := ParsePrefix(string(text))
1233         if err != nil {
1234                 return err
1235         }
1236         *x = prefix
1237         return nil
1238 }
1239
1240 // PrefixMatcher defines type 'prefix_matcher'.
1241 type PrefixMatcher struct {
1242         Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
1243         Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
1244 }
1245
1246 // AddressUnion defines union 'address_union'.
1247 type AddressUnion struct {
1248         // IP4 *IP4Address
1249         // IP6 *IP6Address
1250         XXX_UnionData [16]byte
1251 }
1252
1253 func AddressUnionIP4(a IP4Address) (u AddressUnion) {
1254         u.SetIP4(a)
1255         return
1256 }
1257 func (u *AddressUnion) SetIP4(a IP4Address) {
1258         buf := codec.NewBuffer(u.XXX_UnionData[:])
1259         buf.EncodeBytes(a[:], 4)
1260 }
1261 func (u *AddressUnion) GetIP4() (a IP4Address) {
1262         buf := codec.NewBuffer(u.XXX_UnionData[:])
1263         copy(a[:], buf.DecodeBytes(4))
1264         return
1265 }
1266
1267 func AddressUnionIP6(a IP6Address) (u AddressUnion) {
1268         u.SetIP6(a)
1269         return
1270 }
1271 func (u *AddressUnion) SetIP6(a IP6Address) {
1272         buf := codec.NewBuffer(u.XXX_UnionData[:])
1273         buf.EncodeBytes(a[:], 16)
1274 }
1275 func (u *AddressUnion) GetIP6() (a IP6Address) {
1276         buf := codec.NewBuffer(u.XXX_UnionData[:])
1277         copy(a[:], buf.DecodeBytes(16))
1278         return
1279 }
1280
1281 // GbpBridgeDomainAdd defines message 'gbp_bridge_domain_add'.
1282 type GbpBridgeDomainAdd struct {
1283         Bd GbpBridgeDomain `binapi:"gbp_bridge_domain,name=bd" json:"bd,omitempty"`
1284 }
1285
1286 func (m *GbpBridgeDomainAdd) Reset()               { *m = GbpBridgeDomainAdd{} }
1287 func (*GbpBridgeDomainAdd) GetMessageName() string { return "gbp_bridge_domain_add" }
1288 func (*GbpBridgeDomainAdd) GetCrcString() string   { return "8454bfdf" }
1289 func (*GbpBridgeDomainAdd) GetMessageType() api.MessageType {
1290         return api.RequestMessage
1291 }
1292
1293 func (m *GbpBridgeDomainAdd) Size() (size int) {
1294         if m == nil {
1295                 return 0
1296         }
1297         size += 4 // m.Bd.BdID
1298         size += 4 // m.Bd.RdID
1299         size += 4 // m.Bd.Flags
1300         size += 4 // m.Bd.BviSwIfIndex
1301         size += 4 // m.Bd.UuFwdSwIfIndex
1302         size += 4 // m.Bd.BmFloodSwIfIndex
1303         return size
1304 }
1305 func (m *GbpBridgeDomainAdd) Marshal(b []byte) ([]byte, error) {
1306         if b == nil {
1307                 b = make([]byte, m.Size())
1308         }
1309         buf := codec.NewBuffer(b)
1310         buf.EncodeUint32(m.Bd.BdID)
1311         buf.EncodeUint32(m.Bd.RdID)
1312         buf.EncodeUint32(uint32(m.Bd.Flags))
1313         buf.EncodeUint32(uint32(m.Bd.BviSwIfIndex))
1314         buf.EncodeUint32(uint32(m.Bd.UuFwdSwIfIndex))
1315         buf.EncodeUint32(uint32(m.Bd.BmFloodSwIfIndex))
1316         return buf.Bytes(), nil
1317 }
1318 func (m *GbpBridgeDomainAdd) Unmarshal(b []byte) error {
1319         buf := codec.NewBuffer(b)
1320         m.Bd.BdID = buf.DecodeUint32()
1321         m.Bd.RdID = buf.DecodeUint32()
1322         m.Bd.Flags = GbpBridgeDomainFlags(buf.DecodeUint32())
1323         m.Bd.BviSwIfIndex = InterfaceIndex(buf.DecodeUint32())
1324         m.Bd.UuFwdSwIfIndex = InterfaceIndex(buf.DecodeUint32())
1325         m.Bd.BmFloodSwIfIndex = InterfaceIndex(buf.DecodeUint32())
1326         return nil
1327 }
1328
1329 // GbpBridgeDomainAddReply defines message 'gbp_bridge_domain_add_reply'.
1330 type GbpBridgeDomainAddReply struct {
1331         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1332 }
1333
1334 func (m *GbpBridgeDomainAddReply) Reset()               { *m = GbpBridgeDomainAddReply{} }
1335 func (*GbpBridgeDomainAddReply) GetMessageName() string { return "gbp_bridge_domain_add_reply" }
1336 func (*GbpBridgeDomainAddReply) GetCrcString() string   { return "e8d4e804" }
1337 func (*GbpBridgeDomainAddReply) GetMessageType() api.MessageType {
1338         return api.ReplyMessage
1339 }
1340
1341 func (m *GbpBridgeDomainAddReply) Size() (size int) {
1342         if m == nil {
1343                 return 0
1344         }
1345         size += 4 // m.Retval
1346         return size
1347 }
1348 func (m *GbpBridgeDomainAddReply) Marshal(b []byte) ([]byte, error) {
1349         if b == nil {
1350                 b = make([]byte, m.Size())
1351         }
1352         buf := codec.NewBuffer(b)
1353         buf.EncodeInt32(m.Retval)
1354         return buf.Bytes(), nil
1355 }
1356 func (m *GbpBridgeDomainAddReply) Unmarshal(b []byte) error {
1357         buf := codec.NewBuffer(b)
1358         m.Retval = buf.DecodeInt32()
1359         return nil
1360 }
1361
1362 // GbpBridgeDomainDel defines message 'gbp_bridge_domain_del'.
1363 type GbpBridgeDomainDel struct {
1364         BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
1365 }
1366
1367 func (m *GbpBridgeDomainDel) Reset()               { *m = GbpBridgeDomainDel{} }
1368 func (*GbpBridgeDomainDel) GetMessageName() string { return "gbp_bridge_domain_del" }
1369 func (*GbpBridgeDomainDel) GetCrcString() string   { return "c25fdce6" }
1370 func (*GbpBridgeDomainDel) GetMessageType() api.MessageType {
1371         return api.RequestMessage
1372 }
1373
1374 func (m *GbpBridgeDomainDel) Size() (size int) {
1375         if m == nil {
1376                 return 0
1377         }
1378         size += 4 // m.BdID
1379         return size
1380 }
1381 func (m *GbpBridgeDomainDel) Marshal(b []byte) ([]byte, error) {
1382         if b == nil {
1383                 b = make([]byte, m.Size())
1384         }
1385         buf := codec.NewBuffer(b)
1386         buf.EncodeUint32(m.BdID)
1387         return buf.Bytes(), nil
1388 }
1389 func (m *GbpBridgeDomainDel) Unmarshal(b []byte) error {
1390         buf := codec.NewBuffer(b)
1391         m.BdID = buf.DecodeUint32()
1392         return nil
1393 }
1394
1395 // GbpBridgeDomainDelReply defines message 'gbp_bridge_domain_del_reply'.
1396 type GbpBridgeDomainDelReply struct {
1397         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1398 }
1399
1400 func (m *GbpBridgeDomainDelReply) Reset()               { *m = GbpBridgeDomainDelReply{} }
1401 func (*GbpBridgeDomainDelReply) GetMessageName() string { return "gbp_bridge_domain_del_reply" }
1402 func (*GbpBridgeDomainDelReply) GetCrcString() string   { return "e8d4e804" }
1403 func (*GbpBridgeDomainDelReply) GetMessageType() api.MessageType {
1404         return api.ReplyMessage
1405 }
1406
1407 func (m *GbpBridgeDomainDelReply) Size() (size int) {
1408         if m == nil {
1409                 return 0
1410         }
1411         size += 4 // m.Retval
1412         return size
1413 }
1414 func (m *GbpBridgeDomainDelReply) Marshal(b []byte) ([]byte, error) {
1415         if b == nil {
1416                 b = make([]byte, m.Size())
1417         }
1418         buf := codec.NewBuffer(b)
1419         buf.EncodeInt32(m.Retval)
1420         return buf.Bytes(), nil
1421 }
1422 func (m *GbpBridgeDomainDelReply) Unmarshal(b []byte) error {
1423         buf := codec.NewBuffer(b)
1424         m.Retval = buf.DecodeInt32()
1425         return nil
1426 }
1427
1428 // GbpBridgeDomainDetails defines message 'gbp_bridge_domain_details'.
1429 type GbpBridgeDomainDetails struct {
1430         Bd GbpBridgeDomain `binapi:"gbp_bridge_domain,name=bd" json:"bd,omitempty"`
1431 }
1432
1433 func (m *GbpBridgeDomainDetails) Reset()               { *m = GbpBridgeDomainDetails{} }
1434 func (*GbpBridgeDomainDetails) GetMessageName() string { return "gbp_bridge_domain_details" }
1435 func (*GbpBridgeDomainDetails) GetCrcString() string   { return "2acd15f9" }
1436 func (*GbpBridgeDomainDetails) GetMessageType() api.MessageType {
1437         return api.ReplyMessage
1438 }
1439
1440 func (m *GbpBridgeDomainDetails) Size() (size int) {
1441         if m == nil {
1442                 return 0
1443         }
1444         size += 4 // m.Bd.BdID
1445         size += 4 // m.Bd.RdID
1446         size += 4 // m.Bd.Flags
1447         size += 4 // m.Bd.BviSwIfIndex
1448         size += 4 // m.Bd.UuFwdSwIfIndex
1449         size += 4 // m.Bd.BmFloodSwIfIndex
1450         return size
1451 }
1452 func (m *GbpBridgeDomainDetails) Marshal(b []byte) ([]byte, error) {
1453         if b == nil {
1454                 b = make([]byte, m.Size())
1455         }
1456         buf := codec.NewBuffer(b)
1457         buf.EncodeUint32(m.Bd.BdID)
1458         buf.EncodeUint32(m.Bd.RdID)
1459         buf.EncodeUint32(uint32(m.Bd.Flags))
1460         buf.EncodeUint32(uint32(m.Bd.BviSwIfIndex))
1461         buf.EncodeUint32(uint32(m.Bd.UuFwdSwIfIndex))
1462         buf.EncodeUint32(uint32(m.Bd.BmFloodSwIfIndex))
1463         return buf.Bytes(), nil
1464 }
1465 func (m *GbpBridgeDomainDetails) Unmarshal(b []byte) error {
1466         buf := codec.NewBuffer(b)
1467         m.Bd.BdID = buf.DecodeUint32()
1468         m.Bd.RdID = buf.DecodeUint32()
1469         m.Bd.Flags = GbpBridgeDomainFlags(buf.DecodeUint32())
1470         m.Bd.BviSwIfIndex = InterfaceIndex(buf.DecodeUint32())
1471         m.Bd.UuFwdSwIfIndex = InterfaceIndex(buf.DecodeUint32())
1472         m.Bd.BmFloodSwIfIndex = InterfaceIndex(buf.DecodeUint32())
1473         return nil
1474 }
1475
1476 // GbpBridgeDomainDump defines message 'gbp_bridge_domain_dump'.
1477 type GbpBridgeDomainDump struct{}
1478
1479 func (m *GbpBridgeDomainDump) Reset()               { *m = GbpBridgeDomainDump{} }
1480 func (*GbpBridgeDomainDump) GetMessageName() string { return "gbp_bridge_domain_dump" }
1481 func (*GbpBridgeDomainDump) GetCrcString() string   { return "51077d14" }
1482 func (*GbpBridgeDomainDump) GetMessageType() api.MessageType {
1483         return api.RequestMessage
1484 }
1485
1486 func (m *GbpBridgeDomainDump) Size() (size int) {
1487         if m == nil {
1488                 return 0
1489         }
1490         return size
1491 }
1492 func (m *GbpBridgeDomainDump) Marshal(b []byte) ([]byte, error) {
1493         if b == nil {
1494                 b = make([]byte, m.Size())
1495         }
1496         buf := codec.NewBuffer(b)
1497         return buf.Bytes(), nil
1498 }
1499 func (m *GbpBridgeDomainDump) Unmarshal(b []byte) error {
1500         return nil
1501 }
1502
1503 // GbpBridgeDomainDumpReply defines message 'gbp_bridge_domain_dump_reply'.
1504 type GbpBridgeDomainDumpReply struct {
1505         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1506 }
1507
1508 func (m *GbpBridgeDomainDumpReply) Reset()               { *m = GbpBridgeDomainDumpReply{} }
1509 func (*GbpBridgeDomainDumpReply) GetMessageName() string { return "gbp_bridge_domain_dump_reply" }
1510 func (*GbpBridgeDomainDumpReply) GetCrcString() string   { return "e8d4e804" }
1511 func (*GbpBridgeDomainDumpReply) GetMessageType() api.MessageType {
1512         return api.ReplyMessage
1513 }
1514
1515 func (m *GbpBridgeDomainDumpReply) Size() (size int) {
1516         if m == nil {
1517                 return 0
1518         }
1519         size += 4 // m.Retval
1520         return size
1521 }
1522 func (m *GbpBridgeDomainDumpReply) Marshal(b []byte) ([]byte, error) {
1523         if b == nil {
1524                 b = make([]byte, m.Size())
1525         }
1526         buf := codec.NewBuffer(b)
1527         buf.EncodeInt32(m.Retval)
1528         return buf.Bytes(), nil
1529 }
1530 func (m *GbpBridgeDomainDumpReply) Unmarshal(b []byte) error {
1531         buf := codec.NewBuffer(b)
1532         m.Retval = buf.DecodeInt32()
1533         return nil
1534 }
1535
1536 // GbpContractAddDel defines message 'gbp_contract_add_del'.
1537 type GbpContractAddDel struct {
1538         IsAdd    bool        `binapi:"bool,name=is_add" json:"is_add,omitempty"`
1539         Contract GbpContract `binapi:"gbp_contract,name=contract" json:"contract,omitempty"`
1540 }
1541
1542 func (m *GbpContractAddDel) Reset()               { *m = GbpContractAddDel{} }
1543 func (*GbpContractAddDel) GetMessageName() string { return "gbp_contract_add_del" }
1544 func (*GbpContractAddDel) GetCrcString() string   { return "553e275b" }
1545 func (*GbpContractAddDel) GetMessageType() api.MessageType {
1546         return api.RequestMessage
1547 }
1548
1549 func (m *GbpContractAddDel) Size() (size int) {
1550         if m == nil {
1551                 return 0
1552         }
1553         size += 1      // m.IsAdd
1554         size += 2      // m.Contract.Scope
1555         size += 2      // m.Contract.Sclass
1556         size += 2      // m.Contract.Dclass
1557         size += 4      // m.Contract.ACLIndex
1558         size += 1      // m.Contract.NEtherTypes
1559         size += 2 * 16 // m.Contract.AllowedEthertypes
1560         size += 1      // m.Contract.NRules
1561         for j2 := 0; j2 < len(m.Contract.Rules); j2++ {
1562                 var s2 GbpRule
1563                 _ = s2
1564                 if j2 < len(m.Contract.Rules) {
1565                         s2 = m.Contract.Rules[j2]
1566                 }
1567                 size += 4 // s2.Action
1568                 size += 4 // s2.NhSet.HashMode
1569                 size += 1 // s2.NhSet.NNhs
1570                 for j4 := 0; j4 < 8; j4++ {
1571                         size += 4      // s2.NhSet.Nhs[j4].IP.Af
1572                         size += 1 * 16 // s2.NhSet.Nhs[j4].IP.Un
1573                         size += 1 * 6  // s2.NhSet.Nhs[j4].Mac
1574                         size += 4      // s2.NhSet.Nhs[j4].BdID
1575                         size += 4      // s2.NhSet.Nhs[j4].RdID
1576                 }
1577         }
1578         return size
1579 }
1580 func (m *GbpContractAddDel) Marshal(b []byte) ([]byte, error) {
1581         if b == nil {
1582                 b = make([]byte, m.Size())
1583         }
1584         buf := codec.NewBuffer(b)
1585         buf.EncodeBool(m.IsAdd)
1586         buf.EncodeUint16(uint16(m.Contract.Scope))
1587         buf.EncodeUint16(m.Contract.Sclass)
1588         buf.EncodeUint16(m.Contract.Dclass)
1589         buf.EncodeUint32(m.Contract.ACLIndex)
1590         buf.EncodeUint8(m.Contract.NEtherTypes)
1591         for i := 0; i < 16; i++ {
1592                 var x uint16
1593                 if i < len(m.Contract.AllowedEthertypes) {
1594                         x = uint16(m.Contract.AllowedEthertypes[i])
1595                 }
1596                 buf.EncodeUint16(x)
1597         }
1598         buf.EncodeUint8(uint8(len(m.Contract.Rules)))
1599         for j1 := 0; j1 < len(m.Contract.Rules); j1++ {
1600                 var v1 GbpRule // Rules
1601                 if j1 < len(m.Contract.Rules) {
1602                         v1 = m.Contract.Rules[j1]
1603                 }
1604                 buf.EncodeUint32(uint32(v1.Action))
1605                 buf.EncodeUint32(uint32(v1.NhSet.HashMode))
1606                 buf.EncodeUint8(v1.NhSet.NNhs)
1607                 for j3 := 0; j3 < 8; j3++ {
1608                         buf.EncodeUint32(uint32(v1.NhSet.Nhs[j3].IP.Af))
1609                         buf.EncodeBytes(v1.NhSet.Nhs[j3].IP.Un.XXX_UnionData[:], 16)
1610                         buf.EncodeBytes(v1.NhSet.Nhs[j3].Mac[:], 6)
1611                         buf.EncodeUint32(v1.NhSet.Nhs[j3].BdID)
1612                         buf.EncodeUint32(v1.NhSet.Nhs[j3].RdID)
1613                 }
1614         }
1615         return buf.Bytes(), nil
1616 }
1617 func (m *GbpContractAddDel) Unmarshal(b []byte) error {
1618         buf := codec.NewBuffer(b)
1619         m.IsAdd = buf.DecodeBool()
1620         m.Contract.Scope = GbpScope(buf.DecodeUint16())
1621         m.Contract.Sclass = buf.DecodeUint16()
1622         m.Contract.Dclass = buf.DecodeUint16()
1623         m.Contract.ACLIndex = buf.DecodeUint32()
1624         m.Contract.NEtherTypes = buf.DecodeUint8()
1625         m.Contract.AllowedEthertypes = make([]uint16, 16)
1626         for i := 0; i < len(m.Contract.AllowedEthertypes); i++ {
1627                 m.Contract.AllowedEthertypes[i] = buf.DecodeUint16()
1628         }
1629         m.Contract.NRules = buf.DecodeUint8()
1630         m.Contract.Rules = make([]GbpRule, m.Contract.NRules)
1631         for j1 := 0; j1 < len(m.Contract.Rules); j1++ {
1632                 m.Contract.Rules[j1].Action = GbpRuleAction(buf.DecodeUint32())
1633                 m.Contract.Rules[j1].NhSet.HashMode = GbpHashMode(buf.DecodeUint32())
1634                 m.Contract.Rules[j1].NhSet.NNhs = buf.DecodeUint8()
1635                 for j3 := 0; j3 < 8; j3++ {
1636                         m.Contract.Rules[j1].NhSet.Nhs[j3].IP.Af = AddressFamily(buf.DecodeUint32())
1637                         copy(m.Contract.Rules[j1].NhSet.Nhs[j3].IP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1638                         copy(m.Contract.Rules[j1].NhSet.Nhs[j3].Mac[:], buf.DecodeBytes(6))
1639                         m.Contract.Rules[j1].NhSet.Nhs[j3].BdID = buf.DecodeUint32()
1640                         m.Contract.Rules[j1].NhSet.Nhs[j3].RdID = buf.DecodeUint32()
1641                 }
1642         }
1643         return nil
1644 }
1645
1646 // GbpContractAddDelReply defines message 'gbp_contract_add_del_reply'.
1647 type GbpContractAddDelReply struct {
1648         Retval     int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
1649         StatsIndex uint32 `binapi:"u32,name=stats_index" json:"stats_index,omitempty"`
1650 }
1651
1652 func (m *GbpContractAddDelReply) Reset()               { *m = GbpContractAddDelReply{} }
1653 func (*GbpContractAddDelReply) GetMessageName() string { return "gbp_contract_add_del_reply" }
1654 func (*GbpContractAddDelReply) GetCrcString() string   { return "1992deab" }
1655 func (*GbpContractAddDelReply) GetMessageType() api.MessageType {
1656         return api.ReplyMessage
1657 }
1658
1659 func (m *GbpContractAddDelReply) Size() (size int) {
1660         if m == nil {
1661                 return 0
1662         }
1663         size += 4 // m.Retval
1664         size += 4 // m.StatsIndex
1665         return size
1666 }
1667 func (m *GbpContractAddDelReply) Marshal(b []byte) ([]byte, error) {
1668         if b == nil {
1669                 b = make([]byte, m.Size())
1670         }
1671         buf := codec.NewBuffer(b)
1672         buf.EncodeInt32(m.Retval)
1673         buf.EncodeUint32(m.StatsIndex)
1674         return buf.Bytes(), nil
1675 }
1676 func (m *GbpContractAddDelReply) Unmarshal(b []byte) error {
1677         buf := codec.NewBuffer(b)
1678         m.Retval = buf.DecodeInt32()
1679         m.StatsIndex = buf.DecodeUint32()
1680         return nil
1681 }
1682
1683 // GbpContractDetails defines message 'gbp_contract_details'.
1684 type GbpContractDetails struct {
1685         Contract GbpContract `binapi:"gbp_contract,name=contract" json:"contract,omitempty"`
1686 }
1687
1688 func (m *GbpContractDetails) Reset()               { *m = GbpContractDetails{} }
1689 func (*GbpContractDetails) GetMessageName() string { return "gbp_contract_details" }
1690 func (*GbpContractDetails) GetCrcString() string   { return "2a18db6e" }
1691 func (*GbpContractDetails) GetMessageType() api.MessageType {
1692         return api.ReplyMessage
1693 }
1694
1695 func (m *GbpContractDetails) Size() (size int) {
1696         if m == nil {
1697                 return 0
1698         }
1699         size += 2      // m.Contract.Scope
1700         size += 2      // m.Contract.Sclass
1701         size += 2      // m.Contract.Dclass
1702         size += 4      // m.Contract.ACLIndex
1703         size += 1      // m.Contract.NEtherTypes
1704         size += 2 * 16 // m.Contract.AllowedEthertypes
1705         size += 1      // m.Contract.NRules
1706         for j2 := 0; j2 < len(m.Contract.Rules); j2++ {
1707                 var s2 GbpRule
1708                 _ = s2
1709                 if j2 < len(m.Contract.Rules) {
1710                         s2 = m.Contract.Rules[j2]
1711                 }
1712                 size += 4 // s2.Action
1713                 size += 4 // s2.NhSet.HashMode
1714                 size += 1 // s2.NhSet.NNhs
1715                 for j4 := 0; j4 < 8; j4++ {
1716                         size += 4      // s2.NhSet.Nhs[j4].IP.Af
1717                         size += 1 * 16 // s2.NhSet.Nhs[j4].IP.Un
1718                         size += 1 * 6  // s2.NhSet.Nhs[j4].Mac
1719                         size += 4      // s2.NhSet.Nhs[j4].BdID
1720                         size += 4      // s2.NhSet.Nhs[j4].RdID
1721                 }
1722         }
1723         return size
1724 }
1725 func (m *GbpContractDetails) Marshal(b []byte) ([]byte, error) {
1726         if b == nil {
1727                 b = make([]byte, m.Size())
1728         }
1729         buf := codec.NewBuffer(b)
1730         buf.EncodeUint16(uint16(m.Contract.Scope))
1731         buf.EncodeUint16(m.Contract.Sclass)
1732         buf.EncodeUint16(m.Contract.Dclass)
1733         buf.EncodeUint32(m.Contract.ACLIndex)
1734         buf.EncodeUint8(m.Contract.NEtherTypes)
1735         for i := 0; i < 16; i++ {
1736                 var x uint16
1737                 if i < len(m.Contract.AllowedEthertypes) {
1738                         x = uint16(m.Contract.AllowedEthertypes[i])
1739                 }
1740                 buf.EncodeUint16(x)
1741         }
1742         buf.EncodeUint8(uint8(len(m.Contract.Rules)))
1743         for j1 := 0; j1 < len(m.Contract.Rules); j1++ {
1744                 var v1 GbpRule // Rules
1745                 if j1 < len(m.Contract.Rules) {
1746                         v1 = m.Contract.Rules[j1]
1747                 }
1748                 buf.EncodeUint32(uint32(v1.Action))
1749                 buf.EncodeUint32(uint32(v1.NhSet.HashMode))
1750                 buf.EncodeUint8(v1.NhSet.NNhs)
1751                 for j3 := 0; j3 < 8; j3++ {
1752                         buf.EncodeUint32(uint32(v1.NhSet.Nhs[j3].IP.Af))
1753                         buf.EncodeBytes(v1.NhSet.Nhs[j3].IP.Un.XXX_UnionData[:], 16)
1754                         buf.EncodeBytes(v1.NhSet.Nhs[j3].Mac[:], 6)
1755                         buf.EncodeUint32(v1.NhSet.Nhs[j3].BdID)
1756                         buf.EncodeUint32(v1.NhSet.Nhs[j3].RdID)
1757                 }
1758         }
1759         return buf.Bytes(), nil
1760 }
1761 func (m *GbpContractDetails) Unmarshal(b []byte) error {
1762         buf := codec.NewBuffer(b)
1763         m.Contract.Scope = GbpScope(buf.DecodeUint16())
1764         m.Contract.Sclass = buf.DecodeUint16()
1765         m.Contract.Dclass = buf.DecodeUint16()
1766         m.Contract.ACLIndex = buf.DecodeUint32()
1767         m.Contract.NEtherTypes = buf.DecodeUint8()
1768         m.Contract.AllowedEthertypes = make([]uint16, 16)
1769         for i := 0; i < len(m.Contract.AllowedEthertypes); i++ {
1770                 m.Contract.AllowedEthertypes[i] = buf.DecodeUint16()
1771         }
1772         m.Contract.NRules = buf.DecodeUint8()
1773         m.Contract.Rules = make([]GbpRule, m.Contract.NRules)
1774         for j1 := 0; j1 < len(m.Contract.Rules); j1++ {
1775                 m.Contract.Rules[j1].Action = GbpRuleAction(buf.DecodeUint32())
1776                 m.Contract.Rules[j1].NhSet.HashMode = GbpHashMode(buf.DecodeUint32())
1777                 m.Contract.Rules[j1].NhSet.NNhs = buf.DecodeUint8()
1778                 for j3 := 0; j3 < 8; j3++ {
1779                         m.Contract.Rules[j1].NhSet.Nhs[j3].IP.Af = AddressFamily(buf.DecodeUint32())
1780                         copy(m.Contract.Rules[j1].NhSet.Nhs[j3].IP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1781                         copy(m.Contract.Rules[j1].NhSet.Nhs[j3].Mac[:], buf.DecodeBytes(6))
1782                         m.Contract.Rules[j1].NhSet.Nhs[j3].BdID = buf.DecodeUint32()
1783                         m.Contract.Rules[j1].NhSet.Nhs[j3].RdID = buf.DecodeUint32()
1784                 }
1785         }
1786         return nil
1787 }
1788
1789 // GbpContractDump defines message 'gbp_contract_dump'.
1790 type GbpContractDump struct{}
1791
1792 func (m *GbpContractDump) Reset()               { *m = GbpContractDump{} }
1793 func (*GbpContractDump) GetMessageName() string { return "gbp_contract_dump" }
1794 func (*GbpContractDump) GetCrcString() string   { return "51077d14" }
1795 func (*GbpContractDump) GetMessageType() api.MessageType {
1796         return api.RequestMessage
1797 }
1798
1799 func (m *GbpContractDump) Size() (size int) {
1800         if m == nil {
1801                 return 0
1802         }
1803         return size
1804 }
1805 func (m *GbpContractDump) Marshal(b []byte) ([]byte, error) {
1806         if b == nil {
1807                 b = make([]byte, m.Size())
1808         }
1809         buf := codec.NewBuffer(b)
1810         return buf.Bytes(), nil
1811 }
1812 func (m *GbpContractDump) Unmarshal(b []byte) error {
1813         return nil
1814 }
1815
1816 // GbpEndpointAdd defines message 'gbp_endpoint_add'.
1817 type GbpEndpointAdd struct {
1818         Endpoint GbpEndpoint `binapi:"gbp_endpoint,name=endpoint" json:"endpoint,omitempty"`
1819 }
1820
1821 func (m *GbpEndpointAdd) Reset()               { *m = GbpEndpointAdd{} }
1822 func (*GbpEndpointAdd) GetMessageName() string { return "gbp_endpoint_add" }
1823 func (*GbpEndpointAdd) GetCrcString() string   { return "9ce16d5a" }
1824 func (*GbpEndpointAdd) GetMessageType() api.MessageType {
1825         return api.RequestMessage
1826 }
1827
1828 func (m *GbpEndpointAdd) Size() (size int) {
1829         if m == nil {
1830                 return 0
1831         }
1832         size += 4      // m.Endpoint.SwIfIndex
1833         size += 2      // m.Endpoint.Sclass
1834         size += 4      // m.Endpoint.Flags
1835         size += 1 * 6  // m.Endpoint.Mac
1836         size += 4      // m.Endpoint.Tun.Src.Af
1837         size += 1 * 16 // m.Endpoint.Tun.Src.Un
1838         size += 4      // m.Endpoint.Tun.Dst.Af
1839         size += 1 * 16 // m.Endpoint.Tun.Dst.Un
1840         size += 1      // m.Endpoint.NIps
1841         for j2 := 0; j2 < len(m.Endpoint.Ips); j2++ {
1842                 var s2 Address
1843                 _ = s2
1844                 if j2 < len(m.Endpoint.Ips) {
1845                         s2 = m.Endpoint.Ips[j2]
1846                 }
1847                 size += 4      // s2.Af
1848                 size += 1 * 16 // s2.Un
1849         }
1850         return size
1851 }
1852 func (m *GbpEndpointAdd) Marshal(b []byte) ([]byte, error) {
1853         if b == nil {
1854                 b = make([]byte, m.Size())
1855         }
1856         buf := codec.NewBuffer(b)
1857         buf.EncodeUint32(uint32(m.Endpoint.SwIfIndex))
1858         buf.EncodeUint16(m.Endpoint.Sclass)
1859         buf.EncodeUint32(uint32(m.Endpoint.Flags))
1860         buf.EncodeBytes(m.Endpoint.Mac[:], 6)
1861         buf.EncodeUint32(uint32(m.Endpoint.Tun.Src.Af))
1862         buf.EncodeBytes(m.Endpoint.Tun.Src.Un.XXX_UnionData[:], 16)
1863         buf.EncodeUint32(uint32(m.Endpoint.Tun.Dst.Af))
1864         buf.EncodeBytes(m.Endpoint.Tun.Dst.Un.XXX_UnionData[:], 16)
1865         buf.EncodeUint8(uint8(len(m.Endpoint.Ips)))
1866         for j1 := 0; j1 < len(m.Endpoint.Ips); j1++ {
1867                 var v1 Address // Ips
1868                 if j1 < len(m.Endpoint.Ips) {
1869                         v1 = m.Endpoint.Ips[j1]
1870                 }
1871                 buf.EncodeUint32(uint32(v1.Af))
1872                 buf.EncodeBytes(v1.Un.XXX_UnionData[:], 16)
1873         }
1874         return buf.Bytes(), nil
1875 }
1876 func (m *GbpEndpointAdd) Unmarshal(b []byte) error {
1877         buf := codec.NewBuffer(b)
1878         m.Endpoint.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
1879         m.Endpoint.Sclass = buf.DecodeUint16()
1880         m.Endpoint.Flags = GbpEndpointFlags(buf.DecodeUint32())
1881         copy(m.Endpoint.Mac[:], buf.DecodeBytes(6))
1882         m.Endpoint.Tun.Src.Af = AddressFamily(buf.DecodeUint32())
1883         copy(m.Endpoint.Tun.Src.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1884         m.Endpoint.Tun.Dst.Af = AddressFamily(buf.DecodeUint32())
1885         copy(m.Endpoint.Tun.Dst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1886         m.Endpoint.NIps = buf.DecodeUint8()
1887         m.Endpoint.Ips = make([]Address, m.Endpoint.NIps)
1888         for j1 := 0; j1 < len(m.Endpoint.Ips); j1++ {
1889                 m.Endpoint.Ips[j1].Af = AddressFamily(buf.DecodeUint32())
1890                 copy(m.Endpoint.Ips[j1].Un.XXX_UnionData[:], buf.DecodeBytes(16))
1891         }
1892         return nil
1893 }
1894
1895 // GbpEndpointAddReply defines message 'gbp_endpoint_add_reply'.
1896 type GbpEndpointAddReply struct {
1897         Retval int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
1898         Handle uint32 `binapi:"u32,name=handle" json:"handle,omitempty"`
1899 }
1900
1901 func (m *GbpEndpointAddReply) Reset()               { *m = GbpEndpointAddReply{} }
1902 func (*GbpEndpointAddReply) GetMessageName() string { return "gbp_endpoint_add_reply" }
1903 func (*GbpEndpointAddReply) GetCrcString() string   { return "1dd3ff3e" }
1904 func (*GbpEndpointAddReply) GetMessageType() api.MessageType {
1905         return api.ReplyMessage
1906 }
1907
1908 func (m *GbpEndpointAddReply) Size() (size int) {
1909         if m == nil {
1910                 return 0
1911         }
1912         size += 4 // m.Retval
1913         size += 4 // m.Handle
1914         return size
1915 }
1916 func (m *GbpEndpointAddReply) Marshal(b []byte) ([]byte, error) {
1917         if b == nil {
1918                 b = make([]byte, m.Size())
1919         }
1920         buf := codec.NewBuffer(b)
1921         buf.EncodeInt32(m.Retval)
1922         buf.EncodeUint32(m.Handle)
1923         return buf.Bytes(), nil
1924 }
1925 func (m *GbpEndpointAddReply) Unmarshal(b []byte) error {
1926         buf := codec.NewBuffer(b)
1927         m.Retval = buf.DecodeInt32()
1928         m.Handle = buf.DecodeUint32()
1929         return nil
1930 }
1931
1932 // GbpEndpointDel defines message 'gbp_endpoint_del'.
1933 type GbpEndpointDel struct {
1934         Handle uint32 `binapi:"u32,name=handle" json:"handle,omitempty"`
1935 }
1936
1937 func (m *GbpEndpointDel) Reset()               { *m = GbpEndpointDel{} }
1938 func (*GbpEndpointDel) GetMessageName() string { return "gbp_endpoint_del" }
1939 func (*GbpEndpointDel) GetCrcString() string   { return "b93cd566" }
1940 func (*GbpEndpointDel) GetMessageType() api.MessageType {
1941         return api.RequestMessage
1942 }
1943
1944 func (m *GbpEndpointDel) Size() (size int) {
1945         if m == nil {
1946                 return 0
1947         }
1948         size += 4 // m.Handle
1949         return size
1950 }
1951 func (m *GbpEndpointDel) Marshal(b []byte) ([]byte, error) {
1952         if b == nil {
1953                 b = make([]byte, m.Size())
1954         }
1955         buf := codec.NewBuffer(b)
1956         buf.EncodeUint32(m.Handle)
1957         return buf.Bytes(), nil
1958 }
1959 func (m *GbpEndpointDel) Unmarshal(b []byte) error {
1960         buf := codec.NewBuffer(b)
1961         m.Handle = buf.DecodeUint32()
1962         return nil
1963 }
1964
1965 // GbpEndpointDelReply defines message 'gbp_endpoint_del_reply'.
1966 type GbpEndpointDelReply struct {
1967         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1968 }
1969
1970 func (m *GbpEndpointDelReply) Reset()               { *m = GbpEndpointDelReply{} }
1971 func (*GbpEndpointDelReply) GetMessageName() string { return "gbp_endpoint_del_reply" }
1972 func (*GbpEndpointDelReply) GetCrcString() string   { return "e8d4e804" }
1973 func (*GbpEndpointDelReply) GetMessageType() api.MessageType {
1974         return api.ReplyMessage
1975 }
1976
1977 func (m *GbpEndpointDelReply) Size() (size int) {
1978         if m == nil {
1979                 return 0
1980         }
1981         size += 4 // m.Retval
1982         return size
1983 }
1984 func (m *GbpEndpointDelReply) Marshal(b []byte) ([]byte, error) {
1985         if b == nil {
1986                 b = make([]byte, m.Size())
1987         }
1988         buf := codec.NewBuffer(b)
1989         buf.EncodeInt32(m.Retval)
1990         return buf.Bytes(), nil
1991 }
1992 func (m *GbpEndpointDelReply) Unmarshal(b []byte) error {
1993         buf := codec.NewBuffer(b)
1994         m.Retval = buf.DecodeInt32()
1995         return nil
1996 }
1997
1998 // GbpEndpointDetails defines message 'gbp_endpoint_details'.
1999 type GbpEndpointDetails struct {
2000         Age      float64     `binapi:"f64,name=age" json:"age,omitempty"`
2001         Handle   uint32      `binapi:"u32,name=handle" json:"handle,omitempty"`
2002         Endpoint GbpEndpoint `binapi:"gbp_endpoint,name=endpoint" json:"endpoint,omitempty"`
2003 }
2004
2005 func (m *GbpEndpointDetails) Reset()               { *m = GbpEndpointDetails{} }
2006 func (*GbpEndpointDetails) GetMessageName() string { return "gbp_endpoint_details" }
2007 func (*GbpEndpointDetails) GetCrcString() string   { return "08aecb60" }
2008 func (*GbpEndpointDetails) GetMessageType() api.MessageType {
2009         return api.ReplyMessage
2010 }
2011
2012 func (m *GbpEndpointDetails) Size() (size int) {
2013         if m == nil {
2014                 return 0
2015         }
2016         size += 8      // m.Age
2017         size += 4      // m.Handle
2018         size += 4      // m.Endpoint.SwIfIndex
2019         size += 2      // m.Endpoint.Sclass
2020         size += 4      // m.Endpoint.Flags
2021         size += 1 * 6  // m.Endpoint.Mac
2022         size += 4      // m.Endpoint.Tun.Src.Af
2023         size += 1 * 16 // m.Endpoint.Tun.Src.Un
2024         size += 4      // m.Endpoint.Tun.Dst.Af
2025         size += 1 * 16 // m.Endpoint.Tun.Dst.Un
2026         size += 1      // m.Endpoint.NIps
2027         for j2 := 0; j2 < len(m.Endpoint.Ips); j2++ {
2028                 var s2 Address
2029                 _ = s2
2030                 if j2 < len(m.Endpoint.Ips) {
2031                         s2 = m.Endpoint.Ips[j2]
2032                 }
2033                 size += 4      // s2.Af
2034                 size += 1 * 16 // s2.Un
2035         }
2036         return size
2037 }
2038 func (m *GbpEndpointDetails) Marshal(b []byte) ([]byte, error) {
2039         if b == nil {
2040                 b = make([]byte, m.Size())
2041         }
2042         buf := codec.NewBuffer(b)
2043         buf.EncodeFloat64(m.Age)
2044         buf.EncodeUint32(m.Handle)
2045         buf.EncodeUint32(uint32(m.Endpoint.SwIfIndex))
2046         buf.EncodeUint16(m.Endpoint.Sclass)
2047         buf.EncodeUint32(uint32(m.Endpoint.Flags))
2048         buf.EncodeBytes(m.Endpoint.Mac[:], 6)
2049         buf.EncodeUint32(uint32(m.Endpoint.Tun.Src.Af))
2050         buf.EncodeBytes(m.Endpoint.Tun.Src.Un.XXX_UnionData[:], 16)
2051         buf.EncodeUint32(uint32(m.Endpoint.Tun.Dst.Af))
2052         buf.EncodeBytes(m.Endpoint.Tun.Dst.Un.XXX_UnionData[:], 16)
2053         buf.EncodeUint8(uint8(len(m.Endpoint.Ips)))
2054         for j1 := 0; j1 < len(m.Endpoint.Ips); j1++ {
2055                 var v1 Address // Ips
2056                 if j1 < len(m.Endpoint.Ips) {
2057                         v1 = m.Endpoint.Ips[j1]
2058                 }
2059                 buf.EncodeUint32(uint32(v1.Af))
2060                 buf.EncodeBytes(v1.Un.XXX_UnionData[:], 16)
2061         }
2062         return buf.Bytes(), nil
2063 }
2064 func (m *GbpEndpointDetails) Unmarshal(b []byte) error {
2065         buf := codec.NewBuffer(b)
2066         m.Age = buf.DecodeFloat64()
2067         m.Handle = buf.DecodeUint32()
2068         m.Endpoint.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
2069         m.Endpoint.Sclass = buf.DecodeUint16()
2070         m.Endpoint.Flags = GbpEndpointFlags(buf.DecodeUint32())
2071         copy(m.Endpoint.Mac[:], buf.DecodeBytes(6))
2072         m.Endpoint.Tun.Src.Af = AddressFamily(buf.DecodeUint32())
2073         copy(m.Endpoint.Tun.Src.Un.XXX_UnionData[:], buf.DecodeBytes(16))
2074         m.Endpoint.Tun.Dst.Af = AddressFamily(buf.DecodeUint32())
2075         copy(m.Endpoint.Tun.Dst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
2076         m.Endpoint.NIps = buf.DecodeUint8()
2077         m.Endpoint.Ips = make([]Address, m.Endpoint.NIps)
2078         for j1 := 0; j1 < len(m.Endpoint.Ips); j1++ {
2079                 m.Endpoint.Ips[j1].Af = AddressFamily(buf.DecodeUint32())
2080                 copy(m.Endpoint.Ips[j1].Un.XXX_UnionData[:], buf.DecodeBytes(16))
2081         }
2082         return nil
2083 }
2084
2085 // GbpEndpointDump defines message 'gbp_endpoint_dump'.
2086 type GbpEndpointDump struct{}
2087
2088 func (m *GbpEndpointDump) Reset()               { *m = GbpEndpointDump{} }
2089 func (*GbpEndpointDump) GetMessageName() string { return "gbp_endpoint_dump" }
2090 func (*GbpEndpointDump) GetCrcString() string   { return "51077d14" }
2091 func (*GbpEndpointDump) GetMessageType() api.MessageType {
2092         return api.RequestMessage
2093 }
2094
2095 func (m *GbpEndpointDump) Size() (size int) {
2096         if m == nil {
2097                 return 0
2098         }
2099         return size
2100 }
2101 func (m *GbpEndpointDump) Marshal(b []byte) ([]byte, error) {
2102         if b == nil {
2103                 b = make([]byte, m.Size())
2104         }
2105         buf := codec.NewBuffer(b)
2106         return buf.Bytes(), nil
2107 }
2108 func (m *GbpEndpointDump) Unmarshal(b []byte) error {
2109         return nil
2110 }
2111
2112 // GbpEndpointGroupAdd defines message 'gbp_endpoint_group_add'.
2113 type GbpEndpointGroupAdd struct {
2114         Epg GbpEndpointGroup `binapi:"gbp_endpoint_group,name=epg" json:"epg,omitempty"`
2115 }
2116
2117 func (m *GbpEndpointGroupAdd) Reset()               { *m = GbpEndpointGroupAdd{} }
2118 func (*GbpEndpointGroupAdd) GetMessageName() string { return "gbp_endpoint_group_add" }
2119 func (*GbpEndpointGroupAdd) GetCrcString() string   { return "8e0f4054" }
2120 func (*GbpEndpointGroupAdd) GetMessageType() api.MessageType {
2121         return api.RequestMessage
2122 }
2123
2124 func (m *GbpEndpointGroupAdd) Size() (size int) {
2125         if m == nil {
2126                 return 0
2127         }
2128         size += 4 // m.Epg.Vnid
2129         size += 2 // m.Epg.Sclass
2130         size += 4 // m.Epg.BdID
2131         size += 4 // m.Epg.RdID
2132         size += 4 // m.Epg.UplinkSwIfIndex
2133         size += 4 // m.Epg.Retention.RemoteEpTimeout
2134         return size
2135 }
2136 func (m *GbpEndpointGroupAdd) Marshal(b []byte) ([]byte, error) {
2137         if b == nil {
2138                 b = make([]byte, m.Size())
2139         }
2140         buf := codec.NewBuffer(b)
2141         buf.EncodeUint32(m.Epg.Vnid)
2142         buf.EncodeUint16(m.Epg.Sclass)
2143         buf.EncodeUint32(m.Epg.BdID)
2144         buf.EncodeUint32(m.Epg.RdID)
2145         buf.EncodeUint32(uint32(m.Epg.UplinkSwIfIndex))
2146         buf.EncodeUint32(m.Epg.Retention.RemoteEpTimeout)
2147         return buf.Bytes(), nil
2148 }
2149 func (m *GbpEndpointGroupAdd) Unmarshal(b []byte) error {
2150         buf := codec.NewBuffer(b)
2151         m.Epg.Vnid = buf.DecodeUint32()
2152         m.Epg.Sclass = buf.DecodeUint16()
2153         m.Epg.BdID = buf.DecodeUint32()
2154         m.Epg.RdID = buf.DecodeUint32()
2155         m.Epg.UplinkSwIfIndex = InterfaceIndex(buf.DecodeUint32())
2156         m.Epg.Retention.RemoteEpTimeout = buf.DecodeUint32()
2157         return nil
2158 }
2159
2160 // GbpEndpointGroupAddReply defines message 'gbp_endpoint_group_add_reply'.
2161 type GbpEndpointGroupAddReply struct {
2162         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2163 }
2164
2165 func (m *GbpEndpointGroupAddReply) Reset()               { *m = GbpEndpointGroupAddReply{} }
2166 func (*GbpEndpointGroupAddReply) GetMessageName() string { return "gbp_endpoint_group_add_reply" }
2167 func (*GbpEndpointGroupAddReply) GetCrcString() string   { return "e8d4e804" }
2168 func (*GbpEndpointGroupAddReply) GetMessageType() api.MessageType {
2169         return api.ReplyMessage
2170 }
2171
2172 func (m *GbpEndpointGroupAddReply) Size() (size int) {
2173         if m == nil {
2174                 return 0
2175         }
2176         size += 4 // m.Retval
2177         return size
2178 }
2179 func (m *GbpEndpointGroupAddReply) Marshal(b []byte) ([]byte, error) {
2180         if b == nil {
2181                 b = make([]byte, m.Size())
2182         }
2183         buf := codec.NewBuffer(b)
2184         buf.EncodeInt32(m.Retval)
2185         return buf.Bytes(), nil
2186 }
2187 func (m *GbpEndpointGroupAddReply) Unmarshal(b []byte) error {
2188         buf := codec.NewBuffer(b)
2189         m.Retval = buf.DecodeInt32()
2190         return nil
2191 }
2192
2193 // GbpEndpointGroupDel defines message 'gbp_endpoint_group_del'.
2194 type GbpEndpointGroupDel struct {
2195         Sclass uint16 `binapi:"u16,name=sclass" json:"sclass,omitempty"`
2196 }
2197
2198 func (m *GbpEndpointGroupDel) Reset()               { *m = GbpEndpointGroupDel{} }
2199 func (*GbpEndpointGroupDel) GetMessageName() string { return "gbp_endpoint_group_del" }
2200 func (*GbpEndpointGroupDel) GetCrcString() string   { return "3436b8b7" }
2201 func (*GbpEndpointGroupDel) GetMessageType() api.MessageType {
2202         return api.RequestMessage
2203 }
2204
2205 func (m *GbpEndpointGroupDel) Size() (size int) {
2206         if m == nil {
2207                 return 0
2208         }
2209         size += 2 // m.Sclass
2210         return size
2211 }
2212 func (m *GbpEndpointGroupDel) Marshal(b []byte) ([]byte, error) {
2213         if b == nil {
2214                 b = make([]byte, m.Size())
2215         }
2216         buf := codec.NewBuffer(b)
2217         buf.EncodeUint16(m.Sclass)
2218         return buf.Bytes(), nil
2219 }
2220 func (m *GbpEndpointGroupDel) Unmarshal(b []byte) error {
2221         buf := codec.NewBuffer(b)
2222         m.Sclass = buf.DecodeUint16()
2223         return nil
2224 }
2225
2226 // GbpEndpointGroupDelReply defines message 'gbp_endpoint_group_del_reply'.
2227 type GbpEndpointGroupDelReply struct {
2228         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2229 }
2230
2231 func (m *GbpEndpointGroupDelReply) Reset()               { *m = GbpEndpointGroupDelReply{} }
2232 func (*GbpEndpointGroupDelReply) GetMessageName() string { return "gbp_endpoint_group_del_reply" }
2233 func (*GbpEndpointGroupDelReply) GetCrcString() string   { return "e8d4e804" }
2234 func (*GbpEndpointGroupDelReply) GetMessageType() api.MessageType {
2235         return api.ReplyMessage
2236 }
2237
2238 func (m *GbpEndpointGroupDelReply) Size() (size int) {
2239         if m == nil {
2240                 return 0
2241         }
2242         size += 4 // m.Retval
2243         return size
2244 }
2245 func (m *GbpEndpointGroupDelReply) Marshal(b []byte) ([]byte, error) {
2246         if b == nil {
2247                 b = make([]byte, m.Size())
2248         }
2249         buf := codec.NewBuffer(b)
2250         buf.EncodeInt32(m.Retval)
2251         return buf.Bytes(), nil
2252 }
2253 func (m *GbpEndpointGroupDelReply) Unmarshal(b []byte) error {
2254         buf := codec.NewBuffer(b)
2255         m.Retval = buf.DecodeInt32()
2256         return nil
2257 }
2258
2259 // GbpEndpointGroupDetails defines message 'gbp_endpoint_group_details'.
2260 type GbpEndpointGroupDetails struct {
2261         Epg GbpEndpointGroup `binapi:"gbp_endpoint_group,name=epg" json:"epg,omitempty"`
2262 }
2263
2264 func (m *GbpEndpointGroupDetails) Reset()               { *m = GbpEndpointGroupDetails{} }
2265 func (*GbpEndpointGroupDetails) GetMessageName() string { return "gbp_endpoint_group_details" }
2266 func (*GbpEndpointGroupDetails) GetCrcString() string   { return "8f38292c" }
2267 func (*GbpEndpointGroupDetails) GetMessageType() api.MessageType {
2268         return api.ReplyMessage
2269 }
2270
2271 func (m *GbpEndpointGroupDetails) Size() (size int) {
2272         if m == nil {
2273                 return 0
2274         }
2275         size += 4 // m.Epg.Vnid
2276         size += 2 // m.Epg.Sclass
2277         size += 4 // m.Epg.BdID
2278         size += 4 // m.Epg.RdID
2279         size += 4 // m.Epg.UplinkSwIfIndex
2280         size += 4 // m.Epg.Retention.RemoteEpTimeout
2281         return size
2282 }
2283 func (m *GbpEndpointGroupDetails) Marshal(b []byte) ([]byte, error) {
2284         if b == nil {
2285                 b = make([]byte, m.Size())
2286         }
2287         buf := codec.NewBuffer(b)
2288         buf.EncodeUint32(m.Epg.Vnid)
2289         buf.EncodeUint16(m.Epg.Sclass)
2290         buf.EncodeUint32(m.Epg.BdID)
2291         buf.EncodeUint32(m.Epg.RdID)
2292         buf.EncodeUint32(uint32(m.Epg.UplinkSwIfIndex))
2293         buf.EncodeUint32(m.Epg.Retention.RemoteEpTimeout)
2294         return buf.Bytes(), nil
2295 }
2296 func (m *GbpEndpointGroupDetails) Unmarshal(b []byte) error {
2297         buf := codec.NewBuffer(b)
2298         m.Epg.Vnid = buf.DecodeUint32()
2299         m.Epg.Sclass = buf.DecodeUint16()
2300         m.Epg.BdID = buf.DecodeUint32()
2301         m.Epg.RdID = buf.DecodeUint32()
2302         m.Epg.UplinkSwIfIndex = InterfaceIndex(buf.DecodeUint32())
2303         m.Epg.Retention.RemoteEpTimeout = buf.DecodeUint32()
2304         return nil
2305 }
2306
2307 // GbpEndpointGroupDump defines message 'gbp_endpoint_group_dump'.
2308 type GbpEndpointGroupDump struct{}
2309
2310 func (m *GbpEndpointGroupDump) Reset()               { *m = GbpEndpointGroupDump{} }
2311 func (*GbpEndpointGroupDump) GetMessageName() string { return "gbp_endpoint_group_dump" }
2312 func (*GbpEndpointGroupDump) GetCrcString() string   { return "51077d14" }
2313 func (*GbpEndpointGroupDump) GetMessageType() api.MessageType {
2314         return api.RequestMessage
2315 }
2316
2317 func (m *GbpEndpointGroupDump) Size() (size int) {
2318         if m == nil {
2319                 return 0
2320         }
2321         return size
2322 }
2323 func (m *GbpEndpointGroupDump) Marshal(b []byte) ([]byte, error) {
2324         if b == nil {
2325                 b = make([]byte, m.Size())
2326         }
2327         buf := codec.NewBuffer(b)
2328         return buf.Bytes(), nil
2329 }
2330 func (m *GbpEndpointGroupDump) Unmarshal(b []byte) error {
2331         return nil
2332 }
2333
2334 // GbpExtItfAddDel defines message 'gbp_ext_itf_add_del'.
2335 type GbpExtItfAddDel struct {
2336         IsAdd  bool      `binapi:"bool,name=is_add" json:"is_add,omitempty"`
2337         ExtItf GbpExtItf `binapi:"gbp_ext_itf,name=ext_itf" json:"ext_itf,omitempty"`
2338 }
2339
2340 func (m *GbpExtItfAddDel) Reset()               { *m = GbpExtItfAddDel{} }
2341 func (*GbpExtItfAddDel) GetMessageName() string { return "gbp_ext_itf_add_del" }
2342 func (*GbpExtItfAddDel) GetCrcString() string   { return "12ed5700" }
2343 func (*GbpExtItfAddDel) GetMessageType() api.MessageType {
2344         return api.RequestMessage
2345 }
2346
2347 func (m *GbpExtItfAddDel) Size() (size int) {
2348         if m == nil {
2349                 return 0
2350         }
2351         size += 1 // m.IsAdd
2352         size += 4 // m.ExtItf.SwIfIndex
2353         size += 4 // m.ExtItf.BdID
2354         size += 4 // m.ExtItf.RdID
2355         size += 4 // m.ExtItf.Flags
2356         return size
2357 }
2358 func (m *GbpExtItfAddDel) Marshal(b []byte) ([]byte, error) {
2359         if b == nil {
2360                 b = make([]byte, m.Size())
2361         }
2362         buf := codec.NewBuffer(b)
2363         buf.EncodeBool(m.IsAdd)
2364         buf.EncodeUint32(uint32(m.ExtItf.SwIfIndex))
2365         buf.EncodeUint32(m.ExtItf.BdID)
2366         buf.EncodeUint32(m.ExtItf.RdID)
2367         buf.EncodeUint32(uint32(m.ExtItf.Flags))
2368         return buf.Bytes(), nil
2369 }
2370 func (m *GbpExtItfAddDel) Unmarshal(b []byte) error {
2371         buf := codec.NewBuffer(b)
2372         m.IsAdd = buf.DecodeBool()
2373         m.ExtItf.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
2374         m.ExtItf.BdID = buf.DecodeUint32()
2375         m.ExtItf.RdID = buf.DecodeUint32()
2376         m.ExtItf.Flags = GbpExtItfFlags(buf.DecodeUint32())
2377         return nil
2378 }
2379
2380 // GbpExtItfAddDelReply defines message 'gbp_ext_itf_add_del_reply'.
2381 type GbpExtItfAddDelReply struct {
2382         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2383 }
2384
2385 func (m *GbpExtItfAddDelReply) Reset()               { *m = GbpExtItfAddDelReply{} }
2386 func (*GbpExtItfAddDelReply) GetMessageName() string { return "gbp_ext_itf_add_del_reply" }
2387 func (*GbpExtItfAddDelReply) GetCrcString() string   { return "e8d4e804" }
2388 func (*GbpExtItfAddDelReply) GetMessageType() api.MessageType {
2389         return api.ReplyMessage
2390 }
2391
2392 func (m *GbpExtItfAddDelReply) Size() (size int) {
2393         if m == nil {
2394                 return 0
2395         }
2396         size += 4 // m.Retval
2397         return size
2398 }
2399 func (m *GbpExtItfAddDelReply) Marshal(b []byte) ([]byte, error) {
2400         if b == nil {
2401                 b = make([]byte, m.Size())
2402         }
2403         buf := codec.NewBuffer(b)
2404         buf.EncodeInt32(m.Retval)
2405         return buf.Bytes(), nil
2406 }
2407 func (m *GbpExtItfAddDelReply) Unmarshal(b []byte) error {
2408         buf := codec.NewBuffer(b)
2409         m.Retval = buf.DecodeInt32()
2410         return nil
2411 }
2412
2413 // GbpExtItfDetails defines message 'gbp_ext_itf_details'.
2414 type GbpExtItfDetails struct {
2415         ExtItf GbpExtItf `binapi:"gbp_ext_itf,name=ext_itf" json:"ext_itf,omitempty"`
2416 }
2417
2418 func (m *GbpExtItfDetails) Reset()               { *m = GbpExtItfDetails{} }
2419 func (*GbpExtItfDetails) GetMessageName() string { return "gbp_ext_itf_details" }
2420 func (*GbpExtItfDetails) GetCrcString() string   { return "408a45c0" }
2421 func (*GbpExtItfDetails) GetMessageType() api.MessageType {
2422         return api.ReplyMessage
2423 }
2424
2425 func (m *GbpExtItfDetails) Size() (size int) {
2426         if m == nil {
2427                 return 0
2428         }
2429         size += 4 // m.ExtItf.SwIfIndex
2430         size += 4 // m.ExtItf.BdID
2431         size += 4 // m.ExtItf.RdID
2432         size += 4 // m.ExtItf.Flags
2433         return size
2434 }
2435 func (m *GbpExtItfDetails) Marshal(b []byte) ([]byte, error) {
2436         if b == nil {
2437                 b = make([]byte, m.Size())
2438         }
2439         buf := codec.NewBuffer(b)
2440         buf.EncodeUint32(uint32(m.ExtItf.SwIfIndex))
2441         buf.EncodeUint32(m.ExtItf.BdID)
2442         buf.EncodeUint32(m.ExtItf.RdID)
2443         buf.EncodeUint32(uint32(m.ExtItf.Flags))
2444         return buf.Bytes(), nil
2445 }
2446 func (m *GbpExtItfDetails) Unmarshal(b []byte) error {
2447         buf := codec.NewBuffer(b)
2448         m.ExtItf.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
2449         m.ExtItf.BdID = buf.DecodeUint32()
2450         m.ExtItf.RdID = buf.DecodeUint32()
2451         m.ExtItf.Flags = GbpExtItfFlags(buf.DecodeUint32())
2452         return nil
2453 }
2454
2455 // GbpExtItfDump defines message 'gbp_ext_itf_dump'.
2456 type GbpExtItfDump struct{}
2457
2458 func (m *GbpExtItfDump) Reset()               { *m = GbpExtItfDump{} }
2459 func (*GbpExtItfDump) GetMessageName() string { return "gbp_ext_itf_dump" }
2460 func (*GbpExtItfDump) GetCrcString() string   { return "51077d14" }
2461 func (*GbpExtItfDump) GetMessageType() api.MessageType {
2462         return api.RequestMessage
2463 }
2464
2465 func (m *GbpExtItfDump) Size() (size int) {
2466         if m == nil {
2467                 return 0
2468         }
2469         return size
2470 }
2471 func (m *GbpExtItfDump) Marshal(b []byte) ([]byte, error) {
2472         if b == nil {
2473                 b = make([]byte, m.Size())
2474         }
2475         buf := codec.NewBuffer(b)
2476         return buf.Bytes(), nil
2477 }
2478 func (m *GbpExtItfDump) Unmarshal(b []byte) error {
2479         return nil
2480 }
2481
2482 // GbpRecircAddDel defines message 'gbp_recirc_add_del'.
2483 type GbpRecircAddDel struct {
2484         IsAdd  bool      `binapi:"bool,name=is_add" json:"is_add,omitempty"`
2485         Recirc GbpRecirc `binapi:"gbp_recirc,name=recirc" json:"recirc,omitempty"`
2486 }
2487
2488 func (m *GbpRecircAddDel) Reset()               { *m = GbpRecircAddDel{} }
2489 func (*GbpRecircAddDel) GetMessageName() string { return "gbp_recirc_add_del" }
2490 func (*GbpRecircAddDel) GetCrcString() string   { return "718c69c3" }
2491 func (*GbpRecircAddDel) GetMessageType() api.MessageType {
2492         return api.RequestMessage
2493 }
2494
2495 func (m *GbpRecircAddDel) Size() (size int) {
2496         if m == nil {
2497                 return 0
2498         }
2499         size += 1 // m.IsAdd
2500         size += 4 // m.Recirc.SwIfIndex
2501         size += 2 // m.Recirc.Sclass
2502         size += 1 // m.Recirc.IsExt
2503         return size
2504 }
2505 func (m *GbpRecircAddDel) Marshal(b []byte) ([]byte, error) {
2506         if b == nil {
2507                 b = make([]byte, m.Size())
2508         }
2509         buf := codec.NewBuffer(b)
2510         buf.EncodeBool(m.IsAdd)
2511         buf.EncodeUint32(uint32(m.Recirc.SwIfIndex))
2512         buf.EncodeUint16(m.Recirc.Sclass)
2513         buf.EncodeBool(m.Recirc.IsExt)
2514         return buf.Bytes(), nil
2515 }
2516 func (m *GbpRecircAddDel) Unmarshal(b []byte) error {
2517         buf := codec.NewBuffer(b)
2518         m.IsAdd = buf.DecodeBool()
2519         m.Recirc.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
2520         m.Recirc.Sclass = buf.DecodeUint16()
2521         m.Recirc.IsExt = buf.DecodeBool()
2522         return nil
2523 }
2524
2525 // GbpRecircAddDelReply defines message 'gbp_recirc_add_del_reply'.
2526 type GbpRecircAddDelReply struct {
2527         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2528 }
2529
2530 func (m *GbpRecircAddDelReply) Reset()               { *m = GbpRecircAddDelReply{} }
2531 func (*GbpRecircAddDelReply) GetMessageName() string { return "gbp_recirc_add_del_reply" }
2532 func (*GbpRecircAddDelReply) GetCrcString() string   { return "e8d4e804" }
2533 func (*GbpRecircAddDelReply) GetMessageType() api.MessageType {
2534         return api.ReplyMessage
2535 }
2536
2537 func (m *GbpRecircAddDelReply) Size() (size int) {
2538         if m == nil {
2539                 return 0
2540         }
2541         size += 4 // m.Retval
2542         return size
2543 }
2544 func (m *GbpRecircAddDelReply) Marshal(b []byte) ([]byte, error) {
2545         if b == nil {
2546                 b = make([]byte, m.Size())
2547         }
2548         buf := codec.NewBuffer(b)
2549         buf.EncodeInt32(m.Retval)
2550         return buf.Bytes(), nil
2551 }
2552 func (m *GbpRecircAddDelReply) Unmarshal(b []byte) error {
2553         buf := codec.NewBuffer(b)
2554         m.Retval = buf.DecodeInt32()
2555         return nil
2556 }
2557
2558 // GbpRecircDetails defines message 'gbp_recirc_details'.
2559 type GbpRecircDetails struct {
2560         Recirc GbpRecirc `binapi:"gbp_recirc,name=recirc" json:"recirc,omitempty"`
2561 }
2562
2563 func (m *GbpRecircDetails) Reset()               { *m = GbpRecircDetails{} }
2564 func (*GbpRecircDetails) GetMessageName() string { return "gbp_recirc_details" }
2565 func (*GbpRecircDetails) GetCrcString() string   { return "66ecc42e" }
2566 func (*GbpRecircDetails) GetMessageType() api.MessageType {
2567         return api.ReplyMessage
2568 }
2569
2570 func (m *GbpRecircDetails) Size() (size int) {
2571         if m == nil {
2572                 return 0
2573         }
2574         size += 4 // m.Recirc.SwIfIndex
2575         size += 2 // m.Recirc.Sclass
2576         size += 1 // m.Recirc.IsExt
2577         return size
2578 }
2579 func (m *GbpRecircDetails) Marshal(b []byte) ([]byte, error) {
2580         if b == nil {
2581                 b = make([]byte, m.Size())
2582         }
2583         buf := codec.NewBuffer(b)
2584         buf.EncodeUint32(uint32(m.Recirc.SwIfIndex))
2585         buf.EncodeUint16(m.Recirc.Sclass)
2586         buf.EncodeBool(m.Recirc.IsExt)
2587         return buf.Bytes(), nil
2588 }
2589 func (m *GbpRecircDetails) Unmarshal(b []byte) error {
2590         buf := codec.NewBuffer(b)
2591         m.Recirc.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
2592         m.Recirc.Sclass = buf.DecodeUint16()
2593         m.Recirc.IsExt = buf.DecodeBool()
2594         return nil
2595 }
2596
2597 // GbpRecircDump defines message 'gbp_recirc_dump'.
2598 type GbpRecircDump struct{}
2599
2600 func (m *GbpRecircDump) Reset()               { *m = GbpRecircDump{} }
2601 func (*GbpRecircDump) GetMessageName() string { return "gbp_recirc_dump" }
2602 func (*GbpRecircDump) GetCrcString() string   { return "51077d14" }
2603 func (*GbpRecircDump) GetMessageType() api.MessageType {
2604         return api.RequestMessage
2605 }
2606
2607 func (m *GbpRecircDump) Size() (size int) {
2608         if m == nil {
2609                 return 0
2610         }
2611         return size
2612 }
2613 func (m *GbpRecircDump) Marshal(b []byte) ([]byte, error) {
2614         if b == nil {
2615                 b = make([]byte, m.Size())
2616         }
2617         buf := codec.NewBuffer(b)
2618         return buf.Bytes(), nil
2619 }
2620 func (m *GbpRecircDump) Unmarshal(b []byte) error {
2621         return nil
2622 }
2623
2624 // GbpRouteDomainAdd defines message 'gbp_route_domain_add'.
2625 type GbpRouteDomainAdd struct {
2626         Rd GbpRouteDomain `binapi:"gbp_route_domain,name=rd" json:"rd,omitempty"`
2627 }
2628
2629 func (m *GbpRouteDomainAdd) Reset()               { *m = GbpRouteDomainAdd{} }
2630 func (*GbpRouteDomainAdd) GetMessageName() string { return "gbp_route_domain_add" }
2631 func (*GbpRouteDomainAdd) GetCrcString() string   { return "2d0afe38" }
2632 func (*GbpRouteDomainAdd) GetMessageType() api.MessageType {
2633         return api.RequestMessage
2634 }
2635
2636 func (m *GbpRouteDomainAdd) Size() (size int) {
2637         if m == nil {
2638                 return 0
2639         }
2640         size += 4 // m.Rd.RdID
2641         size += 4 // m.Rd.IP4TableID
2642         size += 4 // m.Rd.IP6TableID
2643         size += 4 // m.Rd.IP4UuSwIfIndex
2644         size += 4 // m.Rd.IP6UuSwIfIndex
2645         size += 2 // m.Rd.Scope
2646         return size
2647 }
2648 func (m *GbpRouteDomainAdd) Marshal(b []byte) ([]byte, error) {
2649         if b == nil {
2650                 b = make([]byte, m.Size())
2651         }
2652         buf := codec.NewBuffer(b)
2653         buf.EncodeUint32(m.Rd.RdID)
2654         buf.EncodeUint32(m.Rd.IP4TableID)
2655         buf.EncodeUint32(m.Rd.IP6TableID)
2656         buf.EncodeUint32(uint32(m.Rd.IP4UuSwIfIndex))
2657         buf.EncodeUint32(uint32(m.Rd.IP6UuSwIfIndex))
2658         buf.EncodeUint16(uint16(m.Rd.Scope))
2659         return buf.Bytes(), nil
2660 }
2661 func (m *GbpRouteDomainAdd) Unmarshal(b []byte) error {
2662         buf := codec.NewBuffer(b)
2663         m.Rd.RdID = buf.DecodeUint32()
2664         m.Rd.IP4TableID = buf.DecodeUint32()
2665         m.Rd.IP6TableID = buf.DecodeUint32()
2666         m.Rd.IP4UuSwIfIndex = InterfaceIndex(buf.DecodeUint32())
2667         m.Rd.IP6UuSwIfIndex = InterfaceIndex(buf.DecodeUint32())
2668         m.Rd.Scope = GbpScope(buf.DecodeUint16())
2669         return nil
2670 }
2671
2672 // GbpRouteDomainAddReply defines message 'gbp_route_domain_add_reply'.
2673 type GbpRouteDomainAddReply struct {
2674         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2675 }
2676
2677 func (m *GbpRouteDomainAddReply) Reset()               { *m = GbpRouteDomainAddReply{} }
2678 func (*GbpRouteDomainAddReply) GetMessageName() string { return "gbp_route_domain_add_reply" }
2679 func (*GbpRouteDomainAddReply) GetCrcString() string   { return "e8d4e804" }
2680 func (*GbpRouteDomainAddReply) GetMessageType() api.MessageType {
2681         return api.ReplyMessage
2682 }
2683
2684 func (m *GbpRouteDomainAddReply) Size() (size int) {
2685         if m == nil {
2686                 return 0
2687         }
2688         size += 4 // m.Retval
2689         return size
2690 }
2691 func (m *GbpRouteDomainAddReply) Marshal(b []byte) ([]byte, error) {
2692         if b == nil {
2693                 b = make([]byte, m.Size())
2694         }
2695         buf := codec.NewBuffer(b)
2696         buf.EncodeInt32(m.Retval)
2697         return buf.Bytes(), nil
2698 }
2699 func (m *GbpRouteDomainAddReply) Unmarshal(b []byte) error {
2700         buf := codec.NewBuffer(b)
2701         m.Retval = buf.DecodeInt32()
2702         return nil
2703 }
2704
2705 // GbpRouteDomainDel defines message 'gbp_route_domain_del'.
2706 type GbpRouteDomainDel struct {
2707         RdID uint32 `binapi:"u32,name=rd_id" json:"rd_id,omitempty"`
2708 }
2709
2710 func (m *GbpRouteDomainDel) Reset()               { *m = GbpRouteDomainDel{} }
2711 func (*GbpRouteDomainDel) GetMessageName() string { return "gbp_route_domain_del" }
2712 func (*GbpRouteDomainDel) GetCrcString() string   { return "bee4edcd" }
2713 func (*GbpRouteDomainDel) GetMessageType() api.MessageType {
2714         return api.RequestMessage
2715 }
2716
2717 func (m *GbpRouteDomainDel) Size() (size int) {
2718         if m == nil {
2719                 return 0
2720         }
2721         size += 4 // m.RdID
2722         return size
2723 }
2724 func (m *GbpRouteDomainDel) Marshal(b []byte) ([]byte, error) {
2725         if b == nil {
2726                 b = make([]byte, m.Size())
2727         }
2728         buf := codec.NewBuffer(b)
2729         buf.EncodeUint32(m.RdID)
2730         return buf.Bytes(), nil
2731 }
2732 func (m *GbpRouteDomainDel) Unmarshal(b []byte) error {
2733         buf := codec.NewBuffer(b)
2734         m.RdID = buf.DecodeUint32()
2735         return nil
2736 }
2737
2738 // GbpRouteDomainDelReply defines message 'gbp_route_domain_del_reply'.
2739 type GbpRouteDomainDelReply struct {
2740         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2741 }
2742
2743 func (m *GbpRouteDomainDelReply) Reset()               { *m = GbpRouteDomainDelReply{} }
2744 func (*GbpRouteDomainDelReply) GetMessageName() string { return "gbp_route_domain_del_reply" }
2745 func (*GbpRouteDomainDelReply) GetCrcString() string   { return "e8d4e804" }
2746 func (*GbpRouteDomainDelReply) GetMessageType() api.MessageType {
2747         return api.ReplyMessage
2748 }
2749
2750 func (m *GbpRouteDomainDelReply) Size() (size int) {
2751         if m == nil {
2752                 return 0
2753         }
2754         size += 4 // m.Retval
2755         return size
2756 }
2757 func (m *GbpRouteDomainDelReply) Marshal(b []byte) ([]byte, error) {
2758         if b == nil {
2759                 b = make([]byte, m.Size())
2760         }
2761         buf := codec.NewBuffer(b)
2762         buf.EncodeInt32(m.Retval)
2763         return buf.Bytes(), nil
2764 }
2765 func (m *GbpRouteDomainDelReply) Unmarshal(b []byte) error {
2766         buf := codec.NewBuffer(b)
2767         m.Retval = buf.DecodeInt32()
2768         return nil
2769 }
2770
2771 // GbpRouteDomainDetails defines message 'gbp_route_domain_details'.
2772 type GbpRouteDomainDetails struct {
2773         Rd GbpRouteDomain `binapi:"gbp_route_domain,name=rd" json:"rd,omitempty"`
2774 }
2775
2776 func (m *GbpRouteDomainDetails) Reset()               { *m = GbpRouteDomainDetails{} }
2777 func (*GbpRouteDomainDetails) GetMessageName() string { return "gbp_route_domain_details" }
2778 func (*GbpRouteDomainDetails) GetCrcString() string   { return "8ab11375" }
2779 func (*GbpRouteDomainDetails) GetMessageType() api.MessageType {
2780         return api.ReplyMessage
2781 }
2782
2783 func (m *GbpRouteDomainDetails) Size() (size int) {
2784         if m == nil {
2785                 return 0
2786         }
2787         size += 4 // m.Rd.RdID
2788         size += 4 // m.Rd.IP4TableID
2789         size += 4 // m.Rd.IP6TableID
2790         size += 4 // m.Rd.IP4UuSwIfIndex
2791         size += 4 // m.Rd.IP6UuSwIfIndex
2792         size += 2 // m.Rd.Scope
2793         return size
2794 }
2795 func (m *GbpRouteDomainDetails) Marshal(b []byte) ([]byte, error) {
2796         if b == nil {
2797                 b = make([]byte, m.Size())
2798         }
2799         buf := codec.NewBuffer(b)
2800         buf.EncodeUint32(m.Rd.RdID)
2801         buf.EncodeUint32(m.Rd.IP4TableID)
2802         buf.EncodeUint32(m.Rd.IP6TableID)
2803         buf.EncodeUint32(uint32(m.Rd.IP4UuSwIfIndex))
2804         buf.EncodeUint32(uint32(m.Rd.IP6UuSwIfIndex))
2805         buf.EncodeUint16(uint16(m.Rd.Scope))
2806         return buf.Bytes(), nil
2807 }
2808 func (m *GbpRouteDomainDetails) Unmarshal(b []byte) error {
2809         buf := codec.NewBuffer(b)
2810         m.Rd.RdID = buf.DecodeUint32()
2811         m.Rd.IP4TableID = buf.DecodeUint32()
2812         m.Rd.IP6TableID = buf.DecodeUint32()
2813         m.Rd.IP4UuSwIfIndex = InterfaceIndex(buf.DecodeUint32())
2814         m.Rd.IP6UuSwIfIndex = InterfaceIndex(buf.DecodeUint32())
2815         m.Rd.Scope = GbpScope(buf.DecodeUint16())
2816         return nil
2817 }
2818
2819 // GbpRouteDomainDump defines message 'gbp_route_domain_dump'.
2820 type GbpRouteDomainDump struct{}
2821
2822 func (m *GbpRouteDomainDump) Reset()               { *m = GbpRouteDomainDump{} }
2823 func (*GbpRouteDomainDump) GetMessageName() string { return "gbp_route_domain_dump" }
2824 func (*GbpRouteDomainDump) GetCrcString() string   { return "51077d14" }
2825 func (*GbpRouteDomainDump) GetMessageType() api.MessageType {
2826         return api.RequestMessage
2827 }
2828
2829 func (m *GbpRouteDomainDump) Size() (size int) {
2830         if m == nil {
2831                 return 0
2832         }
2833         return size
2834 }
2835 func (m *GbpRouteDomainDump) Marshal(b []byte) ([]byte, error) {
2836         if b == nil {
2837                 b = make([]byte, m.Size())
2838         }
2839         buf := codec.NewBuffer(b)
2840         return buf.Bytes(), nil
2841 }
2842 func (m *GbpRouteDomainDump) Unmarshal(b []byte) error {
2843         return nil
2844 }
2845
2846 // GbpRouteDomainDumpReply defines message 'gbp_route_domain_dump_reply'.
2847 type GbpRouteDomainDumpReply struct {
2848         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2849 }
2850
2851 func (m *GbpRouteDomainDumpReply) Reset()               { *m = GbpRouteDomainDumpReply{} }
2852 func (*GbpRouteDomainDumpReply) GetMessageName() string { return "gbp_route_domain_dump_reply" }
2853 func (*GbpRouteDomainDumpReply) GetCrcString() string   { return "e8d4e804" }
2854 func (*GbpRouteDomainDumpReply) GetMessageType() api.MessageType {
2855         return api.ReplyMessage
2856 }
2857
2858 func (m *GbpRouteDomainDumpReply) Size() (size int) {
2859         if m == nil {
2860                 return 0
2861         }
2862         size += 4 // m.Retval
2863         return size
2864 }
2865 func (m *GbpRouteDomainDumpReply) Marshal(b []byte) ([]byte, error) {
2866         if b == nil {
2867                 b = make([]byte, m.Size())
2868         }
2869         buf := codec.NewBuffer(b)
2870         buf.EncodeInt32(m.Retval)
2871         return buf.Bytes(), nil
2872 }
2873 func (m *GbpRouteDomainDumpReply) Unmarshal(b []byte) error {
2874         buf := codec.NewBuffer(b)
2875         m.Retval = buf.DecodeInt32()
2876         return nil
2877 }
2878
2879 // GbpSubnetAddDel defines message 'gbp_subnet_add_del'.
2880 type GbpSubnetAddDel struct {
2881         IsAdd  bool      `binapi:"bool,name=is_add" json:"is_add,omitempty"`
2882         Subnet GbpSubnet `binapi:"gbp_subnet,name=subnet" json:"subnet,omitempty"`
2883 }
2884
2885 func (m *GbpSubnetAddDel) Reset()               { *m = GbpSubnetAddDel{} }
2886 func (*GbpSubnetAddDel) GetMessageName() string { return "gbp_subnet_add_del" }
2887 func (*GbpSubnetAddDel) GetCrcString() string   { return "888aca35" }
2888 func (*GbpSubnetAddDel) GetMessageType() api.MessageType {
2889         return api.RequestMessage
2890 }
2891
2892 func (m *GbpSubnetAddDel) Size() (size int) {
2893         if m == nil {
2894                 return 0
2895         }
2896         size += 1      // m.IsAdd
2897         size += 4      // m.Subnet.RdID
2898         size += 4      // m.Subnet.SwIfIndex
2899         size += 2      // m.Subnet.Sclass
2900         size += 4      // m.Subnet.Type
2901         size += 4      // m.Subnet.Prefix.Address.Af
2902         size += 1 * 16 // m.Subnet.Prefix.Address.Un
2903         size += 1      // m.Subnet.Prefix.Len
2904         return size
2905 }
2906 func (m *GbpSubnetAddDel) Marshal(b []byte) ([]byte, error) {
2907         if b == nil {
2908                 b = make([]byte, m.Size())
2909         }
2910         buf := codec.NewBuffer(b)
2911         buf.EncodeBool(m.IsAdd)
2912         buf.EncodeUint32(m.Subnet.RdID)
2913         buf.EncodeUint32(uint32(m.Subnet.SwIfIndex))
2914         buf.EncodeUint16(m.Subnet.Sclass)
2915         buf.EncodeUint32(uint32(m.Subnet.Type))
2916         buf.EncodeUint32(uint32(m.Subnet.Prefix.Address.Af))
2917         buf.EncodeBytes(m.Subnet.Prefix.Address.Un.XXX_UnionData[:], 16)
2918         buf.EncodeUint8(m.Subnet.Prefix.Len)
2919         return buf.Bytes(), nil
2920 }
2921 func (m *GbpSubnetAddDel) Unmarshal(b []byte) error {
2922         buf := codec.NewBuffer(b)
2923         m.IsAdd = buf.DecodeBool()
2924         m.Subnet.RdID = buf.DecodeUint32()
2925         m.Subnet.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
2926         m.Subnet.Sclass = buf.DecodeUint16()
2927         m.Subnet.Type = GbpSubnetType(buf.DecodeUint32())
2928         m.Subnet.Prefix.Address.Af = AddressFamily(buf.DecodeUint32())
2929         copy(m.Subnet.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
2930         m.Subnet.Prefix.Len = buf.DecodeUint8()
2931         return nil
2932 }
2933
2934 // GbpSubnetAddDelReply defines message 'gbp_subnet_add_del_reply'.
2935 type GbpSubnetAddDelReply struct {
2936         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2937 }
2938
2939 func (m *GbpSubnetAddDelReply) Reset()               { *m = GbpSubnetAddDelReply{} }
2940 func (*GbpSubnetAddDelReply) GetMessageName() string { return "gbp_subnet_add_del_reply" }
2941 func (*GbpSubnetAddDelReply) GetCrcString() string   { return "e8d4e804" }
2942 func (*GbpSubnetAddDelReply) GetMessageType() api.MessageType {
2943         return api.ReplyMessage
2944 }
2945
2946 func (m *GbpSubnetAddDelReply) Size() (size int) {
2947         if m == nil {
2948                 return 0
2949         }
2950         size += 4 // m.Retval
2951         return size
2952 }
2953 func (m *GbpSubnetAddDelReply) Marshal(b []byte) ([]byte, error) {
2954         if b == nil {
2955                 b = make([]byte, m.Size())
2956         }
2957         buf := codec.NewBuffer(b)
2958         buf.EncodeInt32(m.Retval)
2959         return buf.Bytes(), nil
2960 }
2961 func (m *GbpSubnetAddDelReply) Unmarshal(b []byte) error {
2962         buf := codec.NewBuffer(b)
2963         m.Retval = buf.DecodeInt32()
2964         return nil
2965 }
2966
2967 // GbpSubnetDetails defines message 'gbp_subnet_details'.
2968 type GbpSubnetDetails struct {
2969         Subnet GbpSubnet `binapi:"gbp_subnet,name=subnet" json:"subnet,omitempty"`
2970 }
2971
2972 func (m *GbpSubnetDetails) Reset()               { *m = GbpSubnetDetails{} }
2973 func (*GbpSubnetDetails) GetMessageName() string { return "gbp_subnet_details" }
2974 func (*GbpSubnetDetails) GetCrcString() string   { return "4ed84156" }
2975 func (*GbpSubnetDetails) GetMessageType() api.MessageType {
2976         return api.ReplyMessage
2977 }
2978
2979 func (m *GbpSubnetDetails) Size() (size int) {
2980         if m == nil {
2981                 return 0
2982         }
2983         size += 4      // m.Subnet.RdID
2984         size += 4      // m.Subnet.SwIfIndex
2985         size += 2      // m.Subnet.Sclass
2986         size += 4      // m.Subnet.Type
2987         size += 4      // m.Subnet.Prefix.Address.Af
2988         size += 1 * 16 // m.Subnet.Prefix.Address.Un
2989         size += 1      // m.Subnet.Prefix.Len
2990         return size
2991 }
2992 func (m *GbpSubnetDetails) Marshal(b []byte) ([]byte, error) {
2993         if b == nil {
2994                 b = make([]byte, m.Size())
2995         }
2996         buf := codec.NewBuffer(b)
2997         buf.EncodeUint32(m.Subnet.RdID)
2998         buf.EncodeUint32(uint32(m.Subnet.SwIfIndex))
2999         buf.EncodeUint16(m.Subnet.Sclass)
3000         buf.EncodeUint32(uint32(m.Subnet.Type))
3001         buf.EncodeUint32(uint32(m.Subnet.Prefix.Address.Af))
3002         buf.EncodeBytes(m.Subnet.Prefix.Address.Un.XXX_UnionData[:], 16)
3003         buf.EncodeUint8(m.Subnet.Prefix.Len)
3004         return buf.Bytes(), nil
3005 }
3006 func (m *GbpSubnetDetails) Unmarshal(b []byte) error {
3007         buf := codec.NewBuffer(b)
3008         m.Subnet.RdID = buf.DecodeUint32()
3009         m.Subnet.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
3010         m.Subnet.Sclass = buf.DecodeUint16()
3011         m.Subnet.Type = GbpSubnetType(buf.DecodeUint32())
3012         m.Subnet.Prefix.Address.Af = AddressFamily(buf.DecodeUint32())
3013         copy(m.Subnet.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
3014         m.Subnet.Prefix.Len = buf.DecodeUint8()
3015         return nil
3016 }
3017
3018 // GbpSubnetDump defines message 'gbp_subnet_dump'.
3019 type GbpSubnetDump struct{}
3020
3021 func (m *GbpSubnetDump) Reset()               { *m = GbpSubnetDump{} }
3022 func (*GbpSubnetDump) GetMessageName() string { return "gbp_subnet_dump" }
3023 func (*GbpSubnetDump) GetCrcString() string   { return "51077d14" }
3024 func (*GbpSubnetDump) GetMessageType() api.MessageType {
3025         return api.RequestMessage
3026 }
3027
3028 func (m *GbpSubnetDump) Size() (size int) {
3029         if m == nil {
3030                 return 0
3031         }
3032         return size
3033 }
3034 func (m *GbpSubnetDump) Marshal(b []byte) ([]byte, error) {
3035         if b == nil {
3036                 b = make([]byte, m.Size())
3037         }
3038         buf := codec.NewBuffer(b)
3039         return buf.Bytes(), nil
3040 }
3041 func (m *GbpSubnetDump) Unmarshal(b []byte) error {
3042         return nil
3043 }
3044
3045 // GbpVxlanTunnelAdd defines message 'gbp_vxlan_tunnel_add'.
3046 type GbpVxlanTunnelAdd struct {
3047         Tunnel GbpVxlanTunnel `binapi:"gbp_vxlan_tunnel,name=tunnel" json:"tunnel,omitempty"`
3048 }
3049
3050 func (m *GbpVxlanTunnelAdd) Reset()               { *m = GbpVxlanTunnelAdd{} }
3051 func (*GbpVxlanTunnelAdd) GetMessageName() string { return "gbp_vxlan_tunnel_add" }
3052 func (*GbpVxlanTunnelAdd) GetCrcString() string   { return "3e070b35" }
3053 func (*GbpVxlanTunnelAdd) GetMessageType() api.MessageType {
3054         return api.RequestMessage
3055 }
3056
3057 func (m *GbpVxlanTunnelAdd) Size() (size int) {
3058         if m == nil {
3059                 return 0
3060         }
3061         size += 4     // m.Tunnel.Vni
3062         size += 4     // m.Tunnel.Mode
3063         size += 4     // m.Tunnel.BdRdID
3064         size += 1 * 4 // m.Tunnel.Src
3065         return size
3066 }
3067 func (m *GbpVxlanTunnelAdd) Marshal(b []byte) ([]byte, error) {
3068         if b == nil {
3069                 b = make([]byte, m.Size())
3070         }
3071         buf := codec.NewBuffer(b)
3072         buf.EncodeUint32(m.Tunnel.Vni)
3073         buf.EncodeUint32(uint32(m.Tunnel.Mode))
3074         buf.EncodeUint32(m.Tunnel.BdRdID)
3075         buf.EncodeBytes(m.Tunnel.Src[:], 4)
3076         return buf.Bytes(), nil
3077 }
3078 func (m *GbpVxlanTunnelAdd) Unmarshal(b []byte) error {
3079         buf := codec.NewBuffer(b)
3080         m.Tunnel.Vni = buf.DecodeUint32()
3081         m.Tunnel.Mode = GbpVxlanTunnelMode(buf.DecodeUint32())
3082         m.Tunnel.BdRdID = buf.DecodeUint32()
3083         copy(m.Tunnel.Src[:], buf.DecodeBytes(4))
3084         return nil
3085 }
3086
3087 // GbpVxlanTunnelAddReply defines message 'gbp_vxlan_tunnel_add_reply'.
3088 type GbpVxlanTunnelAddReply struct {
3089         Retval    int32          `binapi:"i32,name=retval" json:"retval,omitempty"`
3090         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
3091 }
3092
3093 func (m *GbpVxlanTunnelAddReply) Reset()               { *m = GbpVxlanTunnelAddReply{} }
3094 func (*GbpVxlanTunnelAddReply) GetMessageName() string { return "gbp_vxlan_tunnel_add_reply" }
3095 func (*GbpVxlanTunnelAddReply) GetCrcString() string   { return "5383d31f" }
3096 func (*GbpVxlanTunnelAddReply) GetMessageType() api.MessageType {
3097         return api.ReplyMessage
3098 }
3099
3100 func (m *GbpVxlanTunnelAddReply) Size() (size int) {
3101         if m == nil {
3102                 return 0
3103         }
3104         size += 4 // m.Retval
3105         size += 4 // m.SwIfIndex
3106         return size
3107 }
3108 func (m *GbpVxlanTunnelAddReply) Marshal(b []byte) ([]byte, error) {
3109         if b == nil {
3110                 b = make([]byte, m.Size())
3111         }
3112         buf := codec.NewBuffer(b)
3113         buf.EncodeInt32(m.Retval)
3114         buf.EncodeUint32(uint32(m.SwIfIndex))
3115         return buf.Bytes(), nil
3116 }
3117 func (m *GbpVxlanTunnelAddReply) Unmarshal(b []byte) error {
3118         buf := codec.NewBuffer(b)
3119         m.Retval = buf.DecodeInt32()
3120         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
3121         return nil
3122 }
3123
3124 // GbpVxlanTunnelDel defines message 'gbp_vxlan_tunnel_del'.
3125 type GbpVxlanTunnelDel struct {
3126         Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
3127 }
3128
3129 func (m *GbpVxlanTunnelDel) Reset()               { *m = GbpVxlanTunnelDel{} }
3130 func (*GbpVxlanTunnelDel) GetMessageName() string { return "gbp_vxlan_tunnel_del" }
3131 func (*GbpVxlanTunnelDel) GetCrcString() string   { return "8d1f2fe9" }
3132 func (*GbpVxlanTunnelDel) GetMessageType() api.MessageType {
3133         return api.RequestMessage
3134 }
3135
3136 func (m *GbpVxlanTunnelDel) Size() (size int) {
3137         if m == nil {
3138                 return 0
3139         }
3140         size += 4 // m.Vni
3141         return size
3142 }
3143 func (m *GbpVxlanTunnelDel) Marshal(b []byte) ([]byte, error) {
3144         if b == nil {
3145                 b = make([]byte, m.Size())
3146         }
3147         buf := codec.NewBuffer(b)
3148         buf.EncodeUint32(m.Vni)
3149         return buf.Bytes(), nil
3150 }
3151 func (m *GbpVxlanTunnelDel) Unmarshal(b []byte) error {
3152         buf := codec.NewBuffer(b)
3153         m.Vni = buf.DecodeUint32()
3154         return nil
3155 }
3156
3157 // GbpVxlanTunnelDelReply defines message 'gbp_vxlan_tunnel_del_reply'.
3158 type GbpVxlanTunnelDelReply struct {
3159         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
3160 }
3161
3162 func (m *GbpVxlanTunnelDelReply) Reset()               { *m = GbpVxlanTunnelDelReply{} }
3163 func (*GbpVxlanTunnelDelReply) GetMessageName() string { return "gbp_vxlan_tunnel_del_reply" }
3164 func (*GbpVxlanTunnelDelReply) GetCrcString() string   { return "e8d4e804" }
3165 func (*GbpVxlanTunnelDelReply) GetMessageType() api.MessageType {
3166         return api.ReplyMessage
3167 }
3168
3169 func (m *GbpVxlanTunnelDelReply) Size() (size int) {
3170         if m == nil {
3171                 return 0
3172         }
3173         size += 4 // m.Retval
3174         return size
3175 }
3176 func (m *GbpVxlanTunnelDelReply) Marshal(b []byte) ([]byte, error) {
3177         if b == nil {
3178                 b = make([]byte, m.Size())
3179         }
3180         buf := codec.NewBuffer(b)
3181         buf.EncodeInt32(m.Retval)
3182         return buf.Bytes(), nil
3183 }
3184 func (m *GbpVxlanTunnelDelReply) Unmarshal(b []byte) error {
3185         buf := codec.NewBuffer(b)
3186         m.Retval = buf.DecodeInt32()
3187         return nil
3188 }
3189
3190 // GbpVxlanTunnelDetails defines message 'gbp_vxlan_tunnel_details'.
3191 type GbpVxlanTunnelDetails struct {
3192         Tunnel GbpVxlanTunnel `binapi:"gbp_vxlan_tunnel,name=tunnel" json:"tunnel,omitempty"`
3193 }
3194
3195 func (m *GbpVxlanTunnelDetails) Reset()               { *m = GbpVxlanTunnelDetails{} }
3196 func (*GbpVxlanTunnelDetails) GetMessageName() string { return "gbp_vxlan_tunnel_details" }
3197 func (*GbpVxlanTunnelDetails) GetCrcString() string   { return "65c6c818" }
3198 func (*GbpVxlanTunnelDetails) GetMessageType() api.MessageType {
3199         return api.ReplyMessage
3200 }
3201
3202 func (m *GbpVxlanTunnelDetails) Size() (size int) {
3203         if m == nil {
3204                 return 0
3205         }
3206         size += 4     // m.Tunnel.Vni
3207         size += 4     // m.Tunnel.Mode
3208         size += 4     // m.Tunnel.BdRdID
3209         size += 1 * 4 // m.Tunnel.Src
3210         return size
3211 }
3212 func (m *GbpVxlanTunnelDetails) Marshal(b []byte) ([]byte, error) {
3213         if b == nil {
3214                 b = make([]byte, m.Size())
3215         }
3216         buf := codec.NewBuffer(b)
3217         buf.EncodeUint32(m.Tunnel.Vni)
3218         buf.EncodeUint32(uint32(m.Tunnel.Mode))
3219         buf.EncodeUint32(m.Tunnel.BdRdID)
3220         buf.EncodeBytes(m.Tunnel.Src[:], 4)
3221         return buf.Bytes(), nil
3222 }
3223 func (m *GbpVxlanTunnelDetails) Unmarshal(b []byte) error {
3224         buf := codec.NewBuffer(b)
3225         m.Tunnel.Vni = buf.DecodeUint32()
3226         m.Tunnel.Mode = GbpVxlanTunnelMode(buf.DecodeUint32())
3227         m.Tunnel.BdRdID = buf.DecodeUint32()
3228         copy(m.Tunnel.Src[:], buf.DecodeBytes(4))
3229         return nil
3230 }
3231
3232 // GbpVxlanTunnelDump defines message 'gbp_vxlan_tunnel_dump'.
3233 type GbpVxlanTunnelDump struct{}
3234
3235 func (m *GbpVxlanTunnelDump) Reset()               { *m = GbpVxlanTunnelDump{} }
3236 func (*GbpVxlanTunnelDump) GetMessageName() string { return "gbp_vxlan_tunnel_dump" }
3237 func (*GbpVxlanTunnelDump) GetCrcString() string   { return "51077d14" }
3238 func (*GbpVxlanTunnelDump) GetMessageType() api.MessageType {
3239         return api.RequestMessage
3240 }
3241
3242 func (m *GbpVxlanTunnelDump) Size() (size int) {
3243         if m == nil {
3244                 return 0
3245         }
3246         return size
3247 }
3248 func (m *GbpVxlanTunnelDump) Marshal(b []byte) ([]byte, error) {
3249         if b == nil {
3250                 b = make([]byte, m.Size())
3251         }
3252         buf := codec.NewBuffer(b)
3253         return buf.Bytes(), nil
3254 }
3255 func (m *GbpVxlanTunnelDump) Unmarshal(b []byte) error {
3256         return nil
3257 }
3258
3259 func init() { file_gbp_binapi_init() }
3260 func file_gbp_binapi_init() {
3261         api.RegisterMessage((*GbpBridgeDomainAdd)(nil), "gbp_bridge_domain_add_8454bfdf")
3262         api.RegisterMessage((*GbpBridgeDomainAddReply)(nil), "gbp_bridge_domain_add_reply_e8d4e804")
3263         api.RegisterMessage((*GbpBridgeDomainDel)(nil), "gbp_bridge_domain_del_c25fdce6")
3264         api.RegisterMessage((*GbpBridgeDomainDelReply)(nil), "gbp_bridge_domain_del_reply_e8d4e804")
3265         api.RegisterMessage((*GbpBridgeDomainDetails)(nil), "gbp_bridge_domain_details_2acd15f9")
3266         api.RegisterMessage((*GbpBridgeDomainDump)(nil), "gbp_bridge_domain_dump_51077d14")
3267         api.RegisterMessage((*GbpBridgeDomainDumpReply)(nil), "gbp_bridge_domain_dump_reply_e8d4e804")
3268         api.RegisterMessage((*GbpContractAddDel)(nil), "gbp_contract_add_del_553e275b")
3269         api.RegisterMessage((*GbpContractAddDelReply)(nil), "gbp_contract_add_del_reply_1992deab")
3270         api.RegisterMessage((*GbpContractDetails)(nil), "gbp_contract_details_2a18db6e")
3271         api.RegisterMessage((*GbpContractDump)(nil), "gbp_contract_dump_51077d14")
3272         api.RegisterMessage((*GbpEndpointAdd)(nil), "gbp_endpoint_add_9ce16d5a")
3273         api.RegisterMessage((*GbpEndpointAddReply)(nil), "gbp_endpoint_add_reply_1dd3ff3e")
3274         api.RegisterMessage((*GbpEndpointDel)(nil), "gbp_endpoint_del_b93cd566")
3275         api.RegisterMessage((*GbpEndpointDelReply)(nil), "gbp_endpoint_del_reply_e8d4e804")
3276         api.RegisterMessage((*GbpEndpointDetails)(nil), "gbp_endpoint_details_08aecb60")
3277         api.RegisterMessage((*GbpEndpointDump)(nil), "gbp_endpoint_dump_51077d14")
3278         api.RegisterMessage((*GbpEndpointGroupAdd)(nil), "gbp_endpoint_group_add_8e0f4054")
3279         api.RegisterMessage((*GbpEndpointGroupAddReply)(nil), "gbp_endpoint_group_add_reply_e8d4e804")
3280         api.RegisterMessage((*GbpEndpointGroupDel)(nil), "gbp_endpoint_group_del_3436b8b7")
3281         api.RegisterMessage((*GbpEndpointGroupDelReply)(nil), "gbp_endpoint_group_del_reply_e8d4e804")
3282         api.RegisterMessage((*GbpEndpointGroupDetails)(nil), "gbp_endpoint_group_details_8f38292c")
3283         api.RegisterMessage((*GbpEndpointGroupDump)(nil), "gbp_endpoint_group_dump_51077d14")
3284         api.RegisterMessage((*GbpExtItfAddDel)(nil), "gbp_ext_itf_add_del_12ed5700")
3285         api.RegisterMessage((*GbpExtItfAddDelReply)(nil), "gbp_ext_itf_add_del_reply_e8d4e804")
3286         api.RegisterMessage((*GbpExtItfDetails)(nil), "gbp_ext_itf_details_408a45c0")
3287         api.RegisterMessage((*GbpExtItfDump)(nil), "gbp_ext_itf_dump_51077d14")
3288         api.RegisterMessage((*GbpRecircAddDel)(nil), "gbp_recirc_add_del_718c69c3")
3289         api.RegisterMessage((*GbpRecircAddDelReply)(nil), "gbp_recirc_add_del_reply_e8d4e804")
3290         api.RegisterMessage((*GbpRecircDetails)(nil), "gbp_recirc_details_66ecc42e")
3291         api.RegisterMessage((*GbpRecircDump)(nil), "gbp_recirc_dump_51077d14")
3292         api.RegisterMessage((*GbpRouteDomainAdd)(nil), "gbp_route_domain_add_2d0afe38")
3293         api.RegisterMessage((*GbpRouteDomainAddReply)(nil), "gbp_route_domain_add_reply_e8d4e804")
3294         api.RegisterMessage((*GbpRouteDomainDel)(nil), "gbp_route_domain_del_bee4edcd")
3295         api.RegisterMessage((*GbpRouteDomainDelReply)(nil), "gbp_route_domain_del_reply_e8d4e804")
3296         api.RegisterMessage((*GbpRouteDomainDetails)(nil), "gbp_route_domain_details_8ab11375")
3297         api.RegisterMessage((*GbpRouteDomainDump)(nil), "gbp_route_domain_dump_51077d14")
3298         api.RegisterMessage((*GbpRouteDomainDumpReply)(nil), "gbp_route_domain_dump_reply_e8d4e804")
3299         api.RegisterMessage((*GbpSubnetAddDel)(nil), "gbp_subnet_add_del_888aca35")
3300         api.RegisterMessage((*GbpSubnetAddDelReply)(nil), "gbp_subnet_add_del_reply_e8d4e804")
3301         api.RegisterMessage((*GbpSubnetDetails)(nil), "gbp_subnet_details_4ed84156")
3302         api.RegisterMessage((*GbpSubnetDump)(nil), "gbp_subnet_dump_51077d14")
3303         api.RegisterMessage((*GbpVxlanTunnelAdd)(nil), "gbp_vxlan_tunnel_add_3e070b35")
3304         api.RegisterMessage((*GbpVxlanTunnelAddReply)(nil), "gbp_vxlan_tunnel_add_reply_5383d31f")
3305         api.RegisterMessage((*GbpVxlanTunnelDel)(nil), "gbp_vxlan_tunnel_del_8d1f2fe9")
3306         api.RegisterMessage((*GbpVxlanTunnelDelReply)(nil), "gbp_vxlan_tunnel_del_reply_e8d4e804")
3307         api.RegisterMessage((*GbpVxlanTunnelDetails)(nil), "gbp_vxlan_tunnel_details_65c6c818")
3308         api.RegisterMessage((*GbpVxlanTunnelDump)(nil), "gbp_vxlan_tunnel_dump_51077d14")
3309 }
3310
3311 // Messages returns list of all messages in this module.
3312 func AllMessages() []api.Message {
3313         return []api.Message{
3314                 (*GbpBridgeDomainAdd)(nil),
3315                 (*GbpBridgeDomainAddReply)(nil),
3316                 (*GbpBridgeDomainDel)(nil),
3317                 (*GbpBridgeDomainDelReply)(nil),
3318                 (*GbpBridgeDomainDetails)(nil),
3319                 (*GbpBridgeDomainDump)(nil),
3320                 (*GbpBridgeDomainDumpReply)(nil),
3321                 (*GbpContractAddDel)(nil),
3322                 (*GbpContractAddDelReply)(nil),
3323                 (*GbpContractDetails)(nil),
3324                 (*GbpContractDump)(nil),
3325                 (*GbpEndpointAdd)(nil),
3326                 (*GbpEndpointAddReply)(nil),
3327                 (*GbpEndpointDel)(nil),
3328                 (*GbpEndpointDelReply)(nil),
3329                 (*GbpEndpointDetails)(nil),
3330                 (*GbpEndpointDump)(nil),
3331                 (*GbpEndpointGroupAdd)(nil),
3332                 (*GbpEndpointGroupAddReply)(nil),
3333                 (*GbpEndpointGroupDel)(nil),
3334                 (*GbpEndpointGroupDelReply)(nil),
3335                 (*GbpEndpointGroupDetails)(nil),
3336                 (*GbpEndpointGroupDump)(nil),
3337                 (*GbpExtItfAddDel)(nil),
3338                 (*GbpExtItfAddDelReply)(nil),
3339                 (*GbpExtItfDetails)(nil),
3340                 (*GbpExtItfDump)(nil),
3341                 (*GbpRecircAddDel)(nil),
3342                 (*GbpRecircAddDelReply)(nil),
3343                 (*GbpRecircDetails)(nil),
3344                 (*GbpRecircDump)(nil),
3345                 (*GbpRouteDomainAdd)(nil),
3346                 (*GbpRouteDomainAddReply)(nil),
3347                 (*GbpRouteDomainDel)(nil),
3348                 (*GbpRouteDomainDelReply)(nil),
3349                 (*GbpRouteDomainDetails)(nil),
3350                 (*GbpRouteDomainDump)(nil),
3351                 (*GbpRouteDomainDumpReply)(nil),
3352                 (*GbpSubnetAddDel)(nil),
3353                 (*GbpSubnetAddDelReply)(nil),
3354                 (*GbpSubnetDetails)(nil),
3355                 (*GbpSubnetDump)(nil),
3356                 (*GbpVxlanTunnelAdd)(nil),
3357                 (*GbpVxlanTunnelAddReply)(nil),
3358                 (*GbpVxlanTunnelDel)(nil),
3359                 (*GbpVxlanTunnelDelReply)(nil),
3360                 (*GbpVxlanTunnelDetails)(nil),
3361                 (*GbpVxlanTunnelDump)(nil),
3362         }
3363 }