Update generated binapi to v22.02 & makefile changes
[govpp.git] / internal / testbinapi / binapi2001 / 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/internal/testbinapi/binapi2001/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         BridgeDomainSetMacAge(ctx context.Context, in *BridgeDomainSetMacAge) (*BridgeDomainSetMacAgeReply, error)
22         BridgeFlags(ctx context.Context, in *BridgeFlags) (*BridgeFlagsReply, error)
23         BviCreate(ctx context.Context, in *BviCreate) (*BviCreateReply, error)
24         BviDelete(ctx context.Context, in *BviDelete) (*BviDeleteReply, error)
25         L2FibClearTable(ctx context.Context, in *L2FibClearTable) (*L2FibClearTableReply, error)
26         L2FibTableDump(ctx context.Context, in *L2FibTableDump) (RPCService_L2FibTableDumpClient, error)
27         L2Flags(ctx context.Context, in *L2Flags) (*L2FlagsReply, error)
28         L2InterfaceEfpFilter(ctx context.Context, in *L2InterfaceEfpFilter) (*L2InterfaceEfpFilterReply, error)
29         L2InterfacePbbTagRewrite(ctx context.Context, in *L2InterfacePbbTagRewrite) (*L2InterfacePbbTagRewriteReply, error)
30         L2InterfaceVlanTagRewrite(ctx context.Context, in *L2InterfaceVlanTagRewrite) (*L2InterfaceVlanTagRewriteReply, error)
31         L2PatchAddDel(ctx context.Context, in *L2PatchAddDel) (*L2PatchAddDelReply, error)
32         L2XconnectDump(ctx context.Context, in *L2XconnectDump) (RPCService_L2XconnectDumpClient, error)
33         L2fibAddDel(ctx context.Context, in *L2fibAddDel) (*L2fibAddDelReply, error)
34         L2fibFlushAll(ctx context.Context, in *L2fibFlushAll) (*L2fibFlushAllReply, error)
35         L2fibFlushBd(ctx context.Context, in *L2fibFlushBd) (*L2fibFlushBdReply, error)
36         L2fibFlushInt(ctx context.Context, in *L2fibFlushInt) (*L2fibFlushIntReply, error)
37         SwInterfaceSetL2Bridge(ctx context.Context, in *SwInterfaceSetL2Bridge) (*SwInterfaceSetL2BridgeReply, error)
38         SwInterfaceSetL2Xconnect(ctx context.Context, in *SwInterfaceSetL2Xconnect) (*SwInterfaceSetL2XconnectReply, error)
39         SwInterfaceSetVpath(ctx context.Context, in *SwInterfaceSetVpath) (*SwInterfaceSetVpathReply, error)
40         WantL2ArpTermEvents(ctx context.Context, in *WantL2ArpTermEvents) (*WantL2ArpTermEventsReply, error)
41         WantL2MacsEvents(ctx context.Context, in *WantL2MacsEvents) (*WantL2MacsEventsReply, error)
42 }
43
44 type serviceClient struct {
45         conn api.Connection
46 }
47
48 func NewServiceClient(conn api.Connection) RPCService {
49         return &serviceClient{conn}
50 }
51
52 func (c *serviceClient) BdIPMacAddDel(ctx context.Context, in *BdIPMacAddDel) (*BdIPMacAddDelReply, error) {
53         out := new(BdIPMacAddDelReply)
54         err := c.conn.Invoke(ctx, in, out)
55         if err != nil {
56                 return nil, err
57         }
58         return out, api.RetvalToVPPApiError(out.Retval)
59 }
60
61 func (c *serviceClient) BdIPMacDump(ctx context.Context, in *BdIPMacDump) (RPCService_BdIPMacDumpClient, error) {
62         stream, err := c.conn.NewStream(ctx)
63         if err != nil {
64                 return nil, err
65         }
66         x := &serviceClient_BdIPMacDumpClient{stream}
67         if err := x.Stream.SendMsg(in); err != nil {
68                 return nil, err
69         }
70         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
71                 return nil, err
72         }
73         return x, nil
74 }
75
76 type RPCService_BdIPMacDumpClient interface {
77         Recv() (*BdIPMacDetails, error)
78         api.Stream
79 }
80
81 type serviceClient_BdIPMacDumpClient struct {
82         api.Stream
83 }
84
85 func (c *serviceClient_BdIPMacDumpClient) Recv() (*BdIPMacDetails, error) {
86         msg, err := c.Stream.RecvMsg()
87         if err != nil {
88                 return nil, err
89         }
90         switch m := msg.(type) {
91         case *BdIPMacDetails:
92                 return m, nil
93         case *vpe.ControlPingReply:
94                 err = c.Stream.Close()
95                 if err != nil {
96                         return nil, err
97                 }
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                 err = c.Stream.Close()
156                 if err != nil {
157                         return nil, err
158                 }
159                 return nil, io.EOF
160         default:
161                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
162         }
163 }
164
165 func (c *serviceClient) BridgeDomainSetMacAge(ctx context.Context, in *BridgeDomainSetMacAge) (*BridgeDomainSetMacAgeReply, error) {
166         out := new(BridgeDomainSetMacAgeReply)
167         err := c.conn.Invoke(ctx, in, out)
168         if err != nil {
169                 return nil, err
170         }
171         return out, api.RetvalToVPPApiError(out.Retval)
172 }
173
174 func (c *serviceClient) BridgeFlags(ctx context.Context, in *BridgeFlags) (*BridgeFlagsReply, error) {
175         out := new(BridgeFlagsReply)
176         err := c.conn.Invoke(ctx, in, out)
177         if err != nil {
178                 return nil, err
179         }
180         return out, api.RetvalToVPPApiError(out.Retval)
181 }
182
183 func (c *serviceClient) BviCreate(ctx context.Context, in *BviCreate) (*BviCreateReply, error) {
184         out := new(BviCreateReply)
185         err := c.conn.Invoke(ctx, in, out)
186         if err != nil {
187                 return nil, err
188         }
189         return out, api.RetvalToVPPApiError(out.Retval)
190 }
191
192 func (c *serviceClient) BviDelete(ctx context.Context, in *BviDelete) (*BviDeleteReply, error) {
193         out := new(BviDeleteReply)
194         err := c.conn.Invoke(ctx, in, out)
195         if err != nil {
196                 return nil, err
197         }
198         return out, api.RetvalToVPPApiError(out.Retval)
199 }
200
201 func (c *serviceClient) L2FibClearTable(ctx context.Context, in *L2FibClearTable) (*L2FibClearTableReply, error) {
202         out := new(L2FibClearTableReply)
203         err := c.conn.Invoke(ctx, in, out)
204         if err != nil {
205                 return nil, err
206         }
207         return out, api.RetvalToVPPApiError(out.Retval)
208 }
209
210 func (c *serviceClient) L2FibTableDump(ctx context.Context, in *L2FibTableDump) (RPCService_L2FibTableDumpClient, error) {
211         stream, err := c.conn.NewStream(ctx)
212         if err != nil {
213                 return nil, err
214         }
215         x := &serviceClient_L2FibTableDumpClient{stream}
216         if err := x.Stream.SendMsg(in); err != nil {
217                 return nil, err
218         }
219         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
220                 return nil, err
221         }
222         return x, nil
223 }
224
225 type RPCService_L2FibTableDumpClient interface {
226         Recv() (*L2FibTableDetails, error)
227         api.Stream
228 }
229
230 type serviceClient_L2FibTableDumpClient struct {
231         api.Stream
232 }
233
234 func (c *serviceClient_L2FibTableDumpClient) Recv() (*L2FibTableDetails, error) {
235         msg, err := c.Stream.RecvMsg()
236         if err != nil {
237                 return nil, err
238         }
239         switch m := msg.(type) {
240         case *L2FibTableDetails:
241                 return m, nil
242         case *vpe.ControlPingReply:
243                 err = c.Stream.Close()
244                 if err != nil {
245                         return nil, err
246                 }
247                 return nil, io.EOF
248         default:
249                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
250         }
251 }
252
253 func (c *serviceClient) L2Flags(ctx context.Context, in *L2Flags) (*L2FlagsReply, error) {
254         out := new(L2FlagsReply)
255         err := c.conn.Invoke(ctx, in, out)
256         if err != nil {
257                 return nil, err
258         }
259         return out, api.RetvalToVPPApiError(out.Retval)
260 }
261
262 func (c *serviceClient) L2InterfaceEfpFilter(ctx context.Context, in *L2InterfaceEfpFilter) (*L2InterfaceEfpFilterReply, error) {
263         out := new(L2InterfaceEfpFilterReply)
264         err := c.conn.Invoke(ctx, in, out)
265         if err != nil {
266                 return nil, err
267         }
268         return out, api.RetvalToVPPApiError(out.Retval)
269 }
270
271 func (c *serviceClient) L2InterfacePbbTagRewrite(ctx context.Context, in *L2InterfacePbbTagRewrite) (*L2InterfacePbbTagRewriteReply, error) {
272         out := new(L2InterfacePbbTagRewriteReply)
273         err := c.conn.Invoke(ctx, in, out)
274         if err != nil {
275                 return nil, err
276         }
277         return out, api.RetvalToVPPApiError(out.Retval)
278 }
279
280 func (c *serviceClient) L2InterfaceVlanTagRewrite(ctx context.Context, in *L2InterfaceVlanTagRewrite) (*L2InterfaceVlanTagRewriteReply, error) {
281         out := new(L2InterfaceVlanTagRewriteReply)
282         err := c.conn.Invoke(ctx, in, out)
283         if err != nil {
284                 return nil, err
285         }
286         return out, api.RetvalToVPPApiError(out.Retval)
287 }
288
289 func (c *serviceClient) L2PatchAddDel(ctx context.Context, in *L2PatchAddDel) (*L2PatchAddDelReply, error) {
290         out := new(L2PatchAddDelReply)
291         err := c.conn.Invoke(ctx, in, out)
292         if err != nil {
293                 return nil, err
294         }
295         return out, api.RetvalToVPPApiError(out.Retval)
296 }
297
298 func (c *serviceClient) L2XconnectDump(ctx context.Context, in *L2XconnectDump) (RPCService_L2XconnectDumpClient, error) {
299         stream, err := c.conn.NewStream(ctx)
300         if err != nil {
301                 return nil, err
302         }
303         x := &serviceClient_L2XconnectDumpClient{stream}
304         if err := x.Stream.SendMsg(in); err != nil {
305                 return nil, err
306         }
307         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
308                 return nil, err
309         }
310         return x, nil
311 }
312
313 type RPCService_L2XconnectDumpClient interface {
314         Recv() (*L2XconnectDetails, error)
315         api.Stream
316 }
317
318 type serviceClient_L2XconnectDumpClient struct {
319         api.Stream
320 }
321
322 func (c *serviceClient_L2XconnectDumpClient) Recv() (*L2XconnectDetails, error) {
323         msg, err := c.Stream.RecvMsg()
324         if err != nil {
325                 return nil, err
326         }
327         switch m := msg.(type) {
328         case *L2XconnectDetails:
329                 return m, nil
330         case *vpe.ControlPingReply:
331                 err = c.Stream.Close()
332                 if err != nil {
333                         return nil, err
334                 }
335                 return nil, io.EOF
336         default:
337                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
338         }
339 }
340
341 func (c *serviceClient) L2fibAddDel(ctx context.Context, in *L2fibAddDel) (*L2fibAddDelReply, error) {
342         out := new(L2fibAddDelReply)
343         err := c.conn.Invoke(ctx, in, out)
344         if err != nil {
345                 return nil, err
346         }
347         return out, api.RetvalToVPPApiError(out.Retval)
348 }
349
350 func (c *serviceClient) L2fibFlushAll(ctx context.Context, in *L2fibFlushAll) (*L2fibFlushAllReply, error) {
351         out := new(L2fibFlushAllReply)
352         err := c.conn.Invoke(ctx, in, out)
353         if err != nil {
354                 return nil, err
355         }
356         return out, api.RetvalToVPPApiError(out.Retval)
357 }
358
359 func (c *serviceClient) L2fibFlushBd(ctx context.Context, in *L2fibFlushBd) (*L2fibFlushBdReply, error) {
360         out := new(L2fibFlushBdReply)
361         err := c.conn.Invoke(ctx, in, out)
362         if err != nil {
363                 return nil, err
364         }
365         return out, api.RetvalToVPPApiError(out.Retval)
366 }
367
368 func (c *serviceClient) L2fibFlushInt(ctx context.Context, in *L2fibFlushInt) (*L2fibFlushIntReply, error) {
369         out := new(L2fibFlushIntReply)
370         err := c.conn.Invoke(ctx, in, out)
371         if err != nil {
372                 return nil, err
373         }
374         return out, api.RetvalToVPPApiError(out.Retval)
375 }
376
377 func (c *serviceClient) SwInterfaceSetL2Bridge(ctx context.Context, in *SwInterfaceSetL2Bridge) (*SwInterfaceSetL2BridgeReply, error) {
378         out := new(SwInterfaceSetL2BridgeReply)
379         err := c.conn.Invoke(ctx, in, out)
380         if err != nil {
381                 return nil, err
382         }
383         return out, api.RetvalToVPPApiError(out.Retval)
384 }
385
386 func (c *serviceClient) SwInterfaceSetL2Xconnect(ctx context.Context, in *SwInterfaceSetL2Xconnect) (*SwInterfaceSetL2XconnectReply, error) {
387         out := new(SwInterfaceSetL2XconnectReply)
388         err := c.conn.Invoke(ctx, in, out)
389         if err != nil {
390                 return nil, err
391         }
392         return out, api.RetvalToVPPApiError(out.Retval)
393 }
394
395 func (c *serviceClient) SwInterfaceSetVpath(ctx context.Context, in *SwInterfaceSetVpath) (*SwInterfaceSetVpathReply, error) {
396         out := new(SwInterfaceSetVpathReply)
397         err := c.conn.Invoke(ctx, in, out)
398         if err != nil {
399                 return nil, err
400         }
401         return out, api.RetvalToVPPApiError(out.Retval)
402 }
403
404 func (c *serviceClient) WantL2ArpTermEvents(ctx context.Context, in *WantL2ArpTermEvents) (*WantL2ArpTermEventsReply, error) {
405         out := new(WantL2ArpTermEventsReply)
406         err := c.conn.Invoke(ctx, in, out)
407         if err != nil {
408                 return nil, err
409         }
410         return out, api.RetvalToVPPApiError(out.Retval)
411 }
412
413 func (c *serviceClient) WantL2MacsEvents(ctx context.Context, in *WantL2MacsEvents) (*WantL2MacsEventsReply, error) {
414         out := new(WantL2MacsEventsReply)
415         err := c.conn.Invoke(ctx, in, out)
416         if err != nil {
417                 return nil, err
418         }
419         return out, api.RetvalToVPPApiError(out.Retval)
420 }