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