Format generated Go source code in-process
[govpp.git] / examples / binapi / memclnt / memclnt.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // source: /usr/share/vpp/api/core/memclnt.api.json
3
4 /*
5 Package memclnt is a generated VPP binary API for 'memclnt' module.
6
7 It consists of:
8           2 types
9          22 messages
10          13 services
11 */
12 package memclnt
13
14 import (
15         "bytes"
16         "context"
17         "io"
18         "strconv"
19
20         api "git.fd.io/govpp.git/api"
21         struc "github.com/lunixbochs/struc"
22 )
23
24 const (
25         // ModuleName is the name of this module.
26         ModuleName = "memclnt"
27         // APIVersion is the API version of this module.
28         APIVersion = "2.1.0"
29         // VersionCrc is the CRC of this module.
30         VersionCrc = 0x8d3dd881
31 )
32
33 // MessageTableEntry represents VPP binary API type 'message_table_entry'.
34 type MessageTableEntry struct {
35         Index uint16
36         Name  string `struc:"[64]byte"`
37 }
38
39 func (*MessageTableEntry) GetTypeName() string { return "message_table_entry" }
40
41 // ModuleVersion represents VPP binary API type 'module_version'.
42 type ModuleVersion struct {
43         Major uint32
44         Minor uint32
45         Patch uint32
46         Name  string `struc:"[64]byte"`
47 }
48
49 func (*ModuleVersion) GetTypeName() string { return "module_version" }
50
51 // APIVersions represents VPP binary API message 'api_versions'.
52 type APIVersions struct{}
53
54 func (m *APIVersions) Reset()                        { *m = APIVersions{} }
55 func (*APIVersions) GetMessageName() string          { return "api_versions" }
56 func (*APIVersions) GetCrcString() string            { return "51077d14" }
57 func (*APIVersions) GetMessageType() api.MessageType { return api.RequestMessage }
58
59 // APIVersionsReply represents VPP binary API message 'api_versions_reply'.
60 type APIVersionsReply struct {
61         Retval      int32
62         Count       uint32 `struc:"sizeof=APIVersions"`
63         APIVersions []ModuleVersion
64 }
65
66 func (m *APIVersionsReply) Reset()                        { *m = APIVersionsReply{} }
67 func (*APIVersionsReply) GetMessageName() string          { return "api_versions_reply" }
68 func (*APIVersionsReply) GetCrcString() string            { return "5f0d99d6" }
69 func (*APIVersionsReply) GetMessageType() api.MessageType { return api.ReplyMessage }
70
71 // GetFirstMsgID represents VPP binary API message 'get_first_msg_id'.
72 type GetFirstMsgID struct {
73         Name string `struc:"[64]byte"`
74 }
75
76 func (m *GetFirstMsgID) Reset()                        { *m = GetFirstMsgID{} }
77 func (*GetFirstMsgID) GetMessageName() string          { return "get_first_msg_id" }
78 func (*GetFirstMsgID) GetCrcString() string            { return "ebf79a66" }
79 func (*GetFirstMsgID) GetMessageType() api.MessageType { return api.RequestMessage }
80
81 // GetFirstMsgIDReply represents VPP binary API message 'get_first_msg_id_reply'.
82 type GetFirstMsgIDReply struct {
83         Retval     int32
84         FirstMsgID uint16
85 }
86
87 func (m *GetFirstMsgIDReply) Reset()                        { *m = GetFirstMsgIDReply{} }
88 func (*GetFirstMsgIDReply) GetMessageName() string          { return "get_first_msg_id_reply" }
89 func (*GetFirstMsgIDReply) GetCrcString() string            { return "7d337472" }
90 func (*GetFirstMsgIDReply) GetMessageType() api.MessageType { return api.ReplyMessage }
91
92 // MemclntCreate represents VPP binary API message 'memclnt_create'.
93 type MemclntCreate struct {
94         CtxQuota    int32
95         InputQueue  uint64
96         Name        string   `struc:"[64]byte"`
97         APIVersions []uint32 `struc:"[8]uint32"`
98 }
99
100 func (m *MemclntCreate) Reset()                        { *m = MemclntCreate{} }
101 func (*MemclntCreate) GetMessageName() string          { return "memclnt_create" }
102 func (*MemclntCreate) GetCrcString() string            { return "9c5e1c2f" }
103 func (*MemclntCreate) GetMessageType() api.MessageType { return api.ReplyMessage }
104
105 // MemclntCreateReply represents VPP binary API message 'memclnt_create_reply'.
106 type MemclntCreateReply struct {
107         Response     int32
108         Handle       uint64
109         Index        uint32
110         MessageTable uint64
111 }
112
113 func (m *MemclntCreateReply) Reset()                        { *m = MemclntCreateReply{} }
114 func (*MemclntCreateReply) GetMessageName() string          { return "memclnt_create_reply" }
115 func (*MemclntCreateReply) GetCrcString() string            { return "42ec4560" }
116 func (*MemclntCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage }
117
118 // MemclntDelete represents VPP binary API message 'memclnt_delete'.
119 type MemclntDelete struct {
120         Index     uint32
121         Handle    uint64
122         DoCleanup bool
123 }
124
125 func (m *MemclntDelete) Reset()                        { *m = MemclntDelete{} }
126 func (*MemclntDelete) GetMessageName() string          { return "memclnt_delete" }
127 func (*MemclntDelete) GetCrcString() string            { return "7e1c04e3" }
128 func (*MemclntDelete) GetMessageType() api.MessageType { return api.OtherMessage }
129
130 // MemclntDeleteReply represents VPP binary API message 'memclnt_delete_reply'.
131 type MemclntDeleteReply struct {
132         Response int32
133         Handle   uint64
134 }
135
136 func (m *MemclntDeleteReply) Reset()                        { *m = MemclntDeleteReply{} }
137 func (*MemclntDeleteReply) GetMessageName() string          { return "memclnt_delete_reply" }
138 func (*MemclntDeleteReply) GetCrcString() string            { return "3d3b6312" }
139 func (*MemclntDeleteReply) GetMessageType() api.MessageType { return api.OtherMessage }
140
141 // MemclntKeepalive represents VPP binary API message 'memclnt_keepalive'.
142 type MemclntKeepalive struct{}
143
144 func (m *MemclntKeepalive) Reset()                        { *m = MemclntKeepalive{} }
145 func (*MemclntKeepalive) GetMessageName() string          { return "memclnt_keepalive" }
146 func (*MemclntKeepalive) GetCrcString() string            { return "51077d14" }
147 func (*MemclntKeepalive) GetMessageType() api.MessageType { return api.RequestMessage }
148
149 // MemclntKeepaliveReply represents VPP binary API message 'memclnt_keepalive_reply'.
150 type MemclntKeepaliveReply struct {
151         Retval int32
152 }
153
154 func (m *MemclntKeepaliveReply) Reset()                        { *m = MemclntKeepaliveReply{} }
155 func (*MemclntKeepaliveReply) GetMessageName() string          { return "memclnt_keepalive_reply" }
156 func (*MemclntKeepaliveReply) GetCrcString() string            { return "e8d4e804" }
157 func (*MemclntKeepaliveReply) GetMessageType() api.MessageType { return api.ReplyMessage }
158
159 // MemclntReadTimeout represents VPP binary API message 'memclnt_read_timeout'.
160 type MemclntReadTimeout struct {
161         Dummy uint8
162 }
163
164 func (m *MemclntReadTimeout) Reset()                        { *m = MemclntReadTimeout{} }
165 func (*MemclntReadTimeout) GetMessageName() string          { return "memclnt_read_timeout" }
166 func (*MemclntReadTimeout) GetCrcString() string            { return "c3a3a452" }
167 func (*MemclntReadTimeout) GetMessageType() api.MessageType { return api.OtherMessage }
168
169 // MemclntRxThreadSuspend represents VPP binary API message 'memclnt_rx_thread_suspend'.
170 type MemclntRxThreadSuspend struct {
171         Dummy uint8
172 }
173
174 func (m *MemclntRxThreadSuspend) Reset()                        { *m = MemclntRxThreadSuspend{} }
175 func (*MemclntRxThreadSuspend) GetMessageName() string          { return "memclnt_rx_thread_suspend" }
176 func (*MemclntRxThreadSuspend) GetCrcString() string            { return "c3a3a452" }
177 func (*MemclntRxThreadSuspend) GetMessageType() api.MessageType { return api.OtherMessage }
178
179 // RPCCall represents VPP binary API message 'rpc_call'.
180 type RPCCall struct {
181         Function        uint64
182         Multicast       uint8
183         NeedBarrierSync uint8
184         SendReply       uint8
185         DataLen         uint32 `struc:"sizeof=Data"`
186         Data            []byte
187 }
188
189 func (m *RPCCall) Reset()                        { *m = RPCCall{} }
190 func (*RPCCall) GetMessageName() string          { return "rpc_call" }
191 func (*RPCCall) GetCrcString() string            { return "7e8a2c95" }
192 func (*RPCCall) GetMessageType() api.MessageType { return api.RequestMessage }
193
194 // RPCCallReply represents VPP binary API message 'rpc_call_reply'.
195 type RPCCallReply struct {
196         Retval int32
197 }
198
199 func (m *RPCCallReply) Reset()                        { *m = RPCCallReply{} }
200 func (*RPCCallReply) GetMessageName() string          { return "rpc_call_reply" }
201 func (*RPCCallReply) GetCrcString() string            { return "e8d4e804" }
202 func (*RPCCallReply) GetMessageType() api.MessageType { return api.ReplyMessage }
203
204 // RxThreadExit represents VPP binary API message 'rx_thread_exit'.
205 type RxThreadExit struct {
206         Dummy uint8
207 }
208
209 func (m *RxThreadExit) Reset()                        { *m = RxThreadExit{} }
210 func (*RxThreadExit) GetMessageName() string          { return "rx_thread_exit" }
211 func (*RxThreadExit) GetCrcString() string            { return "c3a3a452" }
212 func (*RxThreadExit) GetMessageType() api.MessageType { return api.OtherMessage }
213
214 // SockInitShm represents VPP binary API message 'sock_init_shm'.
215 type SockInitShm struct {
216         RequestedSize uint32
217         Nitems        uint8 `struc:"sizeof=Configs"`
218         Configs       []uint64
219 }
220
221 func (m *SockInitShm) Reset()                        { *m = SockInitShm{} }
222 func (*SockInitShm) GetMessageName() string          { return "sock_init_shm" }
223 func (*SockInitShm) GetCrcString() string            { return "51646d92" }
224 func (*SockInitShm) GetMessageType() api.MessageType { return api.RequestMessage }
225
226 // SockInitShmReply represents VPP binary API message 'sock_init_shm_reply'.
227 type SockInitShmReply struct {
228         Retval int32
229 }
230
231 func (m *SockInitShmReply) Reset()                        { *m = SockInitShmReply{} }
232 func (*SockInitShmReply) GetMessageName() string          { return "sock_init_shm_reply" }
233 func (*SockInitShmReply) GetCrcString() string            { return "e8d4e804" }
234 func (*SockInitShmReply) GetMessageType() api.MessageType { return api.ReplyMessage }
235
236 // SockclntCreate represents VPP binary API message 'sockclnt_create'.
237 type SockclntCreate struct {
238         Name string `struc:"[64]byte"`
239 }
240
241 func (m *SockclntCreate) Reset()                        { *m = SockclntCreate{} }
242 func (*SockclntCreate) GetMessageName() string          { return "sockclnt_create" }
243 func (*SockclntCreate) GetCrcString() string            { return "455fb9c4" }
244 func (*SockclntCreate) GetMessageType() api.MessageType { return api.ReplyMessage }
245
246 // SockclntCreateReply represents VPP binary API message 'sockclnt_create_reply'.
247 type SockclntCreateReply struct {
248         Response     int32
249         Index        uint32
250         Count        uint16 `struc:"sizeof=MessageTable"`
251         MessageTable []MessageTableEntry
252 }
253
254 func (m *SockclntCreateReply) Reset()                        { *m = SockclntCreateReply{} }
255 func (*SockclntCreateReply) GetMessageName() string          { return "sockclnt_create_reply" }
256 func (*SockclntCreateReply) GetCrcString() string            { return "35166268" }
257 func (*SockclntCreateReply) GetMessageType() api.MessageType { return api.RequestMessage }
258
259 // SockclntDelete represents VPP binary API message 'sockclnt_delete'.
260 type SockclntDelete struct {
261         Index uint32
262 }
263
264 func (m *SockclntDelete) Reset()                        { *m = SockclntDelete{} }
265 func (*SockclntDelete) GetMessageName() string          { return "sockclnt_delete" }
266 func (*SockclntDelete) GetCrcString() string            { return "8ac76db6" }
267 func (*SockclntDelete) GetMessageType() api.MessageType { return api.RequestMessage }
268
269 // SockclntDeleteReply represents VPP binary API message 'sockclnt_delete_reply'.
270 type SockclntDeleteReply struct {
271         Response int32
272 }
273
274 func (m *SockclntDeleteReply) Reset()                        { *m = SockclntDeleteReply{} }
275 func (*SockclntDeleteReply) GetMessageName() string          { return "sockclnt_delete_reply" }
276 func (*SockclntDeleteReply) GetCrcString() string            { return "8f38b1ee" }
277 func (*SockclntDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage }
278
279 // TracePluginMsgIds represents VPP binary API message 'trace_plugin_msg_ids'.
280 type TracePluginMsgIds struct {
281         PluginName string `struc:"[128]byte"`
282         FirstMsgID uint16
283         LastMsgID  uint16
284 }
285
286 func (m *TracePluginMsgIds) Reset()                        { *m = TracePluginMsgIds{} }
287 func (*TracePluginMsgIds) GetMessageName() string          { return "trace_plugin_msg_ids" }
288 func (*TracePluginMsgIds) GetCrcString() string            { return "f476d3ce" }
289 func (*TracePluginMsgIds) GetMessageType() api.MessageType { return api.RequestMessage }
290
291 func init() {
292         api.RegisterMessage((*APIVersions)(nil), "memclnt.APIVersions")
293         api.RegisterMessage((*APIVersionsReply)(nil), "memclnt.APIVersionsReply")
294         api.RegisterMessage((*GetFirstMsgID)(nil), "memclnt.GetFirstMsgID")
295         api.RegisterMessage((*GetFirstMsgIDReply)(nil), "memclnt.GetFirstMsgIDReply")
296         api.RegisterMessage((*MemclntCreate)(nil), "memclnt.MemclntCreate")
297         api.RegisterMessage((*MemclntCreateReply)(nil), "memclnt.MemclntCreateReply")
298         api.RegisterMessage((*MemclntDelete)(nil), "memclnt.MemclntDelete")
299         api.RegisterMessage((*MemclntDeleteReply)(nil), "memclnt.MemclntDeleteReply")
300         api.RegisterMessage((*MemclntKeepalive)(nil), "memclnt.MemclntKeepalive")
301         api.RegisterMessage((*MemclntKeepaliveReply)(nil), "memclnt.MemclntKeepaliveReply")
302         api.RegisterMessage((*MemclntReadTimeout)(nil), "memclnt.MemclntReadTimeout")
303         api.RegisterMessage((*MemclntRxThreadSuspend)(nil), "memclnt.MemclntRxThreadSuspend")
304         api.RegisterMessage((*RPCCall)(nil), "memclnt.RPCCall")
305         api.RegisterMessage((*RPCCallReply)(nil), "memclnt.RPCCallReply")
306         api.RegisterMessage((*RxThreadExit)(nil), "memclnt.RxThreadExit")
307         api.RegisterMessage((*SockInitShm)(nil), "memclnt.SockInitShm")
308         api.RegisterMessage((*SockInitShmReply)(nil), "memclnt.SockInitShmReply")
309         api.RegisterMessage((*SockclntCreate)(nil), "memclnt.SockclntCreate")
310         api.RegisterMessage((*SockclntCreateReply)(nil), "memclnt.SockclntCreateReply")
311         api.RegisterMessage((*SockclntDelete)(nil), "memclnt.SockclntDelete")
312         api.RegisterMessage((*SockclntDeleteReply)(nil), "memclnt.SockclntDeleteReply")
313         api.RegisterMessage((*TracePluginMsgIds)(nil), "memclnt.TracePluginMsgIds")
314 }
315
316 // Messages returns list of all messages in this module.
317 func AllMessages() []api.Message {
318         return []api.Message{
319                 (*APIVersions)(nil),
320                 (*APIVersionsReply)(nil),
321                 (*GetFirstMsgID)(nil),
322                 (*GetFirstMsgIDReply)(nil),
323                 (*MemclntCreate)(nil),
324                 (*MemclntCreateReply)(nil),
325                 (*MemclntDelete)(nil),
326                 (*MemclntDeleteReply)(nil),
327                 (*MemclntKeepalive)(nil),
328                 (*MemclntKeepaliveReply)(nil),
329                 (*MemclntReadTimeout)(nil),
330                 (*MemclntRxThreadSuspend)(nil),
331                 (*RPCCall)(nil),
332                 (*RPCCallReply)(nil),
333                 (*RxThreadExit)(nil),
334                 (*SockInitShm)(nil),
335                 (*SockInitShmReply)(nil),
336                 (*SockclntCreate)(nil),
337                 (*SockclntCreateReply)(nil),
338                 (*SockclntDelete)(nil),
339                 (*SockclntDeleteReply)(nil),
340                 (*TracePluginMsgIds)(nil),
341         }
342 }
343
344 // RPCService represents RPC service API for memclnt module.
345 type RPCService interface {
346         APIVersions(ctx context.Context, in *APIVersions) (*APIVersionsReply, error)
347         GetFirstMsgID(ctx context.Context, in *GetFirstMsgID) (*GetFirstMsgIDReply, error)
348         MemclntCreate(ctx context.Context, in *MemclntCreate) (*MemclntCreateReply, error)
349         MemclntDelete(ctx context.Context, in *MemclntDelete) (*MemclntDeleteReply, error)
350         MemclntKeepalive(ctx context.Context, in *MemclntKeepalive) (*MemclntKeepaliveReply, error)
351         MemclntReadTimeout(ctx context.Context, in *MemclntReadTimeout) error
352         MemclntRxThreadSuspend(ctx context.Context, in *MemclntRxThreadSuspend) error
353         RPCCall(ctx context.Context, in *RPCCall) (*RPCCallReply, error)
354         RxThreadExit(ctx context.Context, in *RxThreadExit) error
355         SockInitShm(ctx context.Context, in *SockInitShm) (*SockInitShmReply, error)
356         SockclntCreate(ctx context.Context, in *SockclntCreate) (*SockclntCreateReply, error)
357         SockclntDelete(ctx context.Context, in *SockclntDelete) (*SockclntDeleteReply, error)
358         TracePluginMsgIds(ctx context.Context, in *TracePluginMsgIds) error
359 }
360
361 type serviceClient struct {
362         ch api.Channel
363 }
364
365 func NewServiceClient(ch api.Channel) RPCService {
366         return &serviceClient{ch}
367 }
368
369 func (c *serviceClient) APIVersions(ctx context.Context, in *APIVersions) (*APIVersionsReply, error) {
370         out := new(APIVersionsReply)
371         err := c.ch.SendRequest(in).ReceiveReply(out)
372         if err != nil {
373                 return nil, err
374         }
375         return out, nil
376 }
377
378 func (c *serviceClient) GetFirstMsgID(ctx context.Context, in *GetFirstMsgID) (*GetFirstMsgIDReply, error) {
379         out := new(GetFirstMsgIDReply)
380         err := c.ch.SendRequest(in).ReceiveReply(out)
381         if err != nil {
382                 return nil, err
383         }
384         return out, nil
385 }
386
387 func (c *serviceClient) MemclntCreate(ctx context.Context, in *MemclntCreate) (*MemclntCreateReply, error) {
388         out := new(MemclntCreateReply)
389         err := c.ch.SendRequest(in).ReceiveReply(out)
390         if err != nil {
391                 return nil, err
392         }
393         return out, nil
394 }
395
396 func (c *serviceClient) MemclntDelete(ctx context.Context, in *MemclntDelete) (*MemclntDeleteReply, error) {
397         out := new(MemclntDeleteReply)
398         err := c.ch.SendRequest(in).ReceiveReply(out)
399         if err != nil {
400                 return nil, err
401         }
402         return out, nil
403 }
404
405 func (c *serviceClient) MemclntKeepalive(ctx context.Context, in *MemclntKeepalive) (*MemclntKeepaliveReply, error) {
406         out := new(MemclntKeepaliveReply)
407         err := c.ch.SendRequest(in).ReceiveReply(out)
408         if err != nil {
409                 return nil, err
410         }
411         return out, nil
412 }
413
414 func (c *serviceClient) MemclntReadTimeout(ctx context.Context, in *MemclntReadTimeout) error {
415         c.ch.SendRequest(in)
416         return nil
417 }
418
419 func (c *serviceClient) MemclntRxThreadSuspend(ctx context.Context, in *MemclntRxThreadSuspend) error {
420         c.ch.SendRequest(in)
421         return nil
422 }
423
424 func (c *serviceClient) RPCCall(ctx context.Context, in *RPCCall) (*RPCCallReply, error) {
425         out := new(RPCCallReply)
426         err := c.ch.SendRequest(in).ReceiveReply(out)
427         if err != nil {
428                 return nil, err
429         }
430         return out, nil
431 }
432
433 func (c *serviceClient) RxThreadExit(ctx context.Context, in *RxThreadExit) error {
434         c.ch.SendRequest(in)
435         return nil
436 }
437
438 func (c *serviceClient) SockInitShm(ctx context.Context, in *SockInitShm) (*SockInitShmReply, error) {
439         out := new(SockInitShmReply)
440         err := c.ch.SendRequest(in).ReceiveReply(out)
441         if err != nil {
442                 return nil, err
443         }
444         return out, nil
445 }
446
447 func (c *serviceClient) SockclntCreate(ctx context.Context, in *SockclntCreate) (*SockclntCreateReply, error) {
448         out := new(SockclntCreateReply)
449         err := c.ch.SendRequest(in).ReceiveReply(out)
450         if err != nil {
451                 return nil, err
452         }
453         return out, nil
454 }
455
456 func (c *serviceClient) SockclntDelete(ctx context.Context, in *SockclntDelete) (*SockclntDeleteReply, error) {
457         out := new(SockclntDeleteReply)
458         err := c.ch.SendRequest(in).ReceiveReply(out)
459         if err != nil {
460                 return nil, err
461         }
462         return out, nil
463 }
464
465 func (c *serviceClient) TracePluginMsgIds(ctx context.Context, in *TracePluginMsgIds) error {
466         c.ch.SendRequest(in)
467         return nil
468 }
469
470 // This is a compile-time assertion to ensure that this generated file
471 // is compatible with the GoVPP api package it is being compiled against.
472 // A compilation error at this line likely means your copy of the
473 // GoVPP api package needs to be updated.
474 const _ = api.GoVppAPIPackageIsVersion1 // please upgrade the GoVPP api package
475
476 // Reference imports to suppress errors if they are not otherwise used.
477 var _ = api.RegisterMessage
478 var _ = bytes.NewBuffer
479 var _ = context.Background
480 var _ = io.Copy
481 var _ = strconv.Itoa
482 var _ = struc.Pack