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