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