1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0
4 // VPP: 20.05.1-release
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() (size int) {
55 size += 2 // m.SessionID
56 size += 1 // m.ClientIP.Af
57 size += 1 * 16 // m.ClientIP.Un
58 size += 4 // m.DecapVrfID
59 size += 1 * 6 // m.ClientMac
62 func (m *PppoeAddDelSession) Marshal(b []byte) ([]byte, error) {
64 b = make([]byte, m.Size())
66 buf := codec.NewBuffer(b)
67 buf.EncodeBool(m.IsAdd)
68 buf.EncodeUint16(m.SessionID)
69 buf.EncodeUint8(uint8(m.ClientIP.Af))
70 buf.EncodeBytes(m.ClientIP.Un.XXX_UnionData[:], 16)
71 buf.EncodeUint32(m.DecapVrfID)
72 buf.EncodeBytes(m.ClientMac[:], 6)
73 return buf.Bytes(), nil
75 func (m *PppoeAddDelSession) Unmarshal(b []byte) error {
76 buf := codec.NewBuffer(b)
77 m.IsAdd = buf.DecodeBool()
78 m.SessionID = buf.DecodeUint16()
79 m.ClientIP.Af = ip_types.AddressFamily(buf.DecodeUint8())
80 copy(m.ClientIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
81 m.DecapVrfID = buf.DecodeUint32()
82 copy(m.ClientMac[:], buf.DecodeBytes(6))
86 // PppoeAddDelSessionReply defines message 'pppoe_add_del_session_reply'.
87 type PppoeAddDelSessionReply struct {
88 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
89 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
92 func (m *PppoeAddDelSessionReply) Reset() { *m = PppoeAddDelSessionReply{} }
93 func (*PppoeAddDelSessionReply) GetMessageName() string { return "pppoe_add_del_session_reply" }
94 func (*PppoeAddDelSessionReply) GetCrcString() string { return "5383d31f" }
95 func (*PppoeAddDelSessionReply) GetMessageType() api.MessageType {
96 return api.ReplyMessage
99 func (m *PppoeAddDelSessionReply) Size() (size int) {
103 size += 4 // m.Retval
104 size += 4 // m.SwIfIndex
107 func (m *PppoeAddDelSessionReply) Marshal(b []byte) ([]byte, error) {
109 b = make([]byte, m.Size())
111 buf := codec.NewBuffer(b)
112 buf.EncodeInt32(m.Retval)
113 buf.EncodeUint32(uint32(m.SwIfIndex))
114 return buf.Bytes(), nil
116 func (m *PppoeAddDelSessionReply) Unmarshal(b []byte) error {
117 buf := codec.NewBuffer(b)
118 m.Retval = buf.DecodeInt32()
119 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
123 // PppoeSessionDetails defines message 'pppoe_session_details'.
124 type PppoeSessionDetails struct {
125 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
126 SessionID uint16 `binapi:"u16,name=session_id" json:"session_id,omitempty"`
127 ClientIP ip_types.Address `binapi:"address,name=client_ip" json:"client_ip,omitempty"`
128 EncapIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=encap_if_index" json:"encap_if_index,omitempty"`
129 DecapVrfID uint32 `binapi:"u32,name=decap_vrf_id" json:"decap_vrf_id,omitempty"`
130 LocalMac ethernet_types.MacAddress `binapi:"mac_address,name=local_mac" json:"local_mac,omitempty"`
131 ClientMac ethernet_types.MacAddress `binapi:"mac_address,name=client_mac" json:"client_mac,omitempty"`
134 func (m *PppoeSessionDetails) Reset() { *m = PppoeSessionDetails{} }
135 func (*PppoeSessionDetails) GetMessageName() string { return "pppoe_session_details" }
136 func (*PppoeSessionDetails) GetCrcString() string { return "332bc742" }
137 func (*PppoeSessionDetails) GetMessageType() api.MessageType {
138 return api.ReplyMessage
141 func (m *PppoeSessionDetails) Size() (size int) {
145 size += 4 // m.SwIfIndex
146 size += 2 // m.SessionID
147 size += 1 // m.ClientIP.Af
148 size += 1 * 16 // m.ClientIP.Un
149 size += 4 // m.EncapIfIndex
150 size += 4 // m.DecapVrfID
151 size += 1 * 6 // m.LocalMac
152 size += 1 * 6 // m.ClientMac
155 func (m *PppoeSessionDetails) Marshal(b []byte) ([]byte, error) {
157 b = make([]byte, m.Size())
159 buf := codec.NewBuffer(b)
160 buf.EncodeUint32(uint32(m.SwIfIndex))
161 buf.EncodeUint16(m.SessionID)
162 buf.EncodeUint8(uint8(m.ClientIP.Af))
163 buf.EncodeBytes(m.ClientIP.Un.XXX_UnionData[:], 16)
164 buf.EncodeUint32(uint32(m.EncapIfIndex))
165 buf.EncodeUint32(m.DecapVrfID)
166 buf.EncodeBytes(m.LocalMac[:], 6)
167 buf.EncodeBytes(m.ClientMac[:], 6)
168 return buf.Bytes(), nil
170 func (m *PppoeSessionDetails) Unmarshal(b []byte) error {
171 buf := codec.NewBuffer(b)
172 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
173 m.SessionID = buf.DecodeUint16()
174 m.ClientIP.Af = ip_types.AddressFamily(buf.DecodeUint8())
175 copy(m.ClientIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
176 m.EncapIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
177 m.DecapVrfID = buf.DecodeUint32()
178 copy(m.LocalMac[:], buf.DecodeBytes(6))
179 copy(m.ClientMac[:], buf.DecodeBytes(6))
183 // PppoeSessionDump defines message 'pppoe_session_dump'.
184 type PppoeSessionDump struct {
185 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
188 func (m *PppoeSessionDump) Reset() { *m = PppoeSessionDump{} }
189 func (*PppoeSessionDump) GetMessageName() string { return "pppoe_session_dump" }
190 func (*PppoeSessionDump) GetCrcString() string { return "f9e6675e" }
191 func (*PppoeSessionDump) GetMessageType() api.MessageType {
192 return api.RequestMessage
195 func (m *PppoeSessionDump) Size() (size int) {
199 size += 4 // m.SwIfIndex
202 func (m *PppoeSessionDump) Marshal(b []byte) ([]byte, error) {
204 b = make([]byte, m.Size())
206 buf := codec.NewBuffer(b)
207 buf.EncodeUint32(uint32(m.SwIfIndex))
208 return buf.Bytes(), nil
210 func (m *PppoeSessionDump) Unmarshal(b []byte) error {
211 buf := codec.NewBuffer(b)
212 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
216 func init() { file_pppoe_binapi_init() }
217 func file_pppoe_binapi_init() {
218 api.RegisterMessage((*PppoeAddDelSession)(nil), "pppoe_add_del_session_46ace853")
219 api.RegisterMessage((*PppoeAddDelSessionReply)(nil), "pppoe_add_del_session_reply_5383d31f")
220 api.RegisterMessage((*PppoeSessionDetails)(nil), "pppoe_session_details_332bc742")
221 api.RegisterMessage((*PppoeSessionDump)(nil), "pppoe_session_dump_f9e6675e")
224 // Messages returns list of all messages in this module.
225 func AllMessages() []api.Message {
226 return []api.Message{
227 (*PppoeAddDelSession)(nil),
228 (*PppoeAddDelSessionReply)(nil),
229 (*PppoeSessionDetails)(nil),
230 (*PppoeSessionDump)(nil),