Improve binapi generator
[govpp.git] / binapi / 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.05-release
5 // source: /usr/share/vpp/api/plugins/lb.api.json
6
7 // Package lb contains generated bindings for API file lb.api.
8 //
9 // Contents:
10 //  16 messages
11 //
12 package lb
13
14 import (
15         api "git.fd.io/govpp.git/api"
16         interface_types "git.fd.io/govpp.git/binapi/interface_types"
17         ip_types "git.fd.io/govpp.git/binapi/ip_types"
18         lb_types "git.fd.io/govpp.git/binapi/lb_types"
19         codec "git.fd.io/govpp.git/codec"
20 )
21
22 // This is a compile-time assertion to ensure that this generated file
23 // is compatible with the GoVPP api package it is being compiled against.
24 // A compilation error at this line likely means your copy of the
25 // GoVPP api package needs to be updated.
26 const _ = api.GoVppAPIPackageIsVersion2
27
28 const (
29         APIFile    = "lb"
30         APIVersion = "1.0.0"
31         VersionCrc = 0x5e4e85b1
32 )
33
34 // LbAddDelAs defines message 'lb_add_del_as'.
35 type LbAddDelAs struct {
36         Pfx       ip_types.AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"`
37         Protocol  uint8                      `binapi:"u8,name=protocol,default=%!s(float64=255)" json:"protocol,omitempty"`
38         Port      uint16                     `binapi:"u16,name=port" json:"port,omitempty"`
39         AsAddress ip_types.Address           `binapi:"address,name=as_address" json:"as_address,omitempty"`
40         IsDel     bool                       `binapi:"bool,name=is_del" json:"is_del,omitempty"`
41         IsFlush   bool                       `binapi:"bool,name=is_flush" json:"is_flush,omitempty"`
42 }
43
44 func (m *LbAddDelAs) Reset()               { *m = LbAddDelAs{} }
45 func (*LbAddDelAs) GetMessageName() string { return "lb_add_del_as" }
46 func (*LbAddDelAs) GetCrcString() string   { return "78628987" }
47 func (*LbAddDelAs) GetMessageType() api.MessageType {
48         return api.RequestMessage
49 }
50
51 func (m *LbAddDelAs) Size() int {
52         if m == nil {
53                 return 0
54         }
55         var size int
56         size += 1      // m.Pfx.Address.Af
57         size += 1 * 16 // m.Pfx.Address.Un
58         size += 1      // m.Pfx.Len
59         size += 1      // m.Protocol
60         size += 2      // m.Port
61         size += 1      // m.AsAddress.Af
62         size += 1 * 16 // m.AsAddress.Un
63         size += 1      // m.IsDel
64         size += 1      // m.IsFlush
65         return size
66 }
67 func (m *LbAddDelAs) Marshal(b []byte) ([]byte, error) {
68         var buf *codec.Buffer
69         if b == nil {
70                 buf = codec.NewBuffer(make([]byte, m.Size()))
71         } else {
72                 buf = codec.NewBuffer(b)
73         }
74         buf.EncodeUint8(uint8(m.Pfx.Address.Af))
75         buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 0)
76         buf.EncodeUint8(uint8(m.Pfx.Len))
77         buf.EncodeUint8(uint8(m.Protocol))
78         buf.EncodeUint16(uint16(m.Port))
79         buf.EncodeUint8(uint8(m.AsAddress.Af))
80         buf.EncodeBytes(m.AsAddress.Un.XXX_UnionData[:], 0)
81         buf.EncodeBool(m.IsDel)
82         buf.EncodeBool(m.IsFlush)
83         return buf.Bytes(), nil
84 }
85 func (m *LbAddDelAs) Unmarshal(b []byte) error {
86         buf := codec.NewBuffer(b)
87         m.Pfx.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
88         copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
89         m.Pfx.Len = buf.DecodeUint8()
90         m.Protocol = buf.DecodeUint8()
91         m.Port = buf.DecodeUint16()
92         m.AsAddress.Af = ip_types.AddressFamily(buf.DecodeUint8())
93         copy(m.AsAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
94         m.IsDel = buf.DecodeBool()
95         m.IsFlush = buf.DecodeBool()
96         return nil
97 }
98
99 // LbAddDelAsReply defines message 'lb_add_del_as_reply'.
100 type LbAddDelAsReply struct {
101         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
102 }
103
104 func (m *LbAddDelAsReply) Reset()               { *m = LbAddDelAsReply{} }
105 func (*LbAddDelAsReply) GetMessageName() string { return "lb_add_del_as_reply" }
106 func (*LbAddDelAsReply) GetCrcString() string   { return "e8d4e804" }
107 func (*LbAddDelAsReply) GetMessageType() api.MessageType {
108         return api.ReplyMessage
109 }
110
111 func (m *LbAddDelAsReply) Size() int {
112         if m == nil {
113                 return 0
114         }
115         var size int
116         size += 4 // m.Retval
117         return size
118 }
119 func (m *LbAddDelAsReply) Marshal(b []byte) ([]byte, error) {
120         var buf *codec.Buffer
121         if b == nil {
122                 buf = codec.NewBuffer(make([]byte, m.Size()))
123         } else {
124                 buf = codec.NewBuffer(b)
125         }
126         buf.EncodeUint32(uint32(m.Retval))
127         return buf.Bytes(), nil
128 }
129 func (m *LbAddDelAsReply) Unmarshal(b []byte) error {
130         buf := codec.NewBuffer(b)
131         m.Retval = int32(buf.DecodeUint32())
132         return nil
133 }
134
135 // LbAddDelIntfNat4 defines message 'lb_add_del_intf_nat4'.
136 type LbAddDelIntfNat4 struct {
137         IsAdd     bool                           `binapi:"bool,name=is_add" json:"is_add,omitempty"`
138         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
139 }
140
141 func (m *LbAddDelIntfNat4) Reset()               { *m = LbAddDelIntfNat4{} }
142 func (*LbAddDelIntfNat4) GetMessageName() string { return "lb_add_del_intf_nat4" }
143 func (*LbAddDelIntfNat4) GetCrcString() string   { return "47d6e753" }
144 func (*LbAddDelIntfNat4) GetMessageType() api.MessageType {
145         return api.RequestMessage
146 }
147
148 func (m *LbAddDelIntfNat4) Size() int {
149         if m == nil {
150                 return 0
151         }
152         var size int
153         size += 1 // m.IsAdd
154         size += 4 // m.SwIfIndex
155         return size
156 }
157 func (m *LbAddDelIntfNat4) Marshal(b []byte) ([]byte, error) {
158         var buf *codec.Buffer
159         if b == nil {
160                 buf = codec.NewBuffer(make([]byte, m.Size()))
161         } else {
162                 buf = codec.NewBuffer(b)
163         }
164         buf.EncodeBool(m.IsAdd)
165         buf.EncodeUint32(uint32(m.SwIfIndex))
166         return buf.Bytes(), nil
167 }
168 func (m *LbAddDelIntfNat4) Unmarshal(b []byte) error {
169         buf := codec.NewBuffer(b)
170         m.IsAdd = buf.DecodeBool()
171         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
172         return nil
173 }
174
175 // LbAddDelIntfNat4Reply defines message 'lb_add_del_intf_nat4_reply'.
176 type LbAddDelIntfNat4Reply struct {
177         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
178 }
179
180 func (m *LbAddDelIntfNat4Reply) Reset()               { *m = LbAddDelIntfNat4Reply{} }
181 func (*LbAddDelIntfNat4Reply) GetMessageName() string { return "lb_add_del_intf_nat4_reply" }
182 func (*LbAddDelIntfNat4Reply) GetCrcString() string   { return "e8d4e804" }
183 func (*LbAddDelIntfNat4Reply) GetMessageType() api.MessageType {
184         return api.ReplyMessage
185 }
186
187 func (m *LbAddDelIntfNat4Reply) Size() int {
188         if m == nil {
189                 return 0
190         }
191         var size int
192         size += 4 // m.Retval
193         return size
194 }
195 func (m *LbAddDelIntfNat4Reply) Marshal(b []byte) ([]byte, error) {
196         var buf *codec.Buffer
197         if b == nil {
198                 buf = codec.NewBuffer(make([]byte, m.Size()))
199         } else {
200                 buf = codec.NewBuffer(b)
201         }
202         buf.EncodeUint32(uint32(m.Retval))
203         return buf.Bytes(), nil
204 }
205 func (m *LbAddDelIntfNat4Reply) Unmarshal(b []byte) error {
206         buf := codec.NewBuffer(b)
207         m.Retval = int32(buf.DecodeUint32())
208         return nil
209 }
210
211 // LbAddDelIntfNat6 defines message 'lb_add_del_intf_nat6'.
212 type LbAddDelIntfNat6 struct {
213         IsAdd     bool                           `binapi:"bool,name=is_add" json:"is_add,omitempty"`
214         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
215 }
216
217 func (m *LbAddDelIntfNat6) Reset()               { *m = LbAddDelIntfNat6{} }
218 func (*LbAddDelIntfNat6) GetMessageName() string { return "lb_add_del_intf_nat6" }
219 func (*LbAddDelIntfNat6) GetCrcString() string   { return "47d6e753" }
220 func (*LbAddDelIntfNat6) GetMessageType() api.MessageType {
221         return api.RequestMessage
222 }
223
224 func (m *LbAddDelIntfNat6) Size() int {
225         if m == nil {
226                 return 0
227         }
228         var size int
229         size += 1 // m.IsAdd
230         size += 4 // m.SwIfIndex
231         return size
232 }
233 func (m *LbAddDelIntfNat6) Marshal(b []byte) ([]byte, error) {
234         var buf *codec.Buffer
235         if b == nil {
236                 buf = codec.NewBuffer(make([]byte, m.Size()))
237         } else {
238                 buf = codec.NewBuffer(b)
239         }
240         buf.EncodeBool(m.IsAdd)
241         buf.EncodeUint32(uint32(m.SwIfIndex))
242         return buf.Bytes(), nil
243 }
244 func (m *LbAddDelIntfNat6) Unmarshal(b []byte) error {
245         buf := codec.NewBuffer(b)
246         m.IsAdd = buf.DecodeBool()
247         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
248         return nil
249 }
250
251 // LbAddDelIntfNat6Reply defines message 'lb_add_del_intf_nat6_reply'.
252 type LbAddDelIntfNat6Reply struct {
253         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
254 }
255
256 func (m *LbAddDelIntfNat6Reply) Reset()               { *m = LbAddDelIntfNat6Reply{} }
257 func (*LbAddDelIntfNat6Reply) GetMessageName() string { return "lb_add_del_intf_nat6_reply" }
258 func (*LbAddDelIntfNat6Reply) GetCrcString() string   { return "e8d4e804" }
259 func (*LbAddDelIntfNat6Reply) GetMessageType() api.MessageType {
260         return api.ReplyMessage
261 }
262
263 func (m *LbAddDelIntfNat6Reply) Size() int {
264         if m == nil {
265                 return 0
266         }
267         var size int
268         size += 4 // m.Retval
269         return size
270 }
271 func (m *LbAddDelIntfNat6Reply) Marshal(b []byte) ([]byte, error) {
272         var buf *codec.Buffer
273         if b == nil {
274                 buf = codec.NewBuffer(make([]byte, m.Size()))
275         } else {
276                 buf = codec.NewBuffer(b)
277         }
278         buf.EncodeUint32(uint32(m.Retval))
279         return buf.Bytes(), nil
280 }
281 func (m *LbAddDelIntfNat6Reply) Unmarshal(b []byte) error {
282         buf := codec.NewBuffer(b)
283         m.Retval = int32(buf.DecodeUint32())
284         return nil
285 }
286
287 // LbAddDelVip defines message 'lb_add_del_vip'.
288 type LbAddDelVip struct {
289         Pfx                 ip_types.AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"`
290         Protocol            uint8                      `binapi:"u8,name=protocol,default=%!s(float64=255)" json:"protocol,omitempty"`
291         Port                uint16                     `binapi:"u16,name=port" json:"port,omitempty"`
292         Encap               lb_types.LbEncapType       `binapi:"lb_encap_type,name=encap" json:"encap,omitempty"`
293         Dscp                uint8                      `binapi:"u8,name=dscp" json:"dscp,omitempty"`
294         Type                lb_types.LbSrvType         `binapi:"lb_srv_type,name=type" json:"type,omitempty"`
295         TargetPort          uint16                     `binapi:"u16,name=target_port" json:"target_port,omitempty"`
296         NodePort            uint16                     `binapi:"u16,name=node_port" json:"node_port,omitempty"`
297         NewFlowsTableLength uint32                     `binapi:"u32,name=new_flows_table_length,default=%!s(float64=1024)" json:"new_flows_table_length,omitempty"`
298         IsDel               bool                       `binapi:"bool,name=is_del" json:"is_del,omitempty"`
299 }
300
301 func (m *LbAddDelVip) Reset()               { *m = LbAddDelVip{} }
302 func (*LbAddDelVip) GetMessageName() string { return "lb_add_del_vip" }
303 func (*LbAddDelVip) GetCrcString() string   { return "d15b7ddc" }
304 func (*LbAddDelVip) GetMessageType() api.MessageType {
305         return api.RequestMessage
306 }
307
308 func (m *LbAddDelVip) Size() int {
309         if m == nil {
310                 return 0
311         }
312         var size int
313         size += 1      // m.Pfx.Address.Af
314         size += 1 * 16 // m.Pfx.Address.Un
315         size += 1      // m.Pfx.Len
316         size += 1      // m.Protocol
317         size += 2      // m.Port
318         size += 4      // m.Encap
319         size += 1      // m.Dscp
320         size += 4      // m.Type
321         size += 2      // m.TargetPort
322         size += 2      // m.NodePort
323         size += 4      // m.NewFlowsTableLength
324         size += 1      // m.IsDel
325         return size
326 }
327 func (m *LbAddDelVip) Marshal(b []byte) ([]byte, error) {
328         var buf *codec.Buffer
329         if b == nil {
330                 buf = codec.NewBuffer(make([]byte, m.Size()))
331         } else {
332                 buf = codec.NewBuffer(b)
333         }
334         buf.EncodeUint8(uint8(m.Pfx.Address.Af))
335         buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 0)
336         buf.EncodeUint8(uint8(m.Pfx.Len))
337         buf.EncodeUint8(uint8(m.Protocol))
338         buf.EncodeUint16(uint16(m.Port))
339         buf.EncodeUint32(uint32(m.Encap))
340         buf.EncodeUint8(uint8(m.Dscp))
341         buf.EncodeUint32(uint32(m.Type))
342         buf.EncodeUint16(uint16(m.TargetPort))
343         buf.EncodeUint16(uint16(m.NodePort))
344         buf.EncodeUint32(uint32(m.NewFlowsTableLength))
345         buf.EncodeBool(m.IsDel)
346         return buf.Bytes(), nil
347 }
348 func (m *LbAddDelVip) Unmarshal(b []byte) error {
349         buf := codec.NewBuffer(b)
350         m.Pfx.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
351         copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
352         m.Pfx.Len = buf.DecodeUint8()
353         m.Protocol = buf.DecodeUint8()
354         m.Port = buf.DecodeUint16()
355         m.Encap = lb_types.LbEncapType(buf.DecodeUint32())
356         m.Dscp = buf.DecodeUint8()
357         m.Type = lb_types.LbSrvType(buf.DecodeUint32())
358         m.TargetPort = buf.DecodeUint16()
359         m.NodePort = buf.DecodeUint16()
360         m.NewFlowsTableLength = buf.DecodeUint32()
361         m.IsDel = buf.DecodeBool()
362         return nil
363 }
364
365 // LbAddDelVipReply defines message 'lb_add_del_vip_reply'.
366 type LbAddDelVipReply struct {
367         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
368 }
369
370 func (m *LbAddDelVipReply) Reset()               { *m = LbAddDelVipReply{} }
371 func (*LbAddDelVipReply) GetMessageName() string { return "lb_add_del_vip_reply" }
372 func (*LbAddDelVipReply) GetCrcString() string   { return "e8d4e804" }
373 func (*LbAddDelVipReply) GetMessageType() api.MessageType {
374         return api.ReplyMessage
375 }
376
377 func (m *LbAddDelVipReply) Size() int {
378         if m == nil {
379                 return 0
380         }
381         var size int
382         size += 4 // m.Retval
383         return size
384 }
385 func (m *LbAddDelVipReply) Marshal(b []byte) ([]byte, error) {
386         var buf *codec.Buffer
387         if b == nil {
388                 buf = codec.NewBuffer(make([]byte, m.Size()))
389         } else {
390                 buf = codec.NewBuffer(b)
391         }
392         buf.EncodeUint32(uint32(m.Retval))
393         return buf.Bytes(), nil
394 }
395 func (m *LbAddDelVipReply) Unmarshal(b []byte) error {
396         buf := codec.NewBuffer(b)
397         m.Retval = int32(buf.DecodeUint32())
398         return nil
399 }
400
401 // LbAsDetails defines message 'lb_as_details'.
402 type LbAsDetails struct {
403         Vip        lb_types.LbVip   `binapi:"lb_vip,name=vip" json:"vip,omitempty"`
404         AppSrv     ip_types.Address `binapi:"address,name=app_srv" json:"app_srv,omitempty"`
405         Flags      uint8            `binapi:"u8,name=flags" json:"flags,omitempty"`
406         InUseSince uint32           `binapi:"u32,name=in_use_since" json:"in_use_since,omitempty"`
407 }
408
409 func (m *LbAsDetails) Reset()               { *m = LbAsDetails{} }
410 func (*LbAsDetails) GetMessageName() string { return "lb_as_details" }
411 func (*LbAsDetails) GetCrcString() string   { return "9c39f60e" }
412 func (*LbAsDetails) GetMessageType() api.MessageType {
413         return api.ReplyMessage
414 }
415
416 func (m *LbAsDetails) Size() int {
417         if m == nil {
418                 return 0
419         }
420         var size int
421         size += 1      // m.Vip.Pfx.Address.Af
422         size += 1 * 16 // m.Vip.Pfx.Address.Un
423         size += 1      // m.Vip.Pfx.Len
424         size += 1      // m.Vip.Protocol
425         size += 2      // m.Vip.Port
426         size += 1      // m.AppSrv.Af
427         size += 1 * 16 // m.AppSrv.Un
428         size += 1      // m.Flags
429         size += 4      // m.InUseSince
430         return size
431 }
432 func (m *LbAsDetails) Marshal(b []byte) ([]byte, error) {
433         var buf *codec.Buffer
434         if b == nil {
435                 buf = codec.NewBuffer(make([]byte, m.Size()))
436         } else {
437                 buf = codec.NewBuffer(b)
438         }
439         buf.EncodeUint8(uint8(m.Vip.Pfx.Address.Af))
440         buf.EncodeBytes(m.Vip.Pfx.Address.Un.XXX_UnionData[:], 0)
441         buf.EncodeUint8(uint8(m.Vip.Pfx.Len))
442         buf.EncodeUint8(uint8(m.Vip.Protocol))
443         buf.EncodeUint16(uint16(m.Vip.Port))
444         buf.EncodeUint8(uint8(m.AppSrv.Af))
445         buf.EncodeBytes(m.AppSrv.Un.XXX_UnionData[:], 0)
446         buf.EncodeUint8(uint8(m.Flags))
447         buf.EncodeUint32(uint32(m.InUseSince))
448         return buf.Bytes(), nil
449 }
450 func (m *LbAsDetails) Unmarshal(b []byte) error {
451         buf := codec.NewBuffer(b)
452         m.Vip.Pfx.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
453         copy(m.Vip.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
454         m.Vip.Pfx.Len = buf.DecodeUint8()
455         m.Vip.Protocol = ip_types.IPProto(buf.DecodeUint8())
456         m.Vip.Port = buf.DecodeUint16()
457         m.AppSrv.Af = ip_types.AddressFamily(buf.DecodeUint8())
458         copy(m.AppSrv.Un.XXX_UnionData[:], buf.DecodeBytes(16))
459         m.Flags = buf.DecodeUint8()
460         m.InUseSince = buf.DecodeUint32()
461         return nil
462 }
463
464 // LbAsDump defines message 'lb_as_dump'.
465 type LbAsDump struct {
466         Pfx      ip_types.AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"`
467         Protocol uint8                      `binapi:"u8,name=protocol" json:"protocol,omitempty"`
468         Port     uint16                     `binapi:"u16,name=port" json:"port,omitempty"`
469 }
470
471 func (m *LbAsDump) Reset()               { *m = LbAsDump{} }
472 func (*LbAsDump) GetMessageName() string { return "lb_as_dump" }
473 func (*LbAsDump) GetCrcString() string   { return "1063f819" }
474 func (*LbAsDump) GetMessageType() api.MessageType {
475         return api.RequestMessage
476 }
477
478 func (m *LbAsDump) Size() int {
479         if m == nil {
480                 return 0
481         }
482         var size int
483         size += 1      // m.Pfx.Address.Af
484         size += 1 * 16 // m.Pfx.Address.Un
485         size += 1      // m.Pfx.Len
486         size += 1      // m.Protocol
487         size += 2      // m.Port
488         return size
489 }
490 func (m *LbAsDump) Marshal(b []byte) ([]byte, error) {
491         var buf *codec.Buffer
492         if b == nil {
493                 buf = codec.NewBuffer(make([]byte, m.Size()))
494         } else {
495                 buf = codec.NewBuffer(b)
496         }
497         buf.EncodeUint8(uint8(m.Pfx.Address.Af))
498         buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 0)
499         buf.EncodeUint8(uint8(m.Pfx.Len))
500         buf.EncodeUint8(uint8(m.Protocol))
501         buf.EncodeUint16(uint16(m.Port))
502         return buf.Bytes(), nil
503 }
504 func (m *LbAsDump) Unmarshal(b []byte) error {
505         buf := codec.NewBuffer(b)
506         m.Pfx.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
507         copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
508         m.Pfx.Len = buf.DecodeUint8()
509         m.Protocol = buf.DecodeUint8()
510         m.Port = buf.DecodeUint16()
511         return nil
512 }
513
514 // LbConf defines message 'lb_conf'.
515 type LbConf struct {
516         IP4SrcAddress        ip_types.IP4Address `binapi:"ip4_address,name=ip4_src_address" json:"ip4_src_address,omitempty"`
517         IP6SrcAddress        ip_types.IP6Address `binapi:"ip6_address,name=ip6_src_address" json:"ip6_src_address,omitempty"`
518         StickyBucketsPerCore uint32              `binapi:"u32,name=sticky_buckets_per_core,default=%!s(float64=4.294967295e+09)" json:"sticky_buckets_per_core,omitempty"`
519         FlowTimeout          uint32              `binapi:"u32,name=flow_timeout,default=%!s(float64=4.294967295e+09)" json:"flow_timeout,omitempty"`
520 }
521
522 func (m *LbConf) Reset()               { *m = LbConf{} }
523 func (*LbConf) GetMessageName() string { return "lb_conf" }
524 func (*LbConf) GetCrcString() string   { return "22ddb739" }
525 func (*LbConf) GetMessageType() api.MessageType {
526         return api.RequestMessage
527 }
528
529 func (m *LbConf) Size() int {
530         if m == nil {
531                 return 0
532         }
533         var size int
534         size += 1 * 4  // m.IP4SrcAddress
535         size += 1 * 16 // m.IP6SrcAddress
536         size += 4      // m.StickyBucketsPerCore
537         size += 4      // m.FlowTimeout
538         return size
539 }
540 func (m *LbConf) Marshal(b []byte) ([]byte, error) {
541         var buf *codec.Buffer
542         if b == nil {
543                 buf = codec.NewBuffer(make([]byte, m.Size()))
544         } else {
545                 buf = codec.NewBuffer(b)
546         }
547         buf.EncodeBytes(m.IP4SrcAddress[:], 4)
548         buf.EncodeBytes(m.IP6SrcAddress[:], 16)
549         buf.EncodeUint32(uint32(m.StickyBucketsPerCore))
550         buf.EncodeUint32(uint32(m.FlowTimeout))
551         return buf.Bytes(), nil
552 }
553 func (m *LbConf) Unmarshal(b []byte) error {
554         buf := codec.NewBuffer(b)
555         copy(m.IP4SrcAddress[:], buf.DecodeBytes(4))
556         copy(m.IP6SrcAddress[:], buf.DecodeBytes(16))
557         m.StickyBucketsPerCore = buf.DecodeUint32()
558         m.FlowTimeout = buf.DecodeUint32()
559         return nil
560 }
561
562 // LbConfReply defines message 'lb_conf_reply'.
563 type LbConfReply struct {
564         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
565 }
566
567 func (m *LbConfReply) Reset()               { *m = LbConfReply{} }
568 func (*LbConfReply) GetMessageName() string { return "lb_conf_reply" }
569 func (*LbConfReply) GetCrcString() string   { return "e8d4e804" }
570 func (*LbConfReply) GetMessageType() api.MessageType {
571         return api.ReplyMessage
572 }
573
574 func (m *LbConfReply) Size() int {
575         if m == nil {
576                 return 0
577         }
578         var size int
579         size += 4 // m.Retval
580         return size
581 }
582 func (m *LbConfReply) Marshal(b []byte) ([]byte, error) {
583         var buf *codec.Buffer
584         if b == nil {
585                 buf = codec.NewBuffer(make([]byte, m.Size()))
586         } else {
587                 buf = codec.NewBuffer(b)
588         }
589         buf.EncodeUint32(uint32(m.Retval))
590         return buf.Bytes(), nil
591 }
592 func (m *LbConfReply) Unmarshal(b []byte) error {
593         buf := codec.NewBuffer(b)
594         m.Retval = int32(buf.DecodeUint32())
595         return nil
596 }
597
598 // LbFlushVip defines message 'lb_flush_vip'.
599 type LbFlushVip struct {
600         Pfx      ip_types.AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"`
601         Protocol uint8                      `binapi:"u8,name=protocol" json:"protocol,omitempty"`
602         Port     uint16                     `binapi:"u16,name=port" json:"port,omitempty"`
603 }
604
605 func (m *LbFlushVip) Reset()               { *m = LbFlushVip{} }
606 func (*LbFlushVip) GetMessageName() string { return "lb_flush_vip" }
607 func (*LbFlushVip) GetCrcString() string   { return "1063f819" }
608 func (*LbFlushVip) GetMessageType() api.MessageType {
609         return api.RequestMessage
610 }
611
612 func (m *LbFlushVip) Size() int {
613         if m == nil {
614                 return 0
615         }
616         var size int
617         size += 1      // m.Pfx.Address.Af
618         size += 1 * 16 // m.Pfx.Address.Un
619         size += 1      // m.Pfx.Len
620         size += 1      // m.Protocol
621         size += 2      // m.Port
622         return size
623 }
624 func (m *LbFlushVip) Marshal(b []byte) ([]byte, error) {
625         var buf *codec.Buffer
626         if b == nil {
627                 buf = codec.NewBuffer(make([]byte, m.Size()))
628         } else {
629                 buf = codec.NewBuffer(b)
630         }
631         buf.EncodeUint8(uint8(m.Pfx.Address.Af))
632         buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 0)
633         buf.EncodeUint8(uint8(m.Pfx.Len))
634         buf.EncodeUint8(uint8(m.Protocol))
635         buf.EncodeUint16(uint16(m.Port))
636         return buf.Bytes(), nil
637 }
638 func (m *LbFlushVip) Unmarshal(b []byte) error {
639         buf := codec.NewBuffer(b)
640         m.Pfx.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
641         copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
642         m.Pfx.Len = buf.DecodeUint8()
643         m.Protocol = buf.DecodeUint8()
644         m.Port = buf.DecodeUint16()
645         return nil
646 }
647
648 // LbFlushVipReply defines message 'lb_flush_vip_reply'.
649 type LbFlushVipReply struct {
650         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
651 }
652
653 func (m *LbFlushVipReply) Reset()               { *m = LbFlushVipReply{} }
654 func (*LbFlushVipReply) GetMessageName() string { return "lb_flush_vip_reply" }
655 func (*LbFlushVipReply) GetCrcString() string   { return "e8d4e804" }
656 func (*LbFlushVipReply) GetMessageType() api.MessageType {
657         return api.ReplyMessage
658 }
659
660 func (m *LbFlushVipReply) Size() int {
661         if m == nil {
662                 return 0
663         }
664         var size int
665         size += 4 // m.Retval
666         return size
667 }
668 func (m *LbFlushVipReply) Marshal(b []byte) ([]byte, error) {
669         var buf *codec.Buffer
670         if b == nil {
671                 buf = codec.NewBuffer(make([]byte, m.Size()))
672         } else {
673                 buf = codec.NewBuffer(b)
674         }
675         buf.EncodeUint32(uint32(m.Retval))
676         return buf.Bytes(), nil
677 }
678 func (m *LbFlushVipReply) Unmarshal(b []byte) error {
679         buf := codec.NewBuffer(b)
680         m.Retval = int32(buf.DecodeUint32())
681         return nil
682 }
683
684 // LbVipDetails defines message 'lb_vip_details'.
685 type LbVipDetails struct {
686         Vip             lb_types.LbVip       `binapi:"lb_vip,name=vip" json:"vip,omitempty"`
687         Encap           lb_types.LbEncapType `binapi:"lb_encap_type,name=encap" json:"encap,omitempty"`
688         Dscp            ip_types.IPDscp      `binapi:"ip_dscp,name=dscp" json:"dscp,omitempty"`
689         SrvType         lb_types.LbSrvType   `binapi:"lb_srv_type,name=srv_type" json:"srv_type,omitempty"`
690         TargetPort      uint16               `binapi:"u16,name=target_port" json:"target_port,omitempty"`
691         FlowTableLength uint16               `binapi:"u16,name=flow_table_length" json:"flow_table_length,omitempty"`
692 }
693
694 func (m *LbVipDetails) Reset()               { *m = LbVipDetails{} }
695 func (*LbVipDetails) GetMessageName() string { return "lb_vip_details" }
696 func (*LbVipDetails) GetCrcString() string   { return "08f39bed" }
697 func (*LbVipDetails) GetMessageType() api.MessageType {
698         return api.ReplyMessage
699 }
700
701 func (m *LbVipDetails) Size() int {
702         if m == nil {
703                 return 0
704         }
705         var size int
706         size += 1      // m.Vip.Pfx.Address.Af
707         size += 1 * 16 // m.Vip.Pfx.Address.Un
708         size += 1      // m.Vip.Pfx.Len
709         size += 1      // m.Vip.Protocol
710         size += 2      // m.Vip.Port
711         size += 4      // m.Encap
712         size += 1      // m.Dscp
713         size += 4      // m.SrvType
714         size += 2      // m.TargetPort
715         size += 2      // m.FlowTableLength
716         return size
717 }
718 func (m *LbVipDetails) Marshal(b []byte) ([]byte, error) {
719         var buf *codec.Buffer
720         if b == nil {
721                 buf = codec.NewBuffer(make([]byte, m.Size()))
722         } else {
723                 buf = codec.NewBuffer(b)
724         }
725         buf.EncodeUint8(uint8(m.Vip.Pfx.Address.Af))
726         buf.EncodeBytes(m.Vip.Pfx.Address.Un.XXX_UnionData[:], 0)
727         buf.EncodeUint8(uint8(m.Vip.Pfx.Len))
728         buf.EncodeUint8(uint8(m.Vip.Protocol))
729         buf.EncodeUint16(uint16(m.Vip.Port))
730         buf.EncodeUint32(uint32(m.Encap))
731         buf.EncodeUint8(uint8(m.Dscp))
732         buf.EncodeUint32(uint32(m.SrvType))
733         buf.EncodeUint16(uint16(m.TargetPort))
734         buf.EncodeUint16(uint16(m.FlowTableLength))
735         return buf.Bytes(), nil
736 }
737 func (m *LbVipDetails) Unmarshal(b []byte) error {
738         buf := codec.NewBuffer(b)
739         m.Vip.Pfx.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
740         copy(m.Vip.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
741         m.Vip.Pfx.Len = buf.DecodeUint8()
742         m.Vip.Protocol = ip_types.IPProto(buf.DecodeUint8())
743         m.Vip.Port = buf.DecodeUint16()
744         m.Encap = lb_types.LbEncapType(buf.DecodeUint32())
745         m.Dscp = ip_types.IPDscp(buf.DecodeUint8())
746         m.SrvType = lb_types.LbSrvType(buf.DecodeUint32())
747         m.TargetPort = buf.DecodeUint16()
748         m.FlowTableLength = buf.DecodeUint16()
749         return nil
750 }
751
752 // LbVipDump defines message 'lb_vip_dump'.
753 type LbVipDump struct {
754         Pfx        ip_types.AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"`
755         PfxMatcher ip_types.PrefixMatcher     `binapi:"prefix_matcher,name=pfx_matcher" json:"pfx_matcher,omitempty"`
756         Protocol   uint8                      `binapi:"u8,name=protocol,default=%!s(float64=255)" json:"protocol,omitempty"`
757         Port       uint16                     `binapi:"u16,name=port" json:"port,omitempty"`
758 }
759
760 func (m *LbVipDump) Reset()               { *m = LbVipDump{} }
761 func (*LbVipDump) GetMessageName() string { return "lb_vip_dump" }
762 func (*LbVipDump) GetCrcString() string   { return "c7bcb124" }
763 func (*LbVipDump) GetMessageType() api.MessageType {
764         return api.RequestMessage
765 }
766
767 func (m *LbVipDump) Size() int {
768         if m == nil {
769                 return 0
770         }
771         var size int
772         size += 1      // m.Pfx.Address.Af
773         size += 1 * 16 // m.Pfx.Address.Un
774         size += 1      // m.Pfx.Len
775         size += 1      // m.PfxMatcher.Le
776         size += 1      // m.PfxMatcher.Ge
777         size += 1      // m.Protocol
778         size += 2      // m.Port
779         return size
780 }
781 func (m *LbVipDump) Marshal(b []byte) ([]byte, error) {
782         var buf *codec.Buffer
783         if b == nil {
784                 buf = codec.NewBuffer(make([]byte, m.Size()))
785         } else {
786                 buf = codec.NewBuffer(b)
787         }
788         buf.EncodeUint8(uint8(m.Pfx.Address.Af))
789         buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 0)
790         buf.EncodeUint8(uint8(m.Pfx.Len))
791         buf.EncodeUint8(uint8(m.PfxMatcher.Le))
792         buf.EncodeUint8(uint8(m.PfxMatcher.Ge))
793         buf.EncodeUint8(uint8(m.Protocol))
794         buf.EncodeUint16(uint16(m.Port))
795         return buf.Bytes(), nil
796 }
797 func (m *LbVipDump) Unmarshal(b []byte) error {
798         buf := codec.NewBuffer(b)
799         m.Pfx.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
800         copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
801         m.Pfx.Len = buf.DecodeUint8()
802         m.PfxMatcher.Le = buf.DecodeUint8()
803         m.PfxMatcher.Ge = buf.DecodeUint8()
804         m.Protocol = buf.DecodeUint8()
805         m.Port = buf.DecodeUint16()
806         return nil
807 }
808
809 func init() { file_lb_binapi_init() }
810 func file_lb_binapi_init() {
811         api.RegisterMessage((*LbAddDelAs)(nil), "lb_add_del_as_78628987")
812         api.RegisterMessage((*LbAddDelAsReply)(nil), "lb_add_del_as_reply_e8d4e804")
813         api.RegisterMessage((*LbAddDelIntfNat4)(nil), "lb_add_del_intf_nat4_47d6e753")
814         api.RegisterMessage((*LbAddDelIntfNat4Reply)(nil), "lb_add_del_intf_nat4_reply_e8d4e804")
815         api.RegisterMessage((*LbAddDelIntfNat6)(nil), "lb_add_del_intf_nat6_47d6e753")
816         api.RegisterMessage((*LbAddDelIntfNat6Reply)(nil), "lb_add_del_intf_nat6_reply_e8d4e804")
817         api.RegisterMessage((*LbAddDelVip)(nil), "lb_add_del_vip_d15b7ddc")
818         api.RegisterMessage((*LbAddDelVipReply)(nil), "lb_add_del_vip_reply_e8d4e804")
819         api.RegisterMessage((*LbAsDetails)(nil), "lb_as_details_9c39f60e")
820         api.RegisterMessage((*LbAsDump)(nil), "lb_as_dump_1063f819")
821         api.RegisterMessage((*LbConf)(nil), "lb_conf_22ddb739")
822         api.RegisterMessage((*LbConfReply)(nil), "lb_conf_reply_e8d4e804")
823         api.RegisterMessage((*LbFlushVip)(nil), "lb_flush_vip_1063f819")
824         api.RegisterMessage((*LbFlushVipReply)(nil), "lb_flush_vip_reply_e8d4e804")
825         api.RegisterMessage((*LbVipDetails)(nil), "lb_vip_details_08f39bed")
826         api.RegisterMessage((*LbVipDump)(nil), "lb_vip_dump_c7bcb124")
827 }
828
829 // Messages returns list of all messages in this module.
830 func AllMessages() []api.Message {
831         return []api.Message{
832                 (*LbAddDelAs)(nil),
833                 (*LbAddDelAsReply)(nil),
834                 (*LbAddDelIntfNat4)(nil),
835                 (*LbAddDelIntfNat4Reply)(nil),
836                 (*LbAddDelIntfNat6)(nil),
837                 (*LbAddDelIntfNat6Reply)(nil),
838                 (*LbAddDelVip)(nil),
839                 (*LbAddDelVipReply)(nil),
840                 (*LbAsDetails)(nil),
841                 (*LbAsDump)(nil),
842                 (*LbConf)(nil),
843                 (*LbConfReply)(nil),
844                 (*LbFlushVip)(nil),
845                 (*LbFlushVipReply)(nil),
846                 (*LbVipDetails)(nil),
847                 (*LbVipDump)(nil),
848         }
849 }