Simplify subscribing to events and fix events
[govpp.git] / examples / bin_api / vpe / vpe.ba.go
1 // Code generated by GoVPP binapi-generator. DO NOT EDIT.
2 // source: vpe.api.json
3
4 /*
5 Package vpe is a generated VPP binary API of the 'vpe' VPP module.
6
7 It is generated from this file:
8         vpe.api.json
9
10 It contains these VPP binary API objects:
11         16 messages
12         8 services
13 */
14 package vpe
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 // ControlPing represents the VPP binary API message 'control_ping'.
28 // Generated from 'vpe.api.json', line 4:
29 //
30 //            "control_ping",
31 //            [
32 //                "u16",
33 //                "_vl_msg_id"
34 //            ],
35 //            [
36 //                "u32",
37 //                "client_index"
38 //            ],
39 //            [
40 //                "u32",
41 //                "context"
42 //            ],
43 //            {
44 //                "crc": "0x51077d14"
45 //            }
46 //
47 type ControlPing struct{}
48
49 func (*ControlPing) GetMessageName() string {
50         return "control_ping"
51 }
52 func (*ControlPing) GetCrcString() string {
53         return "51077d14"
54 }
55 func (*ControlPing) GetMessageType() api.MessageType {
56         return api.RequestMessage
57 }
58 func NewControlPing() api.Message {
59         return &ControlPing{}
60 }
61
62 // ControlPingReply represents the VPP binary API message 'control_ping_reply'.
63 // Generated from 'vpe.api.json', line 22:
64 //
65 //            "control_ping_reply",
66 //            [
67 //                "u16",
68 //                "_vl_msg_id"
69 //            ],
70 //            [
71 //                "u32",
72 //                "context"
73 //            ],
74 //            [
75 //                "i32",
76 //                "retval"
77 //            ],
78 //            [
79 //                "u32",
80 //                "client_index"
81 //            ],
82 //            [
83 //                "u32",
84 //                "vpe_pid"
85 //            ],
86 //            {
87 //                "crc": "0xf6b0b8ca"
88 //            }
89 //
90 type ControlPingReply struct {
91         Retval      int32
92         ClientIndex uint32
93         VpePID      uint32
94 }
95
96 func (*ControlPingReply) GetMessageName() string {
97         return "control_ping_reply"
98 }
99 func (*ControlPingReply) GetCrcString() string {
100         return "f6b0b8ca"
101 }
102 func (*ControlPingReply) GetMessageType() api.MessageType {
103         return api.ReplyMessage
104 }
105 func NewControlPingReply() api.Message {
106         return &ControlPingReply{}
107 }
108
109 // Cli represents the VPP binary API message 'cli'.
110 // Generated from 'vpe.api.json', line 48:
111 //
112 //            "cli",
113 //            [
114 //                "u16",
115 //                "_vl_msg_id"
116 //            ],
117 //            [
118 //                "u32",
119 //                "client_index"
120 //            ],
121 //            [
122 //                "u32",
123 //                "context"
124 //            ],
125 //            [
126 //                "u64",
127 //                "cmd_in_shmem"
128 //            ],
129 //            {
130 //                "crc": "0x23bfbfff"
131 //            }
132 //
133 type Cli struct {
134         CmdInShmem uint64
135 }
136
137 func (*Cli) GetMessageName() string {
138         return "cli"
139 }
140 func (*Cli) GetCrcString() string {
141         return "23bfbfff"
142 }
143 func (*Cli) GetMessageType() api.MessageType {
144         return api.RequestMessage
145 }
146 func NewCli() api.Message {
147         return &Cli{}
148 }
149
150 // CliInband represents the VPP binary API message 'cli_inband'.
151 // Generated from 'vpe.api.json', line 70:
152 //
153 //            "cli_inband",
154 //            [
155 //                "u16",
156 //                "_vl_msg_id"
157 //            ],
158 //            [
159 //                "u32",
160 //                "client_index"
161 //            ],
162 //            [
163 //                "u32",
164 //                "context"
165 //            ],
166 //            [
167 //                "u32",
168 //                "length"
169 //            ],
170 //            [
171 //                "u8",
172 //                "cmd",
173 //                0,
174 //                "length"
175 //            ],
176 //            {
177 //                "crc": "0x74e00a49"
178 //            }
179 //
180 type CliInband struct {
181         Length uint32 `struc:"sizeof=Cmd"`
182         Cmd    []byte
183 }
184
185 func (*CliInband) GetMessageName() string {
186         return "cli_inband"
187 }
188 func (*CliInband) GetCrcString() string {
189         return "74e00a49"
190 }
191 func (*CliInband) GetMessageType() api.MessageType {
192         return api.RequestMessage
193 }
194 func NewCliInband() api.Message {
195         return &CliInband{}
196 }
197
198 // CliReply represents the VPP binary API message 'cli_reply'.
199 // Generated from 'vpe.api.json', line 98:
200 //
201 //            "cli_reply",
202 //            [
203 //                "u16",
204 //                "_vl_msg_id"
205 //            ],
206 //            [
207 //                "u32",
208 //                "context"
209 //            ],
210 //            [
211 //                "i32",
212 //                "retval"
213 //            ],
214 //            [
215 //                "u64",
216 //                "reply_in_shmem"
217 //            ],
218 //            {
219 //                "crc": "0x06d68297"
220 //            }
221 //
222 type CliReply struct {
223         Retval       int32
224         ReplyInShmem uint64
225 }
226
227 func (*CliReply) GetMessageName() string {
228         return "cli_reply"
229 }
230 func (*CliReply) GetCrcString() string {
231         return "06d68297"
232 }
233 func (*CliReply) GetMessageType() api.MessageType {
234         return api.ReplyMessage
235 }
236 func NewCliReply() api.Message {
237         return &CliReply{}
238 }
239
240 // CliInbandReply represents the VPP binary API message 'cli_inband_reply'.
241 // Generated from 'vpe.api.json', line 120:
242 //
243 //            "cli_inband_reply",
244 //            [
245 //                "u16",
246 //                "_vl_msg_id"
247 //            ],
248 //            [
249 //                "u32",
250 //                "context"
251 //            ],
252 //            [
253 //                "i32",
254 //                "retval"
255 //            ],
256 //            [
257 //                "u32",
258 //                "length"
259 //            ],
260 //            [
261 //                "u8",
262 //                "reply",
263 //                0,
264 //                "length"
265 //            ],
266 //            {
267 //                "crc": "0x1f22bbb8"
268 //            }
269 //
270 type CliInbandReply struct {
271         Retval int32
272         Length uint32 `struc:"sizeof=Reply"`
273         Reply  []byte
274 }
275
276 func (*CliInbandReply) GetMessageName() string {
277         return "cli_inband_reply"
278 }
279 func (*CliInbandReply) GetCrcString() string {
280         return "1f22bbb8"
281 }
282 func (*CliInbandReply) GetMessageType() api.MessageType {
283         return api.ReplyMessage
284 }
285 func NewCliInbandReply() api.Message {
286         return &CliInbandReply{}
287 }
288
289 // GetNodeIndex represents the VPP binary API message 'get_node_index'.
290 // Generated from 'vpe.api.json', line 148:
291 //
292 //            "get_node_index",
293 //            [
294 //                "u16",
295 //                "_vl_msg_id"
296 //            ],
297 //            [
298 //                "u32",
299 //                "client_index"
300 //            ],
301 //            [
302 //                "u32",
303 //                "context"
304 //            ],
305 //            [
306 //                "u8",
307 //                "node_name",
308 //                64
309 //            ],
310 //            {
311 //                "crc": "0x6c9a495d"
312 //            }
313 //
314 type GetNodeIndex struct {
315         NodeName []byte `struc:"[64]byte"`
316 }
317
318 func (*GetNodeIndex) GetMessageName() string {
319         return "get_node_index"
320 }
321 func (*GetNodeIndex) GetCrcString() string {
322         return "6c9a495d"
323 }
324 func (*GetNodeIndex) GetMessageType() api.MessageType {
325         return api.RequestMessage
326 }
327 func NewGetNodeIndex() api.Message {
328         return &GetNodeIndex{}
329 }
330
331 // GetNodeIndexReply represents the VPP binary API message 'get_node_index_reply'.
332 // Generated from 'vpe.api.json', line 171:
333 //
334 //            "get_node_index_reply",
335 //            [
336 //                "u16",
337 //                "_vl_msg_id"
338 //            ],
339 //            [
340 //                "u32",
341 //                "context"
342 //            ],
343 //            [
344 //                "i32",
345 //                "retval"
346 //            ],
347 //            [
348 //                "u32",
349 //                "node_index"
350 //            ],
351 //            {
352 //                "crc": "0xa8600b89"
353 //            }
354 //
355 type GetNodeIndexReply struct {
356         Retval    int32
357         NodeIndex uint32
358 }
359
360 func (*GetNodeIndexReply) GetMessageName() string {
361         return "get_node_index_reply"
362 }
363 func (*GetNodeIndexReply) GetCrcString() string {
364         return "a8600b89"
365 }
366 func (*GetNodeIndexReply) GetMessageType() api.MessageType {
367         return api.ReplyMessage
368 }
369 func NewGetNodeIndexReply() api.Message {
370         return &GetNodeIndexReply{}
371 }
372
373 // AddNodeNext represents the VPP binary API message 'add_node_next'.
374 // Generated from 'vpe.api.json', line 193:
375 //
376 //            "add_node_next",
377 //            [
378 //                "u16",
379 //                "_vl_msg_id"
380 //            ],
381 //            [
382 //                "u32",
383 //                "client_index"
384 //            ],
385 //            [
386 //                "u32",
387 //                "context"
388 //            ],
389 //            [
390 //                "u8",
391 //                "node_name",
392 //                64
393 //            ],
394 //            [
395 //                "u8",
396 //                "next_name",
397 //                64
398 //            ],
399 //            {
400 //                "crc": "0x9ab92f7a"
401 //            }
402 //
403 type AddNodeNext struct {
404         NodeName []byte `struc:"[64]byte"`
405         NextName []byte `struc:"[64]byte"`
406 }
407
408 func (*AddNodeNext) GetMessageName() string {
409         return "add_node_next"
410 }
411 func (*AddNodeNext) GetCrcString() string {
412         return "9ab92f7a"
413 }
414 func (*AddNodeNext) GetMessageType() api.MessageType {
415         return api.RequestMessage
416 }
417 func NewAddNodeNext() api.Message {
418         return &AddNodeNext{}
419 }
420
421 // AddNodeNextReply represents the VPP binary API message 'add_node_next_reply'.
422 // Generated from 'vpe.api.json', line 221:
423 //
424 //            "add_node_next_reply",
425 //            [
426 //                "u16",
427 //                "_vl_msg_id"
428 //            ],
429 //            [
430 //                "u32",
431 //                "context"
432 //            ],
433 //            [
434 //                "i32",
435 //                "retval"
436 //            ],
437 //            [
438 //                "u32",
439 //                "next_index"
440 //            ],
441 //            {
442 //                "crc": "0x2ed75f32"
443 //            }
444 //
445 type AddNodeNextReply struct {
446         Retval    int32
447         NextIndex uint32
448 }
449
450 func (*AddNodeNextReply) GetMessageName() string {
451         return "add_node_next_reply"
452 }
453 func (*AddNodeNextReply) GetCrcString() string {
454         return "2ed75f32"
455 }
456 func (*AddNodeNextReply) GetMessageType() api.MessageType {
457         return api.ReplyMessage
458 }
459 func NewAddNodeNextReply() api.Message {
460         return &AddNodeNextReply{}
461 }
462
463 // ShowVersion represents the VPP binary API message 'show_version'.
464 // Generated from 'vpe.api.json', line 243:
465 //
466 //            "show_version",
467 //            [
468 //                "u16",
469 //                "_vl_msg_id"
470 //            ],
471 //            [
472 //                "u32",
473 //                "client_index"
474 //            ],
475 //            [
476 //                "u32",
477 //                "context"
478 //            ],
479 //            {
480 //                "crc": "0x51077d14"
481 //            }
482 //
483 type ShowVersion struct{}
484
485 func (*ShowVersion) GetMessageName() string {
486         return "show_version"
487 }
488 func (*ShowVersion) GetCrcString() string {
489         return "51077d14"
490 }
491 func (*ShowVersion) GetMessageType() api.MessageType {
492         return api.RequestMessage
493 }
494 func NewShowVersion() api.Message {
495         return &ShowVersion{}
496 }
497
498 // ShowVersionReply represents the VPP binary API message 'show_version_reply'.
499 // Generated from 'vpe.api.json', line 261:
500 //
501 //            "show_version_reply",
502 //            [
503 //                "u16",
504 //                "_vl_msg_id"
505 //            ],
506 //            [
507 //                "u32",
508 //                "context"
509 //            ],
510 //            [
511 //                "i32",
512 //                "retval"
513 //            ],
514 //            [
515 //                "u8",
516 //                "program",
517 //                32
518 //            ],
519 //            [
520 //                "u8",
521 //                "version",
522 //                32
523 //            ],
524 //            [
525 //                "u8",
526 //                "build_date",
527 //                32
528 //            ],
529 //            [
530 //                "u8",
531 //                "build_directory",
532 //                256
533 //            ],
534 //            {
535 //                "crc": "0x8b5a13b4"
536 //            }
537 //
538 type ShowVersionReply struct {
539         Retval         int32
540         Program        []byte `struc:"[32]byte"`
541         Version        []byte `struc:"[32]byte"`
542         BuildDate      []byte `struc:"[32]byte"`
543         BuildDirectory []byte `struc:"[256]byte"`
544 }
545
546 func (*ShowVersionReply) GetMessageName() string {
547         return "show_version_reply"
548 }
549 func (*ShowVersionReply) GetCrcString() string {
550         return "8b5a13b4"
551 }
552 func (*ShowVersionReply) GetMessageType() api.MessageType {
553         return api.ReplyMessage
554 }
555 func NewShowVersionReply() api.Message {
556         return &ShowVersionReply{}
557 }
558
559 // GetNodeGraph represents the VPP binary API message 'get_node_graph'.
560 // Generated from 'vpe.api.json', line 299:
561 //
562 //            "get_node_graph",
563 //            [
564 //                "u16",
565 //                "_vl_msg_id"
566 //            ],
567 //            [
568 //                "u32",
569 //                "client_index"
570 //            ],
571 //            [
572 //                "u32",
573 //                "context"
574 //            ],
575 //            {
576 //                "crc": "0x51077d14"
577 //            }
578 //
579 type GetNodeGraph struct{}
580
581 func (*GetNodeGraph) GetMessageName() string {
582         return "get_node_graph"
583 }
584 func (*GetNodeGraph) GetCrcString() string {
585         return "51077d14"
586 }
587 func (*GetNodeGraph) GetMessageType() api.MessageType {
588         return api.RequestMessage
589 }
590 func NewGetNodeGraph() api.Message {
591         return &GetNodeGraph{}
592 }
593
594 // GetNodeGraphReply represents the VPP binary API message 'get_node_graph_reply'.
595 // Generated from 'vpe.api.json', line 317:
596 //
597 //            "get_node_graph_reply",
598 //            [
599 //                "u16",
600 //                "_vl_msg_id"
601 //            ],
602 //            [
603 //                "u32",
604 //                "context"
605 //            ],
606 //            [
607 //                "i32",
608 //                "retval"
609 //            ],
610 //            [
611 //                "u64",
612 //                "reply_in_shmem"
613 //            ],
614 //            {
615 //                "crc": "0x06d68297"
616 //            }
617 //
618 type GetNodeGraphReply struct {
619         Retval       int32
620         ReplyInShmem uint64
621 }
622
623 func (*GetNodeGraphReply) GetMessageName() string {
624         return "get_node_graph_reply"
625 }
626 func (*GetNodeGraphReply) GetCrcString() string {
627         return "06d68297"
628 }
629 func (*GetNodeGraphReply) GetMessageType() api.MessageType {
630         return api.ReplyMessage
631 }
632 func NewGetNodeGraphReply() api.Message {
633         return &GetNodeGraphReply{}
634 }
635
636 // GetNextIndex represents the VPP binary API message 'get_next_index'.
637 // Generated from 'vpe.api.json', line 339:
638 //
639 //            "get_next_index",
640 //            [
641 //                "u16",
642 //                "_vl_msg_id"
643 //            ],
644 //            [
645 //                "u32",
646 //                "client_index"
647 //            ],
648 //            [
649 //                "u32",
650 //                "context"
651 //            ],
652 //            [
653 //                "u8",
654 //                "node_name",
655 //                64
656 //            ],
657 //            [
658 //                "u8",
659 //                "next_name",
660 //                64
661 //            ],
662 //            {
663 //                "crc": "0x9ab92f7a"
664 //            }
665 //
666 type GetNextIndex struct {
667         NodeName []byte `struc:"[64]byte"`
668         NextName []byte `struc:"[64]byte"`
669 }
670
671 func (*GetNextIndex) GetMessageName() string {
672         return "get_next_index"
673 }
674 func (*GetNextIndex) GetCrcString() string {
675         return "9ab92f7a"
676 }
677 func (*GetNextIndex) GetMessageType() api.MessageType {
678         return api.RequestMessage
679 }
680 func NewGetNextIndex() api.Message {
681         return &GetNextIndex{}
682 }
683
684 // GetNextIndexReply represents the VPP binary API message 'get_next_index_reply'.
685 // Generated from 'vpe.api.json', line 367:
686 //
687 //            "get_next_index_reply",
688 //            [
689 //                "u16",
690 //                "_vl_msg_id"
691 //            ],
692 //            [
693 //                "u32",
694 //                "context"
695 //            ],
696 //            [
697 //                "i32",
698 //                "retval"
699 //            ],
700 //            [
701 //                "u32",
702 //                "next_index"
703 //            ],
704 //            {
705 //                "crc": "0x2ed75f32"
706 //            }
707 //
708 type GetNextIndexReply struct {
709         Retval    int32
710         NextIndex uint32
711 }
712
713 func (*GetNextIndexReply) GetMessageName() string {
714         return "get_next_index_reply"
715 }
716 func (*GetNextIndexReply) GetCrcString() string {
717         return "2ed75f32"
718 }
719 func (*GetNextIndexReply) GetMessageType() api.MessageType {
720         return api.ReplyMessage
721 }
722 func NewGetNextIndexReply() api.Message {
723         return &GetNextIndexReply{}
724 }
725
726 /* Services */
727
728 type Services interface {
729         AddNodeNext(*AddNodeNext) (*AddNodeNextReply, error)
730         Cli(*Cli) (*CliReply, error)
731         CliInband(*CliInband) (*CliInbandReply, error)
732         ControlPing(*ControlPing) (*ControlPingReply, error)
733         GetNextIndex(*GetNextIndex) (*GetNextIndexReply, error)
734         GetNodeGraph(*GetNodeGraph) (*GetNodeGraphReply, error)
735         GetNodeIndex(*GetNodeIndex) (*GetNodeIndexReply, error)
736         ShowVersion(*ShowVersion) (*ShowVersionReply, error)
737 }
738
739 func init() {
740         api.RegisterMessage((*ControlPing)(nil), "vpe.ControlPing")
741         api.RegisterMessage((*ControlPingReply)(nil), "vpe.ControlPingReply")
742         api.RegisterMessage((*Cli)(nil), "vpe.Cli")
743         api.RegisterMessage((*CliInband)(nil), "vpe.CliInband")
744         api.RegisterMessage((*CliReply)(nil), "vpe.CliReply")
745         api.RegisterMessage((*CliInbandReply)(nil), "vpe.CliInbandReply")
746         api.RegisterMessage((*GetNodeIndex)(nil), "vpe.GetNodeIndex")
747         api.RegisterMessage((*GetNodeIndexReply)(nil), "vpe.GetNodeIndexReply")
748         api.RegisterMessage((*AddNodeNext)(nil), "vpe.AddNodeNext")
749         api.RegisterMessage((*AddNodeNextReply)(nil), "vpe.AddNodeNextReply")
750         api.RegisterMessage((*ShowVersion)(nil), "vpe.ShowVersion")
751         api.RegisterMessage((*ShowVersionReply)(nil), "vpe.ShowVersionReply")
752         api.RegisterMessage((*GetNodeGraph)(nil), "vpe.GetNodeGraph")
753         api.RegisterMessage((*GetNodeGraphReply)(nil), "vpe.GetNodeGraphReply")
754         api.RegisterMessage((*GetNextIndex)(nil), "vpe.GetNextIndex")
755         api.RegisterMessage((*GetNextIndexReply)(nil), "vpe.GetNextIndexReply")
756 }