Fix codec fallback and generate type imports
[govpp.git] / examples / binapi / interfaces / interfaces_rpc.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2
3 package interfaces
4
5 import (
6         "context"
7         "io"
8
9         api "git.fd.io/govpp.git/api"
10 )
11
12 // RPCService represents RPC service API for interface module.
13 type RPCService interface {
14         DumpSwInterface(ctx context.Context, in *SwInterfaceDump) (RPCService_DumpSwInterfaceClient, error)
15         DumpSwInterfaceRxPlacement(ctx context.Context, in *SwInterfaceRxPlacementDump) (RPCService_DumpSwInterfaceRxPlacementClient, error)
16         CollectDetailedInterfaceStats(ctx context.Context, in *CollectDetailedInterfaceStats) (*CollectDetailedInterfaceStatsReply, error)
17         CreateLoopback(ctx context.Context, in *CreateLoopback) (*CreateLoopbackReply, error)
18         CreateLoopbackInstance(ctx context.Context, in *CreateLoopbackInstance) (*CreateLoopbackInstanceReply, error)
19         CreateSubif(ctx context.Context, in *CreateSubif) (*CreateSubifReply, error)
20         CreateVlanSubif(ctx context.Context, in *CreateVlanSubif) (*CreateVlanSubifReply, error)
21         DeleteLoopback(ctx context.Context, in *DeleteLoopback) (*DeleteLoopbackReply, error)
22         DeleteSubif(ctx context.Context, in *DeleteSubif) (*DeleteSubifReply, error)
23         HwInterfaceSetMtu(ctx context.Context, in *HwInterfaceSetMtu) (*HwInterfaceSetMtuReply, error)
24         InterfaceNameRenumber(ctx context.Context, in *InterfaceNameRenumber) (*InterfaceNameRenumberReply, error)
25         SwInterfaceAddDelAddress(ctx context.Context, in *SwInterfaceAddDelAddress) (*SwInterfaceAddDelAddressReply, error)
26         SwInterfaceAddDelMacAddress(ctx context.Context, in *SwInterfaceAddDelMacAddress) (*SwInterfaceAddDelMacAddressReply, error)
27         SwInterfaceAddressReplaceBegin(ctx context.Context, in *SwInterfaceAddressReplaceBegin) (*SwInterfaceAddressReplaceBeginReply, error)
28         SwInterfaceAddressReplaceEnd(ctx context.Context, in *SwInterfaceAddressReplaceEnd) (*SwInterfaceAddressReplaceEndReply, error)
29         SwInterfaceClearStats(ctx context.Context, in *SwInterfaceClearStats) (*SwInterfaceClearStatsReply, error)
30         SwInterfaceGetMacAddress(ctx context.Context, in *SwInterfaceGetMacAddress) (*SwInterfaceGetMacAddressReply, error)
31         SwInterfaceGetTable(ctx context.Context, in *SwInterfaceGetTable) (*SwInterfaceGetTableReply, error)
32         SwInterfaceSetFlags(ctx context.Context, in *SwInterfaceSetFlags) (*SwInterfaceSetFlagsReply, error)
33         SwInterfaceSetIPDirectedBroadcast(ctx context.Context, in *SwInterfaceSetIPDirectedBroadcast) (*SwInterfaceSetIPDirectedBroadcastReply, error)
34         SwInterfaceSetMacAddress(ctx context.Context, in *SwInterfaceSetMacAddress) (*SwInterfaceSetMacAddressReply, error)
35         SwInterfaceSetMtu(ctx context.Context, in *SwInterfaceSetMtu) (*SwInterfaceSetMtuReply, error)
36         SwInterfaceSetRxMode(ctx context.Context, in *SwInterfaceSetRxMode) (*SwInterfaceSetRxModeReply, error)
37         SwInterfaceSetRxPlacement(ctx context.Context, in *SwInterfaceSetRxPlacement) (*SwInterfaceSetRxPlacementReply, error)
38         SwInterfaceSetTable(ctx context.Context, in *SwInterfaceSetTable) (*SwInterfaceSetTableReply, error)
39         SwInterfaceSetUnnumbered(ctx context.Context, in *SwInterfaceSetUnnumbered) (*SwInterfaceSetUnnumberedReply, error)
40         SwInterfaceTagAddDel(ctx context.Context, in *SwInterfaceTagAddDel) (*SwInterfaceTagAddDelReply, error)
41         WantInterfaceEvents(ctx context.Context, in *WantInterfaceEvents) (*WantInterfaceEventsReply, error)
42 }
43
44 type serviceClient struct {
45         ch api.Channel
46 }
47
48 func NewServiceClient(ch api.Channel) RPCService {
49         return &serviceClient{ch}
50 }
51
52 func (c *serviceClient) DumpSwInterface(ctx context.Context, in *SwInterfaceDump) (RPCService_DumpSwInterfaceClient, error) {
53         stream := c.ch.SendMultiRequest(in)
54         x := &serviceClient_DumpSwInterfaceClient{stream}
55         return x, nil
56 }
57
58 type RPCService_DumpSwInterfaceClient interface {
59         Recv() (*SwInterfaceDetails, error)
60 }
61
62 type serviceClient_DumpSwInterfaceClient struct {
63         api.MultiRequestCtx
64 }
65
66 func (c *serviceClient_DumpSwInterfaceClient) Recv() (*SwInterfaceDetails, error) {
67         m := new(SwInterfaceDetails)
68         stop, err := c.MultiRequestCtx.ReceiveReply(m)
69         if err != nil {
70                 return nil, err
71         }
72         if stop {
73                 return nil, io.EOF
74         }
75         return m, nil
76 }
77
78 func (c *serviceClient) DumpSwInterfaceRxPlacement(ctx context.Context, in *SwInterfaceRxPlacementDump) (RPCService_DumpSwInterfaceRxPlacementClient, error) {
79         stream := c.ch.SendMultiRequest(in)
80         x := &serviceClient_DumpSwInterfaceRxPlacementClient{stream}
81         return x, nil
82 }
83
84 type RPCService_DumpSwInterfaceRxPlacementClient interface {
85         Recv() (*SwInterfaceRxPlacementDetails, error)
86 }
87
88 type serviceClient_DumpSwInterfaceRxPlacementClient struct {
89         api.MultiRequestCtx
90 }
91
92 func (c *serviceClient_DumpSwInterfaceRxPlacementClient) Recv() (*SwInterfaceRxPlacementDetails, error) {
93         m := new(SwInterfaceRxPlacementDetails)
94         stop, err := c.MultiRequestCtx.ReceiveReply(m)
95         if err != nil {
96                 return nil, err
97         }
98         if stop {
99                 return nil, io.EOF
100         }
101         return m, nil
102 }
103
104 func (c *serviceClient) CollectDetailedInterfaceStats(ctx context.Context, in *CollectDetailedInterfaceStats) (*CollectDetailedInterfaceStatsReply, error) {
105         out := new(CollectDetailedInterfaceStatsReply)
106         err := c.ch.SendRequest(in).ReceiveReply(out)
107         if err != nil {
108                 return nil, err
109         }
110         return out, nil
111 }
112
113 func (c *serviceClient) CreateLoopback(ctx context.Context, in *CreateLoopback) (*CreateLoopbackReply, error) {
114         out := new(CreateLoopbackReply)
115         err := c.ch.SendRequest(in).ReceiveReply(out)
116         if err != nil {
117                 return nil, err
118         }
119         return out, nil
120 }
121
122 func (c *serviceClient) CreateLoopbackInstance(ctx context.Context, in *CreateLoopbackInstance) (*CreateLoopbackInstanceReply, error) {
123         out := new(CreateLoopbackInstanceReply)
124         err := c.ch.SendRequest(in).ReceiveReply(out)
125         if err != nil {
126                 return nil, err
127         }
128         return out, nil
129 }
130
131 func (c *serviceClient) CreateSubif(ctx context.Context, in *CreateSubif) (*CreateSubifReply, error) {
132         out := new(CreateSubifReply)
133         err := c.ch.SendRequest(in).ReceiveReply(out)
134         if err != nil {
135                 return nil, err
136         }
137         return out, nil
138 }
139
140 func (c *serviceClient) CreateVlanSubif(ctx context.Context, in *CreateVlanSubif) (*CreateVlanSubifReply, error) {
141         out := new(CreateVlanSubifReply)
142         err := c.ch.SendRequest(in).ReceiveReply(out)
143         if err != nil {
144                 return nil, err
145         }
146         return out, nil
147 }
148
149 func (c *serviceClient) DeleteLoopback(ctx context.Context, in *DeleteLoopback) (*DeleteLoopbackReply, error) {
150         out := new(DeleteLoopbackReply)
151         err := c.ch.SendRequest(in).ReceiveReply(out)
152         if err != nil {
153                 return nil, err
154         }
155         return out, nil
156 }
157
158 func (c *serviceClient) DeleteSubif(ctx context.Context, in *DeleteSubif) (*DeleteSubifReply, error) {
159         out := new(DeleteSubifReply)
160         err := c.ch.SendRequest(in).ReceiveReply(out)
161         if err != nil {
162                 return nil, err
163         }
164         return out, nil
165 }
166
167 func (c *serviceClient) HwInterfaceSetMtu(ctx context.Context, in *HwInterfaceSetMtu) (*HwInterfaceSetMtuReply, error) {
168         out := new(HwInterfaceSetMtuReply)
169         err := c.ch.SendRequest(in).ReceiveReply(out)
170         if err != nil {
171                 return nil, err
172         }
173         return out, nil
174 }
175
176 func (c *serviceClient) InterfaceNameRenumber(ctx context.Context, in *InterfaceNameRenumber) (*InterfaceNameRenumberReply, error) {
177         out := new(InterfaceNameRenumberReply)
178         err := c.ch.SendRequest(in).ReceiveReply(out)
179         if err != nil {
180                 return nil, err
181         }
182         return out, nil
183 }
184
185 func (c *serviceClient) SwInterfaceAddDelAddress(ctx context.Context, in *SwInterfaceAddDelAddress) (*SwInterfaceAddDelAddressReply, error) {
186         out := new(SwInterfaceAddDelAddressReply)
187         err := c.ch.SendRequest(in).ReceiveReply(out)
188         if err != nil {
189                 return nil, err
190         }
191         return out, nil
192 }
193
194 func (c *serviceClient) SwInterfaceAddDelMacAddress(ctx context.Context, in *SwInterfaceAddDelMacAddress) (*SwInterfaceAddDelMacAddressReply, error) {
195         out := new(SwInterfaceAddDelMacAddressReply)
196         err := c.ch.SendRequest(in).ReceiveReply(out)
197         if err != nil {
198                 return nil, err
199         }
200         return out, nil
201 }
202
203 func (c *serviceClient) SwInterfaceAddressReplaceBegin(ctx context.Context, in *SwInterfaceAddressReplaceBegin) (*SwInterfaceAddressReplaceBeginReply, error) {
204         out := new(SwInterfaceAddressReplaceBeginReply)
205         err := c.ch.SendRequest(in).ReceiveReply(out)
206         if err != nil {
207                 return nil, err
208         }
209         return out, nil
210 }
211
212 func (c *serviceClient) SwInterfaceAddressReplaceEnd(ctx context.Context, in *SwInterfaceAddressReplaceEnd) (*SwInterfaceAddressReplaceEndReply, error) {
213         out := new(SwInterfaceAddressReplaceEndReply)
214         err := c.ch.SendRequest(in).ReceiveReply(out)
215         if err != nil {
216                 return nil, err
217         }
218         return out, nil
219 }
220
221 func (c *serviceClient) SwInterfaceClearStats(ctx context.Context, in *SwInterfaceClearStats) (*SwInterfaceClearStatsReply, error) {
222         out := new(SwInterfaceClearStatsReply)
223         err := c.ch.SendRequest(in).ReceiveReply(out)
224         if err != nil {
225                 return nil, err
226         }
227         return out, nil
228 }
229
230 func (c *serviceClient) SwInterfaceGetMacAddress(ctx context.Context, in *SwInterfaceGetMacAddress) (*SwInterfaceGetMacAddressReply, error) {
231         out := new(SwInterfaceGetMacAddressReply)
232         err := c.ch.SendRequest(in).ReceiveReply(out)
233         if err != nil {
234                 return nil, err
235         }
236         return out, nil
237 }
238
239 func (c *serviceClient) SwInterfaceGetTable(ctx context.Context, in *SwInterfaceGetTable) (*SwInterfaceGetTableReply, error) {
240         out := new(SwInterfaceGetTableReply)
241         err := c.ch.SendRequest(in).ReceiveReply(out)
242         if err != nil {
243                 return nil, err
244         }
245         return out, nil
246 }
247
248 func (c *serviceClient) SwInterfaceSetFlags(ctx context.Context, in *SwInterfaceSetFlags) (*SwInterfaceSetFlagsReply, error) {
249         out := new(SwInterfaceSetFlagsReply)
250         err := c.ch.SendRequest(in).ReceiveReply(out)
251         if err != nil {
252                 return nil, err
253         }
254         return out, nil
255 }
256
257 func (c *serviceClient) SwInterfaceSetIPDirectedBroadcast(ctx context.Context, in *SwInterfaceSetIPDirectedBroadcast) (*SwInterfaceSetIPDirectedBroadcastReply, error) {
258         out := new(SwInterfaceSetIPDirectedBroadcastReply)
259         err := c.ch.SendRequest(in).ReceiveReply(out)
260         if err != nil {
261                 return nil, err
262         }
263         return out, nil
264 }
265
266 func (c *serviceClient) SwInterfaceSetMacAddress(ctx context.Context, in *SwInterfaceSetMacAddress) (*SwInterfaceSetMacAddressReply, error) {
267         out := new(SwInterfaceSetMacAddressReply)
268         err := c.ch.SendRequest(in).ReceiveReply(out)
269         if err != nil {
270                 return nil, err
271         }
272         return out, nil
273 }
274
275 func (c *serviceClient) SwInterfaceSetMtu(ctx context.Context, in *SwInterfaceSetMtu) (*SwInterfaceSetMtuReply, error) {
276         out := new(SwInterfaceSetMtuReply)
277         err := c.ch.SendRequest(in).ReceiveReply(out)
278         if err != nil {
279                 return nil, err
280         }
281         return out, nil
282 }
283
284 func (c *serviceClient) SwInterfaceSetRxMode(ctx context.Context, in *SwInterfaceSetRxMode) (*SwInterfaceSetRxModeReply, error) {
285         out := new(SwInterfaceSetRxModeReply)
286         err := c.ch.SendRequest(in).ReceiveReply(out)
287         if err != nil {
288                 return nil, err
289         }
290         return out, nil
291 }
292
293 func (c *serviceClient) SwInterfaceSetRxPlacement(ctx context.Context, in *SwInterfaceSetRxPlacement) (*SwInterfaceSetRxPlacementReply, error) {
294         out := new(SwInterfaceSetRxPlacementReply)
295         err := c.ch.SendRequest(in).ReceiveReply(out)
296         if err != nil {
297                 return nil, err
298         }
299         return out, nil
300 }
301
302 func (c *serviceClient) SwInterfaceSetTable(ctx context.Context, in *SwInterfaceSetTable) (*SwInterfaceSetTableReply, error) {
303         out := new(SwInterfaceSetTableReply)
304         err := c.ch.SendRequest(in).ReceiveReply(out)
305         if err != nil {
306                 return nil, err
307         }
308         return out, nil
309 }
310
311 func (c *serviceClient) SwInterfaceSetUnnumbered(ctx context.Context, in *SwInterfaceSetUnnumbered) (*SwInterfaceSetUnnumberedReply, error) {
312         out := new(SwInterfaceSetUnnumberedReply)
313         err := c.ch.SendRequest(in).ReceiveReply(out)
314         if err != nil {
315                 return nil, err
316         }
317         return out, nil
318 }
319
320 func (c *serviceClient) SwInterfaceTagAddDel(ctx context.Context, in *SwInterfaceTagAddDel) (*SwInterfaceTagAddDelReply, error) {
321         out := new(SwInterfaceTagAddDelReply)
322         err := c.ch.SendRequest(in).ReceiveReply(out)
323         if err != nil {
324                 return nil, err
325         }
326         return out, nil
327 }
328
329 func (c *serviceClient) WantInterfaceEvents(ctx context.Context, in *WantInterfaceEvents) (*WantInterfaceEventsReply, error) {
330         out := new(WantInterfaceEventsReply)
331         err := c.ch.SendRequest(in).ReceiveReply(out)
332         if err != nil {
333                 return nil, err
334         }
335         return out, nil
336 }
337
338 // Reference imports to suppress errors if they are not otherwise used.
339 var _ = api.RegisterMessage
340 var _ = context.Background
341 var _ = io.Copy