summaryrefslogtreecommitdiffstats
path: root/binapi/lacp/lacp.ba.go
blob: 29ad103761df6abcf74bc0aad131712fd766397b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
// versions:
//  binapi-generator: v0.4.0
//  VPP:              20.05.1-release
// source: /usr/share/vpp/api/plugins/lacp.api.json

// Package lacp contains generated bindings for API file lacp.api.
//
// Contents:
//   2 messages
//
package lacp

import (
	api "git.fd.io/govpp.git/api"
	ethernet_types "git.fd.io/govpp.git/binapi/ethernet_types"
	interface_types "git.fd.io/govpp.git/binapi/interface_types"
	codec "git.fd.io/govpp.git/codec"
)

// This is a compile-time assertion to ensure that this generated file
// is compatible with the GoVPP api package it is being compiled against.
// A compilation error at this line likely means your copy of the
// GoVPP api package needs to be updated.
const _ = api.GoVppAPIPackageIsVersion2

const (
	APIFile    = "lacp"
	APIVersion = "2.0.0"
	VersionCrc = 0x461bf09e
)

// SwInterfaceLacpDetails defines message 'sw_interface_lacp_details'.
type SwInterfaceLacpDetails struct {
	SwIfIndex             interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
	InterfaceName         string                         `binapi:"string[64],name=interface_name" json:"interface_name,omitempty"`
	RxState               uint32                         `binapi:"u32,name=rx_state" json:"rx_state,omitempty"`
	TxState               uint32                         `binapi:"u32,name=tx_state" json:"tx_state,omitempty"`
	MuxState              uint32                         `binapi:"u32,name=mux_state" json:"mux_state,omitempty"`
	PtxState              uint32                         `binapi:"u32,name=ptx_state" json:"ptx_state,omitempty"`
	BondInterfaceName     string                         `binapi:"string[64],name=bond_interface_name" json:"bond_interface_name,omitempty"`
	ActorSystemPriority   uint16                         `binapi:"u16,name=actor_system_priority" json:"actor_system_priority,omitempty"`
	ActorSystem           ethernet_types.MacAddress      `binapi:"mac_address,name=actor_system" json:"actor_system,omitempty"`
	ActorKey              uint16                         `binapi:"u16,name=actor_key" json:"actor_key,omitempty"`
	ActorPortPriority     uint16                         `binapi:"u16,name=actor_port_priority" json:"actor_port_priority,omitempty"`
	ActorPortNumber       uint16                         `binapi:"u16,name=actor_port_number" json:"actor_port_number,omitempty"`
	ActorState            uint8                          `binapi:"u8,name=actor_state" json:"actor_state,omitempty"`
	PartnerSystemPriority uint16                         `binapi:"u16,name=partner_system_priority" json:"partner_system_priority,omitempty"`
	PartnerSystem         ethernet_types.MacAddress      `binapi:"mac_address,name=partner_system" json:"partner_system,omitempty"`
	PartnerKey            uint16                         `binapi:"u16,name=partner_key" json:"partner_key,omitempty"`
	PartnerPortPriority   uint16                         `binapi:"u16,name=partner_port_priority" json:"partner_port_priority,omitempty"`
	PartnerPortNumber     uint16                         `binapi:"u16,name=partner_port_number" json:"partner_port_number,omitempty"`
	PartnerState          uint8                          `binapi:"u8,name=partner_state" json:"partner_state,omitempty"`
}

func (m *SwInterfaceLacpDetails) Reset()               { *m = SwInterfaceLacpDetails{} }
func (*SwInterfaceLacpDetails) GetMessageName() string { return "sw_interface_lacp_details" }
func (*SwInterfaceLacpDetails) GetCrcString() string   { return "745ae0ba" }
func (*SwInterfaceLacpDetails) GetMessageType() api.MessageType {
	return api.ReplyMessage
}

