1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
5 // source: /usr/share/vpp/api/plugins/lb.api.json
7 // Package lb contains generated bindings for API file lb.api.
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"
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
31 VersionCrc = 0x5e4e85b1
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"`
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
51 func (m *LbAddDelAs) 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
61 size += 1 // m.AsAddress.Af
62 size += 1 * 16 // m.AsAddress.Un
64 size += 1 // m.IsFlush
67 func (m *LbAddDelAs) Marshal(b []byte) ([]byte, error) {
70 buf = codec.NewBuffer(make([]byte, m.Size()))
72 buf = codec.NewBuffer(b)
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
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()
99 // LbAddDelAsReply defines message 'lb_add_del_as_reply'.
100 type LbAddDelAsReply struct {
101 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
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
111 func (m *LbAddDelAsReply) Size() int {
116 size += 4 // m.Retval
119 func (m *LbAddDelAsReply) Marshal(b []byte) ([]byte, error) {
120 var buf *codec.Buffer
122 buf = codec.NewBuffer(make([]byte, m.Size()))
124 buf = codec.NewBuffer(b)
126 buf.EncodeUint32(uint32(m.Retval))
127 return buf.Bytes(), nil
129 func (m *LbAddDelAsReply) Unmarshal(b []byte) error {
130 buf := codec.NewBuffer(b)
131 m.Retval = int32(buf.DecodeUint32())
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"`
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
148 func (m *LbAddDelIntfNat4) Size() int {
154 size += 4 // m.SwIfIndex
157 func (m *LbAddDelIntfNat4) Marshal(b []byte) ([]byte, error) {
158 var buf *codec.Buffer
160 buf = codec.NewBuffer(make([]byte, m.Size()))
162 buf = codec.NewBuffer(b)
164 buf.EncodeBool(m.IsAdd)
165 buf.EncodeUint32(uint32(m.SwIfIndex))
166 return buf.Bytes(), nil
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())
175 // LbAddDelIntfNat4Reply defines message 'lb_add_del_intf_nat4_reply'.
176 type LbAddDelIntfNat4Reply struct {
177 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
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
187 func (m *LbAddDelIntfNat4Reply) Size() int {
192 size += 4 // m.Retval
195 func (m *LbAddDelIntfNat4Reply) Marshal(b []byte) ([]byte, error) {
196 var buf *codec.Buffer
198 buf = codec.NewBuffer(make([]byte, m.Size()))
200 buf = codec.NewBuffer(b)
202 buf.EncodeUint32(uint32(m.Retval))
203 return buf.Bytes(), nil
205 func (m *LbAddDelIntfNat4Reply) Unmarshal(b []byte) error {
206 buf := codec.NewBuffer(b)
207 m.Retval = int32(buf.DecodeUint32())
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"`
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
224 func (m *LbAddDelIntfNat6) Size() int {
230 size += 4 // m.SwIfIndex
233 func (m *LbAddDelIntfNat6) Marshal(b []byte) ([]byte, error) {
234 var buf *codec.Buffer
236 buf = codec.NewBuffer(make([]byte, m.Size()))
238 buf = codec.NewBuffer(b)
240 buf.EncodeBool(m.IsAdd)
241 buf.EncodeUint32(uint32(m.SwIfIndex))
242 return buf.Bytes(), nil
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())
251 // LbAddDelIntfNat6Reply defines message 'lb_add_del_intf_nat6_reply'.
252 type LbAddDelIntfNat6Reply struct {
253 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
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
263 func (m *LbAddDelIntfNat6Reply) Size() int {
268 size += 4 // m.Retval
271 func (m *LbAddDelIntfNat6Reply) Marshal(b []byte) ([]byte, error) {
272 var buf *codec.Buffer
274 buf = codec.NewBuffer(make([]byte, m.Size()))
276 buf = codec.NewBuffer(b)
278 buf.EncodeUint32(uint32(m.Retval))
279 return buf.Bytes(), nil
281 func (m *LbAddDelIntfNat6Reply) Unmarshal(b []byte) error {
282 buf := codec.NewBuffer(b)
283 m.Retval = int32(buf.DecodeUint32())
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"`
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
308 func (m *LbAddDelVip) 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
321 size += 2 // m.TargetPort
322 size += 2 // m.NodePort
323 size += 4 // m.NewFlowsTableLength
327 func (m *LbAddDelVip) Marshal(b []byte) ([]byte, error) {
328 var buf *codec.Buffer
330 buf = codec.NewBuffer(make([]byte, m.Size()))
332 buf = codec.NewBuffer(b)
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
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()
365 // LbAddDelVipReply defines message 'lb_add_del_vip_reply'.
366 type LbAddDelVipReply struct {
367 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
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
377 func (m *LbAddDelVipReply) Size() int {
382 size += 4 // m.Retval
385 func (m *LbAddDelVipReply) Marshal(b []byte) ([]byte, error) {
386 var buf *codec.Buffer
388 buf = codec.NewBuffer(make([]byte, m.Size()))
390 buf = codec.NewBuffer(b)
392 buf.EncodeUint32(uint32(m.Retval))
393 return buf.Bytes(), nil
395 func (m *LbAddDelVipReply) Unmarshal(b []byte) error {
396 buf := codec.NewBuffer(b)
397 m.Retval = int32(buf.DecodeUint32())
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"`
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
416 func (m *LbAsDetails) 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
429 size += 4 // m.InUseSince
432 func (m *LbAsDetails) Marshal(b []byte) ([]byte, error) {
433 var buf *codec.Buffer
435 buf = codec.NewBuffer(make([]byte, m.Size()))
437 buf = codec.NewBuffer(b)
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
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()
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"`
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
478 func (m *LbAsDump) 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
490 func (m *LbAsDump) Marshal(b []byte) ([]byte, error) {
491 var buf *codec.Buffer
493 buf = codec.NewBuffer(make([]byte, m.Size()))
495 buf = codec.NewBuffer(b)
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
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()
514 // LbConf defines message 'lb_conf'.
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"`
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
529 func (m *LbConf) Size() int {
534 size += 1 * 4 // m.IP4SrcAddress
535 size += 1 * 16 // m.IP6SrcAddress
536 size += 4 // m.StickyBucketsPerCore
537 size += 4 // m.FlowTimeout
540 func (m *LbConf) Marshal(b []byte) ([]byte, error) {
541 var buf *codec.Buffer
543 buf = codec.NewBuffer(make([]byte, m.Size()))
545 buf = codec.NewBuffer(b)
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
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()
562 // LbConfReply defines message 'lb_conf_reply'.
563 type LbConfReply struct {
564 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
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
574 func (m *LbConfReply) Size() int {
579 size += 4 // m.Retval
582 func (m *LbConfReply) Marshal(b []byte) ([]byte, error) {
583 var buf *codec.Buffer
585 buf = codec.NewBuffer(make([]byte, m.Size()))
587 buf = codec.NewBuffer(b)
589 buf.EncodeUint32(uint32(m.Retval))
590 return buf.Bytes(), nil
592 func (m *LbConfReply) Unmarshal(b []byte) error {
593 buf := codec.NewBuffer(b)
594 m.Retval = int32(buf.DecodeUint32())
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"`
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
612 func (m *LbFlushVip) 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
624 func (m *LbFlushVip) Marshal(b []byte) ([]byte, error) {
625 var buf *codec.Buffer
627 buf = codec.NewBuffer(make([]byte, m.Size()))
629 buf = codec.NewBuffer(b)
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
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()
648 // LbFlushVipReply defines message 'lb_flush_vip_reply'.
649 type LbFlushVipReply struct {
650 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
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
660 func (m *LbFlushVipReply) Size() int {
665 size += 4 // m.Retval
668 func (m *LbFlushVipReply) Marshal(b []byte) ([]byte, error) {
669 var buf *codec.Buffer
671 buf = codec.NewBuffer(make([]byte, m.Size()))
673 buf = codec.NewBuffer(b)
675 buf.EncodeUint32(uint32(m.Retval))
676 return buf.Bytes(), nil
678 func (m *LbFlushVipReply) Unmarshal(b []byte) error {
679 buf := codec.NewBuffer(b)
680 m.Retval = int32(buf.DecodeUint32())
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"`
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
701 func (m *LbVipDetails) 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
713 size += 4 // m.SrvType
714 size += 2 // m.TargetPort
715 size += 2 // m.FlowTableLength
718 func (m *LbVipDetails) Marshal(b []byte) ([]byte, error) {
719 var buf *codec.Buffer
721 buf = codec.NewBuffer(make([]byte, m.Size()))
723 buf = codec.NewBuffer(b)
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
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()
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"`
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
767 func (m *LbVipDump) 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
781 func (m *LbVipDump) Marshal(b []byte) ([]byte, error) {
782 var buf *codec.Buffer
784 buf = codec.NewBuffer(make([]byte, m.Size()))
786 buf = codec.NewBuffer(b)
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
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()
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")
829 // Messages returns list of all messages in this module.
830 func AllMessages() []api.Message {
831 return []api.Message{
833 (*LbAddDelAsReply)(nil),
834 (*LbAddDelIntfNat4)(nil),
835 (*LbAddDelIntfNat4Reply)(nil),
836 (*LbAddDelIntfNat6)(nil),
837 (*LbAddDelIntfNat6Reply)(nil),
839 (*LbAddDelVipReply)(nil),
845 (*LbFlushVipReply)(nil),
846 (*LbVipDetails)(nil),