fa2b72b2f5b9a5c810c45a8f415c5a967ebffd2a
[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         vpe "git.fd.io/govpp.git/binapi/vpe"
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(&vpe.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 *vpe.ControlPingReply:
98                 return nil, io.EOF
99         default:
100                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
101         }
102 }
103
104 func (c *serviceClient) BdIPMacFlush(ctx context.Context, in *BdIPMacFlush) (*BdIPMacFlushReply, error) {
105         out := new(BdIPMacFlushReply)
106         err := c.conn.Invoke(ctx, in, out)
107         if err != nil {
108                 return nil, err
109         }
110         return out, api.RetvalToVPPApiError(out.Retval)
111 }
112
113 func (c *serviceClient) BridgeDomainAddDel(ctx context.Context, in *BridgeDomainAddDel) (*BridgeDomainAddDelReply, error) {
114         out := new(BridgeDomainAddDelReply)
115         err := c.conn.Invoke(ctx, in, out)
116         if err != nil {
117                 return nil, err
118         }
119         return out, api.RetvalToVPPApiError(out.Retval)
120 }
121
122 func (c *serviceClient) BridgeDomainDump(ctx context.Context, in *BridgeDomainDump) (RPCService_BridgeDomainDumpClient, error) {
123         stream, err := c.conn.NewStream(ctx)
124         if err != nil {
125                 return nil, err
126         }
127         x := &serviceClient_BridgeDomainDumpClient{stream}
128         if err := x.Stream.SendMsg(in); err != nil {
129                 return nil, err
130         }
131         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
132                 return nil, err
133         }
134         return x, nil
135 }
136
137 type RPCService_BridgeDomainDumpClient interface {
138         Recv() (*BridgeDomainDetails, error)
139         api.Stream
140 }
141
142 type serviceClient_BridgeDomainDumpClient struct {
143         api.Stream
144 }
145
146 func (c *serviceClient_BridgeDomainDumpClient) Recv() (*BridgeDomainDetails, error) {
147         msg, err := c.Stream.RecvMsg()
148         if err != nil {
149                 return nil, err
150         }
151         switch m := msg.(type) {
152         case *BridgeDomainDetails:
153                 return m, nil
154         case *vpe.ControlPingReply:
155                 return nil, io.EOF
156         default:
157                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
158         }
159 }
160
161 func (c *serviceClient) BridgeDomainSetDefaultLearnLimit(ctx context.Context, in *BridgeDomainSetDefaultLearnLimit) (*BridgeDomainSetDefaultLearnLimitReply, error) {
162         out := new(BridgeDomainSetDefaultLearnLimitReply)
163         err := c.conn.Invoke(ctx, in, out)
164         if err != nil {
165                 return nil, err
166         }
167         return out, api.RetvalToVPPApiError(out.Retval)
168 }
169
170 func (c *serviceClient) BridgeDomainSetLearnLimit(ctx context.Context, in *BridgeDomainSetLearnLimit) (*BridgeDomainSetLearnLimitReply, error) {
171         out := new(BridgeDomainSetLearnLimitReply)
172         err := c.conn.Invoke(ctx, in, out)
173         if err != nil {
174                 return nil, err
175         }
176         return out, api.RetvalToVPPApiError(out.Retval)
177 }
178
179 func (c *serviceClient) BridgeDomainSetMacAge(ctx context.Context, in *BridgeDomainSetMacAge) (*BridgeDomainSetMacAgeReply, error) {
180         out := new(BridgeDomainSetMacAgeReply)
181         err := c.conn.Invoke(ctx, in, out)
182         if err != nil {
183                 return nil, err
184         }
185         return out, api.RetvalToVPPApiError(out.Retval)
186 }
187
188 func (c *serviceClient) BridgeFlags(ctx context.Context, in *BridgeFlags) (*BridgeFlagsReply, error) {
189         out := new(BridgeFlagsReply)
190         err := c.conn.Invoke(ctx, in, out)
191         if err != nil {
192                 return nil, err
193         }
194         return out, api.RetvalToVPPApiError(out.Retval)
195 }
196
197 func (c *serviceClient) BviCreate(ctx context.Context, in *BviCreate) (*BviCreateReply, error) {
198         out := new(BviCreateReply)
199         err := c.conn.Invoke(ctx, in, out)
200         if err != nil {
201                 return nil, err
202         }
203         return out, api.RetvalToVPPApiError(out.Retval)
204 }
205
206 func (c *serviceClient) BviDelete(ctx context.Context, in *BviDelete) (*BviDeleteReply, error) {
207         out := new(BviDeleteReply)
208         err := c.conn.Invoke(ctx, in, out)
209         if err != nil {
210                 return nil, err
211         }
212         return out, api.RetvalToVPPApiError(out.Retval)
213 }
214
215 func (c *serviceClient) L2FibClearTable(ctx context.Context, in *L2FibClearTable) (*L2FibClearTableReply, error) {
216         out := new(L2FibClearTableReply)
217         err := c.conn.Invoke(ctx, in, out)
218         if err != nil {
219                 return nil, err
220         }
221         return out, api.RetvalToVPPApiError(out.Retval)
222 }
223
224 func (c *serviceClient) L2FibTableDump(ctx context.Context, in *L2FibTableDump) (RPCService_L2FibTableDumpClient, error) {
225         stream, err := c.conn.NewStream(ctx)
226         if err != nil {
227                 return nil, err
228         }
229         x := &serviceClient_L2FibTableDumpClient{stream}
230         if err := x.Stream.SendMsg(in); err != nil {
231                 return nil, err
232         }
233         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
234                 return nil, err
235         }
236         return x, nil
237 }
238
239 type RPCService_L2FibTableDumpClient interface {
240         Recv() (*L2FibTableDetails, error)
241         api.Stream
242 }
243
244 type serviceClient_L2FibTableDumpClient struct {
245         api.Stream
246 }
247
248 func (c *serviceClient_L2FibTableDumpClient) Recv() (*L2FibTableDetails, error) {
249         msg, err := c.Stream.RecvMsg()
250         if err != nil {
251                 return nil, err
252         }
253         switch m := msg.(type) {
254         case *L2FibTableDetails:
255                 return m, nil
256         case *vpe.ControlPingReply:
257                 return nil, io.EOF
258         default:
259                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
260         }
261 }
262
263 func (c *serviceClient) L2Flags(ctx context.Context, in *L2Flags) (*L2FlagsReply, error) {
264         out := new(L2FlagsReply)
265         err := c.conn.Invoke(ctx, in, out)
266         if err != nil {
267                 return nil, err
268         }
269         return out, api.RetvalToVPPApiError(out.Retval)
270 }
271
272 func (c *serviceClient) L2InterfaceEfpFilter(ctx context.Context, in *L2InterfaceEfpFilter) (*L2InterfaceEfpFilterReply, error) {
273         out := new(L2InterfaceEfpFilterReply)
274         err := c.conn.Invoke(ctx, in, out)
275         if err != nil {
276                 return nil, err
277         }
278         return out, api.RetvalToVPPApiError(out.Retval)
279 }
280
281 func (c *serviceClient) L2InterfacePbbTagRewrite(ctx context.Context, in *L2InterfacePbbTagRewrite) (*L2InterfacePbbTagRewriteReply, error) {
282         out := new(L2InterfacePbbTagRewriteReply)
283         err := c.conn.Invoke(ctx, in, out)
284         if err != nil {
285                 return nil, err
286         }
287         return out, api.RetvalToVPPApiError(out.Retval)
288 }
289
290 func (c *serviceClient) L2InterfaceVlanTagRewrite(ctx context.Context, in *L2InterfaceVlanTagRewrite) (*L2InterfaceVlanTagRewriteReply, error) {
291         out := new(L2InterfaceVlanTagRewriteReply)
292         err := c.conn.Invoke(ctx, in, out)
293         if err != nil {
294                 return nil, err
295         }
296         return out, api.RetvalToVPPApiError(out.Retval)
297 }
298
299 func (c *serviceClient) L2PatchAddDel(ctx context.Context, in *L2PatchAddDel) (*L2PatchAddDelReply, error) {
300         out := new(L2PatchAddDelReply)
301         err := c.conn.Invoke(ctx, in, out)
302         if err != nil {
303                 return nil, err
304         }
305         return out, api.RetvalToVPPApiError(out.Retval)
306 }
307
308 func (c *serviceClient) L2XconnectDump(ctx context.Context, in *L2XconnectDump) (RPCService_L2XconnectDumpClient, error) {
309         stream, err := c.conn.NewStream(ctx)
310         if err != nil {
311                 return nil, err
312         }
313         x := &serviceClient_L2XconnectDumpClient{stream}
314         if err := x.Stream.SendMsg(in); err != nil {
315                 return nil, err
316         }
317         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
318                 return nil, err
319         }
320         return x, nil
321 }
322
323 type RPCService_L2XconnectDumpClient interface {
324         Recv() (*L2XconnectDetails, error)
325         api.Stream
326 }
327
328 type serviceClient_L2XconnectDumpClient struct {
329         api.Stream
330 }
331
332 func (c *serviceClient_L2XconnectDumpClient) Recv() (*L2XconnectDetails, error) {
333         msg, err := c.Stream.RecvMsg()
334         if err != nil {
335                 return nil, err
336         }
337         switch m := msg.(type) {
338         case *L2XconnectDetails:
339                 return m, nil
340         case *vpe.ControlPingReply:
341                 return nil, io.EOF
342         default:
343                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
344         }
345 }
346
347 func (c *serviceClient) L2fibAddDel(ctx context.Context, in *L2fibAddDel) (*L2fibAddDelReply, error) {
348         out := new(L2fibAddDelReply)
349         err := c.conn.Invoke(ctx, in, out)
350         if err != nil {
351                 return nil, err
352         }
353         return out, api.RetvalToVPPApiError(out.Retval)
354 }
355
356 func (c *serviceClient) L2fibFlushAll(ctx context.Context, in *L2fibFlushAll) (*L2fibFlushAllReply, error) {
357         out := new(L2fibFlushAllReply)
358         err := c.conn.Invoke(ctx, in, out)
359         if err != nil {
360                 return nil, err
361         }
362         return out, api.RetvalToVPPApiError(out.Retval)
363 }
364
365 func (c *serviceClient) L2fibFlushBd(ctx context.Context, in *L2fibFlushBd) (*L2fibFlushBdReply, error) {
366         out := new(L2fibFlushBdReply)
367         err := c.conn.Invoke(ctx, in, out)
368         if err != nil {
369                 return nil, err
370         }
371         return out, api.RetvalToVPPApiError(out.Retval)
372 }
373
374 func (c *serviceClient) L2fibFlushInt(ctx context.Context, in *L2fibFlushInt) (*L2fibFlushIntReply, error) {
375         out := new(L2fibFlushIntReply)
376         err := c.conn.Invoke(ctx, in, out)
377         if err != nil {
378                 return nil, err
379         }
380         return out, api.RetvalToVPPApiError(out.Retval)
381 }
382
383 func (c *serviceClient) L2fibSetScanDelay(ctx context.Context, in *L2fibSetScanDelay) (*L2fibSetScanDelayReply, error) {
384         out := new(L2fibSetScanDelayReply)
385         err := c.conn.Invoke(ctx, in, out)
386         if err != nil {
387                 return nil, err
388         }
389         return out, api.RetvalToVPPApiError(out.Retval)
390 }
391
392 func (c *serviceClient) SwInterfaceSetL2Bridge(ctx context.Context, in *SwInterfaceSetL2Bridge) (*SwInterfaceSetL2BridgeReply, error) {
393         out := new(SwInterfaceSetL2BridgeReply)
394         err := c.conn.Invoke(ctx, in, out)
395         if err != nil {
396                 return nil, err
397         }
398         return out, api.RetvalToVPPApiError(out.Retval)
399 }
400
401 func (c *serviceClient) SwInterfaceSetL2Xconnect(ctx context.Context, in *SwInterfaceSetL2Xconnect) (*SwInterfaceSetL2XconnectReply, error) {
402         out := new(SwInterfaceSetL2XconnectReply)
403         err := c.conn.Invoke(ctx, in, out)
404         if err != nil {
405                 return nil, err
406         }
407         return out, api.RetvalToVPPApiError(out.Retval)
408 }
409
410 func (c *serviceClient) SwInterfaceSetVpath(ctx context.Context, in *SwInterfaceSetVpath) (*SwInterfaceSetVpathReply, error) {
411         out := new(SwInterfaceSetVpathReply)
412         err := c.conn.Invoke(ctx, in, out)
413         if err != nil {
414                 return nil, err
415         }
416         return out, api.RetvalToVPPApiError(out.Retval)
417 }
418
419 func (c *serviceClient) WantL2ArpTermEvents(ctx context.Context, in *WantL2ArpTermEvents) (*WantL2ArpTermEventsReply, error) {
420         out := new(WantL2ArpTermEventsReply)
421         err := c.conn.Invoke(ctx, in, out)
422         if err != nil {
423                 return nil, err
424         }
425         return out, api.RetvalToVPPApiError(out.Retval)
426 }
427
428 func (c *serviceClient) WantL2MacsEvents(ctx context.Context, in *WantL2MacsEvents) (*WantL2MacsEventsReply, error) {
429         out := new(WantL2MacsEventsReply)
430         err := c.conn.Invoke(ctx, in, out)
431         if err != nil {
432                 return nil, err
433         }
434         return out, api.RetvalToVPPApiError(out.Retval)
435 }
436
437 func (c *serviceClient) WantL2MacsEvents2(ctx context.Context, in *WantL2MacsEvents2) (*WantL2MacsEvents2Reply, error) {
438         out := new(WantL2MacsEvents2Reply)
439         err := c.conn.Invoke(ctx, in, out)
440         if err != nil {
441                 return nil, err
442         }
443         return out, api.RetvalToVPPApiError(out.Retval)
444 }