1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
5 // source: /usr/share/vpp/api/core/af_packet.api.json
7 // Package af_packet contains generated bindings for API file af_packet.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 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 = 0xe0b6c022
33 // AfPacketCreate defines message 'af_packet_create'.
34 type AfPacketCreate struct {
35 HwAddr ethernet_types.MacAddress `binapi:"mac_address,name=hw_addr" json:"hw_addr,omitempty"`
36 UseRandomHwAddr bool `binapi:"bool,name=use_random_hw_addr" json:"use_random_hw_addr,omitempty"`
37 HostIfName string `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty"`
40 func (m *AfPacketCreate) Reset() { *m = AfPacketCreate{} }
41 func (*AfPacketCreate) GetMessageName() string { return "af_packet_create" }
42 func (*AfPacketCreate) GetCrcString() string { return "a190415f" }
43 func (*AfPacketCreate) GetMessageType() api.MessageType {
44 return api.RequestMessage
47 func (m *AfPacketCreate) Size() int {
52 size += 1 * 6 // m.HwAddr
53 size += 1 // m.UseRandomHwAddr
54 size += 64 // m.HostIfName
57 func (m *AfPacketCreate) Marshal(b []byte) ([]byte, error) {
60 buf = codec.NewBuffer(make([]byte, m.Size()))
62 buf = codec.NewBuffer(b)
64 buf.EncodeBytes(m.HwAddr[:], 6)
65 buf.EncodeBool(m.UseRandomHwAddr)
66 buf.EncodeString(m.HostIfName, 64)
67 return buf.Bytes(), nil
69 func (m *AfPacketCreate) Unmarshal(b []byte) error {
70 buf := codec.NewBuffer(b)
71 copy(m.HwAddr[:], buf.DecodeBytes(6))
72 m.UseRandomHwAddr = buf.DecodeBool()
73 m.HostIfName = buf.DecodeString(64)
77 // AfPacketCreateReply defines message 'af_packet_create_reply'.
78 type AfPacketCreateReply struct {
79 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
80 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
83 func (m *AfPacketCreateReply) Reset() { *m = AfPacketCreateReply{} }
84 func (*AfPacketCreateReply) GetMessageName() string { return "af_packet_create_reply" }
85 func (*AfPacketCreateReply) GetCrcString() string { return "5383d31f" }
86 func (*AfPacketCreateReply) GetMessageType() api.MessageType {
87 return api.ReplyMessage
90 func (m *AfPacketCreateReply) Size() int {
96 size += 4 // m.SwIfIndex
99 func (m *AfPacketCreateReply) Marshal(b []byte) ([]byte, error) {
100 var buf *codec.Buffer
102 buf = codec.NewBuffer(make([]byte, m.Size()))
104 buf = codec.NewBuffer(b)
106 buf.EncodeUint32(uint32(m.Retval))
107 buf.EncodeUint32(uint32(m.SwIfIndex))
108 return buf.Bytes(), nil
110 func (m *AfPacketCreateReply) Unmarshal(b []byte) error {
111 buf := codec.NewBuffer(b)
112 m.Retval = int32(buf.DecodeUint32())
113 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
117 // AfPacketDelete defines message 'af_packet_delete'.
118 type AfPacketDelete struct {
119 HostIfName string `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty"`
122 func (m *AfPacketDelete) Reset() { *m = AfPacketDelete{} }
123 func (*AfPacketDelete) GetMessageName() string { return "af_packet_delete" }
124 func (*AfPacketDelete) GetCrcString() string { return "863fa648" }
125 func (*AfPacketDelete) GetMessageType() api.MessageType {
126 return api.RequestMessage
129 func (m *AfPacketDelete) Size() int {
134 size += 64 // m.HostIfName
137 func (m *AfPacketDelete) Marshal(b []byte) ([]byte, error) {
138 var buf *codec.Buffer
140 buf = codec.NewBuffer(make([]byte, m.Size()))
142 buf = codec.NewBuffer(b)
144 buf.EncodeString(m.HostIfName, 64)
145 return buf.Bytes(), nil
147 func (m *AfPacketDelete) Unmarshal(b []byte) error {
148 buf := codec.NewBuffer(b)
149 m.HostIfName = buf.DecodeString(64)
153 // AfPacketDeleteReply defines message 'af_packet_delete_reply'.
154 type AfPacketDeleteReply struct {
155 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
158 func (m *AfPacketDeleteReply) Reset() { *m = AfPacketDeleteReply{} }
159 func (*AfPacketDeleteReply) GetMessageName() string { return "af_packet_delete_reply" }
160 func (*AfPacketDeleteReply) GetCrcString() string { return "e8d4e804" }
161 func (*AfPacketDeleteReply) GetMessageType() api.MessageType {
162 return api.ReplyMessage
165 func (m *AfPacketDeleteReply) Size() int {
170 size += 4 // m.Retval
173 func (m *AfPacketDeleteReply) Marshal(b []byte) ([]byte, error) {
174 var buf *codec.Buffer
176 buf = codec.NewBuffer(make([]byte, m.Size()))
178 buf = codec.NewBuffer(b)
180 buf.EncodeUint32(uint32(m.Retval))
181 return buf.Bytes(), nil
183 func (m *AfPacketDeleteReply) Unmarshal(b []byte) error {
184 buf := codec.NewBuffer(b)
185 m.Retval = int32(buf.DecodeUint32())
189 // AfPacketDetails defines message 'af_packet_details'.
190 type AfPacketDetails struct {
191 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
192 HostIfName string `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty"`
195 func (m *AfPacketDetails) Reset() { *m = AfPacketDetails{} }
196 func (*AfPacketDetails) GetMessageName() string { return "af_packet_details" }
197 func (*AfPacketDetails) GetCrcString() string { return "58c7c042" }
198 func (*AfPacketDetails) GetMessageType() api.MessageType {
199 return api.ReplyMessage
202 func (m *AfPacketDetails) Size() int {
207 size += 4 // m.SwIfIndex
208 size += 64 // m.HostIfName
211 func (m *AfPacketDetails) Marshal(b []byte) ([]byte, error) {
212 var buf *codec.Buffer
214 buf = codec.NewBuffer(make([]byte, m.Size()))
216 buf = codec.NewBuffer(b)
218 buf.EncodeUint32(uint32(m.SwIfIndex))
219 buf.EncodeString(m.HostIfName, 64)
220 return buf.Bytes(), nil
222 func (m *AfPacketDetails) Unmarshal(b []byte) error {
223 buf := codec.NewBuffer(b)
224 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
225 m.HostIfName = buf.DecodeString(64)
229 // AfPacketDump defines message 'af_packet_dump'.
230 type AfPacketDump struct{}
232 func (m *AfPacketDump) Reset() { *m = AfPacketDump{} }
233 func (*AfPacketDump) GetMessageName() string { return "af_packet_dump" }
234 func (*AfPacketDump) GetCrcString() string { return "51077d14" }
235 func (*AfPacketDump) GetMessageType() api.MessageType {
236 return api.RequestMessage
239 func (m *AfPacketDump) Size() int {
246 func (m *AfPacketDump) Marshal(b []byte) ([]byte, error) {
247 var buf *codec.Buffer
249 buf = codec.NewBuffer(make([]byte, m.Size()))
251 buf = codec.NewBuffer(b)
253 return buf.Bytes(), nil
255 func (m *AfPacketDump) Unmarshal(b []byte) error {
259 // AfPacketSetL4CksumOffload defines message 'af_packet_set_l4_cksum_offload'.
260 type AfPacketSetL4CksumOffload struct {
261 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
262 Set bool `binapi:"bool,name=set" json:"set,omitempty"`
265 func (m *AfPacketSetL4CksumOffload) Reset() { *m = AfPacketSetL4CksumOffload{} }
266 func (*AfPacketSetL4CksumOffload) GetMessageName() string { return "af_packet_set_l4_cksum_offload" }
267 func (*AfPacketSetL4CksumOffload) GetCrcString() string { return "319cd5c8" }
268 func (*AfPacketSetL4CksumOffload) GetMessageType() api.MessageType {
269 return api.RequestMessage
272 func (m *AfPacketSetL4CksumOffload) Size() int {
277 size += 4 // m.SwIfIndex
281 func (m *AfPacketSetL4CksumOffload) Marshal(b []byte) ([]byte, error) {
282 var buf *codec.Buffer
284 buf = codec.NewBuffer(make([]byte, m.Size()))
286 buf = codec.NewBuffer(b)
288 buf.EncodeUint32(uint32(m.SwIfIndex))
289 buf.EncodeBool(m.Set)
290 return buf.Bytes(), nil
292 func (m *AfPacketSetL4CksumOffload) Unmarshal(b []byte) error {
293 buf := codec.NewBuffer(b)
294 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
295 m.Set = buf.DecodeBool()
299 // AfPacketSetL4CksumOffloadReply defines message 'af_packet_set_l4_cksum_offload_reply'.
300 type AfPacketSetL4CksumOffloadReply struct {
301 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
304 func (m *AfPacketSetL4CksumOffloadReply) Reset() { *m = AfPacketSetL4CksumOffloadReply{} }
305 func (*AfPacketSetL4CksumOffloadReply) GetMessageName() string {
306 return "af_packet_set_l4_cksum_offload_reply"
308 func (*AfPacketSetL4CksumOffloadReply) GetCrcString() string { return "e8d4e804" }
309 func (*AfPacketSetL4CksumOffloadReply) GetMessageType() api.MessageType {
310 return api.ReplyMessage
313 func (m *AfPacketSetL4CksumOffloadReply) Size() int {
318 size += 4 // m.Retval
321 func (m *AfPacketSetL4CksumOffloadReply) Marshal(b []byte) ([]byte, error) {
322 var buf *codec.Buffer
324 buf = codec.NewBuffer(make([]byte, m.Size()))
326 buf = codec.NewBuffer(b)
328 buf.EncodeUint32(uint32(m.Retval))
329 return buf.Bytes(), nil
331 func (m *AfPacketSetL4CksumOffloadReply) Unmarshal(b []byte) error {
332 buf := codec.NewBuffer(b)
333 m.Retval = int32(buf.DecodeUint32())
337 func init() { file_af_packet_binapi_init() }
338 func file_af_packet_binapi_init() {
339 api.RegisterMessage((*AfPacketCreate)(nil), "af_packet_create_a190415f")
340 api.RegisterMessage((*AfPacketCreateReply)(nil), "af_packet_create_reply_5383d31f")
341 api.RegisterMessage((*AfPacketDelete)(nil), "af_packet_delete_863fa648")
342 api.RegisterMessage((*AfPacketDeleteReply)(nil), "af_packet_delete_reply_e8d4e804")
343 api.RegisterMessage((*AfPacketDetails)(nil), "af_packet_details_58c7c042")
344 api.RegisterMessage((*AfPacketDump)(nil), "af_packet_dump_51077d14")
345 api.RegisterMessage((*AfPacketSetL4CksumOffload)(nil), "af_packet_set_l4_cksum_offload_319cd5c8")
346 api.RegisterMessage((*AfPacketSetL4CksumOffloadReply)(nil), "af_packet_set_l4_cksum_offload_reply_e8d4e804")
349 // Messages returns list of all messages in this module.
350 func AllMessages() []api.Message {
351 return []api.Message{
352 (*AfPacketCreate)(nil),
353 (*AfPacketCreateReply)(nil),
354 (*AfPacketDelete)(nil),
355 (*AfPacketDeleteReply)(nil),
356 (*AfPacketDetails)(nil),
357 (*AfPacketDump)(nil),
358 (*AfPacketSetL4CksumOffload)(nil),
359 (*AfPacketSetL4CksumOffloadReply)(nil),