1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
5 // source: .vppapi/plugins/lacp.api.json
7 // Package lacp contains generated bindings for API file lacp.api.
17 api "git.fd.io/govpp.git/api"
18 codec "git.fd.io/govpp.git/codec"
23 // This is a compile-time assertion to ensure that this generated file
24 // is compatible with the GoVPP api package it is being compiled against.
25 // A compilation error at this line likely means your copy of the
26 // GoVPP api package needs to be updated.
27 const _ = api.GoVppAPIPackageIsVersion2
32 VersionCrc = 0x930086a4
35 // IfStatusFlags defines enum 'if_status_flags'.
36 type IfStatusFlags uint32
39 IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
40 IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
44 IfStatusFlags_name = map[uint32]string{
45 1: "IF_STATUS_API_FLAG_ADMIN_UP",
46 2: "IF_STATUS_API_FLAG_LINK_UP",
48 IfStatusFlags_value = map[string]uint32{
49 "IF_STATUS_API_FLAG_ADMIN_UP": 1,
50 "IF_STATUS_API_FLAG_LINK_UP": 2,
54 func (x IfStatusFlags) String() string {
55 s, ok := IfStatusFlags_name[uint32(x)]
59 str := func(n uint32) string {
60 s, ok := IfStatusFlags_name[uint32(n)]
64 return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
66 for i := uint32(0); i <= 32; i++ {
81 // IfType defines enum 'if_type'.
85 IF_API_TYPE_HARDWARE IfType = 1
86 IF_API_TYPE_SUB IfType = 2
87 IF_API_TYPE_P2P IfType = 3
88 IF_API_TYPE_PIPE IfType = 4
92 IfType_name = map[uint32]string{
93 1: "IF_API_TYPE_HARDWARE",
96 4: "IF_API_TYPE_PIPE",
98 IfType_value = map[string]uint32{
99 "IF_API_TYPE_HARDWARE": 1,
100 "IF_API_TYPE_SUB": 2,
101 "IF_API_TYPE_P2P": 3,
102 "IF_API_TYPE_PIPE": 4,
106 func (x IfType) String() string {
107 s, ok := IfType_name[uint32(x)]
111 return "IfType(" + strconv.Itoa(int(x)) + ")"
114 // LinkDuplex defines enum 'link_duplex'.
115 type LinkDuplex uint32
118 LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
119 LINK_DUPLEX_API_HALF LinkDuplex = 1
120 LINK_DUPLEX_API_FULL LinkDuplex = 2
124 LinkDuplex_name = map[uint32]string{
125 0: "LINK_DUPLEX_API_UNKNOWN",
126 1: "LINK_DUPLEX_API_HALF",
127 2: "LINK_DUPLEX_API_FULL",
129 LinkDuplex_value = map[string]uint32{
130 "LINK_DUPLEX_API_UNKNOWN": 0,
131 "LINK_DUPLEX_API_HALF": 1,
132 "LINK_DUPLEX_API_FULL": 2,
136 func (x LinkDuplex) String() string {
137 s, ok := LinkDuplex_name[uint32(x)]
141 return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
144 // MtuProto defines enum 'mtu_proto'.
148 MTU_PROTO_API_L3 MtuProto = 1
149 MTU_PROTO_API_IP4 MtuProto = 2
150 MTU_PROTO_API_IP6 MtuProto = 3
151 MTU_PROTO_API_MPLS MtuProto = 4
152 MTU_PROTO_API_N MtuProto = 5
156 MtuProto_name = map[uint32]string{
157 1: "MTU_PROTO_API_L3",
158 2: "MTU_PROTO_API_IP4",
159 3: "MTU_PROTO_API_IP6",
160 4: "MTU_PROTO_API_MPLS",
161 5: "MTU_PROTO_API_N",
163 MtuProto_value = map[string]uint32{
164 "MTU_PROTO_API_L3": 1,
165 "MTU_PROTO_API_IP4": 2,
166 "MTU_PROTO_API_IP6": 3,
167 "MTU_PROTO_API_MPLS": 4,
168 "MTU_PROTO_API_N": 5,
172 func (x MtuProto) String() string {
173 s, ok := MtuProto_name[uint32(x)]
177 return "MtuProto(" + strconv.Itoa(int(x)) + ")"
180 // RxMode defines enum 'rx_mode'.
184 RX_MODE_API_UNKNOWN RxMode = 0
185 RX_MODE_API_POLLING RxMode = 1
186 RX_MODE_API_INTERRUPT RxMode = 2
187 RX_MODE_API_ADAPTIVE RxMode = 3
188 RX_MODE_API_DEFAULT RxMode = 4
192 RxMode_name = map[uint32]string{
193 0: "RX_MODE_API_UNKNOWN",
194 1: "RX_MODE_API_POLLING",
195 2: "RX_MODE_API_INTERRUPT",
196 3: "RX_MODE_API_ADAPTIVE",
197 4: "RX_MODE_API_DEFAULT",
199 RxMode_value = map[string]uint32{
200 "RX_MODE_API_UNKNOWN": 0,
201 "RX_MODE_API_POLLING": 1,
202 "RX_MODE_API_INTERRUPT": 2,
203 "RX_MODE_API_ADAPTIVE": 3,
204 "RX_MODE_API_DEFAULT": 4,
208 func (x RxMode) String() string {
209 s, ok := RxMode_name[uint32(x)]
213 return "RxMode(" + strconv.Itoa(int(x)) + ")"
216 // SubIfFlags defines enum 'sub_if_flags'.
217 type SubIfFlags uint32
220 SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
221 SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
222 SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
223 SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
224 SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
225 SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
226 SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
227 SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
228 SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
229 SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
233 SubIfFlags_name = map[uint32]string{
234 1: "SUB_IF_API_FLAG_NO_TAGS",
235 2: "SUB_IF_API_FLAG_ONE_TAG",
236 4: "SUB_IF_API_FLAG_TWO_TAGS",
237 8: "SUB_IF_API_FLAG_DOT1AD",
238 16: "SUB_IF_API_FLAG_EXACT_MATCH",
239 32: "SUB_IF_API_FLAG_DEFAULT",
240 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
241 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
242 254: "SUB_IF_API_FLAG_MASK_VNET",
243 256: "SUB_IF_API_FLAG_DOT1AH",
245 SubIfFlags_value = map[string]uint32{
246 "SUB_IF_API_FLAG_NO_TAGS": 1,
247 "SUB_IF_API_FLAG_ONE_TAG": 2,
248 "SUB_IF_API_FLAG_TWO_TAGS": 4,
249 "SUB_IF_API_FLAG_DOT1AD": 8,
250 "SUB_IF_API_FLAG_EXACT_MATCH": 16,
251 "SUB_IF_API_FLAG_DEFAULT": 32,
252 "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY": 64,
253 "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY": 128,
254 "SUB_IF_API_FLAG_MASK_VNET": 254,
255 "SUB_IF_API_FLAG_DOT1AH": 256,
259 func (x SubIfFlags) String() string {
260 s, ok := SubIfFlags_name[uint32(x)]
264 str := func(n uint32) string {
265 s, ok := SubIfFlags_name[uint32(n)]
269 return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
271 for i := uint32(0); i <= 32; i++ {
281 return str(uint32(x))
286 // InterfaceIndex defines alias 'interface_index'.
287 type InterfaceIndex uint32
289 // MacAddress defines alias 'mac_address'.
290 type MacAddress [6]uint8
292 func ParseMacAddress(s string) (MacAddress, error) {
293 var macaddr MacAddress
294 mac, err := net.ParseMAC(s)
298 copy(macaddr[:], mac[:])
301 func (x MacAddress) ToMAC() net.HardwareAddr {
302 return net.HardwareAddr(x[:])
304 func (x MacAddress) String() string {
305 return x.ToMAC().String()
307 func (x *MacAddress) MarshalText() ([]byte, error) {
308 return []byte(x.String()), nil
310 func (x *MacAddress) UnmarshalText(text []byte) error {
311 mac, err := ParseMacAddress(string(text))
319 // SwInterfaceLacpDetails defines message 'sw_interface_lacp_details'.
320 type SwInterfaceLacpDetails struct {
321 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
322 InterfaceName string `binapi:"string[64],name=interface_name" json:"interface_name,omitempty"`
323 RxState uint32 `binapi:"u32,name=rx_state" json:"rx_state,omitempty"`
324 TxState uint32 `binapi:"u32,name=tx_state" json:"tx_state,omitempty"`
325 MuxState uint32 `binapi:"u32,name=mux_state" json:"mux_state,omitempty"`
326 PtxState uint32 `binapi:"u32,name=ptx_state" json:"ptx_state,omitempty"`
327 BondInterfaceName string `binapi:"string[64],name=bond_interface_name" json:"bond_interface_name,omitempty"`
328 ActorSystemPriority uint16 `binapi:"u16,name=actor_system_priority" json:"actor_system_priority,omitempty"`
329 ActorSystem MacAddress `binapi:"mac_address,name=actor_system" json:"actor_system,omitempty"`
330 ActorKey uint16 `binapi:"u16,name=actor_key" json:"actor_key,omitempty"`
331 ActorPortPriority uint16 `binapi:"u16,name=actor_port_priority" json:"actor_port_priority,omitempty"`
332 ActorPortNumber uint16 `binapi:"u16,name=actor_port_number" json:"actor_port_number,omitempty"`
333 ActorState uint8 `binapi:"u8,name=actor_state" json:"actor_state,omitempty"`
334 PartnerSystemPriority uint16 `binapi:"u16,name=partner_system_priority" json:"partner_system_priority,omitempty"`
335 PartnerSystem MacAddress `binapi:"mac_address,name=partner_system" json:"partner_system,omitempty"`
336 PartnerKey uint16 `binapi:"u16,name=partner_key" json:"partner_key,omitempty"`
337 PartnerPortPriority uint16 `binapi:"u16,name=partner_port_priority" json:"partner_port_priority,omitempty"`
338 PartnerPortNumber uint16 `binapi:"u16,name=partner_port_number" json:"partner_port_number,omitempty"`
339 PartnerState uint8 `binapi:"u8,name=partner_state" json:"partner_state,omitempty"`
342 func (m *SwInterfaceLacpDetails) Reset() { *m = SwInterfaceLacpDetails{} }
343 func (*SwInterfaceLacpDetails) GetMessageName() string { return "sw_interface_lacp_details" }
344 func (*SwInterfaceLacpDetails) GetCrcString() string { return "745ae0ba" }
345 func (*SwInterfaceLacpDetails) GetMessageType() api.MessageType {
346 return api.ReplyMessage
349 func (m *SwInterfaceLacpDetails) Size() (size int) {
353 size += 4 // m.SwIfIndex
354 size += 64 // m.InterfaceName
355 size += 4 // m.RxState
356 size += 4 // m.TxState
357 size += 4 // m.MuxState
358 size += 4 // m.PtxState
359 size += 64 // m.BondInterfaceName
360 size += 2 // m.ActorSystemPriority
361 size += 1 * 6 // m.ActorSystem
362 size += 2 // m.ActorKey
363 size += 2 // m.ActorPortPriority
364 size += 2 // m.ActorPortNumber
365 size += 1 // m.ActorState
366 size += 2 // m.PartnerSystemPriority
367 size += 1 * 6 // m.PartnerSystem
368 size += 2 // m.PartnerKey
369 size += 2 // m.PartnerPortPriority
370 size += 2 // m.PartnerPortNumber
371 size += 1 // m.PartnerState
374 func (m *SwInterfaceLacpDetails) Marshal(b []byte) ([]byte, error) {
376 b = make([]byte, m.Size())
378 buf := codec.NewBuffer(b)
379 buf.EncodeUint32(uint32(m.SwIfIndex))
380 buf.EncodeString(m.InterfaceName, 64)
381 buf.EncodeUint32(m.RxState)
382 buf.EncodeUint32(m.TxState)
383 buf.EncodeUint32(m.MuxState)
384 buf.EncodeUint32(m.PtxState)
385 buf.EncodeString(m.BondInterfaceName, 64)
386 buf.EncodeUint16(m.ActorSystemPriority)
387 buf.EncodeBytes(m.ActorSystem[:], 6)
388 buf.EncodeUint16(m.ActorKey)
389 buf.EncodeUint16(m.ActorPortPriority)
390 buf.EncodeUint16(m.ActorPortNumber)
391 buf.EncodeUint8(m.ActorState)
392 buf.EncodeUint16(m.PartnerSystemPriority)
393 buf.EncodeBytes(m.PartnerSystem[:], 6)
394 buf.EncodeUint16(m.PartnerKey)
395 buf.EncodeUint16(m.PartnerPortPriority)
396 buf.EncodeUint16(m.PartnerPortNumber)
397 buf.EncodeUint8(m.PartnerState)
398 return buf.Bytes(), nil
400 func (m *SwInterfaceLacpDetails) Unmarshal(b []byte) error {
401 buf := codec.NewBuffer(b)
402 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
403 m.InterfaceName = buf.DecodeString(64)
404 m.RxState = buf.DecodeUint32()
405 m.TxState = buf.DecodeUint32()
406 m.MuxState = buf.DecodeUint32()
407 m.PtxState = buf.DecodeUint32()
408 m.BondInterfaceName = buf.DecodeString(64)
409 m.ActorSystemPriority = buf.DecodeUint16()
410 copy(m.ActorSystem[:], buf.DecodeBytes(6))
411 m.ActorKey = buf.DecodeUint16()
412 m.ActorPortPriority = buf.DecodeUint16()
413 m.ActorPortNumber = buf.DecodeUint16()
414 m.ActorState = buf.DecodeUint8()
415 m.PartnerSystemPriority = buf.DecodeUint16()
416 copy(m.PartnerSystem[:], buf.DecodeBytes(6))
417 m.PartnerKey = buf.DecodeUint16()
418 m.PartnerPortPriority = buf.DecodeUint16()
419 m.PartnerPortNumber = buf.DecodeUint16()
420 m.PartnerState = buf.DecodeUint8()
424 // SwInterfaceLacpDump defines message 'sw_interface_lacp_dump'.
425 type SwInterfaceLacpDump struct{}
427 func (m *SwInterfaceLacpDump) Reset() { *m = SwInterfaceLacpDump{} }
428 func (*SwInterfaceLacpDump) GetMessageName() string { return "sw_interface_lacp_dump" }
429 func (*SwInterfaceLacpDump) GetCrcString() string { return "51077d14" }
430 func (*SwInterfaceLacpDump) GetMessageType() api.MessageType {
431 return api.RequestMessage
434 func (m *SwInterfaceLacpDump) Size() (size int) {
440 func (m *SwInterfaceLacpDump) Marshal(b []byte) ([]byte, error) {
442 b = make([]byte, m.Size())
444 buf := codec.NewBuffer(b)
445 return buf.Bytes(), nil
447 func (m *SwInterfaceLacpDump) Unmarshal(b []byte) error {
451 func init() { file_lacp_binapi_init() }
452 func file_lacp_binapi_init() {
453 api.RegisterMessage((*SwInterfaceLacpDetails)(nil), "sw_interface_lacp_details_745ae0ba")
454 api.RegisterMessage((*SwInterfaceLacpDump)(nil), "sw_interface_lacp_dump_51077d14")
457 // Messages returns list of all messages in this module.
458 func AllMessages() []api.Message {
459 return []api.Message{
460 (*SwInterfaceLacpDetails)(nil),
461 (*SwInterfaceLacpDump)(nil),