1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.5.0
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 = 0x50c0a6c9
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=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 "35d72500" }
47 func (*LbAddDelAs) GetMessageType() api.MessageType {
48 return api.RequestMessage
51 func (m *LbAddDelAs) Size() (size int) {
55 size += 1 // m.Pfx.Address.Af
56 size += 1 * 16 // m.Pfx.Address.Un
57 size += 1 // m.Pfx.Len
58 size += 1 // m.Protocol
60 size += 1 // m.AsAddress.Af
61 size += 1 * 16 // m.AsAddress.Un
63 size += 1 // m.IsFlush
66 func (m *LbAddDelAs) Marshal(b []byte) ([]byte, error) {
68 b = make([]byte, m.Size())
70 buf := codec.NewBuffer(b)
71 buf.EncodeUint8(uint8(m.Pfx.Address.Af))
72 buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 16)
73 buf.EncodeUint8(m.Pfx.Len)
74 buf.EncodeUint8(m.Protocol)
75 buf.EncodeUint16(m.Port)
76 buf.EncodeUint8(uint8(m.AsAddress.Af))
77 buf.EncodeBytes(m.AsAddress.Un.XXX_UnionData[:], 16)
78 buf.EncodeBool(m.IsDel)
79 buf.EncodeBool(m.IsFlush)
80 return buf.Bytes(), nil
82 func (m *LbAddDelAs) Unmarshal(b []byte) error {
83 buf := codec.NewBuffer(b)
84 m.Pfx.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
85 copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
86 m.Pfx.Len = buf.DecodeUint8()
87 m.Protocol = buf.DecodeUint8()
88 m.Port = buf.DecodeUint16()
89 m.AsAddress.Af = ip_types.AddressFamily(buf.DecodeUint8())
90 copy(m.AsAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
91 m.IsDel = buf.DecodeBool()
92 m.IsFlush = buf.DecodeBool()
96 // LbAddDelAsReply defines message 'lb_add_del_as_reply'.
97 type LbAddDelAsReply struct {
98 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
101 func (m *LbAddDelAsReply) Reset() { *m = LbAddDelAsReply{} }
102 func (*LbAddDelAsReply) GetMessageName() string { return "lb_add_del_as_reply" }
103 func (*LbAddDelAsReply) GetCrcString() string { return "e8d4e804" }
104 func (*LbAddDelAsReply) GetMessageType() api.MessageType {
105 return api.ReplyMessage
108 func (m *LbAddDelAsReply) Size() (size int) {
112 size += 4 // m.Retval
115 func (m *LbAddDelAsReply) Marshal(b []byte) ([]byte, error) {
117 b = make([]byte, m.Size())
119 buf := codec.NewBuffer(b)
120 buf.EncodeInt32(m.Retval)
121 return buf.Bytes(), nil
123 func (m *LbAddDelAsReply) Unmarshal(b []byte) error {
124 buf := codec.NewBuffer(b)
125 m.Retval = buf.DecodeInt32()
129 // LbAddDelIntfNat4 defines message 'lb_add_del_intf_nat4'.
130 type LbAddDelIntfNat4 struct {
131 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
132 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
135 func (m *LbAddDelIntfNat4) Reset() { *m = LbAddDelIntfNat4{} }
136 func (*LbAddDelIntfNat4) GetMessageName() string { return "lb_add_del_intf_nat4" }
137 func (*LbAddDelIntfNat4) GetCrcString() string { return "47d6e753" }
138 func (*LbAddDelIntfNat4) GetMessageType() api.MessageType {
139 return api.RequestMessage
142 func (m *LbAddDelIntfNat4) Size() (size int) {
147 size += 4 // m.SwIfIndex
150 func (m *LbAddDelIntfNat4) Marshal(b []byte) ([]byte, error) {
152 b = make([]byte, m.Size())
154 buf := codec.NewBuffer(b)
155 buf.EncodeBool(m.IsAdd)
156 buf.EncodeUint32(uint32(m.SwIfIndex))
157 return buf.Bytes(), nil
159 func (m *LbAddDelIntfNat4) Unmarshal(b []byte) error {
160 buf := codec.NewBuffer(b)
161 m.IsAdd = buf.DecodeBool()
162 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
166 // LbAddDelIntfNat4Reply defines message 'lb_add_del_intf_nat4_reply'.
167 type LbAddDelIntfNat4Reply struct {
168 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
171 func (m *LbAddDelIntfNat4Reply) Reset() { *m = LbAddDelIntfNat4Reply{} }
172 func (*LbAddDelIntfNat4Reply) GetMessageName() string { return "lb_add_del_intf_nat4_reply" }
173 func (*LbAddDelIntfNat4Reply) GetCrcString() string { return "e8d4e804" }
174 func (*LbAddDelIntfNat4Reply) GetMessageType() api.MessageType {
175 return api.ReplyMessage
178 func (m *LbAddDelIntfNat4Reply) Size() (size int) {
182 size += 4 // m.Retval
185 func (m *LbAddDelIntfNat4Reply) Marshal(b []byte) ([]byte, error) {
187 b = make([]byte, m.Size())
189 buf := codec.NewBuffer(b)
190 buf.EncodeInt32(m.Retval)
191 return buf.Bytes(), nil
193 func (m *LbAddDelIntfNat4Reply) Unmarshal(b []byte) error {
194 buf := codec.NewBuffer(b)
195 m.Retval = buf.DecodeInt32()
199 // LbAddDelIntfNat6 defines message 'lb_add_del_intf_nat6'.
200 type LbAddDelIntfNat6 struct {
201 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
202 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
205 func (m *LbAddDelIntfNat6) Reset() { *m = LbAddDelIntfNat6{} }
206 func (*LbAddDelIntfNat6) GetMessageName() string { return "lb_add_del_intf_nat6" }
207 func (*LbAddDelIntfNat6) GetCrcString() string { return "47d6e753" }
208 func (*LbAddDelIntfNat6) GetMessageType() api.MessageType {
209 return api.RequestMessage
212 func (m *LbAddDelIntfNat6) Size() (size int) {
217 size += 4 // m.SwIfIndex
220 func (m *LbAddDelIntfNat6) Marshal(b []byte) ([]byte, error) {
222 b = make([]byte, m.Size())
224 buf := codec.NewBuffer(b)
225 buf.EncodeBool(m.IsAdd)
226 buf.EncodeUint32(uint32(m.SwIfIndex))
227 return buf.Bytes(), nil
229 func (m *LbAddDelIntfNat6) Unmarshal(b []byte) error {
230 buf := codec.NewBuffer(b)
231 m.IsAdd = buf.DecodeBool()
232 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
236 // LbAddDelIntfNat6Reply defines message 'lb_add_del_intf_nat6_reply'.
237 type LbAddDelIntfNat6Reply struct {
238 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
241 func (m *LbAddDelIntfNat6Reply) Reset() { *m = LbAddDelIntfNat6Reply{} }
242 func (*LbAddDelIntfNat6Reply) GetMessageName() string { return "lb_add_del_intf_nat6_reply" }
243 func (*LbAddDelIntfNat6Reply) GetCrcString() string { return "e8d4e804" }
244 func (*LbAddDelIntfNat6Reply) GetMessageType() api.MessageType {
245 return api.ReplyMessage
248 func (m *LbAddDelIntfNat6Reply) Size() (size int) {
252 size += 4 // m.Retval
255 func (m *LbAddDelIntfNat6Reply) Marshal(b []byte) ([]byte, error) {
257 b = make([]byte, m.Size())
259 buf := codec.NewBuffer(b)
260 buf.EncodeInt32(m.Retval)
261 return buf.Bytes(), nil
263 func (m *LbAddDelIntfNat6Reply) Unmarshal(b []byte) error {
264 buf := codec.NewBuffer(b)
265 m.Retval = buf.DecodeInt32()
269 // LbAddDelVip defines message 'lb_add_del_vip'.
270 type LbAddDelVip struct {
271 Pfx ip_types.AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"`
272 Protocol uint8 `binapi:"u8,name=protocol,default=255" json:"protocol,omitempty"`
273 Port uint16 `binapi:"u16,name=port" json:"port,omitempty"`
274 Encap lb_types.LbEncapType `binapi:"lb_encap_type,name=encap" json:"encap,omitempty"`
275 Dscp uint8 `binapi:"u8,name=dscp" json:"dscp,omitempty"`
276 Type lb_types.LbSrvType `binapi:"lb_srv_type,name=type" json:"type,omitempty"`
277 TargetPort uint16 `binapi:"u16,name=target_port" json:"target_port,omitempty"`
278 NodePort uint16 `binapi:"u16,name=node_port" json:"node_port,omitempty"`
279 NewFlowsTableLength uint32 `binapi:"u32,name=new_flows_table_length,default=1024" json:"new_flows_table_length,omitempty"`
280 IsDel bool `binapi:"bool,name=is_del" json:"is_del,omitempty"`
283 func (m *LbAddDelVip) Reset() { *m = LbAddDelVip{} }
284 func (*LbAddDelVip) GetMessageName() string { return "lb_add_del_vip" }
285 func (*LbAddDelVip) GetCrcString() string { return "6fa569c7" }
286 func (*LbAddDelVip) GetMessageType() api.MessageType {
287 return api.RequestMessage
290 func (m *LbAddDelVip) Size() (size int) {
294 size += 1 // m.Pfx.Address.Af
295 size += 1 * 16 // m.Pfx.Address.Un
296 size += 1 // m.Pfx.Len
297 size += 1 // m.Protocol
302 size += 2 // m.TargetPort
303 size += 2 // m.NodePort
304 size += 4 // m.NewFlowsTableLength
308 func (m *LbAddDelVip) Marshal(b []byte) ([]byte, error) {
310 b = make([]byte, m.Size())
312 buf := codec.NewBuffer(b)
313 buf.EncodeUint8(uint8(m.Pfx.Address.Af))
314 buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 16)
315 buf.EncodeUint8(m.Pfx.Len)
316 buf.EncodeUint8(m.Protocol)
317 buf.EncodeUint16(m.Port)
318 buf.EncodeUint32(uint32(m.Encap))
319 buf.EncodeUint8(m.Dscp)
320 buf.EncodeUint32(uint32(m.Type))
321 buf.EncodeUint16(m.TargetPort)
322 buf.EncodeUint16(m.NodePort)
323 buf.EncodeUint32(m.NewFlowsTableLength)
324 buf.EncodeBool(m.IsDel)
325 return buf.Bytes(), nil
327 func (m *LbAddDelVip) Unmarshal(b []byte) error {
328 buf := codec.NewBuffer(b)
329 m.Pfx.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
330 copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
331 m.Pfx.Len = buf.DecodeUint8()
332 m.Protocol = buf.DecodeUint8()
333 m.Port = buf.DecodeUint16()
334 m.Encap = lb_types.LbEncapType(buf.DecodeUint32())
335 m.Dscp = buf.DecodeUint8()
336 m.Type = lb_types.LbSrvType(buf.DecodeUint32())
337 m.TargetPort = buf.DecodeUint16()
338 m.NodePort = buf.DecodeUint16()
339 m.NewFlowsTableLength = buf.DecodeUint32()
340 m.IsDel = buf.DecodeBool()
344 // LbAddDelVipReply defines message 'lb_add_del_vip_reply'.
345 type LbAddDelVipReply struct {
346 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
349 func (m *LbAddDelVipReply) Reset() { *m = LbAddDelVipReply{} }
350 func (*LbAddDelVipReply) GetMessageName() string { return "lb_add_del_vip_reply" }
351 func (*LbAddDelVipReply) GetCrcString() string { return "e8d4e804" }
352 func (*LbAddDelVipReply) GetMessageType() api.MessageType {
353 return api.ReplyMessage
356 func (m *LbAddDelVipReply) Size() (size int) {
360 size += 4 // m.Retval
363 func (m *LbAddDelVipReply) Marshal(b []byte) ([]byte, error) {
365 b = make([]byte, m.Size())
367 buf := codec.NewBuffer(b)
368 buf.EncodeInt32(m.Retval)
369 return buf.Bytes(), nil
371 func (m *LbAddDelVipReply) Unmarshal(b []byte) error {
372 buf := codec.NewBuffer(b)
373 m.Retval = buf.DecodeInt32()
377 // LbAsDetails defines message 'lb_as_details'.
378 type LbAsDetails struct {
379 Vip lb_types.LbVip `binapi:"lb_vip,name=vip" json:"vip,omitempty"`
380 AppSrv ip_types.Address `binapi:"address,name=app_srv" json:"app_srv,omitempty"`
381 Flags uint8 `binapi:"u8,name=flags" json:"flags,omitempty"`
382 InUseSince uint32 `binapi:"u32,name=in_use_since" json:"in_use_since,omitempty"`
385 func (m *LbAsDetails) Reset() { *m = LbAsDetails{} }
386 func (*LbAsDetails) GetMessageName() string { return "lb_as_details" }
387 func (*LbAsDetails) GetCrcString() string { return "8d24c29e" }
388 func (*LbAsDetails) GetMessageType() api.MessageType {
389 return api.ReplyMessage
392 func (m *LbAsDetails) Size() (size int) {
396 size += 1 // m.Vip.Pfx.Address.Af
397 size += 1 * 16 // m.Vip.Pfx.Address.Un
398 size += 1 // m.Vip.Pfx.Len
399 size += 1 // m.Vip.Protocol
400 size += 2 // m.Vip.Port
401 size += 1 // m.AppSrv.Af
402 size += 1 * 16 // m.AppSrv.Un
404 size += 4 // m.InUseSince
407 func (m *LbAsDetails) Marshal(b []byte) ([]byte, error) {
409 b = make([]byte, m.Size())
411 buf := codec.NewBuffer(b)
412 buf.EncodeUint8(uint8(m.Vip.Pfx.Address.Af))
413 buf.EncodeBytes(m.Vip.Pfx.Address.Un.XXX_UnionData[:], 16)
414 buf.EncodeUint8(m.Vip.Pfx.Len)
415 buf.EncodeUint8(uint8(m.Vip.Protocol))
416 buf.EncodeUint16(m.Vip.Port)
417 buf.EncodeUint8(uint8(m.AppSrv.Af))
418 buf.EncodeBytes(m.AppSrv.Un.XXX_UnionData[:], 16)
419 buf.EncodeUint8(m.Flags)
420 buf.EncodeUint32(m.InUseSince)
421 return buf.Bytes(), nil
423 func (m *LbAsDetails) Unmarshal(b []byte) error {
424 buf := codec.NewBuffer(b)
425 m.Vip.Pfx.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
426 copy(m.Vip.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
427 m.Vip.Pfx.Len = buf.DecodeUint8()
428 m.Vip.Protocol = ip_types.IPProto(buf.DecodeUint8())
429 m.Vip.Port = buf.DecodeUint16()
430 m.AppSrv.Af = ip_types.AddressFamily(buf.DecodeUint8())
431 copy(m.AppSrv.Un.XXX_UnionData[:], buf.DecodeBytes(16))
432 m.Flags = buf.DecodeUint8()
433 m.InUseSince = buf.DecodeUint32()
437 // LbAsDump defines message 'lb_as_dump'.
438 type LbAsDump struct {
439 Pfx ip_types.AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"`
440 Protocol uint8 `binapi:"u8,name=protocol" json:"protocol,omitempty"`
441 Port uint16 `binapi:"u16,name=port" json:"port,omitempty"`
444 func (m *LbAsDump) Reset() { *m = LbAsDump{} }
445 func (*LbAsDump) GetMessageName() string { return "lb_as_dump" }
446 func (*LbAsDump) GetCrcString() string { return "1063f819" }
447 func (*LbAsDump) GetMessageType() api.MessageType {
448 return api.RequestMessage
451 func (m *LbAsDump) Size() (size int) {
455 size += 1 // m.Pfx.Address.Af
456 size += 1 * 16 // m.Pfx.Address.Un
457 size += 1 // m.Pfx.Len
458 size += 1 // m.Protocol
462 func (m *LbAsDump) Marshal(b []byte) ([]byte, error) {
464 b = make([]byte, m.Size())
466 buf := codec.NewBuffer(b)
467 buf.EncodeUint8(uint8(m.Pfx.Address.Af))
468 buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 16)
469 buf.EncodeUint8(m.Pfx.Len)
470 buf.EncodeUint8(m.Protocol)
471 buf.EncodeUint16(m.Port)
472 return buf.Bytes(), nil
474 func (m *LbAsDump) Unmarshal(b []byte) error {
475 buf := codec.NewBuffer(b)
476 m.Pfx.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
477 copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
478 m.Pfx.Len = buf.DecodeUint8()
479 m.Protocol = buf.DecodeUint8()
480 m.Port = buf.DecodeUint16()
484 // LbConf defines message 'lb_conf'.
486 IP4SrcAddress ip_types.IP4Address `binapi:"ip4_address,name=ip4_src_address" json:"ip4_src_address,omitempty"`
487 IP6SrcAddress ip_types.IP6Address `binapi:"ip6_address,name=ip6_src_address" json:"ip6_src_address,omitempty"`
488 StickyBucketsPerCore uint32 `binapi:"u32,name=sticky_buckets_per_core,default=4294967295" json:"sticky_buckets_per_core,omitempty"`
489 FlowTimeout uint32 `binapi:"u32,name=flow_timeout,default=4294967295" json:"flow_timeout,omitempty"`
492 func (m *LbConf) Reset() { *m = LbConf{} }
493 func (*LbConf) GetMessageName() string { return "lb_conf" }
494 func (*LbConf) GetCrcString() string { return "56cd3261" }
495 func (*LbConf) GetMessageType() api.MessageType {
496 return api.RequestMessage
499 func (m *LbConf) Size() (size int) {
503 size += 1 * 4 // m.IP4SrcAddress
504 size += 1 * 16 // m.IP6SrcAddress
505 size += 4 // m.StickyBucketsPerCore
506 size += 4 // m.FlowTimeout
509 func (m *LbConf) Marshal(b []byte) ([]byte, error) {
511 b = make([]byte, m.Size())
513 buf := codec.NewBuffer(b)
514 buf.EncodeBytes(m.IP4SrcAddress[:], 4)
515 buf.EncodeBytes(m.IP6SrcAddress[:], 16)
516 buf.EncodeUint32(m.StickyBucketsPerCore)
517 buf.EncodeUint32(m.FlowTimeout)
518 return buf.Bytes(), nil
520 func (m *LbConf) Unmarshal(b []byte) error {
521 buf := codec.NewBuffer(b)
522 copy(m.IP4SrcAddress[:], buf.DecodeBytes(4))
523 copy(m.IP6SrcAddress[:], buf.DecodeBytes(16))
524 m.StickyBucketsPerCore = buf.DecodeUint32()
525 m.FlowTimeout = buf.DecodeUint32()
529 // LbConfReply defines message 'lb_conf_reply'.
530 type LbConfReply struct {
531 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
534 func (m *LbConfReply) Reset() { *m = LbConfReply{} }
535 func (*LbConfReply) GetMessageName() string { return "lb_conf_reply" }
536 func (*LbConfReply) GetCrcString() string { return "e8d4e804" }
537 func (*LbConfReply) GetMessageType() api.MessageType {
538 return api.ReplyMessage
541 func (m *LbConfReply) Size() (size int) {
545 size += 4 // m.Retval
548 func (m *LbConfReply) Marshal(b []byte) ([]byte, error) {
550 b = make([]byte, m.Size())
552 buf := codec.NewBuffer(b)
553 buf.EncodeInt32(m.Retval)
554 return buf.Bytes(), nil
556 func (m *LbConfReply) Unmarshal(b []byte) error {
557 buf := codec.NewBuffer(b)
558 m.Retval = buf.DecodeInt32()
562 // LbFlushVip defines message 'lb_flush_vip'.
563 type LbFlushVip struct {
564 Pfx ip_types.AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"`
565 Protocol uint8 `binapi:"u8,name=protocol" json:"protocol,omitempty"`
566 Port uint16 `binapi:"u16,name=port" json:"port,omitempty"`
569 func (m *LbFlushVip) Reset() { *m = LbFlushVip{} }
570 func (*LbFlushVip) GetMessageName() string { return "lb_flush_vip" }
571 func (*LbFlushVip) GetCrcString() string { return "1063f819" }
572 func (*LbFlushVip) GetMessageType() api.MessageType {
573 return api.RequestMessage
576 func (m *LbFlushVip) Size() (size int) {
580 size += 1 // m.Pfx.Address.Af
581 size += 1 * 16 // m.Pfx.Address.Un
582 size += 1 // m.Pfx.Len
583 size += 1 // m.Protocol
587 func (m *LbFlushVip) Marshal(b []byte) ([]byte, error) {
589 b = make([]byte, m.Size())
591 buf := codec.NewBuffer(b)
592 buf.EncodeUint8(uint8(m.Pfx.Address.Af))
593 buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 16)
594 buf.EncodeUint8(m.Pfx.Len)
595 buf.EncodeUint8(m.Protocol)
596 buf.EncodeUint16(m.Port)
597 return buf.Bytes(), nil
599 func (m *LbFlushVip) Unmarshal(b []byte) error {
600 buf := codec.NewBuffer(b)
601 m.Pfx.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
602 copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
603 m.Pfx.Len = buf.DecodeUint8()
604 m.Protocol = buf.DecodeUint8()
605 m.Port = buf.DecodeUint16()
609 // LbFlushVipReply defines message 'lb_flush_vip_reply'.
610 type LbFlushVipReply struct {
611 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
614 func (m *LbFlushVipReply) Reset() { *m = LbFlushVipReply{} }
615 func (*LbFlushVipReply) GetMessageName() string { return "lb_flush_vip_reply" }
616 func (*LbFlushVipReply) GetCrcString() string { return "e8d4e804" }
617 func (*LbFlushVipReply) GetMessageType() api.MessageType {
618 return api.ReplyMessage
621 func (m *LbFlushVipReply) Size() (size int) {
625 size += 4 // m.Retval
628 func (m *LbFlushVipReply) Marshal(b []byte) ([]byte, error) {
630 b = make([]byte, m.Size())
632 buf := codec.NewBuffer(b)
633 buf.EncodeInt32(m.Retval)
634 return buf.Bytes(), nil
636 func (m *LbFlushVipReply) Unmarshal(b []byte) error {
637 buf := codec.NewBuffer(b)
638 m.Retval = buf.DecodeInt32()
642 // LbVipDetails defines message 'lb_vip_details'.
643 type LbVipDetails struct {
644 Vip lb_types.LbVip `binapi:"lb_vip,name=vip" json:"vip,omitempty"`
645 Encap lb_types.LbEncapType `binapi:"lb_encap_type,name=encap" json:"encap,omitempty"`
646 Dscp ip_types.IPDscp `binapi:"ip_dscp,name=dscp" json:"dscp,omitempty"`
647 SrvType lb_types.LbSrvType `binapi:"lb_srv_type,name=srv_type" json:"srv_type,omitempty"`
648 TargetPort uint16 `binapi:"u16,name=target_port" json:"target_port,omitempty"`
649 FlowTableLength uint16 `binapi:"u16,name=flow_table_length" json:"flow_table_length,omitempty"`
652 func (m *LbVipDetails) Reset() { *m = LbVipDetails{} }
653 func (*LbVipDetails) GetMessageName() string { return "lb_vip_details" }
654 func (*LbVipDetails) GetCrcString() string { return "1329ec9b" }
655 func (*LbVipDetails) GetMessageType() api.MessageType {
656 return api.ReplyMessage
659 func (m *LbVipDetails) Size() (size int) {
663 size += 1 // m.Vip.Pfx.Address.Af
664 size += 1 * 16 // m.Vip.Pfx.Address.Un
665 size += 1 // m.Vip.Pfx.Len
666 size += 1 // m.Vip.Protocol
667 size += 2 // m.Vip.Port
670 size += 4 // m.SrvType
671 size += 2 // m.TargetPort
672 size += 2 // m.FlowTableLength
675 func (m *LbVipDetails) Marshal(b []byte) ([]byte, error) {
677 b = make([]byte, m.Size())
679 buf := codec.NewBuffer(b)
680 buf.EncodeUint8(uint8(m.Vip.Pfx.Address.Af))
681 buf.EncodeBytes(m.Vip.Pfx.Address.Un.XXX_UnionData[:], 16)
682 buf.EncodeUint8(m.Vip.Pfx.Len)
683 buf.EncodeUint8(uint8(m.Vip.Protocol))
684 buf.EncodeUint16(m.Vip.Port)
685 buf.EncodeUint32(uint32(m.Encap))
686 buf.EncodeUint8(uint8(m.Dscp))
687 buf.EncodeUint32(uint32(m.SrvType))
688 buf.EncodeUint16(m.TargetPort)
689 buf.EncodeUint16(m.FlowTableLength)
690 return buf.Bytes(), nil
692 func (m *LbVipDetails) Unmarshal(b []byte) error {
693 buf := codec.NewBuffer(b)
694 m.Vip.Pfx.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
695 copy(m.Vip.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
696 m.Vip.Pfx.Len = buf.DecodeUint8()
697 m.Vip.Protocol = ip_types.IPProto(buf.DecodeUint8())
698 m.Vip.Port = buf.DecodeUint16()
699 m.Encap = lb_types.LbEncapType(buf.DecodeUint32())
700 m.Dscp = ip_types.IPDscp(buf.DecodeUint8())
701 m.SrvType = lb_types.LbSrvType(buf.DecodeUint32())
702 m.TargetPort = buf.DecodeUint16()
703 m.FlowTableLength = buf.DecodeUint16()
707 // LbVipDump defines message 'lb_vip_dump'.
708 type LbVipDump struct {
709 Pfx ip_types.AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"`
710 PfxMatcher ip_types.PrefixMatcher `binapi:"prefix_matcher,name=pfx_matcher" json:"pfx_matcher,omitempty"`
711 Protocol uint8 `binapi:"u8,name=protocol,default=255" json:"protocol,omitempty"`
712 Port uint16 `binapi:"u16,name=port" json:"port,omitempty"`
715 func (m *LbVipDump) Reset() { *m = LbVipDump{} }
716 func (*LbVipDump) GetMessageName() string { return "lb_vip_dump" }
717 func (*LbVipDump) GetCrcString() string { return "56110cb7" }
718 func (*LbVipDump) GetMessageType() api.MessageType {
719 return api.RequestMessage
722 func (m *LbVipDump) Size() (size int) {
726 size += 1 // m.Pfx.Address.Af
727 size += 1 * 16 // m.Pfx.Address.Un
728 size += 1 // m.Pfx.Len
729 size += 1 // m.PfxMatcher.Le
730 size += 1 // m.PfxMatcher.Ge
731 size += 1 // m.Protocol
735 func (m *LbVipDump) Marshal(b []byte) ([]byte, error) {
737 b = make([]byte, m.Size())
739 buf := codec.NewBuffer(b)
740 buf.EncodeUint8(uint8(m.Pfx.Address.Af))
741 buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 16)
742 buf.EncodeUint8(m.Pfx.Len)
743 buf.EncodeUint8(m.PfxMatcher.Le)
744 buf.EncodeUint8(m.PfxMatcher.Ge)
745 buf.EncodeUint8(m.Protocol)
746 buf.EncodeUint16(m.Port)
747 return buf.Bytes(), nil
749 func (m *LbVipDump) Unmarshal(b []byte) error {
750 buf := codec.NewBuffer(b)
751 m.Pfx.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
752 copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
753 m.Pfx.Len = buf.DecodeUint8()
754 m.PfxMatcher.Le = buf.DecodeUint8()
755 m.PfxMatcher.Ge = buf.DecodeUint8()
756 m.Protocol = buf.DecodeUint8()
757 m.Port = buf.DecodeUint16()
761 func init() { file_lb_binapi_init() }
762 func file_lb_binapi_init() {
763 api.RegisterMessage((*LbAddDelAs)(nil), "lb_add_del_as_35d72500")
764 api.RegisterMessage((*LbAddDelAsReply)(nil), "lb_add_del_as_reply_e8d4e804")
765 api.RegisterMessage((*LbAddDelIntfNat4)(nil), "lb_add_del_intf_nat4_47d6e753")
766 api.RegisterMessage((*LbAddDelIntfNat4Reply)(nil), "lb_add_del_intf_nat4_reply_e8d4e804")
767 api.RegisterMessage((*LbAddDelIntfNat6)(nil), "lb_add_del_intf_nat6_47d6e753")
768 api.RegisterMessage((*LbAddDelIntfNat6Reply)(nil), "lb_add_del_intf_nat6_reply_e8d4e804")
769 api.RegisterMessage((*LbAddDelVip)(nil), "lb_add_del_vip_6fa569c7")
770 api.RegisterMessage((*LbAddDelVipReply)(nil), "lb_add_del_vip_reply_e8d4e804")
771 api.RegisterMessage((*LbAsDetails)(nil), "lb_as_details_8d24c29e")
772 api.RegisterMessage((*LbAsDump)(nil), "lb_as_dump_1063f819")
773 api.RegisterMessage((*LbConf)(nil), "lb_conf_56cd3261")
774 api.RegisterMessage((*LbConfReply)(nil), "lb_conf_reply_e8d4e804")
775 api.RegisterMessage((*LbFlushVip)(nil), "lb_flush_vip_1063f819")
776 api.RegisterMessage((*LbFlushVipReply)(nil), "lb_flush_vip_reply_e8d4e804")
777 api.RegisterMessage((*LbVipDetails)(nil), "lb_vip_details_1329ec9b")
778 api.RegisterMessage((*LbVipDump)(nil), "lb_vip_dump_56110cb7")
781 // Messages returns list of all messages in this module.
782 func AllMessages() []api.Message {
783 return []api.Message{
785 (*LbAddDelAsReply)(nil),
786 (*LbAddDelIntfNat4)(nil),
787 (*LbAddDelIntfNat4Reply)(nil),
788 (*LbAddDelIntfNat6)(nil),
789 (*LbAddDelIntfNat6Reply)(nil),
791 (*LbAddDelVipReply)(nil),
797 (*LbFlushVipReply)(nil),
798 (*LbVipDetails)(nil),