348a150693a20c6dcdb416fcaf2a399a053033b2
[govpp.git] / internal / testbinapi / binapi2001 / lb / lb.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.4.0-dev
4 //  VPP:              20.01
5 // source: .vppapi/plugins/lb.api.json
6
7 // Package lb contains generated bindings for API file lb.api.
8 //
9 // Contents:
10 //   6 aliases
11 //  15 enums
12 //   7 structs
13 //   1 union
14 //  16 messages
15 //
16 package lb
17
18 import (
19         "fmt"
20         api "git.fd.io/govpp.git/api"
21         codec "git.fd.io/govpp.git/codec"
22         "net"
23         "strconv"
24         "strings"
25 )
26
27 // This is a compile-time assertion to ensure that this generated file
28 // is compatible with the GoVPP api package it is being compiled against.
29 // A compilation error at this line likely means your copy of the
30 // GoVPP api package needs to be updated.
31 const _ = api.GoVppAPIPackageIsVersion2
32
33 const (
34         APIFile    = "lb"
35         APIVersion = "1.0.0"
36         VersionCrc = 0x76c36b4c
37 )
38
39 // AddressFamily defines enum 'address_family'.
40 type AddressFamily uint32
41
42 const (
43         ADDRESS_IP4 AddressFamily = 0
44         ADDRESS_IP6 AddressFamily = 1
45 )
46
47 var (
48         AddressFamily_name = map[uint32]string{
49                 0: "ADDRESS_IP4",
50                 1: "ADDRESS_IP6",
51         }
52         AddressFamily_value = map[string]uint32{
53                 "ADDRESS_IP4": 0,
54                 "ADDRESS_IP6": 1,
55         }
56 )
57
58 func (x AddressFamily) String() string {
59         s, ok := AddressFamily_name[uint32(x)]
60         if ok {
61                 return s
62         }
63         return "AddressFamily(" + strconv.Itoa(int(x)) + ")"
64 }
65
66 // IfStatusFlags defines enum 'if_status_flags'.
67 type IfStatusFlags uint32
68
69 const (
70         IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
71         IF_STATUS_API_FLAG_LINK_UP  IfStatusFlags = 2
72 )
73
74 var (
75         IfStatusFlags_name = map[uint32]string{
76                 1: "IF_STATUS_API_FLAG_ADMIN_UP",
77                 2: "IF_STATUS_API_FLAG_LINK_UP",
78         }
79         IfStatusFlags_value = map[string]uint32{
80                 "IF_STATUS_API_FLAG_ADMIN_UP": 1,
81                 "IF_STATUS_API_FLAG_LINK_UP":  2,
82         }
83 )
84
85 func (x IfStatusFlags) String() string {
86         s, ok := IfStatusFlags_name[uint32(x)]
87         if ok {
88                 return s
89         }
90         str := func(n uint32) string {
91                 s, ok := IfStatusFlags_name[uint32(n)]
92                 if ok {
93                         return s
94                 }
95                 return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
96         }
97         for i := uint32(0); i <= 32; i++ {
98                 val := uint32(x)
99                 if val&(1<<i) != 0 {
100                         if s != "" {
101                                 s += "|"
102                         }
103                         s += str(1 << i)
104                 }
105         }
106         if s == "" {
107                 return str(uint32(x))
108         }
109         return s
110 }
111
112 // IfType defines enum 'if_type'.
113 type IfType uint32
114
115 const (
116         IF_API_TYPE_HARDWARE IfType = 1
117         IF_API_TYPE_SUB      IfType = 2
118         IF_API_TYPE_P2P      IfType = 3
119         IF_API_TYPE_PIPE     IfType = 4
120 )
121
122 var (
123         IfType_name = map[uint32]string{
124                 1: "IF_API_TYPE_HARDWARE",
125                 2: "IF_API_TYPE_SUB",
126                 3: "IF_API_TYPE_P2P",
127                 4: "IF_API_TYPE_PIPE",
128         }
129         IfType_value = map[string]uint32{
130                 "IF_API_TYPE_HARDWARE": 1,
131                 "IF_API_TYPE_SUB":      2,
132                 "IF_API_TYPE_P2P":      3,
133                 "IF_API_TYPE_PIPE":     4,
134         }
135 )
136
137 func (x IfType) String() string {
138         s, ok := IfType_name[uint32(x)]
139         if ok {
140                 return s
141         }
142         return "IfType(" + strconv.Itoa(int(x)) + ")"
143 }
144
145 // IPDscp defines enum 'ip_dscp'.
146 type IPDscp uint8
147
148 const (
149         IP_API_DSCP_CS0  IPDscp = 0
150         IP_API_DSCP_CS1  IPDscp = 8
151         IP_API_DSCP_AF11 IPDscp = 10
152         IP_API_DSCP_AF12 IPDscp = 12
153         IP_API_DSCP_AF13 IPDscp = 14
154         IP_API_DSCP_CS2  IPDscp = 16
155         IP_API_DSCP_AF21 IPDscp = 18
156         IP_API_DSCP_AF22 IPDscp = 20
157         IP_API_DSCP_AF23 IPDscp = 22
158         IP_API_DSCP_CS3  IPDscp = 24
159         IP_API_DSCP_AF31 IPDscp = 26
160         IP_API_DSCP_AF32 IPDscp = 28
161         IP_API_DSCP_AF33 IPDscp = 30
162         IP_API_DSCP_CS4  IPDscp = 32
163         IP_API_DSCP_AF41 IPDscp = 34
164         IP_API_DSCP_AF42 IPDscp = 36
165         IP_API_DSCP_AF43 IPDscp = 38
166         IP_API_DSCP_CS5  IPDscp = 40
167         IP_API_DSCP_EF   IPDscp = 46
168         IP_API_DSCP_CS6  IPDscp = 48
169         IP_API_DSCP_CS7  IPDscp = 50
170 )
171
172 var (
173         IPDscp_name = map[uint8]string{
174                 0:  "IP_API_DSCP_CS0",
175                 8:  "IP_API_DSCP_CS1",
176                 10: "IP_API_DSCP_AF11",
177                 12: "IP_API_DSCP_AF12",
178                 14: "IP_API_DSCP_AF13",
179                 16: "IP_API_DSCP_CS2",
180                 18: "IP_API_DSCP_AF21",
181                 20: "IP_API_DSCP_AF22",
182                 22: "IP_API_DSCP_AF23",
183                 24: "IP_API_DSCP_CS3",
184                 26: "IP_API_DSCP_AF31",
185                 28: "IP_API_DSCP_AF32",
186                 30: "IP_API_DSCP_AF33",
187                 32: "IP_API_DSCP_CS4",
188                 34: "IP_API_DSCP_AF41",
189                 36: "IP_API_DSCP_AF42",
190                 38: "IP_API_DSCP_AF43",
191                 40: "IP_API_DSCP_CS5",
192                 46: "IP_API_DSCP_EF",
193                 48: "IP_API_DSCP_CS6",
194                 50: "IP_API_DSCP_CS7",
195         }
196         IPDscp_value = map[string]uint8{
197                 "IP_API_DSCP_CS0":  0,
198                 "IP_API_DSCP_CS1":  8,
199                 "IP_API_DSCP_AF11": 10,
200                 "IP_API_DSCP_AF12": 12,
201                 "IP_API_DSCP_AF13": 14,
202                 "IP_API_DSCP_CS2":  16,
203                 "IP_API_DSCP_AF21": 18,
204                 "IP_API_DSCP_AF22": 20,
205                 "IP_API_DSCP_AF23": 22,
206                 "IP_API_DSCP_CS3":  24,
207                 "IP_API_DSCP_AF31": 26,
208                 "IP_API_DSCP_AF32": 28,
209                 "IP_API_DSCP_AF33": 30,
210                 "IP_API_DSCP_CS4":  32,
211                 "IP_API_DSCP_AF41": 34,
212                 "IP_API_DSCP_AF42": 36,
213                 "IP_API_DSCP_AF43": 38,
214                 "IP_API_DSCP_CS5":  40,
215                 "IP_API_DSCP_EF":   46,
216                 "IP_API_DSCP_CS6":  48,
217                 "IP_API_DSCP_CS7":  50,
218         }
219 )
220
221 func (x IPDscp) String() string {
222         s, ok := IPDscp_name[uint8(x)]
223         if ok {
224                 return s
225         }
226         return "IPDscp(" + strconv.Itoa(int(x)) + ")"
227 }
228
229 // IPEcn defines enum 'ip_ecn'.
230 type IPEcn uint8
231
232 const (
233         IP_API_ECN_NONE IPEcn = 0
234         IP_API_ECN_ECT0 IPEcn = 1
235         IP_API_ECN_ECT1 IPEcn = 2
236         IP_API_ECN_CE   IPEcn = 3
237 )
238
239 var (
240         IPEcn_name = map[uint8]string{
241                 0: "IP_API_ECN_NONE",
242                 1: "IP_API_ECN_ECT0",
243                 2: "IP_API_ECN_ECT1",
244                 3: "IP_API_ECN_CE",
245         }
246         IPEcn_value = map[string]uint8{
247                 "IP_API_ECN_NONE": 0,
248                 "IP_API_ECN_ECT0": 1,
249                 "IP_API_ECN_ECT1": 2,
250                 "IP_API_ECN_CE":   3,
251         }
252 )
253
254 func (x IPEcn) String() string {
255         s, ok := IPEcn_name[uint8(x)]
256         if ok {
257                 return s
258         }
259         return "IPEcn(" + strconv.Itoa(int(x)) + ")"
260 }
261
262 // IPProto defines enum 'ip_proto'.
263 type IPProto uint32
264
265 const (
266         IP_API_PROTO_HOPOPT   IPProto = 0
267         IP_API_PROTO_ICMP     IPProto = 1
268         IP_API_PROTO_IGMP     IPProto = 2
269         IP_API_PROTO_TCP      IPProto = 6
270         IP_API_PROTO_UDP      IPProto = 17
271         IP_API_PROTO_GRE      IPProto = 47
272         IP_API_PROTO_AH       IPProto = 50
273         IP_API_PROTO_ESP      IPProto = 51
274         IP_API_PROTO_EIGRP    IPProto = 88
275         IP_API_PROTO_OSPF     IPProto = 89
276         IP_API_PROTO_SCTP     IPProto = 132
277         IP_API_PROTO_RESERVED IPProto = 255
278 )
279
280 var (
281         IPProto_name = map[uint32]string{
282                 0:   "IP_API_PROTO_HOPOPT",
283                 1:   "IP_API_PROTO_ICMP",
284                 2:   "IP_API_PROTO_IGMP",
285                 6:   "IP_API_PROTO_TCP",
286                 17:  "IP_API_PROTO_UDP",
287                 47:  "IP_API_PROTO_GRE",
288                 50:  "IP_API_PROTO_AH",
289                 51:  "IP_API_PROTO_ESP",
290                 88:  "IP_API_PROTO_EIGRP",
291                 89:  "IP_API_PROTO_OSPF",
292                 132: "IP_API_PROTO_SCTP",
293                 255: "IP_API_PROTO_RESERVED",
294         }
295         IPProto_value = map[string]uint32{
296                 "IP_API_PROTO_HOPOPT":   0,
297                 "IP_API_PROTO_ICMP":     1,
298                 "IP_API_PROTO_IGMP":     2,
299                 "IP_API_PROTO_TCP":      6,
300                 "IP_API_PROTO_UDP":      17,
301                 "IP_API_PROTO_GRE":      47,
302                 "IP_API_PROTO_AH":       50,
303                 "IP_API_PROTO_ESP":      51,
304                 "IP_API_PROTO_EIGRP":    88,
305                 "IP_API_PROTO_OSPF":     89,
306                 "IP_API_PROTO_SCTP":     132,
307                 "IP_API_PROTO_RESERVED": 255,
308         }
309 )
310
311 func (x IPProto) String() string {
312         s, ok := IPProto_name[uint32(x)]
313         if ok {
314                 return s
315         }
316         return "IPProto(" + strconv.Itoa(int(x)) + ")"
317 }
318
319 // LbEncapType defines enum 'lb_encap_type'.
320 type LbEncapType uint32
321
322 const (
323         LB_API_ENCAP_TYPE_GRE4  LbEncapType = 0
324         LB_API_ENCAP_TYPE_GRE6  LbEncapType = 1
325         LB_API_ENCAP_TYPE_L3DSR LbEncapType = 2
326         LB_API_ENCAP_TYPE_NAT4  LbEncapType = 3
327         LB_API_ENCAP_TYPE_NAT6  LbEncapType = 4
328         LB_API_ENCAP_N_TYPES    LbEncapType = 5
329 )
330
331 var (
332         LbEncapType_name = map[uint32]string{
333                 0: "LB_API_ENCAP_TYPE_GRE4",
334                 1: "LB_API_ENCAP_TYPE_GRE6",
335                 2: "LB_API_ENCAP_TYPE_L3DSR",
336                 3: "LB_API_ENCAP_TYPE_NAT4",
337                 4: "LB_API_ENCAP_TYPE_NAT6",
338                 5: "LB_API_ENCAP_N_TYPES",
339         }
340         LbEncapType_value = map[string]uint32{
341                 "LB_API_ENCAP_TYPE_GRE4":  0,
342                 "LB_API_ENCAP_TYPE_GRE6":  1,
343                 "LB_API_ENCAP_TYPE_L3DSR": 2,
344                 "LB_API_ENCAP_TYPE_NAT4":  3,
345                 "LB_API_ENCAP_TYPE_NAT6":  4,
346                 "LB_API_ENCAP_N_TYPES":    5,
347         }
348 )
349
350 func (x LbEncapType) String() string {
351         s, ok := LbEncapType_name[uint32(x)]
352         if ok {
353                 return s
354         }
355         return "LbEncapType(" + strconv.Itoa(int(x)) + ")"
356 }
357
358 // LbLkpTypeT defines enum 'lb_lkp_type_t'.
359 type LbLkpTypeT uint32
360
361 const (
362         LB_API_LKP_SAME_IP_PORT LbLkpTypeT = 0
363         LB_API_LKP_DIFF_IP_PORT LbLkpTypeT = 1
364         LB_API_LKP_ALL_PORT_IP  LbLkpTypeT = 2
365         LB_API_LKP_N_TYPES      LbLkpTypeT = 3
366 )
367
368 var (
369         LbLkpTypeT_name = map[uint32]string{
370                 0: "LB_API_LKP_SAME_IP_PORT",
371                 1: "LB_API_LKP_DIFF_IP_PORT",
372                 2: "LB_API_LKP_ALL_PORT_IP",
373                 3: "LB_API_LKP_N_TYPES",
374         }
375         LbLkpTypeT_value = map[string]uint32{
376                 "LB_API_LKP_SAME_IP_PORT": 0,
377                 "LB_API_LKP_DIFF_IP_PORT": 1,
378                 "LB_API_LKP_ALL_PORT_IP":  2,
379                 "LB_API_LKP_N_TYPES":      3,
380         }
381 )
382
383 func (x LbLkpTypeT) String() string {
384         s, ok := LbLkpTypeT_name[uint32(x)]
385         if ok {
386                 return s
387         }
388         return "LbLkpTypeT(" + strconv.Itoa(int(x)) + ")"
389 }
390
391 // LbNatProtocol defines enum 'lb_nat_protocol'.
392 type LbNatProtocol uint32
393
394 const (
395         LB_API_NAT_PROTOCOL_UDP LbNatProtocol = 6
396         LB_API_NAT_PROTOCOL_TCP LbNatProtocol = 23
397         LB_API_NAT_PROTOCOL_ANY LbNatProtocol = 4294967295
398 )
399
400 var (
401         LbNatProtocol_name = map[uint32]string{
402                 6:          "LB_API_NAT_PROTOCOL_UDP",
403                 23:         "LB_API_NAT_PROTOCOL_TCP",
404                 4294967295: "LB_API_NAT_PROTOCOL_ANY",
405         }
406         LbNatProtocol_value = map[string]uint32{
407                 "LB_API_NAT_PROTOCOL_UDP": 6,
408                 "LB_API_NAT_PROTOCOL_TCP": 23,
409                 "LB_API_NAT_PROTOCOL_ANY": 4294967295,
410         }
411 )
412
413 func (x LbNatProtocol) String() string {
414         s, ok := LbNatProtocol_name[uint32(x)]
415         if ok {
416                 return s
417         }
418         return "LbNatProtocol(" + strconv.Itoa(int(x)) + ")"
419 }
420
421 // LbSrvType defines enum 'lb_srv_type'.
422 type LbSrvType uint32
423
424 const (
425         LB_API_SRV_TYPE_CLUSTERIP LbSrvType = 0
426         LB_API_SRV_TYPE_NODEPORT  LbSrvType = 1
427         LB_API_SRV_N_TYPES        LbSrvType = 2
428 )
429
430 var (
431         LbSrvType_name = map[uint32]string{
432                 0: "LB_API_SRV_TYPE_CLUSTERIP",
433                 1: "LB_API_SRV_TYPE_NODEPORT",
434                 2: "LB_API_SRV_N_TYPES",
435         }
436         LbSrvType_value = map[string]uint32{
437                 "LB_API_SRV_TYPE_CLUSTERIP": 0,
438                 "LB_API_SRV_TYPE_NODEPORT":  1,
439                 "LB_API_SRV_N_TYPES":        2,
440         }
441 )
442
443 func (x LbSrvType) String() string {
444         s, ok := LbSrvType_name[uint32(x)]
445         if ok {
446                 return s
447         }
448         return "LbSrvType(" + strconv.Itoa(int(x)) + ")"
449 }
450
451 // LbVipType defines enum 'lb_vip_type'.
452 type LbVipType uint32
453
454 const (
455         LB_API_VIP_TYPE_IP6_GRE6  LbVipType = 0
456         LB_API_VIP_TYPE_IP6_GRE4  LbVipType = 1
457         LB_API_VIP_TYPE_IP4_GRE6  LbVipType = 2
458         LB_API_VIP_TYPE_IP4_GRE4  LbVipType = 3
459         LB_API_VIP_TYPE_IP4_L3DSR LbVipType = 4
460         LB_API_VIP_TYPE_IP4_NAT4  LbVipType = 5
461         LB_API_VIP_TYPE_IP6_NAT6  LbVipType = 6
462         LB_API_VIP_N_TYPES        LbVipType = 7
463 )
464
465 var (
466         LbVipType_name = map[uint32]string{
467                 0: "LB_API_VIP_TYPE_IP6_GRE6",
468                 1: "LB_API_VIP_TYPE_IP6_GRE4",
469                 2: "LB_API_VIP_TYPE_IP4_GRE6",
470                 3: "LB_API_VIP_TYPE_IP4_GRE4",
471                 4: "LB_API_VIP_TYPE_IP4_L3DSR",
472                 5: "LB_API_VIP_TYPE_IP4_NAT4",
473                 6: "LB_API_VIP_TYPE_IP6_NAT6",
474                 7: "LB_API_VIP_N_TYPES",
475         }
476         LbVipType_value = map[string]uint32{
477                 "LB_API_VIP_TYPE_IP6_GRE6":  0,
478                 "LB_API_VIP_TYPE_IP6_GRE4":  1,
479                 "LB_API_VIP_TYPE_IP4_GRE6":  2,
480                 "LB_API_VIP_TYPE_IP4_GRE4":  3,
481                 "LB_API_VIP_TYPE_IP4_L3DSR": 4,
482                 "LB_API_VIP_TYPE_IP4_NAT4":  5,
483                 "LB_API_VIP_TYPE_IP6_NAT6":  6,
484                 "LB_API_VIP_N_TYPES":        7,
485         }
486 )
487
488 func (x LbVipType) String() string {
489         s, ok := LbVipType_name[uint32(x)]
490         if ok {
491                 return s
492         }
493         return "LbVipType(" + strconv.Itoa(int(x)) + ")"
494 }
495
496 // LinkDuplex defines enum 'link_duplex'.
497 type LinkDuplex uint32
498
499 const (
500         LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
501         LINK_DUPLEX_API_HALF    LinkDuplex = 1
502         LINK_DUPLEX_API_FULL    LinkDuplex = 2
503 )
504
505 var (
506         LinkDuplex_name = map[uint32]string{
507                 0: "LINK_DUPLEX_API_UNKNOWN",
508                 1: "LINK_DUPLEX_API_HALF",
509                 2: "LINK_DUPLEX_API_FULL",
510         }
511         LinkDuplex_value = map[string]uint32{
512                 "LINK_DUPLEX_API_UNKNOWN": 0,
513                 "LINK_DUPLEX_API_HALF":    1,
514                 "LINK_DUPLEX_API_FULL":    2,
515         }
516 )
517
518 func (x LinkDuplex) String() string {
519         s, ok := LinkDuplex_name[uint32(x)]
520         if ok {
521                 return s
522         }
523         return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
524 }
525
526 // MtuProto defines enum 'mtu_proto'.
527 type MtuProto uint32
528
529 const (
530         MTU_PROTO_API_L3   MtuProto = 1
531         MTU_PROTO_API_IP4  MtuProto = 2
532         MTU_PROTO_API_IP6  MtuProto = 3
533         MTU_PROTO_API_MPLS MtuProto = 4
534         MTU_PROTO_API_N    MtuProto = 5
535 )
536
537 var (
538         MtuProto_name = map[uint32]string{
539                 1: "MTU_PROTO_API_L3",
540                 2: "MTU_PROTO_API_IP4",
541                 3: "MTU_PROTO_API_IP6",
542                 4: "MTU_PROTO_API_MPLS",
543                 5: "MTU_PROTO_API_N",
544         }
545         MtuProto_value = map[string]uint32{
546                 "MTU_PROTO_API_L3":   1,
547                 "MTU_PROTO_API_IP4":  2,
548                 "MTU_PROTO_API_IP6":  3,
549                 "MTU_PROTO_API_MPLS": 4,
550                 "MTU_PROTO_API_N":    5,
551         }
552 )
553
554 func (x MtuProto) String() string {
555         s, ok := MtuProto_name[uint32(x)]
556         if ok {
557                 return s
558         }
559         return "MtuProto(" + strconv.Itoa(int(x)) + ")"
560 }
561
562 // RxMode defines enum 'rx_mode'.
563 type RxMode uint32
564
565 const (
566         RX_MODE_API_UNKNOWN   RxMode = 0
567         RX_MODE_API_POLLING   RxMode = 1
568         RX_MODE_API_INTERRUPT RxMode = 2
569         RX_MODE_API_ADAPTIVE  RxMode = 3
570         RX_MODE_API_DEFAULT   RxMode = 4
571 )
572
573 var (
574         RxMode_name = map[uint32]string{
575                 0: "RX_MODE_API_UNKNOWN",
576                 1: "RX_MODE_API_POLLING",
577                 2: "RX_MODE_API_INTERRUPT",
578                 3: "RX_MODE_API_ADAPTIVE",
579                 4: "RX_MODE_API_DEFAULT",
580         }
581         RxMode_value = map[string]uint32{
582                 "RX_MODE_API_UNKNOWN":   0,
583                 "RX_MODE_API_POLLING":   1,
584                 "RX_MODE_API_INTERRUPT": 2,
585                 "RX_MODE_API_ADAPTIVE":  3,
586                 "RX_MODE_API_DEFAULT":   4,
587         }
588 )
589
590 func (x RxMode) String() string {
591         s, ok := RxMode_name[uint32(x)]
592         if ok {
593                 return s
594         }
595         return "RxMode(" + strconv.Itoa(int(x)) + ")"
596 }
597
598 // SubIfFlags defines enum 'sub_if_flags'.
599 type SubIfFlags uint32
600
601 const (
602         SUB_IF_API_FLAG_NO_TAGS           SubIfFlags = 1
603         SUB_IF_API_FLAG_ONE_TAG           SubIfFlags = 2
604         SUB_IF_API_FLAG_TWO_TAGS          SubIfFlags = 4
605         SUB_IF_API_FLAG_DOT1AD            SubIfFlags = 8
606         SUB_IF_API_FLAG_EXACT_MATCH       SubIfFlags = 16
607         SUB_IF_API_FLAG_DEFAULT           SubIfFlags = 32
608         SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
609         SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
610         SUB_IF_API_FLAG_MASK_VNET         SubIfFlags = 254
611         SUB_IF_API_FLAG_DOT1AH            SubIfFlags = 256
612 )
613
614 var (
615         SubIfFlags_name = map[uint32]string{
616                 1:   "SUB_IF_API_FLAG_NO_TAGS",
617                 2:   "SUB_IF_API_FLAG_ONE_TAG",
618                 4:   "SUB_IF_API_FLAG_TWO_TAGS",
619                 8:   "SUB_IF_API_FLAG_DOT1AD",
620                 16:  "SUB_IF_API_FLAG_EXACT_MATCH",
621                 32:  "SUB_IF_API_FLAG_DEFAULT",
622                 64:  "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
623                 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
624                 254: "SUB_IF_API_FLAG_MASK_VNET",
625                 256: "SUB_IF_API_FLAG_DOT1AH",
626         }
627         SubIfFlags_value = map[string]uint32{
628                 "SUB_IF_API_FLAG_NO_TAGS":           1,
629                 "SUB_IF_API_FLAG_ONE_TAG":           2,
630                 "SUB_IF_API_FLAG_TWO_TAGS":          4,
631                 "SUB_IF_API_FLAG_DOT1AD":            8,
632                 "SUB_IF_API_FLAG_EXACT_MATCH":       16,
633                 "SUB_IF_API_FLAG_DEFAULT":           32,
634                 "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY": 64,
635                 "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY": 128,
636                 "SUB_IF_API_FLAG_MASK_VNET":         254,
637                 "SUB_IF_API_FLAG_DOT1AH":            256,
638         }
639 )
640
641 func (x SubIfFlags) String() string {
642         s, ok := SubIfFlags_name[uint32(x)]
643         if ok {
644                 return s
645         }
646         str := func(n uint32) string {
647                 s, ok := SubIfFlags_name[uint32(n)]
648                 if ok {
649                         return s
650                 }
651                 return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
652         }
653         for i := uint32(0); i <= 32; i++ {
654                 val := uint32(x)
655                 if val&(1<<i) != 0 {
656                         if s != "" {
657                                 s += "|"
658                         }
659                         s += str(1 << i)
660                 }
661         }
662         if s == "" {
663                 return str(uint32(x))
664         }
665         return s
666 }
667
668 // AddressWithPrefix defines alias 'address_with_prefix'.
669 type AddressWithPrefix Prefix
670
671 func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
672         prefix, err := ParsePrefix(s)
673         if err != nil {
674                 return AddressWithPrefix{}, err
675         }
676         return AddressWithPrefix(prefix), nil
677 }
678 func (x AddressWithPrefix) String() string {
679         return Prefix(x).String()
680 }
681 func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
682         return []byte(x.String()), nil
683 }
684 func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
685         prefix, err := ParseAddressWithPrefix(string(text))
686         if err != nil {
687                 return err
688         }
689         *x = prefix
690         return nil
691 }
692
693 // InterfaceIndex defines alias 'interface_index'.
694 type InterfaceIndex uint32
695
696 // IP4Address defines alias 'ip4_address'.
697 type IP4Address [4]uint8
698
699 func ParseIP4Address(s string) (IP4Address, error) {
700         ip := net.ParseIP(s).To4()
701         if ip == nil {
702                 return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
703         }
704         var ipaddr IP4Address
705         copy(ipaddr[:], ip.To4())
706         return ipaddr, nil
707 }
708
709 func (x IP4Address) ToIP() net.IP {
710         return net.IP(x[:]).To4()
711 }
712 func (x IP4Address) String() string {
713         return x.ToIP().String()
714 }
715 func (x *IP4Address) MarshalText() ([]byte, error) {
716         return []byte(x.String()), nil
717 }
718 func (x *IP4Address) UnmarshalText(text []byte) error {
719         ipaddr, err := ParseIP4Address(string(text))
720         if err != nil {
721                 return err
722         }
723         *x = ipaddr
724         return nil
725 }
726
727 // IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
728 type IP4AddressWithPrefix IP4Prefix
729
730 // IP6Address defines alias 'ip6_address'.
731 type IP6Address [16]uint8
732
733 func ParseIP6Address(s string) (IP6Address, error) {
734         ip := net.ParseIP(s).To16()
735         if ip == nil {
736                 return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
737         }
738         var ipaddr IP6Address
739         copy(ipaddr[:], ip.To16())
740         return ipaddr, nil
741 }
742
743 func (x IP6Address) ToIP() net.IP {
744         return net.IP(x[:]).To16()
745 }
746 func (x IP6Address) String() string {
747         return x.ToIP().String()
748 }
749 func (x *IP6Address) MarshalText() ([]byte, error) {
750         return []byte(x.String()), nil
751 }
752 func (x *IP6Address) UnmarshalText(text []byte) error {
753         ipaddr, err := ParseIP6Address(string(text))
754         if err != nil {
755                 return err
756         }
757         *x = ipaddr
758         return nil
759 }
760
761 // IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
762 type IP6AddressWithPrefix IP6Prefix
763
764 // Address defines type 'address'.
765 type Address struct {
766         Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
767         Un AddressUnion  `binapi:"address_union,name=un" json:"un,omitempty"`
768 }
769
770 func ParseAddress(s string) (Address, error) {
771         ip := net.ParseIP(s)
772         if ip == nil {
773                 return Address{}, fmt.Errorf("invalid address: %s", s)
774         }
775         var addr Address
776         if ip.To4() == nil {
777                 addr.Af = ADDRESS_IP6
778                 var ip6 IP6Address
779                 copy(ip6[:], ip.To16())
780                 addr.Un.SetIP6(ip6)
781         } else {
782                 addr.Af = ADDRESS_IP4
783                 var ip4 IP4Address
784                 copy(ip4[:], ip.To4())
785                 addr.Un.SetIP4(ip4)
786         }
787         return addr, nil
788 }
789 func (x Address) ToIP() net.IP {
790         if x.Af == ADDRESS_IP6 {
791                 ip6 := x.Un.GetIP6()
792                 return net.IP(ip6[:]).To16()
793         } else {
794                 ip4 := x.Un.GetIP4()
795                 return net.IP(ip4[:]).To4()
796         }
797 }
798 func (x Address) String() string {
799         return x.ToIP().String()
800 }
801 func (x *Address) MarshalText() ([]byte, error) {
802         return []byte(x.String()), nil
803 }
804 func (x *Address) UnmarshalText(text []byte) error {
805         addr, err := ParseAddress(string(text))
806         if err != nil {
807                 return err
808         }
809         *x = addr
810         return nil
811 }
812
813 // IP4Prefix defines type 'ip4_prefix'.
814 type IP4Prefix struct {
815         Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
816         Len     uint8      `binapi:"u8,name=len" json:"len,omitempty"`
817 }
818
819 func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
820         hasPrefix := strings.Contains(s, "/")
821         if hasPrefix {
822                 ip, network, err := net.ParseCIDR(s)
823                 if err != nil {
824                         return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
825                 }
826                 maskSize, _ := network.Mask.Size()
827                 prefix.Len = byte(maskSize)
828                 prefix.Address, err = ParseIP4Address(ip.String())
829                 if err != nil {
830                         return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
831                 }
832         } else {
833                 ip := net.ParseIP(s)
834                 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
835                 if ip.To4() == nil {
836                         defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
837                 }
838                 prefix.Len = byte(defaultMaskSize)
839                 prefix.Address, err = ParseIP4Address(ip.String())
840                 if err != nil {
841                         return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
842                 }
843         }
844         return prefix, nil
845 }
846 func (x IP4Prefix) ToIPNet() *net.IPNet {
847         mask := net.CIDRMask(int(x.Len), 32)
848         ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
849         return ipnet
850 }
851 func (x IP4Prefix) String() string {
852         ip := x.Address.String()
853         return ip + "/" + strconv.Itoa(int(x.Len))
854 }
855 func (x *IP4Prefix) MarshalText() ([]byte, error) {
856         return []byte(x.String()), nil
857 }
858 func (x *IP4Prefix) UnmarshalText(text []byte) error {
859         prefix, err := ParseIP4Prefix(string(text))
860         if err != nil {
861                 return err
862         }
863         *x = prefix
864         return nil
865 }
866
867 // IP6Prefix defines type 'ip6_prefix'.
868 type IP6Prefix struct {
869         Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
870         Len     uint8      `binapi:"u8,name=len" json:"len,omitempty"`
871 }
872
873 func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
874         hasPrefix := strings.Contains(s, "/")
875         if hasPrefix {
876                 ip, network, err := net.ParseCIDR(s)
877                 if err != nil {
878                         return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
879                 }
880                 maskSize, _ := network.Mask.Size()
881                 prefix.Len = byte(maskSize)
882                 prefix.Address, err = ParseIP6Address(ip.String())
883                 if err != nil {
884                         return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
885                 }
886         } else {
887                 ip := net.ParseIP(s)
888                 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
889                 if ip.To4() == nil {
890                         defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
891                 }
892                 prefix.Len = byte(defaultMaskSize)
893                 prefix.Address, err = ParseIP6Address(ip.String())
894                 if err != nil {
895                         return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
896                 }
897         }
898         return prefix, nil
899 }
900 func (x IP6Prefix) ToIPNet() *net.IPNet {
901         mask := net.CIDRMask(int(x.Len), 128)
902         ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
903         return ipnet
904 }
905 func (x IP6Prefix) String() string {
906         ip := x.Address.String()
907         return ip + "/" + strconv.Itoa(int(x.Len))
908 }
909 func (x *IP6Prefix) MarshalText() ([]byte, error) {
910         return []byte(x.String()), nil
911 }
912 func (x *IP6Prefix) UnmarshalText(text []byte) error {
913         prefix, err := ParseIP6Prefix(string(text))
914         if err != nil {
915                 return err
916         }
917         *x = prefix
918         return nil
919 }
920
921 // LbVip defines type 'lb_vip'.
922 type LbVip struct {
923         Pfx      AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"`
924         Protocol IPProto           `binapi:"ip_proto,name=protocol" json:"protocol,omitempty"`
925         Port     uint16            `binapi:"u16,name=port" json:"port,omitempty"`
926 }
927
928 // Mprefix defines type 'mprefix'.
929 type Mprefix struct {
930         Af               AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
931         GrpAddressLength uint16        `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
932         GrpAddress       AddressUnion  `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
933         SrcAddress       AddressUnion  `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
934 }
935
936 // Prefix defines type 'prefix'.
937 type Prefix struct {
938         Address Address `binapi:"address,name=address" json:"address,omitempty"`
939         Len     uint8   `binapi:"u8,name=len" json:"len,omitempty"`
940 }
941
942 func ParsePrefix(ip string) (prefix Prefix, err error) {
943         hasPrefix := strings.Contains(ip, "/")
944         if hasPrefix {
945                 netIP, network, err := net.ParseCIDR(ip)
946                 if err != nil {
947                         return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
948                 }
949                 maskSize, _ := network.Mask.Size()
950                 prefix.Len = byte(maskSize)
951                 prefix.Address, err = ParseAddress(netIP.String())
952                 if err != nil {
953                         return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
954                 }
955         } else {
956                 netIP := net.ParseIP(ip)
957                 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
958                 if netIP.To4() == nil {
959                         defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
960                 }
961                 prefix.Len = byte(defaultMaskSize)
962                 prefix.Address, err = ParseAddress(netIP.String())
963                 if err != nil {
964                         return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
965                 }
966         }
967         return prefix, nil
968 }
969 func (x Prefix) ToIPNet() *net.IPNet {
970         var mask net.IPMask
971         if x.Address.Af == ADDRESS_IP4 {
972                 mask = net.CIDRMask(int(x.Len), 32)
973         } else {
974                 mask = net.CIDRMask(int(x.Len), 128)
975         }
976         ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
977         return ipnet
978 }
979 func (x Prefix) String() string {
980         ip := x.Address.String()
981         return ip + "/" + strconv.Itoa(int(x.Len))
982 }
983 func (x *Prefix) MarshalText() ([]byte, error) {
984         return []byte(x.String()), nil
985 }
986 func (x *Prefix) UnmarshalText(text []byte) error {
987         prefix, err := ParsePrefix(string(text))
988         if err != nil {
989                 return err
990         }
991         *x = prefix
992         return nil
993 }
994
995 // PrefixMatcher defines type 'prefix_matcher'.
996 type PrefixMatcher struct {
997         Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
998         Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
999 }
1000
1001 // AddressUnion defines union 'address_union'.
1002 type AddressUnion struct {
1003         // IP4 *IP4Address
1004         // IP6 *IP6Address
1005         XXX_UnionData [16]byte
1006 }
1007
1008 func AddressUnionIP4(a IP4Address) (u AddressUnion) {
1009         u.SetIP4(a)
1010         return
1011 }
1012 func (u *AddressUnion) SetIP4(a IP4Address) {
1013         buf := codec.NewBuffer(u.XXX_UnionData[:])
1014         buf.EncodeBytes(a[:], 4)
1015 }
1016 func (u *AddressUnion) GetIP4() (a IP4Address) {
1017         buf := codec.NewBuffer(u.XXX_UnionData[:])
1018         copy(a[:], buf.DecodeBytes(4))
1019         return
1020 }
1021
1022 func AddressUnionIP6(a IP6Address) (u AddressUnion) {
1023         u.SetIP6(a)
1024         return
1025 }
1026 func (u *AddressUnion) SetIP6(a IP6Address) {
1027         buf := codec.NewBuffer(u.XXX_UnionData[:])
1028         buf.EncodeBytes(a[:], 16)
1029 }
1030 func (u *AddressUnion) GetIP6() (a IP6Address) {
1031         buf := codec.NewBuffer(u.XXX_UnionData[:])
1032         copy(a[:], buf.DecodeBytes(16))
1033         return
1034 }
1035
1036 // LbAddDelAs defines message 'lb_add_del_as'.
1037 type LbAddDelAs struct {
1038         Pfx       AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"`
1039         Protocol  uint8             `binapi:"u8,name=protocol,default=255" json:"protocol,omitempty"`
1040         Port      uint16            `binapi:"u16,name=port" json:"port,omitempty"`
1041         AsAddress Address           `binapi:"address,name=as_address" json:"as_address,omitempty"`
1042         IsDel     bool              `binapi:"bool,name=is_del" json:"is_del,omitempty"`
1043         IsFlush   bool              `binapi:"bool,name=is_flush" json:"is_flush,omitempty"`
1044 }
1045
1046 func (m *LbAddDelAs) Reset()               { *m = LbAddDelAs{} }
1047 func (*LbAddDelAs) GetMessageName() string { return "lb_add_del_as" }
1048 func (*LbAddDelAs) GetCrcString() string   { return "78628987" }
1049 func (*LbAddDelAs) GetMessageType() api.MessageType {
1050         return api.RequestMessage
1051 }
1052
1053 func (m *LbAddDelAs) Size() (size int) {
1054         if m == nil {
1055                 return 0
1056         }
1057         size += 4      // m.Pfx.Address.Af
1058         size += 1 * 16 // m.Pfx.Address.Un
1059         size += 1      // m.Pfx.Len
1060         size += 1      // m.Protocol
1061         size += 2      // m.Port
1062         size += 4      // m.AsAddress.Af
1063         size += 1 * 16 // m.AsAddress.Un
1064         size += 1      // m.IsDel
1065         size += 1      // m.IsFlush
1066         return size
1067 }
1068 func (m *LbAddDelAs) Marshal(b []byte) ([]byte, error) {
1069         if b == nil {
1070                 b = make([]byte, m.Size())
1071         }
1072         buf := codec.NewBuffer(b)
1073         buf.EncodeUint32(uint32(m.Pfx.Address.Af))
1074         buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 16)
1075         buf.EncodeUint8(m.Pfx.Len)
1076         buf.EncodeUint8(m.Protocol)
1077         buf.EncodeUint16(m.Port)
1078         buf.EncodeUint32(uint32(m.AsAddress.Af))
1079         buf.EncodeBytes(m.AsAddress.Un.XXX_UnionData[:], 16)
1080         buf.EncodeBool(m.IsDel)
1081         buf.EncodeBool(m.IsFlush)
1082         return buf.Bytes(), nil
1083 }
1084 func (m *LbAddDelAs) Unmarshal(b []byte) error {
1085         buf := codec.NewBuffer(b)
1086         m.Pfx.Address.Af = AddressFamily(buf.DecodeUint32())
1087         copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1088         m.Pfx.Len = buf.DecodeUint8()
1089         m.Protocol = buf.DecodeUint8()
1090         m.Port = buf.DecodeUint16()
1091         m.AsAddress.Af = AddressFamily(buf.DecodeUint32())
1092         copy(m.AsAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1093         m.IsDel = buf.DecodeBool()
1094         m.IsFlush = buf.DecodeBool()
1095         return nil
1096 }
1097
1098 // LbAddDelAsReply defines message 'lb_add_del_as_reply'.
1099 type LbAddDelAsReply struct {
1100         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1101 }
1102
1103 func (m *LbAddDelAsReply) Reset()               { *m = LbAddDelAsReply{} }
1104 func (*LbAddDelAsReply) GetMessageName() string { return "lb_add_del_as_reply" }
1105 func (*LbAddDelAsReply) GetCrcString() string   { return "e8d4e804" }
1106 func (*LbAddDelAsReply) GetMessageType() api.MessageType {
1107         return api.ReplyMessage
1108 }
1109
1110 func (m *LbAddDelAsReply) Size() (size int) {
1111         if m == nil {
1112                 return 0
1113         }
1114         size += 4 // m.Retval
1115         return size
1116 }
1117 func (m *LbAddDelAsReply) Marshal(b []byte) ([]byte, error) {
1118         if b == nil {
1119                 b = make([]byte, m.Size())
1120         }
1121         buf := codec.NewBuffer(b)
1122         buf.EncodeInt32(m.Retval)
1123         return buf.Bytes(), nil
1124 }
1125 func (m *LbAddDelAsReply) Unmarshal(b []byte) error {
1126         buf := codec.NewBuffer(b)
1127         m.Retval = buf.DecodeInt32()
1128         return nil
1129 }
1130
1131 // LbAddDelIntfNat4 defines message 'lb_add_del_intf_nat4'.
1132 type LbAddDelIntfNat4 struct {
1133         IsAdd     bool           `binapi:"bool,name=is_add" json:"is_add,omitempty"`
1134         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1135 }
1136
1137 func (m *LbAddDelIntfNat4) Reset()               { *m = LbAddDelIntfNat4{} }
1138 func (*LbAddDelIntfNat4) GetMessageName() string { return "lb_add_del_intf_nat4" }
1139 func (*LbAddDelIntfNat4) GetCrcString() string   { return "47d6e753" }
1140 func (*LbAddDelIntfNat4) GetMessageType() api.MessageType {
1141         return api.RequestMessage
1142 }
1143
1144 func (m *LbAddDelIntfNat4) Size() (size int) {
1145         if m == nil {
1146                 return 0
1147         }
1148         size += 1 // m.IsAdd
1149         size += 4 // m.SwIfIndex
1150         return size
1151 }
1152 func (m *LbAddDelIntfNat4) Marshal(b []byte) ([]byte, error) {
1153         if b == nil {
1154                 b = make([]byte, m.Size())
1155         }
1156         buf := codec.NewBuffer(b)
1157         buf.EncodeBool(m.IsAdd)
1158         buf.EncodeUint32(uint32(m.SwIfIndex))
1159         return buf.Bytes(), nil
1160 }
1161 func (m *LbAddDelIntfNat4) Unmarshal(b []byte) error {
1162         buf := codec.NewBuffer(b)
1163         m.IsAdd = buf.DecodeBool()
1164         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
1165         return nil
1166 }
1167
1168 // LbAddDelIntfNat4Reply defines message 'lb_add_del_intf_nat4_reply'.
1169 type LbAddDelIntfNat4Reply struct {
1170         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1171 }
1172
1173 func (m *LbAddDelIntfNat4Reply) Reset()               { *m = LbAddDelIntfNat4Reply{} }
1174 func (*LbAddDelIntfNat4Reply) GetMessageName() string { return "lb_add_del_intf_nat4_reply" }
1175 func (*LbAddDelIntfNat4Reply) GetCrcString() string   { return "e8d4e804" }
1176 func (*LbAddDelIntfNat4Reply) GetMessageType() api.MessageType {
1177         return api.ReplyMessage
1178 }
1179
1180 func (m *LbAddDelIntfNat4Reply) Size() (size int) {
1181         if m == nil {
1182                 return 0
1183         }
1184         size += 4 // m.Retval
1185         return size
1186 }
1187 func (m *LbAddDelIntfNat4Reply) Marshal(b []byte) ([]byte, error) {
1188         if b == nil {
1189                 b = make([]byte, m.Size())
1190         }
1191         buf := codec.NewBuffer(b)
1192         buf.EncodeInt32(m.Retval)
1193         return buf.Bytes(), nil
1194 }
1195 func (m *LbAddDelIntfNat4Reply) Unmarshal(b []byte) error {
1196         buf := codec.NewBuffer(b)
1197         m.Retval = buf.DecodeInt32()
1198         return nil
1199 }
1200
1201 // LbAddDelIntfNat6 defines message 'lb_add_del_intf_nat6'.
1202 type LbAddDelIntfNat6 struct {
1203         IsAdd     bool           `binapi:"bool,name=is_add" json:"is_add,omitempty"`
1204         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1205 }
1206
1207 func (m *LbAddDelIntfNat6) Reset()               { *m = LbAddDelIntfNat6{} }
1208 func (*LbAddDelIntfNat6) GetMessageName() string { return "lb_add_del_intf_nat6" }
1209 func (*LbAddDelIntfNat6) GetCrcString() string   { return "47d6e753" }
1210 func (*LbAddDelIntfNat6) GetMessageType() api.MessageType {
1211         return api.RequestMessage
1212 }
1213
1214 func (m *LbAddDelIntfNat6) Size() (size int) {
1215         if m == nil {
1216                 return 0
1217         }
1218         size += 1 // m.IsAdd
1219         size += 4 // m.SwIfIndex
1220         return size
1221 }
1222 func (m *LbAddDelIntfNat6) Marshal(b []byte) ([]byte, error) {
1223         if b == nil {
1224                 b = make([]byte, m.Size())
1225         }
1226         buf := codec.NewBuffer(b)
1227         buf.EncodeBool(m.IsAdd)
1228         buf.EncodeUint32(uint32(m.SwIfIndex))
1229         return buf.Bytes(), nil
1230 }
1231 func (m *LbAddDelIntfNat6) Unmarshal(b []byte) error {
1232         buf := codec.NewBuffer(b)
1233         m.IsAdd = buf.DecodeBool()
1234         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
1235         return nil
1236 }
1237
1238 // LbAddDelIntfNat6Reply defines message 'lb_add_del_intf_nat6_reply'.
1239 type LbAddDelIntfNat6Reply struct {
1240         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1241 }
1242
1243 func (m *LbAddDelIntfNat6Reply) Reset()               { *m = LbAddDelIntfNat6Reply{} }
1244 func (*LbAddDelIntfNat6Reply) GetMessageName() string { return "lb_add_del_intf_nat6_reply" }
1245 func (*LbAddDelIntfNat6Reply) GetCrcString() string   { return "e8d4e804" }
1246 func (*LbAddDelIntfNat6Reply) GetMessageType() api.MessageType {
1247         return api.ReplyMessage
1248 }
1249
1250 func (m *LbAddDelIntfNat6Reply) Size() (size int) {
1251         if m == nil {
1252                 return 0
1253         }
1254         size += 4 // m.Retval
1255         return size
1256 }
1257 func (m *LbAddDelIntfNat6Reply) Marshal(b []byte) ([]byte, error) {
1258         if b == nil {
1259                 b = make([]byte, m.Size())
1260         }
1261         buf := codec.NewBuffer(b)
1262         buf.EncodeInt32(m.Retval)
1263         return buf.Bytes(), nil
1264 }
1265 func (m *LbAddDelIntfNat6Reply) Unmarshal(b []byte) error {
1266         buf := codec.NewBuffer(b)
1267         m.Retval = buf.DecodeInt32()
1268         return nil
1269 }
1270
1271 // LbAddDelVip defines message 'lb_add_del_vip'.
1272 type LbAddDelVip struct {
1273         Pfx                 AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"`
1274         Protocol            uint8             `binapi:"u8,name=protocol,default=255" json:"protocol,omitempty"`
1275         Port                uint16            `binapi:"u16,name=port" json:"port,omitempty"`
1276         Encap               LbEncapType       `binapi:"lb_encap_type,name=encap" json:"encap,omitempty"`
1277         Dscp                uint8             `binapi:"u8,name=dscp" json:"dscp,omitempty"`
1278         Type                LbSrvType         `binapi:"lb_srv_type,name=type" json:"type,omitempty"`
1279         TargetPort          uint16            `binapi:"u16,name=target_port" json:"target_port,omitempty"`
1280         NodePort            uint16            `binapi:"u16,name=node_port" json:"node_port,omitempty"`
1281         NewFlowsTableLength uint32            `binapi:"u32,name=new_flows_table_length,default=1024" json:"new_flows_table_length,omitempty"`
1282         IsDel               bool              `binapi:"bool,name=is_del" json:"is_del,omitempty"`
1283 }
1284
1285 func (m *LbAddDelVip) Reset()               { *m = LbAddDelVip{} }
1286 func (*LbAddDelVip) GetMessageName() string { return "lb_add_del_vip" }
1287 func (*LbAddDelVip) GetCrcString() string   { return "d15b7ddc" }
1288 func (*LbAddDelVip) GetMessageType() api.MessageType {
1289         return api.RequestMessage
1290 }
1291
1292 func (m *LbAddDelVip) Size() (size int) {
1293         if m == nil {
1294                 return 0
1295         }
1296         size += 4      // m.Pfx.Address.Af
1297         size += 1 * 16 // m.Pfx.Address.Un
1298         size += 1      // m.Pfx.Len
1299         size += 1      // m.Protocol
1300         size += 2      // m.Port
1301         size += 4      // m.Encap
1302         size += 1      // m.Dscp
1303         size += 4      // m.Type
1304         size += 2      // m.TargetPort
1305         size += 2      // m.NodePort
1306         size += 4      // m.NewFlowsTableLength
1307         size += 1      // m.IsDel
1308         return size
1309 }
1310 func (m *LbAddDelVip) Marshal(b []byte) ([]byte, error) {
1311         if b == nil {
1312                 b = make([]byte, m.Size())
1313         }
1314         buf := codec.NewBuffer(b)
1315         buf.EncodeUint32(uint32(m.Pfx.Address.Af))
1316         buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 16)
1317         buf.EncodeUint8(m.Pfx.Len)
1318         buf.EncodeUint8(m.Protocol)
1319         buf.EncodeUint16(m.Port)
1320         buf.EncodeUint32(uint32(m.Encap))
1321         buf.EncodeUint8(m.Dscp)
1322         buf.EncodeUint32(uint32(m.Type))
1323         buf.EncodeUint16(m.TargetPort)
1324         buf.EncodeUint16(m.NodePort)
1325         buf.EncodeUint32(m.NewFlowsTableLength)
1326         buf.EncodeBool(m.IsDel)
1327         return buf.Bytes(), nil
1328 }
1329 func (m *LbAddDelVip) Unmarshal(b []byte) error {
1330         buf := codec.NewBuffer(b)
1331         m.Pfx.Address.Af = AddressFamily(buf.DecodeUint32())
1332         copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1333         m.Pfx.Len = buf.DecodeUint8()
1334         m.Protocol = buf.DecodeUint8()
1335         m.Port = buf.DecodeUint16()
1336         m.Encap = LbEncapType(buf.DecodeUint32())
1337         m.Dscp = buf.DecodeUint8()
1338         m.Type = LbSrvType(buf.DecodeUint32())
1339         m.TargetPort = buf.DecodeUint16()
1340         m.NodePort = buf.DecodeUint16()
1341         m.NewFlowsTableLength = buf.DecodeUint32()
1342         m.IsDel = buf.DecodeBool()
1343         return nil
1344 }
1345
1346 // LbAddDelVipReply defines message 'lb_add_del_vip_reply'.
1347 type LbAddDelVipReply struct {
1348         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1349 }
1350
1351 func (m *LbAddDelVipReply) Reset()               { *m = LbAddDelVipReply{} }
1352 func (*LbAddDelVipReply) GetMessageName() string { return "lb_add_del_vip_reply" }
1353 func (*LbAddDelVipReply) GetCrcString() string   { return "e8d4e804" }
1354 func (*LbAddDelVipReply) GetMessageType() api.MessageType {
1355         return api.ReplyMessage
1356 }
1357
1358 func (m *LbAddDelVipReply) Size() (size int) {
1359         if m == nil {
1360                 return 0
1361         }
1362         size += 4 // m.Retval
1363         return size
1364 }
1365 func (m *LbAddDelVipReply) Marshal(b []byte) ([]byte, error) {
1366         if b == nil {
1367                 b = make([]byte, m.Size())
1368         }
1369         buf := codec.NewBuffer(b)
1370         buf.EncodeInt32(m.Retval)
1371         return buf.Bytes(), nil
1372 }
1373 func (m *LbAddDelVipReply) Unmarshal(b []byte) error {
1374         buf := codec.NewBuffer(b)
1375         m.Retval = buf.DecodeInt32()
1376         return nil
1377 }
1378
1379 // LbAsDetails defines message 'lb_as_details'.
1380 type LbAsDetails struct {
1381         Vip        LbVip   `binapi:"lb_vip,name=vip" json:"vip,omitempty"`
1382         AppSrv     Address `binapi:"address,name=app_srv" json:"app_srv,omitempty"`
1383         Flags      uint8   `binapi:"u8,name=flags" json:"flags,omitempty"`
1384         InUseSince uint32  `binapi:"u32,name=in_use_since" json:"in_use_since,omitempty"`
1385 }
1386
1387 func (m *LbAsDetails) Reset()               { *m = LbAsDetails{} }
1388 func (*LbAsDetails) GetMessageName() string { return "lb_as_details" }
1389 func (*LbAsDetails) GetCrcString() string   { return "9c39f60e" }
1390 func (*LbAsDetails) GetMessageType() api.MessageType {
1391         return api.ReplyMessage
1392 }
1393
1394 func (m *LbAsDetails) Size() (size int) {
1395         if m == nil {
1396                 return 0
1397         }
1398         size += 4      // m.Vip.Pfx.Address.Af
1399         size += 1 * 16 // m.Vip.Pfx.Address.Un
1400         size += 1      // m.Vip.Pfx.Len
1401         size += 4      // m.Vip.Protocol
1402         size += 2      // m.Vip.Port
1403         size += 4      // m.AppSrv.Af
1404         size += 1 * 16 // m.AppSrv.Un
1405         size += 1      // m.Flags
1406         size += 4      // m.InUseSince
1407         return size
1408 }
1409 func (m *LbAsDetails) Marshal(b []byte) ([]byte, error) {
1410         if b == nil {
1411                 b = make([]byte, m.Size())
1412         }
1413         buf := codec.NewBuffer(b)
1414         buf.EncodeUint32(uint32(m.Vip.Pfx.Address.Af))
1415         buf.EncodeBytes(m.Vip.Pfx.Address.Un.XXX_UnionData[:], 16)
1416         buf.EncodeUint8(m.Vip.Pfx.Len)
1417         buf.EncodeUint32(uint32(m.Vip.Protocol))
1418         buf.EncodeUint16(m.Vip.Port)
1419         buf.EncodeUint32(uint32(m.AppSrv.Af))
1420         buf.EncodeBytes(m.AppSrv.Un.XXX_UnionData[:], 16)
1421         buf.EncodeUint8(m.Flags)
1422         buf.EncodeUint32(m.InUseSince)
1423         return buf.Bytes(), nil
1424 }
1425 func (m *LbAsDetails) Unmarshal(b []byte) error {
1426         buf := codec.NewBuffer(b)
1427         m.Vip.Pfx.Address.Af = AddressFamily(buf.DecodeUint32())
1428         copy(m.Vip.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1429         m.Vip.Pfx.Len = buf.DecodeUint8()
1430         m.Vip.Protocol = IPProto(buf.DecodeUint32())
1431         m.Vip.Port = buf.DecodeUint16()
1432         m.AppSrv.Af = AddressFamily(buf.DecodeUint32())
1433         copy(m.AppSrv.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1434         m.Flags = buf.DecodeUint8()
1435         m.InUseSince = buf.DecodeUint32()
1436         return nil
1437 }
1438
1439 // LbAsDump defines message 'lb_as_dump'.
1440 type LbAsDump struct {
1441         Pfx      AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"`
1442         Protocol uint8             `binapi:"u8,name=protocol" json:"protocol,omitempty"`
1443         Port     uint16            `binapi:"u16,name=port" json:"port,omitempty"`
1444 }
1445
1446 func (m *LbAsDump) Reset()               { *m = LbAsDump{} }
1447 func (*LbAsDump) GetMessageName() string { return "lb_as_dump" }
1448 func (*LbAsDump) GetCrcString() string   { return "1063f819" }
1449 func (*LbAsDump) GetMessageType() api.MessageType {
1450         return api.RequestMessage
1451 }
1452
1453 func (m *LbAsDump) Size() (size int) {
1454         if m == nil {
1455                 return 0
1456         }
1457         size += 4      // m.Pfx.Address.Af
1458         size += 1 * 16 // m.Pfx.Address.Un
1459         size += 1      // m.Pfx.Len
1460         size += 1      // m.Protocol
1461         size += 2      // m.Port
1462         return size
1463 }
1464 func (m *LbAsDump) Marshal(b []byte) ([]byte, error) {
1465         if b == nil {
1466                 b = make([]byte, m.Size())
1467         }
1468         buf := codec.NewBuffer(b)
1469         buf.EncodeUint32(uint32(m.Pfx.Address.Af))
1470         buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 16)
1471         buf.EncodeUint8(m.Pfx.Len)
1472         buf.EncodeUint8(m.Protocol)
1473         buf.EncodeUint16(m.Port)
1474         return buf.Bytes(), nil
1475 }
1476 func (m *LbAsDump) Unmarshal(b []byte) error {
1477         buf := codec.NewBuffer(b)
1478         m.Pfx.Address.Af = AddressFamily(buf.DecodeUint32())
1479         copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1480         m.Pfx.Len = buf.DecodeUint8()
1481         m.Protocol = buf.DecodeUint8()
1482         m.Port = buf.DecodeUint16()
1483         return nil
1484 }
1485
1486 // LbConf defines message 'lb_conf'.
1487 type LbConf struct {
1488         IP4SrcAddress        IP4Address `binapi:"ip4_address,name=ip4_src_address" json:"ip4_src_address,omitempty"`
1489         IP6SrcAddress        IP6Address `binapi:"ip6_address,name=ip6_src_address" json:"ip6_src_address,omitempty"`
1490         StickyBucketsPerCore uint32     `binapi:"u32,name=sticky_buckets_per_core" json:"sticky_buckets_per_core,omitempty"`
1491         FlowTimeout          uint32     `binapi:"u32,name=flow_timeout" json:"flow_timeout,omitempty"`
1492 }
1493
1494 func (m *LbConf) Reset()               { *m = LbConf{} }
1495 func (*LbConf) GetMessageName() string { return "lb_conf" }
1496 func (*LbConf) GetCrcString() string   { return "22ddb739" }
1497 func (*LbConf) GetMessageType() api.MessageType {
1498         return api.RequestMessage
1499 }
1500
1501 func (m *LbConf) Size() (size int) {
1502         if m == nil {
1503                 return 0
1504         }
1505         size += 1 * 4  // m.IP4SrcAddress
1506         size += 1 * 16 // m.IP6SrcAddress
1507         size += 4      // m.StickyBucketsPerCore
1508         size += 4      // m.FlowTimeout
1509         return size
1510 }
1511 func (m *LbConf) Marshal(b []byte) ([]byte, error) {
1512         if b == nil {
1513                 b = make([]byte, m.Size())
1514         }
1515         buf := codec.NewBuffer(b)
1516         buf.EncodeBytes(m.IP4SrcAddress[:], 4)
1517         buf.EncodeBytes(m.IP6SrcAddress[:], 16)
1518         buf.EncodeUint32(m.StickyBucketsPerCore)
1519         buf.EncodeUint32(m.FlowTimeout)
1520         return buf.Bytes(), nil
1521 }
1522 func (m *LbConf) Unmarshal(b []byte) error {
1523         buf := codec.NewBuffer(b)
1524         copy(m.IP4SrcAddress[:], buf.DecodeBytes(4))
1525         copy(m.IP6SrcAddress[:], buf.DecodeBytes(16))
1526         m.StickyBucketsPerCore = buf.DecodeUint32()
1527         m.FlowTimeout = buf.DecodeUint32()
1528         return nil
1529 }
1530
1531 // LbConfReply defines message 'lb_conf_reply'.
1532 type LbConfReply struct {
1533         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1534 }
1535
1536 func (m *LbConfReply) Reset()               { *m = LbConfReply{} }
1537 func (*LbConfReply) GetMessageName() string { return "lb_conf_reply" }
1538 func (*LbConfReply) GetCrcString() string   { return "e8d4e804" }
1539 func (*LbConfReply) GetMessageType() api.MessageType {
1540         return api.ReplyMessage
1541 }
1542
1543 func (m *LbConfReply) Size() (size int) {
1544         if m == nil {
1545                 return 0
1546         }
1547         size += 4 // m.Retval
1548         return size
1549 }
1550 func (m *LbConfReply) Marshal(b []byte) ([]byte, error) {
1551         if b == nil {
1552                 b = make([]byte, m.Size())
1553         }
1554         buf := codec.NewBuffer(b)
1555         buf.EncodeInt32(m.Retval)
1556         return buf.Bytes(), nil
1557 }
1558 func (m *LbConfReply) Unmarshal(b []byte) error {
1559         buf := codec.NewBuffer(b)
1560         m.Retval = buf.DecodeInt32()
1561         return nil
1562 }
1563
1564 // LbFlushVip defines message 'lb_flush_vip'.
1565 type LbFlushVip struct {
1566         Pfx      AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"`
1567         Protocol uint8             `binapi:"u8,name=protocol" json:"protocol,omitempty"`
1568         Port     uint16            `binapi:"u16,name=port" json:"port,omitempty"`
1569 }
1570
1571 func (m *LbFlushVip) Reset()               { *m = LbFlushVip{} }
1572 func (*LbFlushVip) GetMessageName() string { return "lb_flush_vip" }
1573 func (*LbFlushVip) GetCrcString() string   { return "1063f819" }
1574 func (*LbFlushVip) GetMessageType() api.MessageType {
1575         return api.RequestMessage
1576 }
1577
1578 func (m *LbFlushVip) Size() (size int) {
1579         if m == nil {
1580                 return 0
1581         }
1582         size += 4      // m.Pfx.Address.Af
1583         size += 1 * 16 // m.Pfx.Address.Un
1584         size += 1      // m.Pfx.Len
1585         size += 1      // m.Protocol
1586         size += 2      // m.Port
1587         return size
1588 }
1589 func (m *LbFlushVip) Marshal(b []byte) ([]byte, error) {
1590         if b == nil {
1591                 b = make([]byte, m.Size())
1592         }
1593         buf := codec.NewBuffer(b)
1594         buf.EncodeUint32(uint32(m.Pfx.Address.Af))
1595         buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 16)
1596         buf.EncodeUint8(m.Pfx.Len)
1597         buf.EncodeUint8(m.Protocol)
1598         buf.EncodeUint16(m.Port)
1599         return buf.Bytes(), nil
1600 }
1601 func (m *LbFlushVip) Unmarshal(b []byte) error {
1602         buf := codec.NewBuffer(b)
1603         m.Pfx.Address.Af = AddressFamily(buf.DecodeUint32())
1604         copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1605         m.Pfx.Len = buf.DecodeUint8()
1606         m.Protocol = buf.DecodeUint8()
1607         m.Port = buf.DecodeUint16()
1608         return nil
1609 }
1610
1611 // LbFlushVipReply defines message 'lb_flush_vip_reply'.
1612 type LbFlushVipReply struct {
1613         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1614 }
1615
1616 func (m *LbFlushVipReply) Reset()               { *m = LbFlushVipReply{} }
1617 func (*LbFlushVipReply) GetMessageName() string { return "lb_flush_vip_reply" }
1618 func (*LbFlushVipReply) GetCrcString() string   { return "e8d4e804" }
1619 func (*LbFlushVipReply) GetMessageType() api.MessageType {
1620         return api.ReplyMessage
1621 }
1622
1623 func (m *LbFlushVipReply) Size() (size int) {
1624         if m == nil {
1625                 return 0
1626         }
1627         size += 4 // m.Retval
1628         return size
1629 }
1630 func (m *LbFlushVipReply) Marshal(b []byte) ([]byte, error) {
1631         if b == nil {
1632                 b = make([]byte, m.Size())
1633         }
1634         buf := codec.NewBuffer(b)
1635         buf.EncodeInt32(m.Retval)
1636         return buf.Bytes(), nil
1637 }
1638 func (m *LbFlushVipReply) Unmarshal(b []byte) error {
1639         buf := codec.NewBuffer(b)
1640         m.Retval = buf.DecodeInt32()
1641         return nil
1642 }
1643
1644 // LbVipDetails defines message 'lb_vip_details'.
1645 type LbVipDetails struct {
1646         Vip             LbVip       `binapi:"lb_vip,name=vip" json:"vip,omitempty"`
1647         Encap           LbEncapType `binapi:"lb_encap_type,name=encap" json:"encap,omitempty"`
1648         Dscp            IPDscp      `binapi:"ip_dscp,name=dscp" json:"dscp,omitempty"`
1649         SrvType         LbSrvType   `binapi:"lb_srv_type,name=srv_type" json:"srv_type,omitempty"`
1650         TargetPort      uint16      `binapi:"u16,name=target_port" json:"target_port,omitempty"`
1651         FlowTableLength uint16      `binapi:"u16,name=flow_table_length" json:"flow_table_length,omitempty"`
1652 }
1653
1654 func (m *LbVipDetails) Reset()               { *m = LbVipDetails{} }
1655 func (*LbVipDetails) GetMessageName() string { return "lb_vip_details" }
1656 func (*LbVipDetails) GetCrcString() string   { return "08f39bed" }
1657 func (*LbVipDetails) GetMessageType() api.MessageType {
1658         return api.ReplyMessage
1659 }
1660
1661 func (m *LbVipDetails) Size() (size int) {
1662         if m == nil {
1663                 return 0
1664         }
1665         size += 4      // m.Vip.Pfx.Address.Af
1666         size += 1 * 16 // m.Vip.Pfx.Address.Un
1667         size += 1      // m.Vip.Pfx.Len
1668         size += 4      // m.Vip.Protocol
1669         size += 2      // m.Vip.Port
1670         size += 4      // m.Encap
1671         size += 1      // m.Dscp
1672         size += 4      // m.SrvType
1673         size += 2      // m.TargetPort
1674         size += 2      // m.FlowTableLength
1675         return size
1676 }
1677 func (m *LbVipDetails) Marshal(b []byte) ([]byte, error) {
1678         if b == nil {
1679                 b = make([]byte, m.Size())
1680         }
1681         buf := codec.NewBuffer(b)
1682         buf.EncodeUint32(uint32(m.Vip.Pfx.Address.Af))
1683         buf.EncodeBytes(m.Vip.Pfx.Address.Un.XXX_UnionData[:], 16)
1684         buf.EncodeUint8(m.Vip.Pfx.Len)
1685         buf.EncodeUint32(uint32(m.Vip.Protocol))
1686         buf.EncodeUint16(m.Vip.Port)
1687         buf.EncodeUint32(uint32(m.Encap))
1688         buf.EncodeUint8(uint8(m.Dscp))
1689         buf.EncodeUint32(uint32(m.SrvType))
1690         buf.EncodeUint16(m.TargetPort)
1691         buf.EncodeUint16(m.FlowTableLength)
1692         return buf.Bytes(), nil
1693 }
1694 func (m *LbVipDetails) Unmarshal(b []byte) error {
1695         buf := codec.NewBuffer(b)
1696         m.Vip.Pfx.Address.Af = AddressFamily(buf.DecodeUint32())
1697         copy(m.Vip.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1698         m.Vip.Pfx.Len = buf.DecodeUint8()
1699         m.Vip.Protocol = IPProto(buf.DecodeUint32())
1700         m.Vip.Port = buf.DecodeUint16()
1701         m.Encap = LbEncapType(buf.DecodeUint32())
1702         m.Dscp = IPDscp(buf.DecodeUint8())
1703         m.SrvType = LbSrvType(buf.DecodeUint32())
1704         m.TargetPort = buf.DecodeUint16()
1705         m.FlowTableLength = buf.DecodeUint16()
1706         return nil
1707 }
1708
1709 // LbVipDump defines message 'lb_vip_dump'.
1710 type LbVipDump struct {
1711         Pfx        AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"`
1712         PfxMatcher PrefixMatcher     `binapi:"prefix_matcher,name=pfx_matcher" json:"pfx_matcher,omitempty"`
1713         Protocol   uint8             `binapi:"u8,name=protocol,default=255" json:"protocol,omitempty"`
1714         Port       uint16            `binapi:"u16,name=port" json:"port,omitempty"`
1715 }
1716
1717 func (m *LbVipDump) Reset()               { *m = LbVipDump{} }
1718 func (*LbVipDump) GetMessageName() string { return "lb_vip_dump" }
1719 func (*LbVipDump) GetCrcString() string   { return "c7bcb124" }
1720 func (*LbVipDump) GetMessageType() api.MessageType {
1721         return api.RequestMessage
1722 }
1723
1724 func (m *LbVipDump) Size() (size int) {
1725         if m == nil {
1726                 return 0
1727         }
1728         size += 4      // m.Pfx.Address.Af
1729         size += 1 * 16 // m.Pfx.Address.Un
1730         size += 1      // m.Pfx.Len
1731         size += 1      // m.PfxMatcher.Le
1732         size += 1      // m.PfxMatcher.Ge
1733         size += 1      // m.Protocol
1734         size += 2      // m.Port
1735         return size
1736 }
1737 func (m *LbVipDump) Marshal(b []byte) ([]byte, error) {
1738         if b == nil {
1739                 b = make([]byte, m.Size())
1740         }
1741         buf := codec.NewBuffer(b)
1742         buf.EncodeUint32(uint32(m.Pfx.Address.Af))
1743         buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 16)
1744         buf.EncodeUint8(m.Pfx.Len)
1745         buf.EncodeUint8(m.PfxMatcher.Le)
1746         buf.EncodeUint8(m.PfxMatcher.Ge)
1747         buf.EncodeUint8(m.Protocol)
1748         buf.EncodeUint16(m.Port)
1749         return buf.Bytes(), nil
1750 }
1751 func (m *LbVipDump) Unmarshal(b []byte) error {
1752         buf := codec.NewBuffer(b)
1753         m.Pfx.Address.Af = AddressFamily(buf.DecodeUint32())
1754         copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1755         m.Pfx.Len = buf.DecodeUint8()
1756         m.PfxMatcher.Le = buf.DecodeUint8()
1757         m.PfxMatcher.Ge = buf.DecodeUint8()
1758         m.Protocol = buf.DecodeUint8()
1759         m.Port = buf.DecodeUint16()
1760         return nil
1761 }
1762
1763 func init() { file_lb_binapi_init() }
1764 func file_lb_binapi_init() {
1765         api.RegisterMessage((*LbAddDelAs)(nil), "lb_add_del_as_78628987")
1766         api.RegisterMessage((*LbAddDelAsReply)(nil), "lb_add_del_as_reply_e8d4e804")
1767         api.RegisterMessage((*LbAddDelIntfNat4)(nil), "lb_add_del_intf_nat4_47d6e753")
1768         api.RegisterMessage((*LbAddDelIntfNat4Reply)(nil), "lb_add_del_intf_nat4_reply_e8d4e804")
1769         api.RegisterMessage((*LbAddDelIntfNat6)(nil), "lb_add_del_intf_nat6_47d6e753")
1770         api.RegisterMessage((*LbAddDelIntfNat6Reply)(nil), "lb_add_del_intf_nat6_reply_e8d4e804")
1771         api.RegisterMessage((*LbAddDelVip)(nil), "lb_add_del_vip_d15b7ddc")
1772         api.RegisterMessage((*LbAddDelVipReply)(nil), "lb_add_del_vip_reply_e8d4e804")
1773         api.RegisterMessage((*LbAsDetails)(nil), "lb_as_details_9c39f60e")
1774         api.RegisterMessage((*LbAsDump)(nil), "lb_as_dump_1063f819")
1775         api.RegisterMessage((*LbConf)(nil), "lb_conf_22ddb739")
1776         api.RegisterMessage((*LbConfReply)(nil), "lb_conf_reply_e8d4e804")
1777         api.RegisterMessage((*LbFlushVip)(nil), "lb_flush_vip_1063f819")
1778         api.RegisterMessage((*LbFlushVipReply)(nil), "lb_flush_vip_reply_e8d4e804")
1779         api.RegisterMessage((*LbVipDetails)(nil), "lb_vip_details_08f39bed")
1780         api.RegisterMessage((*LbVipDump)(nil), "lb_vip_dump_c7bcb124")
1781 }
1782
1783 // Messages returns list of all messages in this module.
1784 func AllMessages() []api.Message {
1785         return []api.Message{
1786                 (*LbAddDelAs)(nil),
1787                 (*LbAddDelAsReply)(nil),
1788                 (*LbAddDelIntfNat4)(nil),
1789                 (*LbAddDelIntfNat4Reply)(nil),
1790                 (*LbAddDelIntfNat6)(nil),
1791                 (*LbAddDelIntfNat6Reply)(nil),
1792                 (*LbAddDelVip)(nil),
1793                 (*LbAddDelVipReply)(nil),
1794                 (*LbAsDetails)(nil),
1795                 (*LbAsDump)(nil),
1796                 (*LbConf)(nil),
1797                 (*LbConfReply)(nil),
1798                 (*LbFlushVip)(nil),
1799                 (*LbFlushVipReply)(nil),
1800                 (*LbVipDetails)(nil),
1801                 (*LbVipDump)(nil),
1802         }
1803 }