Simplify subscribing to events and fix events
[govpp.git] / examples / bin_api / af_packet / af_packet.ba.go
1 // Code generated by GoVPP binapi-generator. DO NOT EDIT.
2 // source: af_packet.api.json
3
4 /*
5 Package af_packet is a generated VPP binary API of the 'af_packet' VPP module.
6
7 It is generated from this file:
8         af_packet.api.json
9
10 It contains these VPP binary API objects:
11         8 messages
12         4 services
13 */
14 package af_packet
15
16 import "git.fd.io/govpp.git/api"
17 import "github.com/lunixbochs/struc"
18 import "bytes"
19
20 // Reference imports to suppress errors if they are not otherwise used.
21 var _ = api.RegisterMessage
22 var _ = struc.Pack
23 var _ = bytes.NewBuffer
24
25 /* Messages */
26
27 // AfPacketCreate represents the VPP binary API message 'af_packet_create'.
28 // Generated from 'af_packet.api.json', line 4:
29 //
30 //            "af_packet_create",
31 //            [
32 //                "u16",
33 //                "_vl_msg_id"
34 //            ],
35 //            [
36 //                "u32",
37 //                "client_index"
38 //            ],
39 //            [
40 //                "u32",
41 //                "context"
42 //            ],
43 //            [
44 //                "u8",
45 //                "host_if_name",
46 //                64
47 //            ],
48 //            [
49 //                "u8",
50 //                "hw_addr",
51 //                6
52 //            ],
53 //            [
54 //                "u8",
55 //                "use_random_hw_addr"
56 //            ],
57 //            {
58 //                "crc": "0x6d5d30d6"
59 //            }
60 //
61 type AfPacketCreate struct {
62         HostIfName      []byte `struc:"[64]byte"`
63         HwAddr          []byte `struc:"[6]byte"`
64         UseRandomHwAddr uint8
65 }
66
67 func (*AfPacketCreate) GetMessageName() string {
68         return "af_packet_create"
69 }
70 func (*AfPacketCreate) GetCrcString() string {
71         return "6d5d30d6"
72 }
73 func (*AfPacketCreate) GetMessageType() api.MessageType {
74         return api.RequestMessage
75 }
76 func NewAfPacketCreate() api.Message {
77         return &AfPacketCreate{}
78 }
79
80 // AfPacketCreateReply represents the VPP binary API message 'af_packet_create_reply'.
81 // Generated from 'af_packet.api.json', line 36:
82 //
83 //            "af_packet_create_reply",
84 //            [
85 //                "u16",
86 //                "_vl_msg_id"
87 //            ],
88 //            [
89 //                "u32",
90 //                "context"
91 //            ],
92 //            [
93 //                "i32",
94 //                "retval"
95 //            ],
96 //            [
97 //                "u32",
98 //                "sw_if_index"
99 //            ],
100 //            {
101 //                "crc": "0xfda5941f"
102 //            }
103 //
104 type AfPacketCreateReply struct {
105         Retval    int32
106         SwIfIndex uint32
107 }
108
109 func (*AfPacketCreateReply) GetMessageName() string {
110         return "af_packet_create_reply"
111 }
112 func (*AfPacketCreateReply) GetCrcString() string {
113         return "fda5941f"
114 }
115 func (*AfPacketCreateReply) GetMessageType() api.MessageType {
116         return api.ReplyMessage
117 }
118 func NewAfPacketCreateReply() api.Message {
119         return &AfPacketCreateReply{}
120 }
121
122 // AfPacketDelete represents the VPP binary API message 'af_packet_delete'.
123 // Generated from 'af_packet.api.json', line 58:
124 //
125 //            "af_packet_delete",
126 //            [
127 //                "u16",
128 //                "_vl_msg_id"
129 //            ],
130 //            [
131 //                "u32",
132 //                "client_index"
133 //            ],
134 //            [
135 //                "u32",
136 //                "context"
137 //            ],
138 //            [
139 //                "u8",
140 //                "host_if_name",
141 //                64
142 //            ],
143 //            {
144 //                "crc": "0x3efceda3"
145 //            }
146 //
147 type AfPacketDelete struct {
148         HostIfName []byte `struc:"[64]byte"`
149 }
150
151 func (*AfPacketDelete) GetMessageName() string {
152         return "af_packet_delete"
153 }
154 func (*AfPacketDelete) GetCrcString() string {
155         return "3efceda3"
156 }
157 func (*AfPacketDelete) GetMessageType() api.MessageType {
158         return api.RequestMessage
159 }
160 func NewAfPacketDelete() api.Message {
161         return &AfPacketDelete{}
162 }
163
164 // AfPacketDeleteReply represents the VPP binary API message 'af_packet_delete_reply'.
165 // Generated from 'af_packet.api.json', line 81:
166 //
167 //            "af_packet_delete_reply",
168 //            [
169 //                "u16",
170 //                "_vl_msg_id"
171 //            ],
172 //            [
173 //                "u32",
174 //                "context"
175 //            ],
176 //            [
177 //                "i32",
178 //                "retval"
179 //            ],
180 //            {
181 //                "crc": "0xe8d4e804"
182 //            }
183 //
184 type AfPacketDeleteReply struct {
185         Retval int32
186 }
187
188 func (*AfPacketDeleteReply) GetMessageName() string {
189         return "af_packet_delete_reply"
190 }
191 func (*AfPacketDeleteReply) GetCrcString() string {
192         return "e8d4e804"
193 }
194 func (*AfPacketDeleteReply) GetMessageType() api.MessageType {
195         return api.ReplyMessage
196 }
197 func NewAfPacketDeleteReply() api.Message {
198         return &AfPacketDeleteReply{}
199 }
200
201 // AfPacketSetL4CksumOffload represents the VPP binary API message 'af_packet_set_l4_cksum_offload'.
202 // Generated from 'af_packet.api.json', line 99:
203 //
204 //            "af_packet_set_l4_cksum_offload",
205 //            [
206 //                "u16",
207 //                "_vl_msg_id"
208 //            ],
209 //            [
210 //                "u32",
211 //                "client_index"
212 //            ],
213 //            [
214 //                "u32",
215 //                "context"
216 //            ],
217 //            [
218 //                "u8",
219 //                "sw_if_index"
220 //            ],
221 //            [
222 //                "u8",
223 //                "set"
224 //            ],
225 //            {
226 //                "crc": "0x86538585"
227 //            }
228 //
229 type AfPacketSetL4CksumOffload struct {
230         SwIfIndex uint8
231         Set       uint8
232 }
233
234 func (*AfPacketSetL4CksumOffload) GetMessageName() string {
235         return "af_packet_set_l4_cksum_offload"
236 }
237 func (*AfPacketSetL4CksumOffload) GetCrcString() string {
238         return "86538585"
239 }
240 func (*AfPacketSetL4CksumOffload) GetMessageType() api.MessageType {
241         return api.RequestMessage
242 }
243 func NewAfPacketSetL4CksumOffload() api.Message {
244         return &AfPacketSetL4CksumOffload{}
245 }
246
247 // AfPacketSetL4CksumOffloadReply represents the VPP binary API message 'af_packet_set_l4_cksum_offload_reply'.
248 // Generated from 'af_packet.api.json', line 125:
249 //
250 //            "af_packet_set_l4_cksum_offload_reply",
251 //            [
252 //                "u16",
253 //                "_vl_msg_id"
254 //            ],
255 //            [
256 //                "u32",
257 //                "context"
258 //            ],
259 //            [
260 //                "i32",
261 //                "retval"
262 //            ],
263 //            {
264 //                "crc": "0xe8d4e804"
265 //            }
266 //
267 type AfPacketSetL4CksumOffloadReply struct {
268         Retval int32
269 }
270
271 func (*AfPacketSetL4CksumOffloadReply) GetMessageName() string {
272         return "af_packet_set_l4_cksum_offload_reply"
273 }
274 func (*AfPacketSetL4CksumOffloadReply) GetCrcString() string {
275         return "e8d4e804"
276 }
277 func (*AfPacketSetL4CksumOffloadReply) GetMessageType() api.MessageType {
278         return api.ReplyMessage
279 }
280 func NewAfPacketSetL4CksumOffloadReply() api.Message {
281         return &AfPacketSetL4CksumOffloadReply{}
282 }
283
284 // AfPacketDump represents the VPP binary API message 'af_packet_dump'.
285 // Generated from 'af_packet.api.json', line 143:
286 //
287 //            "af_packet_dump",
288 //            [
289 //                "u16",
290 //                "_vl_msg_id"
291 //            ],
292 //            [
293 //                "u32",
294 //                "client_index"
295 //            ],
296 //            [
297 //                "u32",
298 //                "context"
299 //            ],
300 //            {
301 //                "crc": "0x51077d14"
302 //            }
303 //
304 type AfPacketDump struct{}
305
306 func (*AfPacketDump) GetMessageName() string {
307         return "af_packet_dump"
308 }
309 func (*AfPacketDump) GetCrcString() string {
310         return "51077d14"
311 }
312 func (*AfPacketDump) GetMessageType() api.MessageType {
313         return api.RequestMessage
314 }
315 func NewAfPacketDump() api.Message {
316         return &AfPacketDump{}
317 }
318
319 // AfPacketDetails represents the VPP binary API message 'af_packet_details'.
320 // Generated from 'af_packet.api.json', line 161:
321 //
322 //            "af_packet_details",
323 //            [
324 //                "u16",
325 //                "_vl_msg_id"
326 //            ],
327 //            [
328 //                "u32",
329 //                "context"
330 //            ],
331 //            [
332 //                "u32",
333 //                "sw_if_index"
334 //            ],
335 //            [
336 //                "u8",
337 //                "host_if_name",
338 //                64
339 //            ],
340 //            {
341 //                "crc": "0x057205fa"
342 //            }
343 //
344 type AfPacketDetails struct {
345         SwIfIndex  uint32
346         HostIfName []byte `struc:"[64]byte"`
347 }
348
349 func (*AfPacketDetails) GetMessageName() string {
350         return "af_packet_details"
351 }
352 func (*AfPacketDetails) GetCrcString() string {
353         return "057205fa"
354 }
355 func (*AfPacketDetails) GetMessageType() api.MessageType {
356         return api.ReplyMessage
357 }
358 func NewAfPacketDetails() api.Message {
359         return &AfPacketDetails{}
360 }
361
362 /* Services */
363
364 type Services interface {
365         DumpAfPacket(*AfPacketDump) (*AfPacketDetails, error)
366         AfPacketCreate(*AfPacketCreate) (*AfPacketCreateReply, error)
367         AfPacketDelete(*AfPacketDelete) (*AfPacketDeleteReply, error)
368         AfPacketSetL4CksumOffload(*AfPacketSetL4CksumOffload) (*AfPacketSetL4CksumOffloadReply, error)
369 }
370
371 func init() {
372         api.RegisterMessage((*AfPacketCreate)(nil), "af_packet.AfPacketCreate")
373         api.RegisterMessage((*AfPacketCreateReply)(nil), "af_packet.AfPacketCreateReply")
374         api.RegisterMessage((*AfPacketDelete)(nil), "af_packet.AfPacketDelete")
375         api.RegisterMessage((*AfPacketDeleteReply)(nil), "af_packet.AfPacketDeleteReply")
376         api.RegisterMessage((*AfPacketSetL4CksumOffload)(nil), "af_packet.AfPacketSetL4CksumOffload")
377         api.RegisterMessage((*AfPacketSetL4CksumOffloadReply)(nil), "af_packet.AfPacketSetL4CksumOffloadReply")
378         api.RegisterMessage((*AfPacketDump)(nil), "af_packet.AfPacketDump")
379         api.RegisterMessage((*AfPacketDetails)(nil), "af_packet.AfPacketDetails")
380 }