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