Refactor GoVPP
[govpp.git] / examples / bin_api / memif / memif.ba.go
1 // Code generated by GoVPP binapi-generator. DO NOT EDIT.
2 // source: memif.api.json
3
4 /*
5 Package memif is a generated VPP binary API of the 'memif' VPP module.
6
7 It is generated from this file:
8         memif.api.json
9
10 It contains these VPP binary API objects:
11         10 messages
12         5 services
13 */
14 package memif
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 _ = struc.Pack
22 var _ = bytes.NewBuffer
23
24 /* Messages */
25
26 // MemifSocketFilenameAddDel represents the VPP binary API message 'memif_socket_filename_add_del'.
27 // Generated from 'memif.api.json', line 4:
28 //
29 //            "memif_socket_filename_add_del",
30 //            [
31 //                "u16",
32 //                "_vl_msg_id"
33 //            ],
34 //            [
35 //                "u32",
36 //                "client_index"
37 //            ],
38 //            [
39 //                "u32",
40 //                "context"
41 //            ],
42 //            [
43 //                "u8",
44 //                "is_add"
45 //            ],
46 //            [
47 //                "u32",
48 //                "socket_id"
49 //            ],
50 //            [
51 //                "u8",
52 //                "socket_filename",
53 //                128
54 //            ],
55 //            {
56 //                "crc": "0x30e3929d"
57 //            }
58 //
59 type MemifSocketFilenameAddDel struct {
60         IsAdd          uint8
61         SocketID       uint32
62         SocketFilename []byte `struc:"[128]byte"`
63 }
64
65 func (*MemifSocketFilenameAddDel) GetMessageName() string {
66         return "memif_socket_filename_add_del"
67 }
68 func (*MemifSocketFilenameAddDel) GetCrcString() string {
69         return "30e3929d"
70 }
71 func (*MemifSocketFilenameAddDel) GetMessageType() api.MessageType {
72         return api.RequestMessage
73 }
74 func NewMemifSocketFilenameAddDel() api.Message {
75         return &MemifSocketFilenameAddDel{}
76 }
77
78 // MemifSocketFilenameAddDelReply represents the VPP binary API message 'memif_socket_filename_add_del_reply'.
79 // Generated from 'memif.api.json', line 35:
80 //
81 //            "memif_socket_filename_add_del_reply",
82 //            [
83 //                "u16",
84 //                "_vl_msg_id"
85 //            ],
86 //            [
87 //                "u32",
88 //                "context"
89 //            ],
90 //            [
91 //                "i32",
92 //                "retval"
93 //            ],
94 //            {
95 //                "crc": "0xe8d4e804"
96 //            }
97 //
98 type MemifSocketFilenameAddDelReply struct {
99         Retval int32
100 }
101
102 func (*MemifSocketFilenameAddDelReply) GetMessageName() string {
103         return "memif_socket_filename_add_del_reply"
104 }
105 func (*MemifSocketFilenameAddDelReply) GetCrcString() string {
106         return "e8d4e804"
107 }
108 func (*MemifSocketFilenameAddDelReply) GetMessageType() api.MessageType {
109         return api.ReplyMessage
110 }
111 func NewMemifSocketFilenameAddDelReply() api.Message {
112         return &MemifSocketFilenameAddDelReply{}
113 }
114
115 // MemifCreate represents the VPP binary API message 'memif_create'.
116 // Generated from 'memif.api.json', line 53:
117 //
118 //            "memif_create",
119 //            [
120 //                "u16",
121 //                "_vl_msg_id"
122 //            ],
123 //            [
124 //                "u32",
125 //                "client_index"
126 //            ],
127 //            [
128 //                "u32",
129 //                "context"
130 //            ],
131 //            [
132 //                "u8",
133 //                "role"
134 //            ],
135 //            [
136 //                "u8",
137 //                "mode"
138 //            ],
139 //            [
140 //                "u8",
141 //                "rx_queues"
142 //            ],
143 //            [
144 //                "u8",
145 //                "tx_queues"
146 //            ],
147 //            [
148 //                "u32",
149 //                "id"
150 //            ],
151 //            [
152 //                "u32",
153 //                "socket_id"
154 //            ],
155 //            [
156 //                "u8",
157 //                "secret",
158 //                24
159 //            ],
160 //            [
161 //                "u32",
162 //                "ring_size"
163 //            ],
164 //            [
165 //                "u16",
166 //                "buffer_size"
167 //            ],
168 //            [
169 //                "u8",
170 //                "hw_addr",
171 //                6
172 //            ],
173 //            {
174 //                "crc": "0x6597cdb2"
175 //            }
176 //
177 type MemifCreate struct {
178         Role       uint8
179         Mode       uint8
180         RxQueues   uint8
181         TxQueues   uint8
182         ID         uint32
183         SocketID   uint32
184         Secret     []byte `struc:"[24]byte"`
185         RingSize   uint32
186         BufferSize uint16
187         HwAddr     []byte `struc:"[6]byte"`
188 }
189
190 func (*MemifCreate) GetMessageName() string {
191         return "memif_create"
192 }
193 func (*MemifCreate) GetCrcString() string {
194         return "6597cdb2"
195 }
196 func (*MemifCreate) GetMessageType() api.MessageType {
197         return api.RequestMessage
198 }
199 func NewMemifCreate() api.Message {
200         return &MemifCreate{}
201 }
202
203 // MemifCreateReply represents the VPP binary API message 'memif_create_reply'.
204 // Generated from 'memif.api.json', line 113:
205 //
206 //            "memif_create_reply",
207 //            [
208 //                "u16",
209 //                "_vl_msg_id"
210 //            ],
211 //            [
212 //                "u32",
213 //                "context"
214 //            ],
215 //            [
216 //                "i32",
217 //                "retval"
218 //            ],
219 //            [
220 //                "u32",
221 //                "sw_if_index"
222 //            ],
223 //            {
224 //                "crc": "0xfda5941f"
225 //            }
226 //
227 type MemifCreateReply struct {
228         Retval    int32
229         SwIfIndex uint32
230 }
231
232 func (*MemifCreateReply) GetMessageName() string {
233         return "memif_create_reply"
234 }
235 func (*MemifCreateReply) GetCrcString() string {
236         return "fda5941f"
237 }
238 func (*MemifCreateReply) GetMessageType() api.MessageType {
239         return api.ReplyMessage
240 }
241 func NewMemifCreateReply() api.Message {
242         return &MemifCreateReply{}
243 }
244
245 // MemifDelete represents the VPP binary API message 'memif_delete'.
246 // Generated from 'memif.api.json', line 135:
247 //
248 //            "memif_delete",
249 //            [
250 //                "u16",
251 //                "_vl_msg_id"
252 //            ],
253 //            [
254 //                "u32",
255 //                "client_index"
256 //            ],
257 //            [
258 //                "u32",
259 //                "context"
260 //            ],
261 //            [
262 //                "u32",
263 //                "sw_if_index"
264 //            ],
265 //            {
266 //                "crc": "0x529cb13f"
267 //            }
268 //
269 type MemifDelete struct {
270         SwIfIndex uint32
271 }
272
273 func (*MemifDelete) GetMessageName() string {
274         return "memif_delete"
275 }
276 func (*MemifDelete) GetCrcString() string {
277         return "529cb13f"
278 }
279 func (*MemifDelete) GetMessageType() api.MessageType {
280         return api.RequestMessage
281 }
282 func NewMemifDelete() api.Message {
283         return &MemifDelete{}
284 }
285
286 // MemifDeleteReply represents the VPP binary API message 'memif_delete_reply'.
287 // Generated from 'memif.api.json', line 157:
288 //
289 //            "memif_delete_reply",
290 //            [
291 //                "u16",
292 //                "_vl_msg_id"
293 //            ],
294 //            [
295 //                "u32",
296 //                "context"
297 //            ],
298 //            [
299 //                "i32",
300 //                "retval"
301 //            ],
302 //            {
303 //                "crc": "0xe8d4e804"
304 //            }
305 //
306 type MemifDeleteReply struct {
307         Retval int32
308 }
309
310 func (*MemifDeleteReply) GetMessageName() string {
311         return "memif_delete_reply"
312 }
313 func (*MemifDeleteReply) GetCrcString() string {
314         return "e8d4e804"
315 }
316 func (*MemifDeleteReply) GetMessageType() api.MessageType {
317         return api.ReplyMessage
318 }
319 func NewMemifDeleteReply() api.Message {
320         return &MemifDeleteReply{}
321 }
322
323 // MemifSocketFilenameDetails represents the VPP binary API message 'memif_socket_filename_details'.
324 // Generated from 'memif.api.json', line 175:
325 //
326 //            "memif_socket_filename_details",
327 //            [
328 //                "u16",
329 //                "_vl_msg_id"
330 //            ],
331 //            [
332 //                "u32",
333 //                "context"
334 //            ],
335 //            [
336 //                "u32",
337 //                "socket_id"
338 //            ],
339 //            [
340 //                "u8",
341 //                "socket_filename",
342 //                128
343 //            ],
344 //            {
345 //                "crc": "0xe347e32f"
346 //            }
347 //
348 type MemifSocketFilenameDetails struct {
349         SocketID       uint32
350         SocketFilename []byte `struc:"[128]byte"`
351 }
352
353 func (*MemifSocketFilenameDetails) GetMessageName() string {
354         return "memif_socket_filename_details"
355 }
356 func (*MemifSocketFilenameDetails) GetCrcString() string {
357         return "e347e32f"
358 }
359 func (*MemifSocketFilenameDetails) GetMessageType() api.MessageType {
360         return api.ReplyMessage
361 }
362 func NewMemifSocketFilenameDetails() api.Message {
363         return &MemifSocketFilenameDetails{}
364 }
365
366 // MemifSocketFilenameDump represents the VPP binary API message 'memif_socket_filename_dump'.
367 // Generated from 'memif.api.json', line 198:
368 //
369 //            "memif_socket_filename_dump",
370 //            [
371 //                "u16",
372 //                "_vl_msg_id"
373 //            ],
374 //            [
375 //                "u32",
376 //                "client_index"
377 //            ],
378 //            [
379 //                "u32",
380 //                "context"
381 //            ],
382 //            {
383 //                "crc": "0x51077d14"
384 //            }
385 //
386 type MemifSocketFilenameDump struct{}
387
388 func (*MemifSocketFilenameDump) GetMessageName() string {
389         return "memif_socket_filename_dump"
390 }
391 func (*MemifSocketFilenameDump) GetCrcString() string {
392         return "51077d14"
393 }
394 func (*MemifSocketFilenameDump) GetMessageType() api.MessageType {
395         return api.RequestMessage
396 }
397 func NewMemifSocketFilenameDump() api.Message {
398         return &MemifSocketFilenameDump{}
399 }
400
401 // MemifDetails represents the VPP binary API message 'memif_details'.
402 // Generated from 'memif.api.json', line 216:
403 //
404 //            "memif_details",
405 //            [
406 //                "u16",
407 //                "_vl_msg_id"
408 //            ],
409 //            [
410 //                "u32",
411 //                "context"
412 //            ],
413 //            [
414 //                "u32",
415 //                "sw_if_index"
416 //            ],
417 //            [
418 //                "u8",
419 //                "if_name",
420 //                64
421 //            ],
422 //            [
423 //                "u8",
424 //                "hw_addr",
425 //                6
426 //            ],
427 //            [
428 //                "u32",
429 //                "id"
430 //            ],
431 //            [
432 //                "u8",
433 //                "role"
434 //            ],
435 //            [
436 //                "u8",
437 //                "mode"
438 //            ],
439 //            [
440 //                "u32",
441 //                "socket_id"
442 //            ],
443 //            [
444 //                "u32",
445 //                "ring_size"
446 //            ],
447 //            [
448 //                "u16",
449 //                "buffer_size"
450 //            ],
451 //            [
452 //                "u8",
453 //                "admin_up_down"
454 //            ],
455 //            [
456 //                "u8",
457 //                "link_up_down"
458 //            ],
459 //            {
460 //                "crc": "0x4f5a3397"
461 //            }
462 //
463 type MemifDetails struct {
464         SwIfIndex   uint32
465         IfName      []byte `struc:"[64]byte"`
466         HwAddr      []byte `struc:"[6]byte"`
467         ID          uint32
468         Role        uint8
469         Mode        uint8
470         SocketID    uint32
471         RingSize    uint32
472         BufferSize  uint16
473         AdminUpDown uint8
474         LinkUpDown  uint8
475 }
476
477 func (*MemifDetails) GetMessageName() string {
478         return "memif_details"
479 }
480 func (*MemifDetails) GetCrcString() string {
481         return "4f5a3397"
482 }
483 func (*MemifDetails) GetMessageType() api.MessageType {
484         return api.ReplyMessage
485 }
486 func NewMemifDetails() api.Message {
487         return &MemifDetails{}
488 }
489
490 // MemifDump represents the VPP binary API message 'memif_dump'.
491 // Generated from 'memif.api.json', line 276:
492 //
493 //            "memif_dump",
494 //            [
495 //                "u16",
496 //                "_vl_msg_id"
497 //            ],
498 //            [
499 //                "u32",
500 //                "client_index"
501 //            ],
502 //            [
503 //                "u32",
504 //                "context"
505 //            ],
506 //            {
507 //                "crc": "0x51077d14"
508 //            }
509 //
510 type MemifDump struct{}
511
512 func (*MemifDump) GetMessageName() string {
513         return "memif_dump"
514 }
515 func (*MemifDump) GetCrcString() string {
516         return "51077d14"
517 }
518 func (*MemifDump) GetMessageType() api.MessageType {
519         return api.RequestMessage
520 }
521 func NewMemifDump() api.Message {
522         return &MemifDump{}
523 }
524
525 /* Services */
526
527 type Services interface {
528         DumpMemif(*MemifDump) (*MemifDetails, error)
529         DumpMemifSocketFilename(*MemifSocketFilenameDump) (*MemifSocketFilenameDetails, error)
530         MemifCreate(*MemifCreate) (*MemifCreateReply, error)
531         MemifDelete(*MemifDelete) (*MemifDeleteReply, error)
532         MemifSocketFilenameAddDel(*MemifSocketFilenameAddDel) (*MemifSocketFilenameAddDelReply, error)
533 }
534
535 func init() {
536         api.RegisterMessage((*MemifSocketFilenameAddDel)(nil), "memif.MemifSocketFilenameAddDel")
537         api.RegisterMessage((*MemifSocketFilenameAddDelReply)(nil), "memif.MemifSocketFilenameAddDelReply")
538         api.RegisterMessage((*MemifCreate)(nil), "memif.MemifCreate")
539         api.RegisterMessage((*MemifCreateReply)(nil), "memif.MemifCreateReply")
540         api.RegisterMessage((*MemifDelete)(nil), "memif.MemifDelete")
541         api.RegisterMessage((*MemifDeleteReply)(nil), "memif.MemifDeleteReply")
542         api.RegisterMessage((*MemifSocketFilenameDetails)(nil), "memif.MemifSocketFilenameDetails")
543         api.RegisterMessage((*MemifSocketFilenameDump)(nil), "memif.MemifSocketFilenameDump")
544         api.RegisterMessage((*MemifDetails)(nil), "memif.MemifDetails")
545         api.RegisterMessage((*MemifDump)(nil), "memif.MemifDump")
546 }