1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
6 // Package pppoe contains generated bindings for API file pppoe.api.
14 api "git.fd.io/govpp.git/api"
15 ethernet_types "git.fd.io/govpp.git/binapi/ethernet_types"
16 interface_types "git.fd.io/govpp.git/binapi/interface_types"
17 ip_types "git.fd.io/govpp.git/binapi/ip_types"
18 codec "git.fd.io/govpp.git/codec"
21 // This is a compile-time assertion to ensure that this generated file
22 // is compatible with the GoVPP api package it is being compiled against.
23 // A compilation error at this line likely means your copy of the
24 // GoVPP api package needs to be updated.
25 const _ = api.GoVppAPIPackageIsVersion2
30 VersionCrc = 0x24ebf557
33 // PppoeAddDelSession defines message 'pppoe_add_del_session'.
34 type PppoeAddDelSession struct {
35 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
36 SessionID uint16 `binapi:"u16,name=session_id" json:"session_id,omitempty"`
37 ClientIP ip_types.Address `binapi:"address,name=client_ip" json:"client_ip,omitempty"`
38 DecapVrfID uint32 `binapi:"u32,name=decap_vrf_id" json:"decap_vrf_id,omitempty"`
39 ClientMac ethernet_types.MacAddress `binapi:"mac_address,name=client_mac" json:"client_mac,omitempty"`
42 func (m *PppoeAddDelSession) Reset() { *m = PppoeAddDelSession{} }
43 func (*PppoeAddDelSession) GetMessageName() string { return "pppoe_add_del_session" }
44 func (*PppoeAddDelSession) GetCrcString() string { return "46ace853" }
45 func (*PppoeAddDelSession) GetMessageType() api.MessageType {
46 return api.RequestMessage
49 func (m *PppoeAddDelSession) Size() (size int) {
54 size += 2 // m.SessionID
55 size += 1 // m.ClientIP.Af
56 size += 1 * 16 // m.ClientIP.Un
57 size += 4 // m.DecapVrfID
58 size += 1 * 6 // m.ClientMac
61 func (m *PppoeAddDelSession) Marshal(b []byte) ([]byte, error) {
63 b = make([]byte, m.Size())
65 buf := codec.NewBuffer(b)
66 buf.EncodeBool(m.IsAdd)
67 buf.EncodeUint16(m.SessionID)
68 buf.EncodeUint8(uint8(m.ClientIP.Af))
69 buf.EncodeBytes(m.ClientIP.Un.XXX_UnionData[:], 16)
70 buf.EncodeUint32(m.DecapVrfID)
71 buf.EncodeBytes(m.ClientMac[:], 6)
72 return buf.Bytes(), nil
74 func (m *PppoeAddDelSession) Unmarshal(b []byte) error {
75 buf := codec.NewBuffer(b)
76 m.IsAdd = buf.DecodeBool()
77 m.SessionID = buf.DecodeUint16()
78 m.ClientIP.Af = ip_types.AddressFamily(buf.DecodeUint8())
79 copy(m.ClientIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
80 m.DecapVrfID = buf.DecodeUint32()
81 copy(m.ClientMac[:], buf.DecodeBytes(6))
85 // PppoeAddDelSessionReply defines message 'pppoe_add_del_session_reply'.
86 type PppoeAddDelSessionReply struct {
87 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
88 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
91 func (m *PppoeAddDelSessionReply) Reset() { *m = PppoeAddDelSessionReply{} }
92 func (*PppoeAddDelSessionReply) GetMessageName() string { return "pppoe_add_del_session_reply" }
93 func (*PppoeAddDelSessionReply) GetCrcString() string { return "5383d31f" }
94 func (*PppoeAddDelSessionReply) GetMessageType() api.MessageType {
95 return api.ReplyMessage
98 func (m *PppoeAddDelSessionReply) Size() (size int) {
102 size += 4 // m.Retval
103 size += 4 // m.SwIfIndex
106 func (m *PppoeAddDelSessionReply) Marshal(b []byte) ([]byte, error) {
108 b = make([]byte, m.Size())
110 buf := codec.NewBuffer(b)
111 buf.EncodeInt32(m.Retval)
112 buf.EncodeUint32(uint32(m.SwIfIndex))
113 return buf.Bytes(), nil
115 func (m *PppoeAddDelSessionReply) Unmarshal(b []byte) error {
116 buf := codec.NewBuffer(b)
117 m.Retval = buf.DecodeInt32()
118 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
122 // PppoeSessionDetails defines message 'pppoe_session_details'.
123 type PppoeSessionDetails struct {
124 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
125 SessionID uint16 `binapi:"u16,name=session_id" json:"session_id,omitempty"`
126 ClientIP ip_types.Address `binapi:"address,name=client_ip" json:"client_ip,omitempty"`
127 EncapIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=encap_if_index" json:"encap_if_index,omitempty"`
128 DecapVrfID uint32 `binapi:"u32,name=decap_vrf_id" json:"decap_vrf_id,omitempty"`
129 LocalMac ethernet_types.MacAddress `binapi:"mac_address,name=local_mac" json:"local_mac,omitempty"`
130 ClientMac ethernet_types.MacAddress `binapi:"mac_address,name=client_mac" json:"client_mac,omitempty"`
133 func (m *PppoeSessionDetails) Reset() { *m = PppoeSessionDetails{} }
134 func (*PppoeSessionDetails) GetMessageName() string { return "pppoe_session_details" }
135 func (*PppoeSessionDetails) GetCrcString() string { return "332bc742" }
136 func (*PppoeSessionDetails) GetMessageType() api.MessageType {
137 return api.ReplyMessage
140 func (m *PppoeSessionDetails) Size() (size int) {
144 size += 4 // m.SwIfIndex
145 size += 2 // m.SessionID
146 size += 1 // m.ClientIP.Af
147 size += 1 * 16 // m.ClientIP.Un
148 size += 4 // m.EncapIfIndex
149 size += 4 // m.DecapVrfID
150 size += 1 * 6 // m.LocalMac
151 size += 1 * 6 // m.ClientMac
154 func (m *PppoeSessionDetails) Marshal(b []byte) ([]byte, error) {
156 b = make([]byte, m.Size())
158 buf := codec.NewBuffer(b)
159 buf.EncodeUint32(uint32(m.SwIfIndex))
160 buf.EncodeUint16(m.SessionID)
161 buf.EncodeUint8(uint8(m.ClientIP.Af))
162 buf.EncodeBytes(m.ClientIP.Un.XXX_UnionData[:], 16)
163 buf.EncodeUint32(uint32(m.EncapIfIndex))
164 buf.EncodeUint32(m.DecapVrfID)
165 buf.EncodeBytes(m.LocalMac[:], 6)
166 buf.EncodeBytes(m.ClientMac[:], 6)
167 return buf.Bytes(), nil
169 func (m *PppoeSessionDetails) Unmarshal(b []byte) error {
170 buf := codec.NewBuffer(b)
171 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
172 m.SessionID = buf.DecodeUint16()
173 m.ClientIP.Af = ip_types.AddressFamily(buf.DecodeUint8())
174 copy(m.ClientIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
175 m.EncapIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
176 m.DecapVrfID = buf.DecodeUint32()
177 copy(m.LocalMac[:], buf.DecodeBytes(6))
178 copy(m.ClientMac[:], buf.DecodeBytes(6))
182 // PppoeSessionDump defines message 'pppoe_session_dump'.
183 type PppoeSessionDump struct {
184 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
187 func (m *PppoeSessionDump) Reset() { *m = PppoeSessionDump{} }
188 func (*PppoeSessionDump) GetMessageName() string { return "pppoe_session_dump" }
189 func (*PppoeSessionDump) GetCrcString() string { return "f9e6675e" }
190 func (*PppoeSessionDump) GetMessageType() api.MessageType {
191 return api.RequestMessage
194 func (m *PppoeSessionDump) Size() (size int) {
198 size += 4 // m.SwIfIndex
201 func (m *PppoeSessionDump) Marshal(b []byte) ([]byte, error) {
203 b = make([]byte, m.Size())
205 buf := codec.NewBuffer(b)
206 buf.EncodeUint32(uint32(m.SwIfIndex))
207 return buf.Bytes(), nil
209 func (m *PppoeSessionDump) Unmarshal(b []byte) error {
210 buf := codec.NewBuffer(b)
211 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
215 func init() { file_pppoe_binapi_init() }
216 func file_pppoe_binapi_init() {
217 api.RegisterMessage((*PppoeAddDelSession)(nil), "pppoe_add_del_session_46ace853")
218 api.RegisterMessage((*PppoeAddDelSessionReply)(nil), "pppoe_add_del_session_reply_5383d31f")
219 api.RegisterMessage((*PppoeSessionDetails)(nil), "pppoe_session_details_332bc742")
220 api.RegisterMessage((*PppoeSessionDump)(nil), "pppoe_session_dump_f9e6675e")
223 // Messages returns list of all messages in this module.
224 func AllMessages() []api.Message {
225 return []api.Message{
226 (*PppoeAddDelSession)(nil),
227 (*PppoeAddDelSessionReply)(nil),
228 (*PppoeSessionDetails)(nil),
229 (*PppoeSessionDump)(nil),