1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.5.0-dev
5 // source: .vppapi/plugins/lacp.api.json
7 // Package lacp contains generated bindings for API file lacp.api.
20 api "git.fd.io/govpp.git/api"
21 codec "git.fd.io/govpp.git/codec"
24 // This is a compile-time assertion to ensure that this generated file
25 // is compatible with the GoVPP api package it is being compiled against.
26 // A compilation error at this line likely means your copy of the
27 // GoVPP api package needs to be updated.
28 const _ = api.GoVppAPIPackageIsVersion2
33 VersionCrc = 0x930086a4
36 // IfStatusFlags defines enum 'if_status_flags'.
37 type IfStatusFlags uint32
40 IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
41 IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
45 IfStatusFlags_name = map[uint32]string{
46 1: "IF_STATUS_API_FLAG_ADMIN_UP",
47 2: "IF_STATUS_API_FLAG_LINK_UP",
49 IfStatusFlags_value = map[string]uint32{
50 "IF_STATUS_API_FLAG_ADMIN_UP": 1,
51 "IF_STATUS_API_FLAG_LINK_UP": 2,
55 func (x IfStatusFlags) String() string {
56 s, ok := IfStatusFlags_name[uint32(x)]
60 str := func(n uint32) string {
61 s, ok := IfStatusFlags_name[uint32(n)]
65 return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
67 for i := uint32(0); i <= 32; i++ {
82 // IfType defines enum 'if_type'.
86 IF_API_TYPE_HARDWARE IfType = 1
87 IF_API_TYPE_SUB IfType = 2
88 IF_API_TYPE_P2P IfType = 3
89 IF_API_TYPE_PIPE IfType = 4
93 IfType_name = map[uint32]string{
94 1: "IF_API_TYPE_HARDWARE",
97 4: "IF_API_TYPE_PIPE",
99 IfType_value = map[string]uint32{
100 "IF_API_TYPE_HARDWARE": 1,
101 "IF_API_TYPE_SUB": 2,
102 "IF_API_TYPE_P2P": 3,
103 "IF_API_TYPE_PIPE": 4,
107 func (x IfType) String() string {
108 s, ok := IfType_name[uint32(x)]
112 return "IfType(" + strconv.Itoa(int(x)) + ")"
115 // LinkDuplex defines enum 'link_duplex'.
116 type LinkDuplex uint32
119 LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
120 LINK_DUPLEX_API_HALF LinkDuplex = 1
121 LINK_DUPLEX_API_FULL LinkDuplex = 2
125 LinkDuplex_name = map[uint32]string{
126 0: "LINK_DUPLEX_API_UNKNOWN",
127 1: "LINK_DUPLEX_API_HALF",
128 2: "LINK_DUPLEX_API_FULL",
130 LinkDuplex_value = map[string]uint32{
131 "LINK_DUPLEX_API_UNKNOWN": 0,
132 "LINK_DUPLEX_API_HALF": 1,
133 "LINK_DUPLEX_API_FULL": 2,
137 func (x LinkDuplex) String() string {
138 s, ok := LinkDuplex_name[uint32(x)]
142 return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
145 // MtuProto defines enum 'mtu_proto'.
149 MTU_PROTO_API_L3 MtuProto = 1
150 MTU_PROTO_API_IP4 MtuProto = 2
151 MTU_PROTO_API_IP6 MtuProto = 3
152 MTU_PROTO_API_MPLS MtuProto = 4
153 MTU_PROTO_API_N MtuProto = 5
157 MtuProto_name = map[uint32]string{
158 1: "MTU_PROTO_API_L3",
159 2: "MTU_PROTO_API_IP4",
160 3: "MTU_PROTO_API_IP6",
161 4: "MTU_PROTO_API_MPLS",
162 5: "MTU_PROTO_API_N",
164 MtuProto_value = map[string]uint32{
165 "MTU_PROTO_API_L3": 1,
166 "MTU_PROTO_API_IP4": 2,
167 "MTU_PROTO_API_IP6": 3,
168 "MTU_PROTO_API_MPLS": 4,
169 "MTU_PROTO_API_N": 5,
173 func (x MtuProto) String() string {
174 s, ok := MtuProto_name[uint32(x)]
178 return "MtuProto(" + strconv.Itoa(int(x)) + ")"
181 // RxMode defines enum 'rx_mode'.
185 RX_MODE_API_UNKNOWN RxMode = 0
186 RX_MODE_API_POLLING RxMode = 1
187 RX_MODE_API_INTERRUPT RxMode = 2
188 RX_MODE_API_ADAPTIVE RxMode = 3
189 RX_MODE_API_DEFAULT RxMode = 4
193 RxMode_name = map[uint32]string{
194 0: "RX_MODE_API_UNKNOWN",
195 1: "RX_MODE_API_POLLING",
196 2: "RX_MODE_API_INTERRUPT",
197 3: "RX_MODE_API_ADAPTIVE",
198 4: "RX_MODE_API_DEFAULT",
200 RxMode_value = map[string]uint32{
201 "RX_MODE_API_UNKNOWN": 0,
202 "RX_MODE_API_POLLING": 1,
203 "RX_MODE_API_INTERRUPT": 2,
204 "RX_MODE_API_ADAPTIVE": 3,
205 "RX_MODE_API_DEFAULT": 4,
209 func (x RxMode) String() string {
210 s, ok := RxMode_name[uint32(x)]
214 return "RxMode(" + strconv.Itoa(int(x)) + ")"
217 // SubIfFlags defines enum 'sub_if_flags'.
218 type SubIfFlags uint32
221 SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
222 SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
223 SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
224 SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
225 SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
226 SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
227 SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
228 SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
229 SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
230 SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
234 SubIfFlags_name = map[uint32]string{
235 1: "SUB_IF_API_FLAG_NO_TAGS",
236 2: "SUB_IF_API_FLAG_ONE_TAG",
237 4: "SUB_IF_API_FLAG_TWO_TAGS",
238 8: "SUB_IF_API_FLAG_DOT1AD",
239 16: "SUB_IF_API_FLAG_EXACT_MATCH",
240 32: "SUB_IF_API_FLAG_DEFAULT",
241 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
242 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
243 254: "SUB_IF_API_FLAG_MASK_VNET",
244 256: "SUB_IF_API_FLAG_DOT1AH",
246 SubIfFlags_value = map[string]uint32{
247 "SUB_IF_API_FLAG_NO_TAGS": 1,
248 "SUB_IF_API_FLAG_ONE_TAG": 2,
249 "SUB_IF_API_FLAG_TWO_TAGS": 4,
250 "SUB_IF_API_FLAG_DOT1AD": 8,
251 "SUB_IF_API_FLAG_EXACT_MATCH": 16,
252 "SUB_IF_API_FLAG_DEFAULT": 32,
253 "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY": 64,
254 "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY": 128,
255 "SUB_IF_API_FLAG_MASK_VNET": 254,
256 "SUB_IF_API_FLAG_DOT1AH": 256,
260 func (x SubIfFlags) String() string {
261 s, ok := SubIfFlags_name[uint32(x)]
265 str := func(n uint32) string {
266 s, ok := SubIfFlags_name[uint32(n)]
270 return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
272 for i := uint32(0); i <= 32; i++ {
282 return str(uint32(x))
287 // InterfaceIndex defines alias 'interface_index'.
288 type InterfaceIndex uint32
290 // MacAddress defines alias 'mac_address'.
291 type MacAddress [6]uint8
293 func ParseMacAddress(s string) (MacAddress, error) {
294 var macaddr MacAddress
295 mac, err := net.ParseMAC(s)
299 copy(macaddr[:], mac[:])
303 func (x MacAddress) ToMAC() net.HardwareAddr {
304 return net.HardwareAddr(x[:])
307 func (x MacAddress) String() string {
308 return x.ToMAC().String()
311 func (x *MacAddress) MarshalText() ([]byte, error) {
312 return []byte(x.String()), nil
315 func (x *MacAddress) UnmarshalText(text []byte) error {
316 mac, err := ParseMacAddress(string(text))
324 // SwInterfaceLacpDetails defines message 'sw_interface_lacp_details'.
325 type SwInterfaceLacpDetails struct {
326 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
327 InterfaceName string `binapi:"string[64],name=interface_name" json:"interface_name,omitempty"`
328 RxState uint32 `binapi:"u32,name=rx_state" json:"rx_state,omitempty"`
329 TxState uint32 `binapi:"u32,name=tx_state" json:"tx_state,omitempty"`
330 MuxState uint32 `binapi:"u32,name=mux_state" json:"mux_state,omitempty"`
331 PtxState uint32 `binapi:"u32,name=ptx_state" json:"ptx_state,omitempty"`
332 BondInterfaceName string `binapi:"string[64],name=bond_interface_name" json:"bond_interface_name,omitempty"`
333 ActorSystemPriority uint16 `binapi:"u16,name=actor_system_priority" json:"actor_system_priority,omitempty"`
334 ActorSystem MacAddress `binapi:"mac_address,name=actor_system" json:"actor_system,omitempty"`
335 ActorKey uint16 `binapi:"u16,name=actor_key" json:"actor_key,omitempty"`
336 ActorPortPriority uint16 `binapi:"u16,name=actor_port_priority" json:"actor_port_priority,omitempty"`
337 ActorPortNumber uint16 `binapi:"u16,name=actor_port_number" json:"actor_port_number,omitempty"`
338 ActorState uint8 `binapi:"u8,name=actor_state" json:"actor_state,omitempty"`
339 PartnerSystemPriority uint16 `binapi:"u16,name=partner_system_priority" json:"partner_system_priority,omitempty"`
340 PartnerSystem MacAddress `binapi:"mac_address,name=partner_system" json:"partner_system,omitempty"`
341 PartnerKey uint16 `binapi:"u16,name=partner_key" json:"partner_key,omitempty"`
342 PartnerPortPriority uint16 `binapi:"u16,name=partner_port_priority" json:"partner_port_priority,omitempty"`
343 PartnerPortNumber uint16 `binapi:"u16,name=partner_port_number" json:"partner_port_number,omitempty"`
344 PartnerState uint8 `binapi:"u8,name=partner_state" json:"partner_state,omitempty"`
347 func (m *SwInterfaceLacpDetails) Reset() { *m = SwInterfaceLacpDetails{} }
348 func (*SwInterfaceLacpDetails) GetMessageName() string { return "sw_interface_lacp_details" }
349 func (*SwInterfaceLacpDetails) GetCrcString() string { return "745ae0ba" }
350 func (*SwInterfaceLacpDetails) GetMessageType() api.MessageType {
351 return api.ReplyMessage
354 func (m *SwInterfaceLacpDetails) Size() (size int) {
358 size += 4 // m.SwIfIndex
359 size += 64 // m.InterfaceName
360 size += 4 // m.RxState
361 size += 4 // m.TxState
362 size += 4 // m.MuxState
363 size += 4 // m.PtxState
364 size += 64 // m.BondInterfaceName
365 size += 2 // m.ActorSystemPriority
366 size += 1 * 6 // m.ActorSystem
367 size += 2 // m.ActorKey
368 size += 2 // m.ActorPortPriority
369 size += 2 // m.ActorPortNumber
370 size += 1 // m.ActorState
371 size += 2 // m.PartnerSystemPriority
372 size += 1 * 6 // m.PartnerSystem
373 size += 2 // m.PartnerKey
374 size += 2 // m.PartnerPortPriority
375 size += 2 // m.PartnerPortNumber
376 size += 1 // m.PartnerState
379 func (m *SwInterfaceLacpDetails) Marshal(b []byte) ([]byte, error) {
381 b = make([]byte, m.Size())
383 buf := codec.NewBuffer(b)
384 buf.EncodeUint32(uint32(m.SwIfIndex))
385 buf.EncodeString(m.InterfaceName, 64)
386 buf.EncodeUint32(m.RxState)
387 buf.EncodeUint32(m.TxState)
388 buf.EncodeUint32(m.MuxState)
389 buf.EncodeUint32(m.PtxState)
390 buf.EncodeString(m.BondInterfaceName, 64)
391 buf.EncodeUint16(m.ActorSystemPriority)
392 buf.EncodeBytes(m.ActorSystem[:], 6)
393 buf.EncodeUint16(m.ActorKey)
394 buf.EncodeUint16(m.ActorPortPriority)
395 buf.EncodeUint16(m.ActorPortNumber)
396 buf.EncodeUint8(m.ActorState)
397 buf.EncodeUint16(m.PartnerSystemPriority)
398 buf.EncodeBytes(m.PartnerSystem[:], 6)
399 buf.EncodeUint16(m.PartnerKey)
400 buf.EncodeUint16(m.PartnerPortPriority)
401 buf.EncodeUint16(m.PartnerPortNumber)
402 buf.EncodeUint8(m.PartnerState)
403 return buf.Bytes(), nil
405 func (m *SwInterfaceLacpDetails) Unmarshal(b []byte) error {
406 buf := codec.NewBuffer(b)
407 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
408 m.InterfaceName = buf.DecodeString(64)
409 m.RxState = buf.DecodeUint32()
410 m.TxState = buf.DecodeUint32()
411 m.MuxState = buf.DecodeUint32()
412 m.PtxState = buf.DecodeUint32()
413 m.BondInterfaceName = buf.DecodeString(64)
414 m.ActorSystemPriority = buf.DecodeUint16()
415 copy(m.ActorSystem[:], buf.DecodeBytes(6))
416 m.ActorKey = buf.DecodeUint16()
417 m.ActorPortPriority = buf.DecodeUint16()
418 m.ActorPortNumber = buf.DecodeUint16()
419 m.ActorState = buf.DecodeUint8()
420 m.PartnerSystemPriority = buf.DecodeUint16()
421 copy(m.PartnerSystem[:], buf.DecodeBytes(6))
422 m.PartnerKey = buf.DecodeUint16()
423 m.PartnerPortPriority = buf.DecodeUint16()
424 m.PartnerPortNumber = buf.DecodeUint16()
425 m.PartnerState = buf.DecodeUint8()
429 // SwInterfaceLacpDump defines message 'sw_interface_lacp_dump'.
430 type SwInterfaceLacpDump struct{}
432 func (m *SwInterfaceLacpDump) Reset() { *m = SwInterfaceLacpDump{} }
433 func (*SwInterfaceLacpDump) GetMessageName() string { return "sw_interface_lacp_dump" }
434 func (*SwInterfaceLacpDump) GetCrcString() string { return "51077d14" }
435 func (*SwInterfaceLacpDump) GetMessageType() api.MessageType {
436 return api.RequestMessage
439 func (m *SwInterfaceLacpDump) Size() (size int) {
445 func (m *SwInterfaceLacpDump) Marshal(b []byte) ([]byte, error) {
447 b = make([]byte, m.Size())
449 buf := codec.NewBuffer(b)
450 return buf.Bytes(), nil
452 func (m *SwInterfaceLacpDump) Unmarshal(b []byte) error {
456 func init() { file_lacp_binapi_init() }
457 func file_lacp_binapi_init() {
458 api.RegisterMessage((*SwInterfaceLacpDetails)(nil), "sw_interface_lacp_details_745ae0ba")
459 api.RegisterMessage((*SwInterfaceLacpDump)(nil), "sw_interface_lacp_dump_51077d14")
462 // Messages returns list of all messages in this module.
463 func AllMessages() []api.Message {
464 return []api.Message{
465 (*SwInterfaceLacpDetails)(nil),
466 (*SwInterfaceLacpDump)(nil),