1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
6 // Package lb contains generated bindings for API file lb.api.
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"
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
30 VersionCrc = 0x5e4e85b1
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"`
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
50 func (m *LbAddDelAs) Size() (size int) {
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
59 size += 1 // m.AsAddress.Af
60 size += 1 * 16 // m.AsAddress.Un
62 size += 1 // m.IsFlush
65 func (m *LbAddDelAs) Marshal(b []byte) ([]byte, error) {
67 b = make([]byte, m.Size())
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
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()
95 // LbAddDelAsReply defines message 'lb_add_del_as_reply'.
96 type LbAddDelAsReply struct {
97 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
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
107 func (m *LbAddDelAsReply) Size() (size int) {
111 size += 4 // m.Retval
114 func (m *LbAddDelAsReply) Marshal(b []byte) ([]byte, error) {
116 b = make([]byte, m.Size())
118 buf := codec.NewBuffer(b)
119 buf.EncodeInt32(m.Retval)
120 return buf.Bytes(), nil
122 func (m *LbAddDelAsReply) Unmarshal(b []byte) error {
123 buf := codec.NewBuffer(b)
124 m.Retval = buf.DecodeInt32()
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"`
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
141 func (m *LbAddDelIntfNat4) Size() (size int) {
146 size += 4 // m.SwIfIndex
149 func (m *LbAddDelIntfNat4) Marshal(b []byte) ([]byte, error) {
151 b = make([]byte, m.Size())
153 buf := codec.NewBuffer(b)
154 buf.EncodeBool(m.IsAdd)
155 buf.EncodeUint32(uint32(m.SwIfIndex))
156 return buf.Bytes(), nil
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())
165 // LbAddDelIntfNat4Reply defines message 'lb_add_del_intf_nat4_reply'.
166 type LbAddDelIntfNat4Reply struct {
167 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
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
177 func (m *LbAddDelIntfNat4Reply) Size() (size int) {
181 size += 4 // m.Retval
184 func (m *LbAddDelIntfNat4Reply) Marshal(b []byte) ([]byte, error) {
186 b = make([]byte, m.Size())
188 buf := codec.NewBuffer(b)
189 buf.EncodeInt32(m.Retval)
190 return buf.Bytes(), nil
192 func (m *LbAddDelIntfNat4Reply) Unmarshal(b []byte) error {
193 buf := codec.NewBuffer(b)
194 m.Retval = buf.DecodeInt32()
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"`
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
211 func (m *LbAddDelIntfNat6) Size() (size int) {
216 size += 4 // m.SwIfIndex
219 func (m *LbAddDelIntfNat6) Marshal(b []byte) ([]byte, error) {
221 b = make([]byte, m.Size())
223 buf := codec.NewBuffer(b)
224 buf.EncodeBool(m.IsAdd)
225 buf.EncodeUint32(uint32(m.SwIfIndex))
226 return buf.Bytes(), nil
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())
235 // LbAddDelIntfNat6Reply defines message 'lb_add_del_intf_nat6_reply'.
236 type LbAddDelIntfNat6Reply struct {
237 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
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
247 func (m *LbAddDelIntfNat6Reply) Size() (size int) {
251 size += 4 // m.Retval
254 func (m *LbAddDelIntfNat6Reply) Marshal(b []byte) ([]byte, error) {
256 b = make([]byte, m.Size())
258 buf := codec.NewBuffer(b)
259 buf.EncodeInt32(m.Retval)
260 return buf.Bytes(), nil
262 func (m *LbAddDelIntfNat6Reply) Unmarshal(b []byte) error {
263 buf := codec.NewBuffer(b)
264 m.Retval = buf.DecodeInt32()
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"`
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
289 func (m *LbAddDelVip) Size() (size int) {
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
301 size += 2 // m.TargetPort
302 size += 2 // m.NodePort
303 size += 4 // m.NewFlowsTableLength
307 func (m *LbAddDelVip) Marshal(b []byte) ([]byte, error) {
309 b = make([]byte, m.Size())
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
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()
343 // LbAddDelVipReply defines message 'lb_add_del_vip_reply'.
344 type LbAddDelVipReply struct {
345 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
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
355 func (m *LbAddDelVipReply) Size() (size int) {
359 size += 4 // m.Retval
362 func (m *LbAddDelVipReply) Marshal(b []byte) ([]byte, error) {
364 b = make([]byte, m.Size())
366 buf := codec.NewBuffer(b)
367 buf.EncodeInt32(m.Retval)
368 return buf.Bytes(), nil
370 func (m *LbAddDelVipReply) Unmarshal(b []byte) error {
371 buf := codec.NewBuffer(b)
372 m.Retval = buf.DecodeInt32()
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"`
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
391 func (m *LbAsDetails) Size() (size int) {
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
403 size += 4 // m.InUseSince
406 func (m *LbAsDetails) Marshal(b []byte) ([]byte, error) {
408 b = make([]byte, m.Size())
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
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()
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"`
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
450 func (m *LbAsDump) Size() (size int) {
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
461 func (m *LbAsDump) Marshal(b []byte) ([]byte, error) {
463 b = make([]byte, m.Size())
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
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()
483 // LbConf defines message 'lb_conf'.
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"`
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
498 func (m *LbConf) Size() (size int) {
502 size += 1 * 4 // m.IP4SrcAddress
503 size += 1 * 16 // m.IP6SrcAddress
504 size += 4 // m.StickyBucketsPerCore
505 size += 4 // m.FlowTimeout
508 func (m *LbConf) Marshal(b []byte) ([]byte, error) {
510 b = make([]byte, m.Size())
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
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()
528 // LbConfReply defines message 'lb_conf_reply'.
529 type LbConfReply struct {
530 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
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
540 func (m *LbConfReply) Size() (size int) {
544 size += 4 // m.Retval
547 func (m *LbConfReply) Marshal(b []byte) ([]byte, error) {
549 b = make([]byte, m.Size())
551 buf := codec.NewBuffer(b)
552 buf.EncodeInt32(m.Retval)
553 return buf.Bytes(), nil
555 func (m *LbConfReply) Unmarshal(b []byte) error {
556 buf := codec.NewBuffer(b)
557 m.Retval = buf.DecodeInt32()
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"`
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
575 func (m *LbFlushVip) Size() (size int) {
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
586 func (m *LbFlushVip) Marshal(b []byte) ([]byte, error) {
588 b = make([]byte, m.Size())
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
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()
608 // LbFlushVipReply defines message 'lb_flush_vip_reply'.
609 type LbFlushVipReply struct {
610 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
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
620 func (m *LbFlushVipReply) Size() (size int) {
624 size += 4 // m.Retval
627 func (m *LbFlushVipReply) Marshal(b []byte) ([]byte, error) {
629 b = make([]byte, m.Size())
631 buf := codec.NewBuffer(b)
632 buf.EncodeInt32(m.Retval)
633 return buf.Bytes(), nil
635 func (m *LbFlushVipReply) Unmarshal(b []byte) error {
636 buf := codec.NewBuffer(b)
637 m.Retval = buf.DecodeInt32()
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"`
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
658 func (m *LbVipDetails) Size() (size int) {
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
669 size += 4 // m.SrvType
670 size += 2 // m.TargetPort
671 size += 2 // m.FlowTableLength
674 func (m *LbVipDetails) Marshal(b []byte) ([]byte, error) {
676 b = make([]byte, m.Size())
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
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()
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"`
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
721 func (m *LbVipDump) Size() (size int) {
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
734 func (m *LbVipDump) Marshal(b []byte) ([]byte, error) {
736 b = make([]byte, m.Size())
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
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()
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")
780 // Messages returns list of all messages in this module.
781 func AllMessages() []api.Message {
782 return []api.Message{
784 (*LbAddDelAsReply)(nil),
785 (*LbAddDelIntfNat4)(nil),
786 (*LbAddDelIntfNat4Reply)(nil),
787 (*LbAddDelIntfNat6)(nil),
788 (*LbAddDelIntfNat6Reply)(nil),
790 (*LbAddDelVipReply)(nil),
796 (*LbFlushVipReply)(nil),
797 (*LbVipDetails)(nil),