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