1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.5.0
5 // source: /usr/share/vpp/api/plugins/pppoe.api.json
7 // Package pppoe contains generated bindings for API file pppoe.api.
15 api "git.fd.io/govpp.git/api"
16 ethernet_types "git.fd.io/govpp.git/binapi/ethernet_types"
17 interface_types "git.fd.io/govpp.git/binapi/interface_types"
18 ip_types "git.fd.io/govpp.git/binapi/ip_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 = 0xec9e86bf
34 // PppoeAddDelCp defines message 'pppoe_add_del_cp'.
35 type PppoeAddDelCp struct {
36 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
37 IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
40 func (m *PppoeAddDelCp) Reset() { *m = PppoeAddDelCp{} }
41 func (*PppoeAddDelCp) GetMessageName() string { return "pppoe_add_del_cp" }
42 func (*PppoeAddDelCp) GetCrcString() string { return "eacd9aaa" }
43 func (*PppoeAddDelCp) GetMessageType() api.MessageType {
44 return api.RequestMessage
47 func (m *PppoeAddDelCp) Size() (size int) {
51 size += 4 // m.SwIfIndex
55 func (m *PppoeAddDelCp) Marshal(b []byte) ([]byte, error) {
57 b = make([]byte, m.Size())
59 buf := codec.NewBuffer(b)
60 buf.EncodeUint32(uint32(m.SwIfIndex))
61 buf.EncodeUint8(m.IsAdd)
62 return buf.Bytes(), nil
64 func (m *PppoeAddDelCp) Unmarshal(b []byte) error {
65 buf := codec.NewBuffer(b)
66 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
67 m.IsAdd = buf.DecodeUint8()
71 // PppoeAddDelCpReply defines message 'pppoe_add_del_cp_reply'.
72 type PppoeAddDelCpReply struct {
73 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
76 func (m *PppoeAddDelCpReply) Reset() { *m = PppoeAddDelCpReply{} }
77 func (*PppoeAddDelCpReply) GetMessageName() string { return "pppoe_add_del_cp_reply" }
78 func (*PppoeAddDelCpReply) GetCrcString() string { return "e8d4e804" }
79 func (*PppoeAddDelCpReply) GetMessageType() api.MessageType {
80 return api.ReplyMessage
83 func (m *PppoeAddDelCpReply) Size() (size int) {
90 func (m *PppoeAddDelCpReply) Marshal(b []byte) ([]byte, error) {
92 b = make([]byte, m.Size())
94 buf := codec.NewBuffer(b)
95 buf.EncodeInt32(m.Retval)
96 return buf.Bytes(), nil
98 func (m *PppoeAddDelCpReply) Unmarshal(b []byte) error {
99 buf := codec.NewBuffer(b)
100 m.Retval = buf.DecodeInt32()
104 // PppoeAddDelSession defines message 'pppoe_add_del_session'.
105 type PppoeAddDelSession struct {
106 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
107 SessionID uint16 `binapi:"u16,name=session_id" json:"session_id,omitempty"`
108 ClientIP ip_types.Address `binapi:"address,name=client_ip" json:"client_ip,omitempty"`
109 DecapVrfID uint32 `binapi:"u32,name=decap_vrf_id" json:"decap_vrf_id,omitempty"`
110 ClientMac ethernet_types.MacAddress `binapi:"mac_address,name=client_mac" json:"client_mac,omitempty"`
113 func (m *PppoeAddDelSession) Reset() { *m = PppoeAddDelSession{} }
114 func (*PppoeAddDelSession) GetMessageName() string { return "pppoe_add_del_session" }
115 func (*PppoeAddDelSession) GetCrcString() string { return "f6fd759e" }
116 func (*PppoeAddDelSession) GetMessageType() api.MessageType {
117 return api.RequestMessage
120 func (m *PppoeAddDelSession) Size() (size int) {
125 size += 2 // m.SessionID
126 size += 1 // m.ClientIP.Af
127 size += 1 * 16 // m.ClientIP.Un
128 size += 4 // m.DecapVrfID
129 size += 1 * 6 // m.ClientMac
132 func (m *PppoeAddDelSession) Marshal(b []byte) ([]byte, error) {
134 b = make([]byte, m.Size())
136 buf := codec.NewBuffer(b)
137 buf.EncodeBool(m.IsAdd)
138 buf.EncodeUint16(m.SessionID)
139 buf.EncodeUint8(uint8(m.ClientIP.Af))
140 buf.EncodeBytes(m.ClientIP.Un.XXX_UnionData[:], 16)
141 buf.EncodeUint32(m.DecapVrfID)
142 buf.EncodeBytes(m.ClientMac[:], 6)
143 return buf.Bytes(), nil
145 func (m *PppoeAddDelSession) Unmarshal(b []byte) error {
146 buf := codec.NewBuffer(b)
147 m.IsAdd = buf.DecodeBool()
148 m.SessionID = buf.DecodeUint16()
149 m.ClientIP.Af = ip_types.AddressFamily(buf.DecodeUint8())
150 copy(m.ClientIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
151 m.DecapVrfID = buf.DecodeUint32()
152 copy(m.ClientMac[:], buf.DecodeBytes(6))
156 // PppoeAddDelSessionReply defines message 'pppoe_add_del_session_reply'.
157 type PppoeAddDelSessionReply struct {
158 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
159 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
162 func (m *PppoeAddDelSessionReply) Reset() { *m = PppoeAddDelSessionReply{} }
163 func (*PppoeAddDelSessionReply) GetMessageName() string { return "pppoe_add_del_session_reply" }
164 func (*PppoeAddDelSessionReply) GetCrcString() string { return "5383d31f" }
165 func (*PppoeAddDelSessionReply) GetMessageType() api.MessageType {
166 return api.ReplyMessage
169 func (m *PppoeAddDelSessionReply) Size() (size int) {
173 size += 4 // m.Retval
174 size += 4 // m.SwIfIndex
177 func (m *PppoeAddDelSessionReply) Marshal(b []byte) ([]byte, error) {
179 b = make([]byte, m.Size())
181 buf := codec.NewBuffer(b)
182 buf.EncodeInt32(m.Retval)
183 buf.EncodeUint32(uint32(m.SwIfIndex))
184 return buf.Bytes(), nil
186 func (m *PppoeAddDelSessionReply) Unmarshal(b []byte) error {
187 buf := codec.NewBuffer(b)
188 m.Retval = buf.DecodeInt32()
189 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
193 // PppoeSessionDetails defines message 'pppoe_session_details'.
194 type PppoeSessionDetails struct {
195 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
196 SessionID uint16 `binapi:"u16,name=session_id" json:"session_id,omitempty"`
197 ClientIP ip_types.Address `binapi:"address,name=client_ip" json:"client_ip,omitempty"`
198 EncapIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=encap_if_index" json:"encap_if_index,omitempty"`
199 DecapVrfID uint32 `binapi:"u32,name=decap_vrf_id" json:"decap_vrf_id,omitempty"`
200 LocalMac ethernet_types.MacAddress `binapi:"mac_address,name=local_mac" json:"local_mac,omitempty"`
201 ClientMac ethernet_types.MacAddress `binapi:"mac_address,name=client_mac" json:"client_mac,omitempty"`
204 func (m *PppoeSessionDetails) Reset() { *m = PppoeSessionDetails{} }
205 func (*PppoeSessionDetails) GetMessageName() string { return "pppoe_session_details" }
206 func (*PppoeSessionDetails) GetCrcString() string { return "4b8e8a4a" }
207 func (*PppoeSessionDetails) GetMessageType() api.MessageType {
208 return api.ReplyMessage
211 func (m *PppoeSessionDetails) Size() (size int) {
215 size += 4 // m.SwIfIndex
216 size += 2 // m.SessionID
217 size += 1 // m.ClientIP.Af
218 size += 1 * 16 // m.ClientIP.Un
219 size += 4 // m.EncapIfIndex
220 size += 4 // m.DecapVrfID
221 size += 1 * 6 // m.LocalMac
222 size += 1 * 6 // m.ClientMac
225 func (m *PppoeSessionDetails) Marshal(b []byte) ([]byte, error) {
227 b = make([]byte, m.Size())
229 buf := codec.NewBuffer(b)
230 buf.EncodeUint32(uint32(m.SwIfIndex))
231 buf.EncodeUint16(m.SessionID)
232 buf.EncodeUint8(uint8(m.ClientIP.Af))
233 buf.EncodeBytes(m.ClientIP.Un.XXX_UnionData[:], 16)
234 buf.EncodeUint32(uint32(m.EncapIfIndex))
235 buf.EncodeUint32(m.DecapVrfID)
236 buf.EncodeBytes(m.LocalMac[:], 6)
237 buf.EncodeBytes(m.ClientMac[:], 6)
238 return buf.Bytes(), nil
240 func (m *PppoeSessionDetails) Unmarshal(b []byte) error {
241 buf := codec.NewBuffer(b)
242 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
243 m.SessionID = buf.DecodeUint16()
244 m.ClientIP.Af = ip_types.AddressFamily(buf.DecodeUint8())
245 copy(m.ClientIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
246 m.EncapIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
247 m.DecapVrfID = buf.DecodeUint32()
248 copy(m.LocalMac[:], buf.DecodeBytes(6))
249 copy(m.ClientMac[:], buf.DecodeBytes(6))
253 // PppoeSessionDump defines message 'pppoe_session_dump'.
254 type PppoeSessionDump struct {
255 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
258 func (m *PppoeSessionDump) Reset() { *m = PppoeSessionDump{} }
259 func (*PppoeSessionDump) GetMessageName() string { return "pppoe_session_dump" }
260 func (*PppoeSessionDump) GetCrcString() string { return "f9e6675e" }
261 func (*PppoeSessionDump) GetMessageType() api.MessageType {
262 return api.RequestMessage
265 func (m *PppoeSessionDump) Size() (size int) {
269 size += 4 // m.SwIfIndex
272 func (m *PppoeSessionDump) Marshal(b []byte) ([]byte, error) {
274 b = make([]byte, m.Size())
276 buf := codec.NewBuffer(b)
277 buf.EncodeUint32(uint32(m.SwIfIndex))
278 return buf.Bytes(), nil
280 func (m *PppoeSessionDump) Unmarshal(b []byte) error {
281 buf := codec.NewBuffer(b)
282 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
286 func init() { file_pppoe_binapi_init() }
287 func file_pppoe_binapi_init() {
288 api.RegisterMessage((*PppoeAddDelCp)(nil), "pppoe_add_del_cp_eacd9aaa")
289 api.RegisterMessage((*PppoeAddDelCpReply)(nil), "pppoe_add_del_cp_reply_e8d4e804")
290 api.RegisterMessage((*PppoeAddDelSession)(nil), "pppoe_add_del_session_f6fd759e")
291 api.RegisterMessage((*PppoeAddDelSessionReply)(nil), "pppoe_add_del_session_reply_5383d31f")
292 api.RegisterMessage((*PppoeSessionDetails)(nil), "pppoe_session_details_4b8e8a4a")
293 api.RegisterMessage((*PppoeSessionDump)(nil), "pppoe_session_dump_f9e6675e")
296 // Messages returns list of all messages in this module.
297 func AllMessages() []api.Message {
298 return []api.Message{
299 (*PppoeAddDelCp)(nil),
300 (*PppoeAddDelCpReply)(nil),
301 (*PppoeAddDelSession)(nil),
302 (*PppoeAddDelSessionReply)(nil),
303 (*PppoeSessionDetails)(nil),
304 (*PppoeSessionDump)(nil),