Fix compatibility with latest master (20.01-rc0)
[govpp.git] / examples / binapi / memif / memif.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // source: /usr/share/vpp/api/plugins/memif.api.json
3
4 /*
5 Package memif is a generated VPP binary API for 'memif' module.
6
7 It consists of:
8          10 messages
9           5 services
10 */
11 package memif
12
13 import (
14         bytes "bytes"
15         context "context"
16         api "git.fd.io/govpp.git/api"
17         struc "github.com/lunixbochs/struc"
18         io "io"
19         strconv "strconv"
20 )
21
22 const (
23         // ModuleName is the name of this module.
24         ModuleName = "memif"
25         // APIVersion is the API version of this module.
26         APIVersion = "2.0.0"
27         // VersionCrc is the CRC of this module.
28         VersionCrc = 0x939f78a7
29 )
30
31 // MemifCreate represents VPP binary API message 'memif_create'.
32 type MemifCreate struct {
33         Role       uint8
34         Mode       uint8
35         RxQueues   uint8
36         TxQueues   uint8
37         ID         uint32
38         SocketID   uint32
39         Secret     []byte `struc:"[24]byte"`
40         RingSize   uint32
41         BufferSize uint16
42         HwAddr     []byte `struc:"[6]byte"`
43 }
44
45 func (*MemifCreate) GetMessageName() string {
46         return "memif_create"
47 }
48 func (*MemifCreate) GetCrcString() string {
49         return "6597cdb2"
50 }
51 func (*MemifCreate) GetMessageType() api.MessageType {
52         return api.RequestMessage
53 }
54
55 // MemifCreateReply represents VPP binary API message 'memif_create_reply'.
56 type MemifCreateReply struct {
57         Retval    int32
58         SwIfIndex uint32
59 }
60
61 func (*MemifCreateReply) GetMessageName() string {
62         return "memif_create_reply"
63 }
64 func (*MemifCreateReply) GetCrcString() string {
65         return "fda5941f"
66 }
67 func (*MemifCreateReply) GetMessageType() api.MessageType {
68         return api.ReplyMessage
69 }
70
71 // MemifDelete represents VPP binary API message 'memif_delete'.
72 type MemifDelete struct {
73         SwIfIndex uint32
74 }
75
76 func (*MemifDelete) GetMessageName() string {
77         return "memif_delete"
78 }
79 func (*MemifDelete) GetCrcString() string {
80         return "529cb13f"
81 }
82 func (*MemifDelete) GetMessageType() api.MessageType {
83         return api.RequestMessage
84 }
85
86 // MemifDeleteReply represents VPP binary API message 'memif_delete_reply'.
87 type MemifDeleteReply struct {
88         Retval int32
89 }
90
91 func (*MemifDeleteReply) GetMessageName() string {
92         return "memif_delete_reply"
93 }
94 func (*MemifDeleteReply) GetCrcString() string {
95         return "e8d4e804"
96 }
97 func (*MemifDeleteReply) GetMessageType() api.MessageType {
98         return api.ReplyMessage
99 }
100
101 // MemifDetails represents VPP binary API message 'memif_details'.
102 type MemifDetails struct {
103         SwIfIndex   uint32
104         IfName      []byte `struc:"[64]byte"`
105         HwAddr      []byte `struc:"[6]byte"`
106         ID          uint32
107         Role        uint8
108         Mode        uint8
109         SocketID    uint32
110         RingSize    uint32
111         BufferSize  uint16
112         AdminUpDown uint8
113         LinkUpDown  uint8
114 }
115
116 func (*MemifDetails) GetMessageName() string {
117         return "memif_details"
118 }
119 func (*MemifDetails) GetCrcString() string {
120         return "4f5a3397"
121 }
122 func (*MemifDetails) GetMessageType() api.MessageType {
123         return api.ReplyMessage
124 }
125
126 // MemifDump represents VPP binary API message 'memif_dump'.
127 type MemifDump struct{}
128
129 func (*MemifDump) GetMessageName() string {
130         return "memif_dump"
131 }
132 func (*MemifDump) GetCrcString() string {
133         return "51077d14"
134 }
135 func (*MemifDump) GetMessageType() api.MessageType {
136         return api.RequestMessage
137 }
138
139 // MemifSocketFilenameAddDel represents VPP binary API message 'memif_socket_filename_add_del'.
140 type MemifSocketFilenameAddDel struct {
141         IsAdd          uint8
142         SocketID       uint32
143         SocketFilename []byte `struc:"[128]byte"`
144 }
145
146 func (*MemifSocketFilenameAddDel) GetMessageName() string {
147         return "memif_socket_filename_add_del"
148 }
149 func (*MemifSocketFilenameAddDel) GetCrcString() string {
150         return "30e3929d"
151 }
152 func (*MemifSocketFilenameAddDel) GetMessageType() api.MessageType {
153         return api.RequestMessage
154 }
155
156 // MemifSocketFilenameAddDelReply represents VPP binary API message 'memif_socket_filename_add_del_reply'.
157 type MemifSocketFilenameAddDelReply struct {
158         Retval int32
159 }
160
161 func (*MemifSocketFilenameAddDelReply) GetMessageName() string {
162         return "memif_socket_filename_add_del_reply"
163 }
164 func (*MemifSocketFilenameAddDelReply) GetCrcString() string {
165         return "e8d4e804"
166 }
167 func (*MemifSocketFilenameAddDelReply) GetMessageType() api.MessageType {
168         return api.ReplyMessage
169 }
170
171 // MemifSocketFilenameDetails represents VPP binary API message 'memif_socket_filename_details'.
172 type MemifSocketFilenameDetails struct {
173         SocketID       uint32
174         SocketFilename []byte `struc:"[128]byte"`
175 }
176
177 func (*MemifSocketFilenameDetails) GetMessageName() string {
178         return "memif_socket_filename_details"
179 }
180 func (*MemifSocketFilenameDetails) GetCrcString() string {
181         return "e347e32f"
182 }
183 func (*MemifSocketFilenameDetails) GetMessageType() api.MessageType {
184         return api.ReplyMessage
185 }
186
187 // MemifSocketFilenameDump represents VPP binary API message 'memif_socket_filename_dump'.
188 type MemifSocketFilenameDump struct{}
189
190 func (*MemifSocketFilenameDump) GetMessageName() string {
191         return "memif_socket_filename_dump"
192 }
193 func (*MemifSocketFilenameDump) GetCrcString() string {
194         return "51077d14"
195 }
196 func (*MemifSocketFilenameDump) GetMessageType() api.MessageType {
197         return api.RequestMessage
198 }
199
200 func init() {
201         api.RegisterMessage((*MemifCreate)(nil), "memif.MemifCreate")
202         api.RegisterMessage((*MemifCreateReply)(nil), "memif.MemifCreateReply")
203         api.RegisterMessage((*MemifDelete)(nil), "memif.MemifDelete")
204         api.RegisterMessage((*MemifDeleteReply)(nil), "memif.MemifDeleteReply")
205         api.RegisterMessage((*MemifDetails)(nil), "memif.MemifDetails")
206         api.RegisterMessage((*MemifDump)(nil), "memif.MemifDump")
207         api.RegisterMessage((*MemifSocketFilenameAddDel)(nil), "memif.MemifSocketFilenameAddDel")
208         api.RegisterMessage((*MemifSocketFilenameAddDelReply)(nil), "memif.MemifSocketFilenameAddDelReply")
209         api.RegisterMessage((*MemifSocketFilenameDetails)(nil), "memif.MemifSocketFilenameDetails")
210         api.RegisterMessage((*MemifSocketFilenameDump)(nil), "memif.MemifSocketFilenameDump")
211 }
212
213 // Messages returns list of all messages in this module.
214 func AllMessages() []api.Message {
215         return []api.Message{
216                 (*MemifCreate)(nil),
217                 (*MemifCreateReply)(nil),
218                 (*MemifDelete)(nil),
219                 (*MemifDeleteReply)(nil),
220                 (*MemifDetails)(nil),
221                 (*MemifDump)(nil),
222                 (*MemifSocketFilenameAddDel)(nil),
223                 (*MemifSocketFilenameAddDelReply)(nil),
224                 (*MemifSocketFilenameDetails)(nil),
225                 (*MemifSocketFilenameDump)(nil),
226         }
227 }
228
229 // RPCService represents RPC service API for memif module.
230 type RPCService interface {
231         DumpMemif(ctx context.Context, in *MemifDump) (RPCService_DumpMemifClient, error)
232         DumpMemifSocketFilename(ctx context.Context, in *MemifSocketFilenameDump) (RPCService_DumpMemifSocketFilenameClient, error)
233         MemifCreate(ctx context.Context, in *MemifCreate) (*MemifCreateReply, error)
234         MemifDelete(ctx context.Context, in *MemifDelete) (*MemifDeleteReply, error)
235         MemifSocketFilenameAddDel(ctx context.Context, in *MemifSocketFilenameAddDel) (*MemifSocketFilenameAddDelReply, error)
236 }
237
238 type serviceClient struct {
239         ch api.Channel
240 }
241
242 func NewServiceClient(ch api.Channel) RPCService {
243         return &serviceClient{ch}
244 }
245
246 func (c *serviceClient) DumpMemif(ctx context.Context, in *MemifDump) (RPCService_DumpMemifClient, error) {
247         stream := c.ch.SendMultiRequest(in)
248         x := &serviceClient_DumpMemifClient{stream}
249         return x, nil
250 }
251
252 type RPCService_DumpMemifClient interface {
253         Recv() (*MemifDetails, error)
254 }
255
256 type serviceClient_DumpMemifClient struct {
257         api.MultiRequestCtx
258 }
259
260 func (c *serviceClient_DumpMemifClient) Recv() (*MemifDetails, error) {
261         m := new(MemifDetails)
262         stop, err := c.MultiRequestCtx.ReceiveReply(m)
263         if err != nil {
264                 return nil, err
265         }
266         if stop {
267                 return nil, io.EOF
268         }
269         return m, nil
270 }
271
272 func (c *serviceClient) DumpMemifSocketFilename(ctx context.Context, in *MemifSocketFilenameDump) (RPCService_DumpMemifSocketFilenameClient, error) {
273         stream := c.ch.SendMultiRequest(in)
274         x := &serviceClient_DumpMemifSocketFilenameClient{stream}
275         return x, nil
276 }
277
278 type RPCService_DumpMemifSocketFilenameClient interface {
279         Recv() (*MemifSocketFilenameDetails, error)
280 }
281
282 type serviceClient_DumpMemifSocketFilenameClient struct {
283         api.MultiRequestCtx
284 }
285
286 func (c *serviceClient_DumpMemifSocketFilenameClient) Recv() (*MemifSocketFilenameDetails, error) {
287         m := new(MemifSocketFilenameDetails)
288         stop, err := c.MultiRequestCtx.ReceiveReply(m)
289         if err != nil {
290                 return nil, err
291         }
292         if stop {
293                 return nil, io.EOF
294         }
295         return m, nil
296 }
297
298 func (c *serviceClient) MemifCreate(ctx context.Context, in *MemifCreate) (*MemifCreateReply, error) {
299         out := new(MemifCreateReply)
300         err := c.ch.SendRequest(in).ReceiveReply(out)
301         if err != nil {
302                 return nil, err
303         }
304         return out, nil
305 }
306
307 func (c *serviceClient) MemifDelete(ctx context.Context, in *MemifDelete) (*MemifDeleteReply, error) {
308         out := new(MemifDeleteReply)
309         err := c.ch.SendRequest(in).ReceiveReply(out)
310         if err != nil {
311                 return nil, err
312         }
313         return out, nil
314 }
315
316 func (c *serviceClient) MemifSocketFilenameAddDel(ctx context.Context, in *MemifSocketFilenameAddDel) (*MemifSocketFilenameAddDelReply, error) {
317         out := new(MemifSocketFilenameAddDelReply)
318         err := c.ch.SendRequest(in).ReceiveReply(out)
319         if err != nil {
320                 return nil, err
321         }
322         return out, nil
323 }
324
325 // This is a compile-time assertion to ensure that this generated file
326 // is compatible with the GoVPP api package it is being compiled against.
327 // A compilation error at this line likely means your copy of the
328 // GoVPP api package needs to be updated.
329 const _ = api.GoVppAPIPackageIsVersion1 // please upgrade the GoVPP api package
330
331 // Reference imports to suppress errors if they are not otherwise used.
332 var _ = api.RegisterMessage
333 var _ = bytes.NewBuffer
334 var _ = context.Background
335 var _ = io.Copy
336 var _ = strconv.Itoa
337 var _ = struc.Pack