Change module name to go.fd.io/govpp
[govpp.git] / binapi / acl / acl_rpc.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2
3 package acl
4
5 import (
6         "context"
7         "fmt"
8         "io"
9
10         api "go.fd.io/govpp/api"
11         memclnt "go.fd.io/govpp/binapi/memclnt"
12 )
13
14 // RPCService defines RPC service acl.
15 type RPCService interface {
16         ACLAddReplace(ctx context.Context, in *ACLAddReplace) (*ACLAddReplaceReply, error)
17         ACLDel(ctx context.Context, in *ACLDel) (*ACLDelReply, error)
18         ACLDump(ctx context.Context, in *ACLDump) (RPCService_ACLDumpClient, error)
19         ACLInterfaceAddDel(ctx context.Context, in *ACLInterfaceAddDel) (*ACLInterfaceAddDelReply, error)
20         ACLInterfaceEtypeWhitelistDump(ctx context.Context, in *ACLInterfaceEtypeWhitelistDump) (RPCService_ACLInterfaceEtypeWhitelistDumpClient, error)
21         ACLInterfaceListDump(ctx context.Context, in *ACLInterfaceListDump) (RPCService_ACLInterfaceListDumpClient, error)
22         ACLInterfaceSetACLList(ctx context.Context, in *ACLInterfaceSetACLList) (*ACLInterfaceSetACLListReply, error)
23         ACLInterfaceSetEtypeWhitelist(ctx context.Context, in *ACLInterfaceSetEtypeWhitelist) (*ACLInterfaceSetEtypeWhitelistReply, error)
24         ACLPluginControlPing(ctx context.Context, in *ACLPluginControlPing) (*ACLPluginControlPingReply, error)
25         ACLPluginGetConnTableMaxEntries(ctx context.Context, in *ACLPluginGetConnTableMaxEntries) (*ACLPluginGetConnTableMaxEntriesReply, error)
26         ACLPluginGetVersion(ctx context.Context, in *ACLPluginGetVersion) (*ACLPluginGetVersionReply, error)
27         ACLPluginUseHashLookupGet(ctx context.Context, in *ACLPluginUseHashLookupGet) (*ACLPluginUseHashLookupGetReply, error)
28         ACLPluginUseHashLookupSet(ctx context.Context, in *ACLPluginUseHashLookupSet) (*ACLPluginUseHashLookupSetReply, error)
29         ACLStatsIntfCountersEnable(ctx context.Context, in *ACLStatsIntfCountersEnable) (*ACLStatsIntfCountersEnableReply, error)
30         MacipACLAdd(ctx context.Context, in *MacipACLAdd) (*MacipACLAddReply, error)
31         MacipACLAddReplace(ctx context.Context, in *MacipACLAddReplace) (*MacipACLAddReplaceReply, error)
32         MacipACLDel(ctx context.Context, in *MacipACLDel) (*MacipACLDelReply, error)
33         MacipACLDump(ctx context.Context, in *MacipACLDump) (RPCService_MacipACLDumpClient, error)
34         MacipACLInterfaceAddDel(ctx context.Context, in *MacipACLInterfaceAddDel) (*MacipACLInterfaceAddDelReply, error)
35         MacipACLInterfaceGet(ctx context.Context, in *MacipACLInterfaceGet) (*MacipACLInterfaceGetReply, error)
36         MacipACLInterfaceListDump(ctx context.Context, in *MacipACLInterfaceListDump) (RPCService_MacipACLInterfaceListDumpClient, error)
37 }
38
39 type serviceClient struct {
40         conn api.Connection
41 }
42
43 func NewServiceClient(conn api.Connection) RPCService {
44         return &serviceClient{conn}
45 }
46
47 func (c *serviceClient) ACLAddReplace(ctx context.Context, in *ACLAddReplace) (*ACLAddReplaceReply, error) {
48         out := new(ACLAddReplaceReply)
49         err := c.conn.Invoke(ctx, in, out)
50         if err != nil {
51                 return nil, err
52         }
53         return out, api.RetvalToVPPApiError(out.Retval)
54 }
55
56 func (c *serviceClient) ACLDel(ctx context.Context, in *ACLDel) (*ACLDelReply, error) {
57         out := new(ACLDelReply)
58         err := c.conn.Invoke(ctx, in, out)
59         if err != nil {
60                 return nil, err
61         }
62         return out, api.RetvalToVPPApiError(out.Retval)
63 }
64
65 func (c *serviceClient) ACLDump(ctx context.Context, in *ACLDump) (RPCService_ACLDumpClient, error) {
66         stream, err := c.conn.NewStream(ctx)
67         if err != nil {
68                 return nil, err
69         }
70         x := &serviceClient_ACLDumpClient{stream}
71         if err := x.Stream.SendMsg(in); err != nil {
72                 return nil, err
73         }
74         if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil {
75                 return nil, err
76         }
77         return x, nil
78 }
79
80 type RPCService_ACLDumpClient interface {
81         Recv() (*ACLDetails, error)
82         api.Stream
83 }
84
85 type serviceClient_ACLDumpClient struct {
86         api.Stream
87 }
88
89 func (c *serviceClient_ACLDumpClient) Recv() (*ACLDetails, error) {
90         msg, err := c.Stream.RecvMsg()
91         if err != nil {
92                 return nil, err
93         }
94         switch m := msg.(type) {
95         case *ACLDetails:
96                 return m, nil
97         case *memclnt.ControlPingReply:
98                 err = c.Stream.Close()
99                 if err != nil {
100                         return nil, err
101                 }
102                 return nil, io.EOF
103         default:
104                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
105         }
106 }
107
108 func (c *serviceClient) ACLInterfaceAddDel(ctx context.Context, in *ACLInterfaceAddDel) (*ACLInterfaceAddDelReply, error) {
109         out := new(ACLInterfaceAddDelReply)
110         err := c.conn.Invoke(ctx, in, out)
111         if err != nil {
112                 return nil, err
113         }
114         return out, api.RetvalToVPPApiError(out.Retval)
115 }
116
117 func (c *serviceClient) ACLInterfaceEtypeWhitelistDump(ctx context.Context, in *ACLInterfaceEtypeWhitelistDump) (RPCService_ACLInterfaceEtypeWhitelistDumpClient, error) {
118         stream, err := c.conn.NewStream(ctx)
119         if err != nil {
120                 return nil, err
121         }
122         x := &serviceClient_ACLInterfaceEtypeWhitelistDumpClient{stream}
123         if err := x.Stream.SendMsg(in); err != nil {
124                 return nil, err
125         }
126         if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil {
127                 return nil, err
128         }
129         return x, nil
130 }
131
132 type RPCService_ACLInterfaceEtypeWhitelistDumpClient interface {
133         Recv() (*ACLInterfaceEtypeWhitelistDetails, error)
134         api.Stream
135 }
136
137 type serviceClient_ACLInterfaceEtypeWhitelistDumpClient struct {
138         api.Stream
139 }
140
141 func (c *serviceClient_ACLInterfaceEtypeWhitelistDumpClient) Recv() (*ACLInterfaceEtypeWhitelistDetails, error) {
142         msg, err := c.Stream.RecvMsg()
143         if err != nil {
144                 return nil, err
145         }
146         switch m := msg.(type) {
147         case *ACLInterfaceEtypeWhitelistDetails:
148                 return m, nil
149         case *memclnt.ControlPingReply:
150                 err = c.Stream.Close()
151                 if err != nil {
152                         return nil, err
153                 }
154                 return nil, io.EOF
155         default:
156                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
157         }
158 }
159
160 func (c *serviceClient) ACLInterfaceListDump(ctx context.Context, in *ACLInterfaceListDump) (RPCService_ACLInterfaceListDumpClient, error) {
161         stream, err := c.conn.NewStream(ctx)
162         if err != nil {
163                 return nil, err
164         }
165         x := &serviceClient_ACLInterfaceListDumpClient{stream}
166         if err := x.Stream.SendMsg(in); err != nil {
167                 return nil, err
168         }
169         if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil {
170                 return nil, err
171         }
172         return x, nil
173 }
174
175 type RPCService_ACLInterfaceListDumpClient interface {
176         Recv() (*ACLInterfaceListDetails, error)
177         api.Stream
178 }
179
180 type serviceClient_ACLInterfaceListDumpClient struct {
181         api.Stream
182 }
183
184 func (c *serviceClient_ACLInterfaceListDumpClient) Recv() (*ACLInterfaceListDetails, error) {
185         msg, err := c.Stream.RecvMsg()
186         if err != nil {
187                 return nil, err
188         }
189         switch m := msg.(type) {
190         case *ACLInterfaceListDetails:
191                 return m, nil
192         case *memclnt.ControlPingReply:
193                 err = c.Stream.Close()
194                 if err != nil {
195                         return nil, err
196                 }
197                 return nil, io.EOF
198         default:
199                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
200         }
201 }
202
203 func (c *serviceClient) ACLInterfaceSetACLList(ctx context.Context, in *ACLInterfaceSetACLList) (*ACLInterfaceSetACLListReply, error) {
204         out := new(ACLInterfaceSetACLListReply)
205         err := c.conn.Invoke(ctx, in, out)
206         if err != nil {
207                 return nil, err
208         }
209         return out, api.RetvalToVPPApiError(out.Retval)
210 }
211
212 func (c *serviceClient) ACLInterfaceSetEtypeWhitelist(ctx context.Context, in *ACLInterfaceSetEtypeWhitelist) (*ACLInterfaceSetEtypeWhitelistReply, error) {
213         out := new(ACLInterfaceSetEtypeWhitelistReply)
214         err := c.conn.Invoke(ctx, in, out)
215         if err != nil {
216                 return nil, err
217         }
218         return out, api.RetvalToVPPApiError(out.Retval)
219 }
220
221 func (c *serviceClient) ACLPluginControlPing(ctx context.Context, in *ACLPluginControlPing) (*ACLPluginControlPingReply, error) {
222         out := new(ACLPluginControlPingReply)
223         err := c.conn.Invoke(ctx, in, out)
224         if err != nil {
225                 return nil, err
226         }
227         return out, api.RetvalToVPPApiError(out.Retval)
228 }
229
230 func (c *serviceClient) ACLPluginGetConnTableMaxEntries(ctx context.Context, in *ACLPluginGetConnTableMaxEntries) (*ACLPluginGetConnTableMaxEntriesReply, error) {
231         out := new(ACLPluginGetConnTableMaxEntriesReply)
232         err := c.conn.Invoke(ctx, in, out)
233         if err != nil {
234                 return nil, err
235         }
236         return out, nil
237 }
238
239 func (c *serviceClient) ACLPluginGetVersion(ctx context.Context, in *ACLPluginGetVersion) (*ACLPluginGetVersionReply, error) {
240         out := new(ACLPluginGetVersionReply)
241         err := c.conn.Invoke(ctx, in, out)
242         if err != nil {
243                 return nil, err
244         }
245         return out, nil
246 }
247
248 func (c *serviceClient) ACLPluginUseHashLookupGet(ctx context.Context, in *ACLPluginUseHashLookupGet) (*ACLPluginUseHashLookupGetReply, error) {
249         out := new(ACLPluginUseHashLookupGetReply)
250         err := c.conn.Invoke(ctx, in, out)
251         if err != nil {
252                 return nil, err
253         }
254         return out, nil
255 }
256
257 func (c *serviceClient) ACLPluginUseHashLookupSet(ctx context.Context, in *ACLPluginUseHashLookupSet) (*ACLPluginUseHashLookupSetReply, error) {
258         out := new(ACLPluginUseHashLookupSetReply)
259         err := c.conn.Invoke(ctx, in, out)
260         if err != nil {
261                 return nil, err
262         }
263         return out, api.RetvalToVPPApiError(out.Retval)
264 }
265
266 func (c *serviceClient) ACLStatsIntfCountersEnable(ctx context.Context, in *ACLStatsIntfCountersEnable) (*ACLStatsIntfCountersEnableReply, error) {
267         out := new(ACLStatsIntfCountersEnableReply)
268         err := c.conn.Invoke(ctx, in, out)
269         if err != nil {
270                 return nil, err
271         }
272         return out, api.RetvalToVPPApiError(out.Retval)
273 }
274
275 func (c *serviceClient) MacipACLAdd(ctx context.Context, in *MacipACLAdd) (*MacipACLAddReply, error) {
276         out := new(MacipACLAddReply)
277         err := c.conn.Invoke(ctx, in, out)
278         if err != nil {
279                 return nil, err
280         }
281         return out, api.RetvalToVPPApiError(out.Retval)
282 }
283
284 func (c *serviceClient) MacipACLAddReplace(ctx context.Context, in *MacipACLAddReplace) (*MacipACLAddReplaceReply, error) {
285         out := new(MacipACLAddReplaceReply)
286         err := c.conn.Invoke(ctx, in, out)
287         if err != nil {
288                 return nil, err
289         }
290         return out, api.RetvalToVPPApiError(out.Retval)
291 }
292
293 func (c *serviceClient) MacipACLDel(ctx context.Context, in *MacipACLDel) (*MacipACLDelReply, error) {
294         out := new(MacipACLDelReply)
295         err := c.conn.Invoke(ctx, in, out)
296         if err != nil {
297                 return nil, err
298         }
299         return out, api.RetvalToVPPApiError(out.Retval)
300 }
301
302 func (c *serviceClient) MacipACLDump(ctx context.Context, in *MacipACLDump) (RPCService_MacipACLDumpClient, error) {
303         stream, err := c.conn.NewStream(ctx)
304         if err != nil {
305                 return nil, err
306         }
307         x := &serviceClient_MacipACLDumpClient{stream}
308         if err := x.Stream.SendMsg(in); err != nil {
309                 return nil, err
310         }
311         if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil {
312                 return nil, err
313         }
314         return x, nil
315 }
316
317 type RPCService_MacipACLDumpClient interface {
318         Recv() (*MacipACLDetails, error)
319         api.Stream
320 }
321
322 type serviceClient_MacipACLDumpClient struct {
323         api.Stream
324 }
325
326 func (c *serviceClient_MacipACLDumpClient) Recv() (*MacipACLDetails, error) {
327         msg, err := c.Stream.RecvMsg()
328         if err != nil {
329                 return nil, err
330         }
331         switch m := msg.(type) {
332         case *MacipACLDetails:
333                 return m, nil
334         case *memclnt.ControlPingReply:
335                 err = c.Stream.Close()
336                 if err != nil {
337                         return nil, err
338                 }
339                 return nil, io.EOF
340         default:
341                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
342         }
343 }
344
345 func (c *serviceClient) MacipACLInterfaceAddDel(ctx context.Context, in *MacipACLInterfaceAddDel) (*MacipACLInterfaceAddDelReply, error) {
346         out := new(MacipACLInterfaceAddDelReply)
347         err := c.conn.Invoke(ctx, in, out)
348         if err != nil {
349                 return nil, err
350         }
351         return out, api.RetvalToVPPApiError(out.Retval)
352 }
353
354 func (c *serviceClient) MacipACLInterfaceGet(ctx context.Context, in *MacipACLInterfaceGet) (*MacipACLInterfaceGetReply, error) {
355         out := new(MacipACLInterfaceGetReply)
356         err := c.conn.Invoke(ctx, in, out)
357         if err != nil {
358                 return nil, err
359         }
360         return out, nil
361 }
362
363 func (c *serviceClient) MacipACLInterfaceListDump(ctx context.Context, in *MacipACLInterfaceListDump) (RPCService_MacipACLInterfaceListDumpClient, error) {
364         stream, err := c.conn.NewStream(ctx)
365         if err != nil {
366                 return nil, err
367         }
368         x := &serviceClient_MacipACLInterfaceListDumpClient{stream}
369         if err := x.Stream.SendMsg(in); err != nil {
370                 return nil, err
371         }
372         if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil {
373                 return nil, err
374         }
375         return x, nil
376 }
377
378 type RPCService_MacipACLInterfaceListDumpClient interface {
379         Recv() (*MacipACLInterfaceListDetails, error)
380         api.Stream
381 }
382
383 type serviceClient_MacipACLInterfaceListDumpClient struct {
384         api.Stream
385 }
386
387 func (c *serviceClient_MacipACLInterfaceListDumpClient) Recv() (*MacipACLInterfaceListDetails, error) {
388         msg, err := c.Stream.RecvMsg()
389         if err != nil {
390                 return nil, err
391         }
392         switch m := msg.(type) {
393         case *MacipACLInterfaceListDetails:
394                 return m, nil
395         case *memclnt.ControlPingReply:
396                 err = c.Stream.Close()
397                 if err != nil {
398                         return nil, err
399                 }
400                 return nil, io.EOF
401         default:
402                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
403         }
404 }