e64c0b8fa71aaf90d831720856d7c59fae0c252e
[govpp.git] / binapi / l2 / l2_rpc.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2
3 package l2
4
5 import (
6         "context"
7         "fmt"
8         "io"
9
10         api "git.fd.io/govpp.git/api"
11         memclnt "git.fd.io/govpp.git/binapi/memclnt"
12 )
13
14 // RPCService defines RPC service l2.
15 type RPCService interface {
16         BdIPMacAddDel(ctx context.Context, in *BdIPMacAddDel) (*BdIPMacAddDelReply, error)
17         BdIPMacDump(ctx context.Context, in *BdIPMacDump) (RPCService_BdIPMacDumpClient, error)
18         BdIPMacFlush(ctx context.Context, in *BdIPMacFlush) (*BdIPMacFlushReply, error)
19         BridgeDomainAddDel(ctx context.Context, in *BridgeDomainAddDel) (*BridgeDomainAddDelReply, error)
20         BridgeDomainDump(ctx context.Context, in *BridgeDomainDump) (RPCService_BridgeDomainDumpClient, error)
21         BridgeDomainSetDefaultLearnLimit(ctx context.Context, in *BridgeDomainSetDefaultLearnLimit) (*BridgeDomainSetDefaultLearnLimitReply, error)
22         BridgeDomainSetLearnLimit(ctx context.Context, in *BridgeDomainSetLearnLimit) (*BridgeDomainSetLearnLimitReply, error)
23         BridgeDomainSetMacAge(ctx context.Context, in *BridgeDomainSetMacAge) (*BridgeDomainSetMacAgeReply, error)
24         BridgeFlags(ctx context.Context, in *BridgeFlags) (*BridgeFlagsReply, error)
25         BviCreate(ctx context.Context, in *BviCreate) (*BviCreateReply, error)
26         BviDelete(ctx context.Context, in *BviDelete) (*BviDeleteReply, error)
27         L2FibClearTable(ctx context.Context, in *L2FibClearTable) (*L2FibClearTableReply, error)
28         L2FibTableDump(ctx context.Context, in *L2FibTableDump) (RPCService_L2FibTableDumpClient, error)
29         L2Flags(ctx context.Context, in *L2Flags) (*L2FlagsReply, error)
30         L2InterfaceEfpFilter(ctx context.Context, in *L2InterfaceEfpFilter) (*L2InterfaceEfpFilterReply, error)
31         L2InterfacePbbTagRewrite(ctx context.Context, in *L2InterfacePbbTagRewrite) (*L2InterfacePbbTagRewriteReply, error)
32         L2InterfaceVlanTagRewrite(ctx context.Context, in *L2InterfaceVlanTagRewrite) (*L2InterfaceVlanTagRewriteReply, error)
33         L2PatchAddDel(ctx context.Context, in *L2PatchAddDel) (*L2PatchAddDelReply, error)
34         L2XconnectDump(ctx context.Context, in *L2XconnectDump) (RPCService_L2XconnectDumpClient, error)
35         L2fibAddDel(ctx context.Context, in *L2fibAddDel) (*L2fibAddDelReply, error)
36         L2fibFlushAll(ctx context.Context, in *L2fibFlushAll) (*L2fibFlushAllReply, error)
37         L2fibFlushBd(ctx context.Context, in *L2fibFlushBd) (*L2fibFlushBdReply, error)
38         L2fibFlushInt(ctx context.Context, in *L2fibFlushInt) (*L2fibFlushIntReply, error)
39         L2fibSetScanDelay(ctx context.Context, in *L2fibSetScanDelay) (*L2fibSetScanDelayReply, error)
40         SwInterfaceSetL2Bridge(ctx context.Context, in *SwInterfaceSetL2Bridge) (*SwInterfaceSetL2BridgeReply, error)
41         SwInterfaceSetL2Xconnect(ctx context.Context, in *SwInterfaceSetL2Xconnect) (*SwInterfaceSetL2XconnectReply, error)
42         SwInterfaceSetVpath(ctx context.Context, in *SwInterfaceSetVpath) (*SwInterfaceSetVpathReply, error)
43         WantL2ArpTermEvents(ctx context.Context, in *WantL2ArpTermEvents) (*WantL2ArpTermEventsReply, error)
44         WantL2MacsEvents(ctx context.Context, in *WantL2MacsEvents) (*WantL2MacsEventsReply, error)
45         WantL2MacsEvents2(ctx context.Context, in *WantL2MacsEvents2) (*WantL2MacsEvents2Reply, error)
46 }
47
48 type serviceClient struct {
49         conn api.Connection
50 }
51
52 func NewServiceClient(conn api.Connection) RPCService {
53         return &serviceClient{conn}
54 }
55
56 func (c *serviceClient) BdIPMacAddDel(ctx context.Context, in *BdIPMacAddDel) (*BdIPMacAddDelReply, error) {
57         out := new(BdIPMacAddDelReply)
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) BdIPMacDump(ctx context.Context, in *BdIPMacDump) (RPCService_BdIPMacDumpClient, error) {
66         stream, err := c.conn.NewStream(ctx)
67         if err != nil {
68                 return nil, err
69         }
70         x := &serviceClient_BdIPMacDumpClient{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_BdIPMacDumpClient interface {
81         Recv() (*BdIPMacDetails, error)
82         api.Stream
83 }
84
85 type serviceClient_BdIPMacDumpClient struct {
86         api.Stream
87 }
88
89 func (c *serviceClient_BdIPMacDumpClient) Recv() (*BdIPMacDetails, error) {
90         msg, err := c.Stream.RecvMsg()
91         if err != nil {
92                 return nil, err
93         }
94         switch m := msg.(type) {
95         case *BdIPMacDetails:
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) BdIPMacFlush(ctx context.Context, in *BdIPMacFlush) (*BdIPMacFlushReply, error) {
109         out := new(BdIPMacFlushReply)
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) BridgeDomainAddDel(ctx context.Context, in *BridgeDomainAddDel) (*BridgeDomainAddDelReply, error) {
118         out := new(BridgeDomainAddDelReply)
119         err := c.conn.Invoke(ctx, in, out)
120         if err != nil {
121                 return nil, err
122         }
123         return out, api.RetvalToVPPApiError(out.Retval)
124 }
125
126 func (c *serviceClient) BridgeDomainDump(ctx context.Context, in *BridgeDomainDump) (RPCService_BridgeDomainDumpClient, error) {
127         stream, err := c.conn.NewStream(ctx)
128         if err != nil {
129                 return nil, err
130         }
131         x := &serviceClient_BridgeDomainDumpClient{stream}
132         if err := x.Stream.SendMsg(in); err != nil {
133                 return nil, err
134         }
135         if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil {
136                 return nil, err
137         }
138         return x, nil
139 }
140
141 type RPCService_BridgeDomainDumpClient interface {
142         Recv() (*BridgeDomainDetails, error)
143         api.Stream
144 }
145
146 type serviceClient_BridgeDomainDumpClient struct {
147         api.Stream
148 }
149
150 func (c *serviceClient_BridgeDomainDumpClient) Recv() (*BridgeDomainDetails, error) {
151         msg, err := c.Stream.RecvMsg()
152         if err != nil {
153                 return nil, err
154         }
155         switch m := msg.(type) {
156         case *BridgeDomainDetails:
157                 return m, nil
158         case *memclnt.ControlPingReply:
159                 err = c.Stream.Close()
160                 if err != nil {
161                         return nil, err
162                 }
163                 return nil, io.EOF
164         default:
165                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
166         }
167 }
168
169 func (c *serviceClient) BridgeDomainSetDefaultLearnLimit(ctx context.Context, in *BridgeDomainSetDefaultLearnLimit) (*BridgeDomainSetDefaultLearnLimitReply, error) {
170         out := new(BridgeDomainSetDefaultLearnLimitReply)
171         err := c.conn.Invoke(ctx, in, out)
172         if err != nil {
173                 return nil, err
174         }
175         return out, api.RetvalToVPPApiError(out.Retval)
176 }
177
178 func (c *serviceClient) BridgeDomainSetLearnLimit(ctx context.Context, in *BridgeDomainSetLearnLimit) (*BridgeDomainSetLearnLimitReply, error) {
179         out := new(BridgeDomainSetLearnLimitReply)
180         err := c.conn.Invoke(ctx, in, out)
181         if err != nil {
182                 return nil, err
183         }
184         return out, api.RetvalToVPPApiError(out.Retval)
185 }
186
187 func (c *serviceClient) BridgeDomainSetMacAge(ctx context.Context, in *BridgeDomainSetMacAge) (*BridgeDomainSetMacAgeReply, error) {
188         out := new(BridgeDomainSetMacAgeReply)
189         err := c.conn.Invoke(ctx, in, out)
190         if err != nil {
191                 return nil, err
192         }
193         return out, api.RetvalToVPPApiError(out.Retval)
194 }
195
196 func (c *serviceClient) BridgeFlags(ctx context.Context, in *BridgeFlags) (*BridgeFlagsReply, error) {
197         out := new(BridgeFlagsReply)
198         err := c.conn.Invoke(ctx, in, out)
199         if err != nil {
200                 return nil, err
201         }
202         return out, api.RetvalToVPPApiError(out.Retval)
203 }
204
205 func (c *serviceClient) BviCreate(ctx context.Context, in *BviCreate) (*BviCreateReply, error) {
206         out := new(BviCreateReply)
207         err := c.conn.Invoke(ctx, in, out)
208         if err != nil {
209                 return nil, err
210         }
211         return out, api.RetvalToVPPApiError(out.Retval)
212 }
213
214 func (c *serviceClient) BviDelete(ctx context.Context, in *BviDelete) (*BviDeleteReply, error) {
215         out := new(BviDeleteReply)
216         err := c.conn.Invoke(ctx, in, out)
217         if err != nil {
218                 return nil, err
219         }
220         return out, api.RetvalToVPPApiError(out.Retval)
221 }
222
223 func (c *serviceClient) L2FibClearTable(ctx context.Context, in *L2FibClearTable) (*L2FibClearTableReply, error) {
224         out := new(L2FibClearTableReply)
225         err := c.conn.Invoke(ctx, in, out)
226         if err != nil {
227                 return nil, err
228         }
229         return out, api.RetvalToVPPApiError(out.Retval)
230 }
231
232 func (c *serviceClient) L2FibTableDump(ctx context.Context, in *L2FibTableDump) (RPCService_L2FibTableDumpClient, error) {
233         stream, err := c.conn.NewStream(ctx)
234         if err != nil {
235                 return nil, err
236         }
237         x := &serviceClient_L2FibTableDumpClient{stream}
238         if err := x.Stream.SendMsg(in); err != nil {
239                 return nil, err
240         }
241         if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil {
242                 return nil, err
243         }
244         return x, nil
245 }
246
247 type RPCService_L2FibTableDumpClient interface {
248         Recv() (*L2FibTableDetails, error)
249         api.Stream
250 }
251
252 type serviceClient_L2FibTableDumpClient struct {
253         api.Stream
254 }
255
256 func (c *serviceClient_L2FibTableDumpClient) Recv() (*L2FibTableDetails, error) {
257         msg, err := c.Stream.RecvMsg()
258         if err != nil {
259                 return nil, err
260         }
261         switch m := msg.(type) {
262         case *L2FibTableDetails:
263                 return m, nil
264         case *memclnt.ControlPingReply:
265                 err = c.Stream.Close()
266                 if err != nil {
267                         return nil, err
268                 }
269                 return nil, io.EOF
270         default:
271                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
272         }
273 }
274
275 func (c *serviceClient) L2Flags(ctx context.Context, in *L2Flags) (*L2FlagsReply, error) {
276         out := new(L2FlagsReply)
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) L2InterfaceEfpFilter(ctx context.Context, in *L2InterfaceEfpFilter) (*L2InterfaceEfpFilterReply, error) {
285         out := new(L2InterfaceEfpFilterReply)
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) L2InterfacePbbTagRewrite(ctx context.Context, in *L2InterfacePbbTagRewrite) (*L2InterfacePbbTagRewriteReply, error) {
294         out := new(L2InterfacePbbTagRewriteReply)
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) L2InterfaceVlanTagRewrite(ctx context.Context, in *L2InterfaceVlanTagRewrite) (*L2InterfaceVlanTagRewriteReply, error) {
303         out := new(L2InterfaceVlanTagRewriteReply)
304         err := c.conn.Invoke(ctx, in, out)
305         if err != nil {
306                 return nil, err
307         }
308         return out, api.RetvalToVPPApiError(out.Retval)
309 }
310
311 func (c *serviceClient) L2PatchAddDel(ctx context.Context, in *L2PatchAddDel) (*L2PatchAddDelReply, error) {
312         out := new(L2PatchAddDelReply)
313         err := c.conn.Invoke(ctx, in, out)
314         if err != nil {
315                 return nil, err
316         }
317         return out, api.RetvalToVPPApiError(out.Retval)
318 }
319
320 func (c *serviceClient) L2XconnectDump(ctx context.Context, in *L2XconnectDump) (RPCService_L2XconnectDumpClient, error) {
321         stream, err := c.conn.NewStream(ctx)
322         if err != nil {
323                 return nil, err
324         }
325         x := &serviceClient_L2XconnectDumpClient{stream}
326         if err := x.Stream.SendMsg(in); err != nil {
327                 return nil, err
328         }
329         if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil {
330                 return nil, err
331         }
332         return x, nil
333 }
334
335 type RPCService_L2XconnectDumpClient interface {
336         Recv() (*L2XconnectDetails, error)
337         api.Stream
338 }
339
340 type serviceClient_L2XconnectDumpClient struct {
341         api.Stream
342 }
343
344 func (c *serviceClient_L2XconnectDumpClient) Recv() (*L2XconnectDetails, error) {
345         msg, err := c.Stream.RecvMsg()
346         if err != nil {
347                 return nil, err
348         }
349         switch m := msg.(type) {
350         case *L2XconnectDetails:
351                 return m, nil
352         case *memclnt.ControlPingReply:
353                 err = c.Stream.Close()
354                 if err != nil {
355                         return nil, err
356                 }
357                 return nil, io.EOF
358         default:
359                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
360         }
361 }
362
363 func (c *serviceClient) L2fibAddDel(ctx context.Context, in *L2fibAddDel) (*L2fibAddDelReply, error) {
364         out := new(L2fibAddDelReply)
365         err := c.conn.Invoke(ctx, in, out)
366         if err != nil {
367                 return nil, err
368         }
369         return out, api.RetvalToVPPApiError(out.Retval)
370 }
371
372 func (c *serviceClient) L2fibFlushAll(ctx context.Context, in *L2fibFlushAll) (*L2fibFlushAllReply, error) {
373         out := new(L2fibFlushAllReply)
374         err := c.conn.Invoke(ctx, in, out)
375         if err != nil {
376                 return nil, err
377         }
378         return out, api.RetvalToVPPApiError(out.Retval)
379 }
380
381 func (c *serviceClient) L2fibFlushBd(ctx context.Context, in *L2fibFlushBd) (*L2fibFlushBdReply, error) {
382         out := new(L2fibFlushBdReply)
383         err := c.conn.Invoke(ctx, in, out)
384         if err != nil {
385                 return nil, err
386         }
387         return out, api.RetvalToVPPApiError(out.Retval)
388 }
389
390 func (c *serviceClient) L2fibFlushInt(ctx context.Context, in *L2fibFlushInt) (*L2fibFlushIntReply, error) {
391         out := new(L2fibFlushIntReply)
392         err := c.conn.Invoke(ctx, in, out)
393         if err != nil {
394                 return nil, err
395         }
396         return out, api.RetvalToVPPApiError(out.Retval)
397 }
398
399 func (c *serviceClient) L2fibSetScanDelay(ctx context.Context, in *L2fibSetScanDelay) (*L2fibSetScanDelayReply, error) {
400         out := new(L2fibSetScanDelayReply)
401         err := c.conn.Invoke(ctx, in, out)
402         if err != nil {
403                 return nil, err
404         }
405         return out, api.RetvalToVPPApiError(out.Retval)
406 }
407
408 func (c *serviceClient) SwInterfaceSetL2Bridge(ctx context.Context, in *SwInterfaceSetL2Bridge) (*SwInterfaceSetL2BridgeReply, error) {
409         out := new(SwInterfaceSetL2BridgeReply)
410         err := c.conn.Invoke(ctx, in, out)
411         if err != nil {
412                 return nil, err
413         }
414         return out, api.RetvalToVPPApiError(out.Retval)
415 }
416
417 func (c *serviceClient) SwInterfaceSetL2Xconnect(ctx context.Context, in *SwInterfaceSetL2Xconnect) (*SwInterfaceSetL2XconnectReply, error) {
418         out := new(SwInterfaceSetL2XconnectReply)
419         err := c.conn.Invoke(ctx, in, out)
420         if err != nil {
421                 return nil, err
422         }
423         return out, api.RetvalToVPPApiError(out.Retval)
424 }
425
426 func (c *serviceClient) SwInterfaceSetVpath(ctx context.Context, in *SwInterfaceSetVpath) (*SwInterfaceSetVpathReply, error) {
427         out := new(SwInterfaceSetVpathReply)
428         err := c.conn.Invoke(ctx, in, out)
429         if err != nil {
430                 return nil, err
431         }
432         return out, api.RetvalToVPPApiError(out.Retval)
433 }
434
435 func (c *serviceClient) WantL2ArpTermEvents(ctx context.Context, in *WantL2ArpTermEvents) (*WantL2ArpTermEventsReply, error) {
436         out := new(WantL2ArpTermEventsReply)
437         err := c.conn.Invoke(ctx, in, out)
438         if err != nil {
439                 return nil, err
440         }
441         return out, api.RetvalToVPPApiError(out.Retval)
442 }
443
444 func (c *serviceClient) WantL2MacsEvents(ctx context.Context, in *WantL2MacsEvents) (*WantL2MacsEventsReply, error) {
445         out := new(WantL2MacsEventsReply)
446         err := c.conn.Invoke(ctx, in, out)
447         if err != nil {
448                 return nil, err
449         }
450         return out, api.RetvalToVPPApiError(out.Retval)
451 }
452
453 func (c *serviceClient) WantL2MacsEvents2(ctx context.Context, in *WantL2MacsEvents2) (*WantL2MacsEvents2Reply, error) {
454         out := new(WantL2MacsEvents2Reply)
455         err := c.conn.Invoke(ctx, in, out)
456         if err != nil {
457                 return nil, err
458         }
459         return out, api.RetvalToVPPApiError(out.Retval)
460 }