1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
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 = 0x24ebf557
34 // PppoeAddDelSession defines message 'pppoe_add_del_session'.
35 type PppoeAddDelSession struct {
36 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
37 SessionID uint16 `binapi:"u16,name=session_id" json:"session_id,omitempty"`
38 ClientIP ip_types.Address `binapi:"address,name=client_ip" json:"client_ip,omitempty"`
39 DecapVrfID uint32 `binapi:"u32,name=decap_vrf_id" json:"decap_vrf_id,omitempty"`
40 ClientMac ethernet_types.MacAddress `binapi:"mac_address,name=client_mac" json:"client_mac,omitempty"`
43 func (m *PppoeAddDelSession) Reset() { *m = PppoeAddDelSession{} }
44 func (*PppoeAddDelSession) GetMessageName() string { return "pppoe_add_del_session" }
45 func (*PppoeAddDelSession) GetCrcString() string { return "46ace853" }
46 func (*PppoeAddDelSession) GetMessageType() api.MessageType {
47 return api.RequestMessage
50 func (m *PppoeAddDelSession) Size() int {
56 size += 2 // m.SessionID
57 size += 1 // m.ClientIP.Af
58 size += 1 * 16 // m.ClientIP.Un
59 size += 4 // m.DecapVrfID
60 size += 1 * 6 // m.ClientMac
63 func (m *PppoeAddDelSession) Marshal(b []byte) ([]byte, error) {
66 buf = codec.NewBuffer(make([]byte, m.Size()))
68 buf = codec.NewBuffer(b)
70 buf.EncodeBool(m.IsAdd)
71 buf.EncodeUint16(uint16(m.SessionID))
72 buf.EncodeUint8(uint8(m.ClientIP.Af))
73 buf.EncodeBytes(m.ClientIP.Un.XXX_UnionData[:], 0)
74 buf.EncodeUint32(uint32(m.DecapVrfID))
75 buf.EncodeBytes(m.ClientMac[:], 6)
76 return buf.Bytes(), nil
78 func (m *PppoeAddDelSession) Unmarshal(b []byte) error {
79 buf := codec.NewBuffer(b)
80 m.IsAdd = buf.DecodeBool()
81 m.SessionID = buf.DecodeUint16()
82 m.ClientIP.Af = ip_types.AddressFamily(buf.DecodeUint8())
83 copy(m.ClientIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
84 m.DecapVrfID = buf.DecodeUint32()
85 copy(m.ClientMac[:], buf.DecodeBytes(6))
89 // PppoeAddDelSessionReply defines message 'pppoe_add_del_session_reply'.
90 type PppoeAddDelSessionReply struct {
91 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
92 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
95 func (m *PppoeAddDelSessionReply) Reset() { *m = PppoeAddDelSessionReply{} }
96 func (*PppoeAddDelSessionReply) GetMessageName() string { return "pppoe_add_del_session_reply" }
97 func (*PppoeAddDelSessionReply) GetCrcString() string { return "5383d31f" }
98 func (*PppoeAddDelSessionReply) GetMessageType() api.MessageType {
99 return api.ReplyMessage
102 func (m *PppoeAddDelSessionReply) Size() int {
107 size += 4 // m.Retval
108 size += 4 // m.SwIfIndex
111 func (m *PppoeAddDelSessionReply) Marshal(b []byte) ([]byte, error) {
112 var buf *codec.Buffer
114 buf = codec.NewBuffer(make([]byte, m.Size()))
116 buf = codec.NewBuffer(b)
118 buf.EncodeUint32(uint32(m.Retval))
119 buf.EncodeUint32(uint32(m.SwIfIndex))
120 return buf.Bytes(), nil
122 func (m *PppoeAddDelSessionReply) Unmarshal(b []byte) error {
123 buf := codec.NewBuffer(b)
124 m.Retval = int32(buf.DecodeUint32())
125 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
129 // PppoeSessionDetails defines message 'pppoe_session_details'.
130 type PppoeSessionDetails struct {
131 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
132 SessionID uint16 `binapi:"u16,name=session_id" json:"session_id,omitempty"`
133 ClientIP ip_types.Address `binapi:"address,name=client_ip" json:"client_ip,omitempty"`
134 EncapIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=encap_if_index" json:"encap_if_index,omitempty"`
135 DecapVrfID uint32 `binapi:"u32,name=decap_vrf_id" json:"decap_vrf_id,omitempty"`
136 LocalMac ethernet_types.MacAddress `binapi:"mac_address,name=local_mac" json:"local_mac,omitempty"`
137 ClientMac ethernet_types.MacAddress `binapi:"mac_address,name=client_mac" json:"client_mac,omitempty"`
140 func (m *PppoeSessionDetails) Reset() { *m = PppoeSessionDetails{} }
141 func (*PppoeSessionDetails) GetMessageName() string { return "pppoe_session_details" }
142 func (*PppoeSessionDetails) GetCrcString() string { return "332bc742" }
143 func (*PppoeSessionDetails) GetMessageType() api.MessageType {
144 return api.ReplyMessage
147 func (m *PppoeSessionDetails) Size() int {
152 size += 4 // m.SwIfIndex
153 size += 2 // m.SessionID
154 size += 1 // m.ClientIP.Af
155 size += 1 * 16 // m.ClientIP.Un
156 size += 4 // m.EncapIfIndex
157 size += 4 // m.DecapVrfID
158 size += 1 * 6 // m.LocalMac
159 size += 1 * 6 // m.ClientMac
162 func (m *PppoeSessionDetails) Marshal(b []byte) ([]byte, error) {
163 var buf *codec.Buffer
165 buf = codec.NewBuffer(make([]byte, m.Size()))
167 buf = codec.NewBuffer(b)
169 buf.EncodeUint32(uint32(m.SwIfIndex))
170 buf.EncodeUint16(uint16(m.SessionID))
171 buf.EncodeUint8(uint8(m.ClientIP.Af))
172 buf.EncodeBytes(m.ClientIP.Un.XXX_UnionData[:], 0)
173 buf.EncodeUint32(uint32(m.EncapIfIndex))
174 buf.EncodeUint32(uint32(m.DecapVrfID))
175 buf.EncodeBytes(m.LocalMac[:], 6)
176 buf.EncodeBytes(m.ClientMac[:], 6)
177 return buf.Bytes(), nil
179 func (m *PppoeSessionDetails) Unmarshal(b []byte) error {
180 buf := codec.NewBuffer(b)
181 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
182 m.SessionID = buf.DecodeUint16()
183 m.ClientIP.Af = ip_types.AddressFamily(buf.DecodeUint8())
184 copy(m.ClientIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
185 m.EncapIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
186 m.DecapVrfID = buf.DecodeUint32()
187 copy(m.LocalMac[:], buf.DecodeBytes(6))
188 copy(m.ClientMac[:], buf.DecodeBytes(6))
192 // PppoeSessionDump defines message 'pppoe_session_dump'.
193 type PppoeSessionDump struct {
194 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
197 func (m *PppoeSessionDump) Reset() { *m = PppoeSessionDump{} }
198 func (*PppoeSessionDump) GetMessageName() string { return "pppoe_session_dump" }
199 func (*PppoeSessionDump) GetCrcString() string { return "f9e6675e" }
200 func (*PppoeSessionDump) GetMessageType() api.MessageType {
201 return api.RequestMessage
204 func (m *PppoeSessionDump) Size() int {
209 size += 4 // m.SwIfIndex
212 func (m *PppoeSessionDump) Marshal(b []byte) ([]byte, error) {
213 var buf *codec.Buffer
215 buf = codec.NewBuffer(make([]byte, m.Size()))
217 buf = codec.NewBuffer(b)
219 buf.EncodeUint32(uint32(m.SwIfIndex))
220 return buf.Bytes(), nil
222 func (m *PppoeSessionDump) Unmarshal(b []byte) error {
223 buf := codec.NewBuffer(b)
224 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
228 func init() { file_pppoe_binapi_init() }
229 func file_pppoe_binapi_init() {
230 api.RegisterMessage((*PppoeAddDelSession)(nil), "pppoe_add_del_session_46ace853")
231 api.RegisterMessage((*PppoeAddDelSessionReply)(nil), "pppoe_add_del_session_reply_5383d31f")
232 api.RegisterMessage((*PppoeSessionDetails)(nil), "pppoe_session_details_332bc742")
233 api.RegisterMessage((*PppoeSessionDump)(nil), "pppoe_session_dump_f9e6675e")
236 // Messages returns list of all messages in this module.
237 func AllMessages() []api.Message {
238 return []api.Message{
239 (*PppoeAddDelSession)(nil),
240 (*PppoeAddDelSessionReply)(nil),
241 (*PppoeSessionDetails)(nil),
242 (*PppoeSessionDump)(nil),