func (m *SwInterfaceLacpDetails) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 4     // m.SwIfIndex
	size += 64    // m.InterfaceName
	size += 4     // m.RxState
	size += 4     // m.TxState
	size += 4     // m.MuxState
	size += 4     // m.PtxState
	size += 64    // m.BondInterfaceName
	size += 2     // m.ActorSystemPriority
	size += 1 * 6 // m.ActorSystem
	size += 2     // m.ActorKey
	size += 2     // m.ActorPortPriority
	size += 2     // m.ActorPortNumber
	size += 1     // m.ActorState
	size += 2     // m.PartnerSystemPriority
	size += 1 * 6 // m.PartnerSystem
	size += 2     // m.PartnerKey
	size += 2     // m.PartnerPortPriority
	size += 2     // m.PartnerPortNumber
	size += 1     // m.PartnerState
	return size
}
func (m *SwInterfaceLacpDetails) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeUint32(uint32(m.SwIfIndex))
	buf.EncodeString(m.InterfaceName, 64)
	buf.EncodeUint32(m.RxState)
	buf.EncodeUint32(m.TxState)
	buf.EncodeUint32(m.MuxState)
	buf.EncodeUint32(m.PtxState)
	buf.EncodeString(m.BondInterfaceName, 64)
	buf.EncodeUint16(m.ActorSystemPriority)
	buf.EncodeBytes(m.ActorSystem[:], 6)
	buf.EncodeUint16(m.ActorKey)
	buf.EncodeUint16(m.ActorPortPriority)
	buf.EncodeUint16(m.ActorPortNumber)
	buf.EncodeUint8(m.ActorState)
	buf.EncodeUint16(m.PartnerSystemPriority)
	buf.EncodeBytes(m.PartnerSystem[:], 6)
	buf.EncodeUint16(m.PartnerKey)
	buf.EncodeUint16(m.PartnerPortPriority)
	buf.EncodeUint16(m.PartnerPortNumber)
	buf.EncodeUint8(m.PartnerState)
	return buf.Bytes(), nil
}
func (m *SwInterfaceLacpDetails) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
	m.InterfaceName = buf.DecodeString(64)
	m.RxState = buf.DecodeUint32()
	m.TxState = buf.DecodeUint32()
	m.MuxState = buf.DecodeUint32()
	m.PtxState = buf.DecodeUint32()
	m.BondInterfaceName = buf.DecodeString(64)
	m.ActorSystemPriority = buf.DecodeUint16()
	copy(m.ActorSystem[:], buf.DecodeBytes(6))
	m.ActorKey = buf.DecodeUint16()
	m.ActorPortPriority = buf.DecodeUint16()
	m.ActorPortNumber = buf.DecodeUint16()
	m.ActorState = buf.DecodeUint8()
	m.PartnerSystemPriority = buf.DecodeUint16()
	copy(m.PartnerSystem[:], buf.DecodeBytes(6))
	m.PartnerKey = buf.DecodeUint16()
	m.PartnerPortPriority = buf.DecodeUint16()
	m.PartnerPortNumber = buf.DecodeUint16()
	m.PartnerState = buf.DecodeUint8()
	return nil
}

// SwInterfaceLacpDump defines message 'sw_interface_lacp_dump'.
type SwInterfaceLacpDump struct{}

func (m *SwInterfaceLacpDump) Reset()               { *m = SwInterfaceLacpDump{} }
func (*SwInterfaceLacpDump) GetMessageName() string { return "sw_interface_lacp_dump" }
func (*SwInterfaceLacpDump) GetCrcString() string   { return "51077d14" }
func (*SwInterfaceLacpDump) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *SwInterfaceLacpDump) Size() (size int) {
	if m == nil {
		return 0
	}
	return size
}
func (m *SwInterfaceLacpDump) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	return buf.Bytes(), nil
}
func (m *SwInterfaceLacpDump) Unmarshal(b []byte) error {
	return nil
}

func init() { file_lacp_binapi_init() }
func file_lacp_binapi_init() {
	api.RegisterMessage((*SwInterfaceLacpDetails)(nil), "sw_interface_lacp_details_745ae0ba")
	api.RegisterMessage((*SwInterfaceLacpDump)(nil), "sw_interface_lacp_dump_51077d14")
}

// Messages returns list of all messages in this module.
func AllMessages() []api.Message {
	return []api.Message{
		(*SwInterfaceLacpDetails)(nil),
		(*SwInterfaceLacpDump)(nil),
	}
}