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