summaryrefslogtreecommitdiffstats
path: root/binapi/pppoe/pppoe.ba.go
blob: 7e02eba88d4eae37917990a62168ff93e40347a6 (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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
// versions:
//  binapi-generator: v0.5.0-dev
//  VPP:              22.02-release
// source: /usr/share/vpp/api/plugins/pppoe.api.json

// Package pppoe contains generated bindings for API file pppoe.api.
//
// Contents:
//   6 messages
//
package pppoe

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"
	ip_types "git.fd.io/govpp.git/binapi/ip_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    = "pppoe"
	APIVersion = "2.0.0"
	VersionCrc = 0xec9e86bf
)

// PppoeAddDelCp defines message 'pppoe_add_del_cp'.
type PppoeAddDelCp struct {
	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
	IsAdd     uint8                          `binapi:"u8,name=is_add" json:"is_add,omitempty"`
}

func (m *PppoeAddDelCp) Reset()               { *m = PppoeAddDelCp{} }
func (*PppoeAddDelCp) GetMessageName() string { return "pppoe_add_del_cp" }
func (*PppoeAddDelCp) GetCrcString() string   { return "eacd9aaa" }
func (*PppoeAddDelCp) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *PppoeAddDelCp) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 4 // m.SwIfIndex
	size += 1 // m.IsAdd
	return size
}
func (m *PppoeAddDelCp) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeUint32(uint32(m.SwIfIndex))
	buf.EncodeUint8(m.IsAdd)
	return buf.Bytes(), nil
}
func (m *PppoeAddDelCp) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
	m.IsAdd = buf.DecodeUint8()
	return nil
}

// PppoeAddDelCpReply defines message 'pppoe_add_del_cp_reply'.
type PppoeAddDelCpReply struct {
	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}

func (m *PppoeAddDelCpReply) Reset()               { *m = PppoeAddDelCpReply{} }
func (*PppoeAddDelCpReply) GetMessageName() string { return "pppoe_add_del_cp_reply" }
func (*PppoeAddDelCpReply) GetCrcString() string   { return "e8d4e804" }
func (*PppoeAddDelCpReply) GetMessageType() api.MessageType {
	return api.ReplyMessage
}

func (m *PppoeAddDelCpReply) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 4 // m.Retval
	return size
}
func (m *PppoeAddDelCpReply) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeInt32(m.Retval)
	return buf.Bytes(), nil
}
func (m *PppoeAddDelCpReply) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Retval = buf.DecodeInt32()
	return nil
}

// PppoeAddDelSession defines message 'pppoe_add_del_session'.
type PppoeAddDelSession struct {
	IsAdd      bool                      `binapi:"bool,name=is_add" json:"is_add,omitempty"`
	SessionID  uint16                    `binapi:"u16,name=session_id" json:"session_id,omitempty"`
	ClientIP   ip_types.Address          `binapi:"address,name=client_ip" json:"client_ip,omitempty"`
	DecapVrfID uint32                    `binapi:"u32,name=decap_vrf_id" json:"decap_vrf_id,omitempty"`
	ClientMac  ethernet_types.MacAddress `binapi:"mac_address,name=client_mac" json:"client_mac,omitempty"`
}

func (m *PppoeAddDelSession) Reset()               { *m = PppoeAddDelSession{} }
func (*PppoeAddDelSession) GetMessageName() string { return "pppoe_add_del_session" }
func (*PppoeAddDelSession) GetCrcString() string   { return "f6fd759e" }
func (*PppoeAddDelSession) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *PppoeAddDelSession) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 1      // m.IsAdd
	size += 2      // m.SessionID
	size += 1      // m.ClientIP.Af
	size += 1 * 16 // m.ClientIP.Un
	size += 4      // m.DecapVrfID
	size += 1 * 6  // m.ClientMac
	return size
}
func (m *PppoeAddDelSession) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeBool(m.IsAdd)
	buf.EncodeUint16(m.SessionID)
	buf.EncodeUint8(uint8(m.ClientIP.Af))
	buf.EncodeBytes(m.ClientIP.Un.XXX_UnionData[:], 16)
	buf.EncodeUint32(m.DecapVrfID)
	buf.EncodeBytes(m.ClientMac[:], 6)
	return buf.Bytes(), nil
}
func (m *PppoeAddDelSession) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.IsAdd = buf.DecodeBool()
	m.SessionID = buf.DecodeUint16()
	m.ClientIP.Af = ip_types.AddressFamily(buf.DecodeUint8())
	copy(m.ClientIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
	m.DecapVrfID = buf.DecodeUint32()
	copy(m.ClientMac[:], buf.DecodeBytes(6))
	return nil
}

// PppoeAddDelSessionReply defines message 'pppoe_add_del_session_reply'.
type PppoeAddDelSessionReply struct {
	Retval    int32                          `binapi:"i32,name=retval" json:"retval,omitempty"`
	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
}

func (m *PppoeAddDelSessionReply) Reset()               { *m = PppoeAddDelSessionReply{} }
func (*PppoeAddDelSessionReply) GetMessageName() string { return "pppoe_add_del_session_reply" }
func (*PppoeAddDelSessionReply) GetCrcString() string   { return "5383d31f" }
func (*PppoeAddDelSessionReply) GetMessageType() api.MessageType {
	return api.ReplyMessage
}

