0645bc50ed47505535350dc82a4b003f2e3faa90
[govpp.git] / binapi / classify / classify_rpc.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2
3 package classify
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 classify.
15 type RPCService interface {
16         ClassifyAddDelSession(ctx context.Context, in *ClassifyAddDelSession) (*ClassifyAddDelSessionReply, error)
17         ClassifyAddDelTable(ctx context.Context, in *ClassifyAddDelTable) (*ClassifyAddDelTableReply, error)
18         ClassifyPcapGetTables(ctx context.Context, in *ClassifyPcapGetTables) (*ClassifyPcapGetTablesReply, error)
19         ClassifyPcapLookupTable(ctx context.Context, in *ClassifyPcapLookupTable) (*ClassifyPcapLookupTableReply, error)
20         ClassifyPcapSetTable(ctx context.Context, in *ClassifyPcapSetTable) (*ClassifyPcapSetTableReply, error)
21         ClassifySessionDump(ctx context.Context, in *ClassifySessionDump) (RPCService_ClassifySessionDumpClient, error)
22         ClassifySetInterfaceIPTable(ctx context.Context, in *ClassifySetInterfaceIPTable) (*ClassifySetInterfaceIPTableReply, error)
23         ClassifySetInterfaceL2Tables(ctx context.Context, in *ClassifySetInterfaceL2Tables) (*ClassifySetInterfaceL2TablesReply, error)
24         ClassifyTableByInterface(ctx context.Context, in *ClassifyTableByInterface) (*ClassifyTableByInterfaceReply, error)
25         ClassifyTableIds(ctx context.Context, in *ClassifyTableIds) (*ClassifyTableIdsReply, error)
26         ClassifyTableInfo(ctx context.Context, in *ClassifyTableInfo) (*ClassifyTableInfoReply, error)
27         ClassifyTraceGetTables(ctx context.Context, in *ClassifyTraceGetTables) (*ClassifyTraceGetTablesReply, error)
28         ClassifyTraceLookupTable(ctx context.Context, in *ClassifyTraceLookupTable) (*ClassifyTraceLookupTableReply, error)
29         ClassifyTraceSetTable(ctx context.Context, in *ClassifyTraceSetTable) (*ClassifyTraceSetTableReply, error)
30         FlowClassifyDump(ctx context.Context, in *FlowClassifyDump) (RPCService_FlowClassifyDumpClient, error)
31         FlowClassifySetInterface(ctx context.Context, in *FlowClassifySetInterface) (*FlowClassifySetInterfaceReply, error)
32         InputACLSetInterface(ctx context.Context, in *InputACLSetInterface) (*InputACLSetInterfaceReply, error)
33         OutputACLSetInterface(ctx context.Context, in *OutputACLSetInterface) (*OutputACLSetInterfaceReply, error)
34         PolicerClassifyDump(ctx context.Context, in *PolicerClassifyDump) (RPCService_PolicerClassifyDumpClient, error)
35         PolicerClassifySetInterface(ctx context.Context, in *PolicerClassifySetInterface) (*PolicerClassifySetInterfaceReply, error)
36         PuntACLAddDel(ctx context.Context, in *PuntACLAddDel) (*PuntACLAddDelReply, error)
37 }
38
39 type serviceClient struct {
40         conn api.Connection
41 }
42
43 func NewServiceClient(conn api.Connection) RPCService {
44         return &serviceClient{conn}
45 }
46
47 func (c *serviceClient) ClassifyAddDelSession(ctx context.Context, in *ClassifyAddDelSession) (*ClassifyAddDelSessionReply, error) {
48         out := new(ClassifyAddDelSessionReply)
49         err := c.conn.Invoke(ctx, in, out)
50         if err != nil {
51                 return nil, err
52         }
53         return out, api.RetvalToVPPApiError(out.Retval)
54 }
55
56 func (c *serviceClient) ClassifyAddDelTable(ctx context.Context, in *ClassifyAddDelTable) (*ClassifyAddDelTableReply, error) {
57         out := new(ClassifyAddDelTableReply)
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) ClassifyPcapGetTables(ctx context.Context, in *ClassifyPcapGetTables) (*ClassifyPcapGetTablesReply, error) {
66         out := new(ClassifyPcapGetTablesReply)
67         err := c.conn.Invoke(ctx, in, out)
68         if err != nil {
69                 return nil, err
70         }
71         return out, api.RetvalToVPPApiError(out.Retval)
72 }
73
74 func (c *serviceClient) ClassifyPcapLookupTable(ctx context.Context, in *ClassifyPcapLookupTable) (*ClassifyPcapLookupTableReply, error) {
75         out := new(ClassifyPcapLookupTableReply)
76         err := c.conn.Invoke(ctx, in, out)
77         if err != nil {
78                 return nil, err
79         }
80         return out, api.RetvalToVPPApiError(out.Retval)
81 }
82
83 func (c *serviceClient) ClassifyPcapSetTable(ctx context.Context, in *ClassifyPcapSetTable) (*ClassifyPcapSetTableReply, error) {
84         out := new(ClassifyPcapSetTableReply)
85         err := c.conn.Invoke(ctx, in, out)
86         if err != nil {
87                 return nil, err
88         }
89         return out, api.RetvalToVPPApiError(out.Retval)
90 }
91
92 func (c *serviceClient) ClassifySessionDump(ctx context.Context, in *ClassifySessionDump) (RPCService_ClassifySessionDumpClient, error) {
93         stream, err := c.conn.NewStream(ctx)
94         if err != nil {
95                 return nil, err
96         }
97         x := &serviceClient_ClassifySessionDumpClient{stream}
98         if err := x.Stream.SendMsg(in); err != nil {
99                 return nil, err
100         }
101         if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil {
102                 return nil, err
103         }
104         return x, nil
105 }
106
107 type RPCService_ClassifySessionDumpClient interface {
108         Recv() (*ClassifySessionDetails, error)
109         api.Stream
110 }
111
112 type serviceClient_ClassifySessionDumpClient struct {
113         api.Stream
114 }
115
116 func (c *serviceClient_ClassifySessionDumpClient) Recv() (*ClassifySessionDetails, error) {
117         msg, err := c.Stream.RecvMsg()
118         if err != nil {
119                 return nil, err
120         }
121         switch m := msg.(type) {
122         case *ClassifySessionDetails:
123                 return m, nil
124         case *memclnt.ControlPingReply:
125                 err = c.Stream.Close()
126                 if err != nil {
127                         return nil, err
128                 }
129                 return nil, io.EOF
130         default:
131                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
132         }
133 }
134
135 func (c *serviceClient) ClassifySetInterfaceIPTable(ctx context.Context, in *ClassifySetInterfaceIPTable) (*ClassifySetInterfaceIPTableReply, error) {
136         out := new(ClassifySetInterfaceIPTableReply)
137         err := c.conn.Invoke(ctx, in, out)
138         if err != nil {
139                 return nil, err
140         }
141         return out, api.RetvalToVPPApiError(out.Retval)
142 }
143
144 func (c *serviceClient) ClassifySetInterfaceL2Tables(ctx context.Context, in *ClassifySetInterfaceL2Tables) (*ClassifySetInterfaceL2TablesReply, error) {
145         out := new(ClassifySetInterfaceL2TablesReply)
146         err := c.conn.Invoke(ctx, in, out)
147         if err != nil {
148                 return nil, err
149         }
150         return out, api.RetvalToVPPApiError(out.Retval)
151 }
152
153 func (c *serviceClient) ClassifyTableByInterface(ctx context.Context, in *ClassifyTableByInterface) (*ClassifyTableByInterfaceReply, error) {
154         out := new(ClassifyTableByInterfaceReply)
155         err := c.conn.Invoke(ctx, in, out)
156         if err != nil {
157                 return nil, err
158         }
159         return out, api.RetvalToVPPApiError(out.Retval)
160 }
161
162 func (c *serviceClient) ClassifyTableIds(ctx context.Context, in *ClassifyTableIds) (*ClassifyTableIdsReply, error) {
163         out := new(ClassifyTableIdsReply)
164         err := c.conn.Invoke(ctx, in, out)
165         if err != nil {
166                 return nil, err
167         }
168         return out, api.RetvalToVPPApiError(out.Retval)
169 }
170
171 func (c *serviceClient) ClassifyTableInfo(ctx context.Context, in *ClassifyTableInfo) (*ClassifyTableInfoReply, error) {
172         out := new(ClassifyTableInfoReply)
173         err := c.conn.Invoke(ctx, in, out)
174         if err != nil {
175                 return nil, err
176         }
177         return out, api.RetvalToVPPApiError(out.Retval)
178 }
179
180 func (c *serviceClient) ClassifyTraceGetTables(ctx context.Context, in *ClassifyTraceGetTables) (*ClassifyTraceGetTablesReply, error) {
181         out := new(ClassifyTraceGetTablesReply)
182         err := c.conn.Invoke(ctx, in, out)
183         if err != nil {
184                 return nil, err
185         }
186         return out, api.RetvalToVPPApiError(out.Retval)
187 }
188
189 func (c *serviceClient) ClassifyTraceLookupTable(ctx context.Context, in *ClassifyTraceLookupTable) (*ClassifyTraceLookupTableReply, error) {
190         out := new(ClassifyTraceLookupTableReply)
191         err := c.conn.Invoke(ctx, in, out)
192         if err != nil {
193                 return nil, err
194         }
195         return out, api.RetvalToVPPApiError(out.Retval)
196 }
197
198 func (c *serviceClient) ClassifyTraceSetTable(ctx context.Context, in *ClassifyTraceSetTable) (*ClassifyTraceSetTableReply, error) {
199         out := new(ClassifyTraceSetTableReply)
200         err := c.conn.Invoke(ctx, in, out)
201         if err != nil {
202                 return nil, err
203         }
204         return out, api.RetvalToVPPApiError(out.Retval)
205 }
206
207 func (c *serviceClient) FlowClassifyDump(ctx context.Context, in *FlowClassifyDump) (RPCService_FlowClassifyDumpClient, error) {
208         stream, err := c.conn.NewStream(ctx)
209         if err != nil {
210                 return nil, err
211         }
212         x := &serviceClient_FlowClassifyDumpClient{stream}
213         if err := x.Stream.SendMsg(in); err != nil {
214                 return nil, err
215         }
216         if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil {
217                 return nil, err
218         }
219         return x, nil
220 }
221
222 type RPCService_FlowClassifyDumpClient interface {
223         Recv() (*FlowClassifyDetails, error)
224         api.Stream
225 }
226
227 type serviceClient_FlowClassifyDumpClient struct {
228         api.Stream
229 }
230
231 func (c *serviceClient_FlowClassifyDumpClient) Recv() (*FlowClassifyDetails, error) {
232         msg, err := c.Stream.RecvMsg()
233         if err != nil {
234                 return nil, err
235         }
236         switch m := msg.(type) {
237         case *FlowClassifyDetails:
238                 return m, nil
239         case *memclnt.ControlPingReply:
240                 err = c.Stream.Close()
241                 if err != nil {
242                         return nil, err
243                 }
244                 return nil, io.EOF
245         default:
246                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
247         }
248 }
249
250 func (c *serviceClient) FlowClassifySetInterface(ctx context.Context, in *FlowClassifySetInterface) (*FlowClassifySetInterfaceReply, error) {
251         out := new(FlowClassifySetInterfaceReply)
252         err := c.conn.Invoke(ctx, in, out)
253         if err != nil {
254                 return nil, err
255         }
256         return out, api.RetvalToVPPApiError(out.Retval)
257 }
258
259 func (c *serviceClient) InputACLSetInterface(ctx context.Context, in *InputACLSetInterface) (*InputACLSetInterfaceReply, error) {
260         out := new(InputACLSetInterfaceReply)
261         err := c.conn.Invoke(ctx, in, out)
262         if err != nil {
263                 return nil, err
264         }
265         return out, api.RetvalToVPPApiError(out.Retval)
266 }
267
268 func (c *serviceClient) OutputACLSetInterface(ctx context.Context, in *OutputACLSetInterface) (*OutputACLSetInterfaceReply, error) {
269         out := new(OutputACLSetInterfaceReply)
270         err := c.conn.Invoke(ctx, in, out)
271         if err != nil {
272                 return nil, err
273         }
274         return out, api.RetvalToVPPApiError(out.Retval)
275 }
276
277 func (c *serviceClient) PolicerClassifyDump(ctx context.Context, in *PolicerClassifyDump) (RPCService_PolicerClassifyDumpClient, error) {
278         stream, err := c.conn.NewStream(ctx)
279         if err != nil {
280                 return nil, err
281         }
282         x := &serviceClient_PolicerClassifyDumpClient{stream}
283         if err := x.Stream.SendMsg(in); err != nil {
284                 return nil, err
285         }
286         if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil {
287                 return nil, err
288         }
289         return x, nil
290 }
291
292 type RPCService_PolicerClassifyDumpClient interface {
293         Recv() (*PolicerClassifyDetails, error)
294         api.Stream
295 }
296
297 type serviceClient_PolicerClassifyDumpClient struct {
298         api.Stream
299 }
300
301 func (c *serviceClient_PolicerClassifyDumpClient) Recv() (*PolicerClassifyDetails, error) {
302         msg, err := c.Stream.RecvMsg()
303         if err != nil {
304                 return nil, err
305         }
306         switch m := msg.(type) {
307         case *PolicerClassifyDetails:
308                 return m, nil
309         case *memclnt.ControlPingReply:
310                 err = c.Stream.Close()
311                 if err != nil {
312                         return nil, err
313                 }
314                 return nil, io.EOF
315         default:
316                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
317         }
318 }
319
320 func (c *serviceClient) PolicerClassifySetInterface(ctx context.Context, in *PolicerClassifySetInterface) (*PolicerClassifySetInterfaceReply, error) {
321         out := new(PolicerClassifySetInterfaceReply)
322         err := c.conn.Invoke(ctx, in, out)
323         if err != nil {
324                 return nil, err
325         }
326         return out, api.RetvalToVPPApiError(out.Retval)
327 }
328
329 func (c *serviceClient) PuntACLAddDel(ctx context.Context, in *PuntACLAddDel) (*PuntACLAddDelReply, error) {
330         out := new(PuntACLAddDelReply)
331         err := c.conn.Invoke(ctx, in, out)
332         if err != nil {
333                 return nil, err
334         }
335         return out, api.RetvalToVPPApiError(out.Retval)
336 }