Improvements for binapi-generator and support VPP 19.04 in statsclient
[govpp.git] / examples / binapi / vpe / vpe.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // source: /usr/share/vpp/api/core/vpe.api.json
3
4 /*
5 Package vpe is a generated VPP binary API for 'vpe' module.
6
7 It consists of:
8           1 type
9          18 messages
10           9 services
11 */
12 package vpe
13
14 import (
15         bytes "bytes"
16         context "context"
17         api "git.fd.io/govpp.git/api"
18         struc "github.com/lunixbochs/struc"
19         io "io"
20         strconv "strconv"
21 )
22
23 const (
24         // ModuleName is the name of this module.
25         ModuleName = "vpe"
26         // APIVersion is the API version of this module.
27         APIVersion = "1.1.0"
28         // VersionCrc is the CRC of this module.
29         VersionCrc = 0x2cc8d629
30 )
31
32 // ThreadData represents VPP binary API type 'thread_data'.
33 type ThreadData struct {
34         ID        uint32
35         Name      []byte `struc:"[64]byte"`
36         Type      []byte `struc:"[64]byte"`
37         PID       uint32
38         CPUID     uint32
39         Core      uint32
40         CPUSocket uint32
41 }
42
43 func (*ThreadData) GetTypeName() string {
44         return "thread_data"
45 }
46 func (*ThreadData) GetCrcString() string {
47         return "0f57094e"
48 }
49
50 // AddNodeNext represents VPP binary API message 'add_node_next'.
51 type AddNodeNext struct {
52         NodeName []byte `struc:"[64]byte"`
53         NextName []byte `struc:"[64]byte"`
54 }
55
56 func (*AddNodeNext) GetMessageName() string {
57         return "add_node_next"
58 }
59 func (*AddNodeNext) GetCrcString() string {
60         return "9ab92f7a"
61 }
62 func (*AddNodeNext) GetMessageType() api.MessageType {
63         return api.RequestMessage
64 }
65
66 // AddNodeNextReply represents VPP binary API message 'add_node_next_reply'.
67 type AddNodeNextReply struct {
68         Retval    int32
69         NextIndex uint32
70 }
71
72 func (*AddNodeNextReply) GetMessageName() string {
73         return "add_node_next_reply"
74 }
75 func (*AddNodeNextReply) GetCrcString() string {
76         return "2ed75f32"
77 }
78 func (*AddNodeNextReply) GetMessageType() api.MessageType {
79         return api.ReplyMessage
80 }
81
82 // Cli represents VPP binary API message 'cli'.
83 type Cli struct {
84         CmdInShmem uint64
85 }
86
87 func (*Cli) GetMessageName() string {
88         return "cli"
89 }
90 func (*Cli) GetCrcString() string {
91         return "23bfbfff"
92 }
93 func (*Cli) GetMessageType() api.MessageType {
94         return api.RequestMessage
95 }
96
97 // CliInband represents VPP binary API message 'cli_inband'.
98 type CliInband struct {
99         XXX_CmdLen uint32 `struc:"sizeof=Cmd"`
100         Cmd        string
101 }
102
103 func (*CliInband) GetMessageName() string {
104         return "cli_inband"
105 }
106 func (*CliInband) GetCrcString() string {
107         return "b1ad59b3"
108 }
109 func (*CliInband) GetMessageType() api.MessageType {
110         return api.RequestMessage
111 }
112
113 // CliInbandReply represents VPP binary API message 'cli_inband_reply'.
114 type CliInbandReply struct {
115         Retval       int32
116         XXX_ReplyLen uint32 `struc:"sizeof=Reply"`
117         Reply        string
118 }
119
120 func (*CliInbandReply) GetMessageName() string {
121         return "cli_inband_reply"
122 }
123 func (*CliInbandReply) GetCrcString() string {
124         return "6d3c80a4"
125 }
126 func (*CliInbandReply) GetMessageType() api.MessageType {
127         return api.ReplyMessage
128 }
129
130 // CliReply represents VPP binary API message 'cli_reply'.
131 type CliReply struct {
132         Retval       int32
133         ReplyInShmem uint64
134 }
135
136 func (*CliReply) GetMessageName() string {
137         return "cli_reply"
138 }
139 func (*CliReply) GetCrcString() string {
140         return "06d68297"
141 }
142 func (*CliReply) GetMessageType() api.MessageType {
143         return api.ReplyMessage
144 }
145
146 // ControlPing represents VPP binary API message 'control_ping'.
147 type ControlPing struct{}
148
149 func (*ControlPing) GetMessageName() string {
150         return "control_ping"
151 }
152 func (*ControlPing) GetCrcString() string {
153         return "51077d14"
154 }
155 func (*ControlPing) GetMessageType() api.MessageType {
156         return api.RequestMessage
157 }
158
159 // ControlPingReply represents VPP binary API message 'control_ping_reply'.
160 type ControlPingReply struct {
161         Retval      int32
162         ClientIndex uint32
163         VpePID      uint32
164 }
165
166 func (*ControlPingReply) GetMessageName() string {
167         return "control_ping_reply"
168 }
169 func (*ControlPingReply) GetCrcString() string {
170         return "f6b0b8ca"
171 }
172 func (*ControlPingReply) GetMessageType() api.MessageType {
173         return api.ReplyMessage
174 }
175
176 // GetNextIndex represents VPP binary API message 'get_next_index'.
177 type GetNextIndex struct {
178         NodeName []byte `struc:"[64]byte"`
179         NextName []byte `struc:"[64]byte"`
180 }
181
182 func (*GetNextIndex) GetMessageName() string {
183         return "get_next_index"
184 }
185 func (*GetNextIndex) GetCrcString() string {
186         return "9ab92f7a"
187 }
188 func (*GetNextIndex) GetMessageType() api.MessageType {
189         return api.RequestMessage
190 }
191
192 // GetNextIndexReply represents VPP binary API message 'get_next_index_reply'.
193 type GetNextIndexReply struct {
194         Retval    int32
195         NextIndex uint32
196 }
197
198 func (*GetNextIndexReply) GetMessageName() string {
199         return "get_next_index_reply"
200 }
201 func (*GetNextIndexReply) GetCrcString() string {
202         return "2ed75f32"
203 }
204 func (*GetNextIndexReply) GetMessageType() api.MessageType {
205         return api.ReplyMessage
206 }
207
208 // GetNodeGraph represents VPP binary API message 'get_node_graph'.
209 type GetNodeGraph struct{}
210
211 func (*GetNodeGraph) GetMessageName() string {
212         return "get_node_graph"
213 }
214 func (*GetNodeGraph) GetCrcString() string {
215         return "51077d14"
216 }
217 func (*GetNodeGraph) GetMessageType() api.MessageType {
218         return api.RequestMessage
219 }
220
221 // GetNodeGraphReply represents VPP binary API message 'get_node_graph_reply'.
222 type GetNodeGraphReply struct {
223         Retval       int32
224         ReplyInShmem uint64
225 }
226
227 func (*GetNodeGraphReply) GetMessageName() string {
228         return "get_node_graph_reply"
229 }
230 func (*GetNodeGraphReply) GetCrcString() string {
231         return "06d68297"
232 }
233 func (*GetNodeGraphReply) GetMessageType() api.MessageType {
234         return api.ReplyMessage
235 }
236
237 // GetNodeIndex represents VPP binary API message 'get_node_index'.
238 type GetNodeIndex struct {
239         NodeName []byte `struc:"[64]byte"`
240 }
241
242 func (*GetNodeIndex) GetMessageName() string {
243         return "get_node_index"
244 }
245 func (*GetNodeIndex) GetCrcString() string {
246         return "6c9a495d"
247 }
248 func (*GetNodeIndex) GetMessageType() api.MessageType {
249         return api.RequestMessage
250 }
251
252 // GetNodeIndexReply represents VPP binary API message 'get_node_index_reply'.
253 type GetNodeIndexReply struct {
254         Retval    int32
255         NodeIndex uint32
256 }
257
258 func (*GetNodeIndexReply) GetMessageName() string {
259         return "get_node_index_reply"
260 }
261 func (*GetNodeIndexReply) GetCrcString() string {
262         return "a8600b89"
263 }
264 func (*GetNodeIndexReply) GetMessageType() api.MessageType {
265         return api.ReplyMessage
266 }
267
268 // ShowThreads represents VPP binary API message 'show_threads'.
269 type ShowThreads struct{}
270
271 func (*ShowThreads) GetMessageName() string {
272         return "show_threads"
273 }
274 func (*ShowThreads) GetCrcString() string {
275         return "51077d14"
276 }
277 func (*ShowThreads) GetMessageType() api.MessageType {
278         return api.RequestMessage
279 }
280
281 // ShowThreadsReply represents VPP binary API message 'show_threads_reply'.
282 type ShowThreadsReply struct {
283         Retval     int32
284         Count      uint32 `struc:"sizeof=ThreadData"`
285         ThreadData []ThreadData
286 }
287
288 func (*ShowThreadsReply) GetMessageName() string {
289         return "show_threads_reply"
290 }
291 func (*ShowThreadsReply) GetCrcString() string {
292         return "6942fb35"
293 }
294 func (*ShowThreadsReply) GetMessageType() api.MessageType {
295         return api.ReplyMessage
296 }
297
298 // ShowVersion represents VPP binary API message 'show_version'.
299 type ShowVersion struct{}
300
301 func (*ShowVersion) GetMessageName() string {
302         return "show_version"
303 }
304 func (*ShowVersion) GetCrcString() string {
305         return "51077d14"
306 }
307 func (*ShowVersion) GetMessageType() api.MessageType {
308         return api.RequestMessage
309 }
310
311 // ShowVersionReply represents VPP binary API message 'show_version_reply'.
312 type ShowVersionReply struct {
313         Retval                int32
314         XXX_ProgramLen        uint32 `struc:"sizeof=Program"`
315         Program               string
316         XXX_VersionLen        uint32 `struc:"sizeof=Version"`
317         Version               string
318         XXX_BuildDateLen      uint32 `struc:"sizeof=BuildDate"`
319         BuildDate             string
320         XXX_BuildDirectoryLen uint32 `struc:"sizeof=BuildDirectory"`
321         BuildDirectory        string
322 }
323
324 func (*ShowVersionReply) GetMessageName() string {
325         return "show_version_reply"
326 }
327 func (*ShowVersionReply) GetCrcString() string {
328         return "b9bcf6df"
329 }
330 func (*ShowVersionReply) GetMessageType() api.MessageType {
331         return api.ReplyMessage
332 }
333
334 func init() {
335         api.RegisterMessage((*AddNodeNext)(nil), "vpe.AddNodeNext")
336         api.RegisterMessage((*AddNodeNextReply)(nil), "vpe.AddNodeNextReply")
337         api.RegisterMessage((*Cli)(nil), "vpe.Cli")
338         api.RegisterMessage((*CliInband)(nil), "vpe.CliInband")
339         api.RegisterMessage((*CliInbandReply)(nil), "vpe.CliInbandReply")
340         api.RegisterMessage((*CliReply)(nil), "vpe.CliReply")
341         api.RegisterMessage((*ControlPing)(nil), "vpe.ControlPing")
342         api.RegisterMessage((*ControlPingReply)(nil), "vpe.ControlPingReply")
343         api.RegisterMessage((*GetNextIndex)(nil), "vpe.GetNextIndex")
344         api.RegisterMessage((*GetNextIndexReply)(nil), "vpe.GetNextIndexReply")
345         api.RegisterMessage((*GetNodeGraph)(nil), "vpe.GetNodeGraph")
346         api.RegisterMessage((*GetNodeGraphReply)(nil), "vpe.GetNodeGraphReply")
347         api.RegisterMessage((*GetNodeIndex)(nil), "vpe.GetNodeIndex")
348         api.RegisterMessage((*GetNodeIndexReply)(nil), "vpe.GetNodeIndexReply")
349         api.RegisterMessage((*ShowThreads)(nil), "vpe.ShowThreads")
350         api.RegisterMessage((*ShowThreadsReply)(nil), "vpe.ShowThreadsReply")
351         api.RegisterMessage((*ShowVersion)(nil), "vpe.ShowVersion")
352         api.RegisterMessage((*ShowVersionReply)(nil), "vpe.ShowVersionReply")
353 }
354
355 // Messages returns list of all messages in this module.
356 func AllMessages() []api.Message {
357         return []api.Message{
358                 (*AddNodeNext)(nil),
359                 (*AddNodeNextReply)(nil),
360                 (*Cli)(nil),
361                 (*CliInband)(nil),
362                 (*CliInbandReply)(nil),
363                 (*CliReply)(nil),
364                 (*ControlPing)(nil),
365                 (*ControlPingReply)(nil),
366                 (*GetNextIndex)(nil),
367                 (*GetNextIndexReply)(nil),
368                 (*GetNodeGraph)(nil),
369                 (*GetNodeGraphReply)(nil),
370                 (*GetNodeIndex)(nil),
371                 (*GetNodeIndexReply)(nil),
372                 (*ShowThreads)(nil),
373                 (*ShowThreadsReply)(nil),
374                 (*ShowVersion)(nil),
375                 (*ShowVersionReply)(nil),
376         }
377 }
378
379 // RPCService represents RPC service API for vpe module.
380 type RPCService interface {
381         AddNodeNext(ctx context.Context, in *AddNodeNext) (*AddNodeNextReply, error)
382         Cli(ctx context.Context, in *Cli) (*CliReply, error)
383         CliInband(ctx context.Context, in *CliInband) (*CliInbandReply, error)
384         ControlPing(ctx context.Context, in *ControlPing) (*ControlPingReply, error)
385         GetNextIndex(ctx context.Context, in *GetNextIndex) (*GetNextIndexReply, error)
386         GetNodeGraph(ctx context.Context, in *GetNodeGraph) (*GetNodeGraphReply, error)
387         GetNodeIndex(ctx context.Context, in *GetNodeIndex) (*GetNodeIndexReply, error)
388         ShowThreads(ctx context.Context, in *ShowThreads) (*ShowThreadsReply, error)
389         ShowVersion(ctx context.Context, in *ShowVersion) (*ShowVersionReply, error)
390 }
391
392 type serviceClient struct {
393         ch api.Channel
394 }
395
396 func NewServiceClient(ch api.Channel) RPCService {
397         return &serviceClient{ch}
398 }
399
400 func (c *serviceClient) AddNodeNext(ctx context.Context, in *AddNodeNext) (*AddNodeNextReply, error) {
401         out := new(AddNodeNextReply)
402         err := c.ch.SendRequest(in).ReceiveReply(out)
403         if err != nil {
404                 return nil, err
405         }
406         return out, nil
407 }
408
409 func (c *serviceClient) Cli(ctx context.Context, in *Cli) (*CliReply, error) {
410         out := new(CliReply)
411         err := c.ch.SendRequest(in).ReceiveReply(out)
412         if err != nil {
413                 return nil, err
414         }
415         return out, nil
416 }
417
418 func (c *serviceClient) CliInband(ctx context.Context, in *CliInband) (*CliInbandReply, error) {
419         out := new(CliInbandReply)
420         err := c.ch.SendRequest(in).ReceiveReply(out)
421         if err != nil {
422                 return nil, err
423         }
424         return out, nil
425 }
426
427 func (c *serviceClient) ControlPing(ctx context.Context, in *ControlPing) (*ControlPingReply, error) {
428         out := new(ControlPingReply)
429         err := c.ch.SendRequest(in).ReceiveReply(out)
430         if err != nil {
431                 return nil, err
432         }
433         return out, nil
434 }
435
436 func (c *serviceClient) GetNextIndex(ctx context.Context, in *GetNextIndex) (*GetNextIndexReply, error) {
437         out := new(GetNextIndexReply)
438         err := c.ch.SendRequest(in).ReceiveReply(out)
439         if err != nil {
440                 return nil, err
441         }
442         return out, nil
443 }
444
445 func (c *serviceClient) GetNodeGraph(ctx context.Context, in *GetNodeGraph) (*GetNodeGraphReply, error) {
446         out := new(GetNodeGraphReply)
447         err := c.ch.SendRequest(in).ReceiveReply(out)
448         if err != nil {
449                 return nil, err
450         }
451         return out, nil
452 }
453
454 func (c *serviceClient) GetNodeIndex(ctx context.Context, in *GetNodeIndex) (*GetNodeIndexReply, error) {
455         out := new(GetNodeIndexReply)
456         err := c.ch.SendRequest(in).ReceiveReply(out)
457         if err != nil {
458                 return nil, err
459         }
460         return out, nil
461 }
462
463 func (c *serviceClient) ShowThreads(ctx context.Context, in *ShowThreads) (*ShowThreadsReply, error) {
464         out := new(ShowThreadsReply)
465         err := c.ch.SendRequest(in).ReceiveReply(out)
466         if err != nil {
467                 return nil, err
468         }
469         return out, nil
470 }
471
472 func (c *serviceClient) ShowVersion(ctx context.Context, in *ShowVersion) (*ShowVersionReply, error) {
473         out := new(ShowVersionReply)
474         err := c.ch.SendRequest(in).ReceiveReply(out)
475         if err != nil {
476                 return nil, err
477         }
478         return out, nil
479 }
480
481 // This is a compile-time assertion to ensure that this generated file
482 // is compatible with the GoVPP api package it is being compiled against.
483 // A compilation error at this line likely means your copy of the
484 // GoVPP api package needs to be updated.
485 const _ = api.GoVppAPIPackageIsVersion1 // please upgrade the GoVPP api package
486
487 // Reference imports to suppress errors if they are not otherwise used.
488 var _ = api.RegisterMessage
489 var _ = bytes.NewBuffer
490 var _ = context.Background
491 var _ = io.Copy
492 var _ = strconv.Itoa
493 var _ = struc.Pack