func (m *PppoeAddDelSessionReply) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 4 // m.Retval
	size += 4 // m.SwIfIndex
	return size
}
func (m *PppoeAddDelSessionReply) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeInt32(m.Retval)
	buf.EncodeUint32(uint32(m.SwIfIndex))
	return buf.Bytes(), nil
}
func (m *PppoeAddDelSessionReply) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Retval = buf.DecodeInt32()
	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
	return nil
}

// PppoeSessionDetails defines message 'pppoe_session_details'.
type PppoeSessionDetails struct {
	SwIfIndex    interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
	SessionID    uint16                         `binapi:"u16,name=session_id" json:"session_id,omitempty"`
	ClientIP     ip_types.Address               `binapi:"address,name=client_ip" json:"client_ip,omitempty"`
	EncapIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=encap_if_index" json:"encap_if_index,omitempty"`
	DecapVrfID   uint32                         `binapi:"u32,name=decap_vrf_id" json:"decap_vrf_id,omitempty"`
	LocalMac     ethernet_types.MacAddress      `binapi:"mac_address,name=local_mac" json:"local_mac,omitempty"`
	ClientMac    ethernet_types.MacAddress      `binapi:"mac_address,name=client_mac" json:"client_mac,omitempty"`
}

func (m *PppoeSessionDetails) Reset()               { *m = PppoeSessionDetails{} }
func (*PppoeSessionDetails) GetMessageName() string { return "pppoe_session_details" }
func (*PppoeSessionDetails) GetCrcString() string   { return "4b8e8a4a" }
func (*PppoeSessionDetails) GetMessageType() api.MessageType {
	return api.ReplyMessage
}

func (m *PppoeSessionDetails) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 4      // m.SwIfIndex
	size += 2      // m.SessionID
	size += 1      // m.ClientIP.Af
	size += 1 * 16 // m.ClientIP.Un
	size += 4      // m.EncapIfIndex
	size += 4      // m.DecapVrfID
	size += 1 * 6  // m.LocalMac
	size += 1 * 6  // m.ClientMac
	return size
}
func (m *PppoeSessionDetails) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeUint32(uint32(m.SwIfIndex))
	buf.EncodeUint16(m.SessionID)
	buf.EncodeUint8(uint8(m.ClientIP.Af))
	buf.EncodeBytes(m.ClientIP.Un.XXX_UnionData[:], 16)
	buf.EncodeUint32(uint32(m.EncapIfIndex))
	buf.EncodeUint32(m.DecapVrfID)
	buf.EncodeBytes(m.LocalMac[:], 6)
	buf.EncodeBytes(m.ClientMac[:], 6)
	return buf.Bytes(), nil
}
func (m *PppoeSessionDetails) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
	m.SessionID = buf.DecodeUint16()
	m.ClientIP.Af = ip_types.AddressFamily(buf.DecodeUint8())
	copy(m.ClientIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
	m.EncapIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
	m.DecapVrfID = buf.DecodeUint32()
	copy(m.LocalMac[:], buf.DecodeBytes(6))
	copy(m.ClientMac[:], buf.DecodeBytes(6))
	return nil
}

// PppoeSessionDump defines message 'pppoe_session_dump'.
type PppoeSessionDump struct {
	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
}

func (m *PppoeSessionDump) Reset()               { *m = PppoeSessionDump{} }
func (*PppoeSessionDump) GetMessageName() string { return "pppoe_session_dump" }
func (*PppoeSessionDump) GetCrcString() string   { return "f9e6675e" }
func (*PppoeSessionDump) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *PppoeSessionDump) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 4 // m.SwIfIndex
	return size
}
func (m *PppoeSessionDump) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeUint32(uint32(m.SwIfIndex))
	return buf.Bytes(), nil
}
func (m *PppoeSessionDump) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
	return nil
}

func init() { file_pppoe_binapi_init() }
func file_pppoe_binapi_init() {
	api.RegisterMessage((*PppoeAddDelCp)(nil), "pppoe_add_del_cp_eacd9aaa")
	api.RegisterMessage((*PppoeAddDelCpReply)(nil), "pppoe_add_del_cp_reply_e8d4e804")
	api.RegisterMessage((*PppoeAddDelSession)(nil), "pppoe_add_del_session_f6fd759e")
	api.RegisterMessage((*PppoeAddDelSessionReply)(nil), "pppoe_add_del_session_reply_5383d31f")
	api.RegisterMessage((*PppoeSessionDetails)(nil), "pppoe_session_details_4b8e8a4a")
	api.RegisterMessage((*PppoeSessionDump)(nil), "pppoe_session_dump_f9e6675e")
}

// Messages returns list of all messages in this module.
func AllMessages() []api.Message {
	return []api.Message{
		(*PppoeAddDelCp)(nil),
		(*PppoeAddDelCpReply)(nil),
		(*PppoeAddDelSession)(nil),
		(*PppoeAddDelSessionReply)(nil),
		(*PppoeSessionDetails)(nil),
		(*PppoeSessionDump)(nil),
	}
}