49137588935a2d70e0c079b6be0a3cad0644caa9
[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         vpe "git.fd.io/govpp.git/binapi/vpe"
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 }
37
38 type serviceClient struct {
39         conn api.Connection
40 }
41
42 func NewServiceClient(conn api.Connection) RPCService {
43         return &serviceClient{conn}
44 }
45
46 func (c *serviceClient) ClassifyAddDelSession(ctx context.Context, in *ClassifyAddDelSession) (*ClassifyAddDelSessionReply, error) {
47         out := new(ClassifyAddDelSessionReply)
48         err := c.conn.Invoke(ctx, in, out)
49         if err != nil {
50                 return nil, err
51         }
52         return out, api.RetvalToVPPApiError(out.Retval)
53 }
54
55 func (c *serviceClient) ClassifyAddDelTable(ctx context.Context, in *ClassifyAddDelTable) (*ClassifyAddDelTableReply, error) {
56         out := new(ClassifyAddDelTableReply)
57         err := c.conn.Invoke(ctx, in, out)
58         if err != nil {
59                 return nil, err
60         }
61         return out, api.RetvalToVPPApiError(out.Retval)
62 }
63
64 func (c *serviceClient) ClassifyPcapGetTables(ctx context.Context, in *ClassifyPcapGetTables) (*ClassifyPcapGetTablesReply, error) {
65         out := new(ClassifyPcapGetTablesReply)
66         err := c.conn.Invoke(ctx, in, out)
67         if err != nil {
68                 return nil, err
69         }
70         return out, api.RetvalToVPPApiError(out.Retval)
71 }
72
73 func (c *serviceClient) ClassifyPcapLookupTable(ctx context.Context, in *ClassifyPcapLookupTable) (*ClassifyPcapLookupTableReply, error) {
74         out := new(ClassifyPcapLookupTableReply)
75         err := c.conn.Invoke(ctx, in, out)
76         if err != nil {
77                 return nil, err
78         }
79         return out, api.RetvalToVPPApiError(out.Retval)
80 }
81
82 func (c *serviceClient) ClassifyPcapSetTable(ctx context.Context, in *ClassifyPcapSetTable) (*ClassifyPcapSetTableReply, error) {
83         out := new(ClassifyPcapSetTableReply)
84         err := c.conn.Invoke(ctx, in, out)
85         if err != nil {
86                 return nil, err
87         }
88         return out, api.RetvalToVPPApiError(out.Retval)
89 }
90
91 func (c *serviceClient) ClassifySessionDump(ctx context.Context, in *ClassifySessionDump) (RPCService_ClassifySessionDumpClient, error) {
92         stream, err := c.conn.NewStream(ctx)
93         if err != nil {
94                 return nil, err
95         }
96         x := &serviceClient_ClassifySessionDumpClient{stream}
97         if err := x.Stream.SendMsg(in); err != nil {
98                 return nil, err
99         }
100         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
101                 return nil, err
102         }
103         return x, nil
104 }
105
106 type RPCService_ClassifySessionDumpClient interface {
107         Recv() (*ClassifySessionDetails, error)
108         api.Stream
109 }
110
111 type serviceClient_ClassifySessionDumpClient struct {
112         api.Stream
113 }
114
115 func (c *serviceClient_ClassifySessionDumpClient) Recv() (*ClassifySessionDetails, error) {
116         msg, err := c.Stream.RecvMsg()
117         if err != nil {
118                 return nil, err
119         }
120         switch m := msg.(type) {
121         case *ClassifySessionDetails:
122                 return m, nil
123         case *vpe.ControlPingReply:
124                 return nil, io.EOF
125         default:
126                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
127         }
128 }
129
130 func (c *serviceClient) ClassifySetInterfaceIPTable(ctx context.Context, in *ClassifySetInterfaceIPTable) (*ClassifySetInterfaceIPTableReply, error) {
131         out := new(ClassifySetInterfaceIPTableReply)
132         err := c.conn.Invoke(ctx, in, out)
133         if err != nil {
134                 return nil, err
135         }
136         return out, api.RetvalToVPPApiError(out.Retval)
137 }
138
139 func (c *serviceClient) ClassifySetInterfaceL2Tables(ctx context.Context, in *ClassifySetInterfaceL2Tables) (*ClassifySetInterfaceL2TablesReply, error) {
140         out := new(ClassifySetInterfaceL2TablesReply)
141         err := c.conn.Invoke(ctx, in, out)
142         if err != nil {
143                 return nil, err
144         }
145         return out, api.RetvalToVPPApiError(out.Retval)
146 }
147
148 func (c *serviceClient) ClassifyTableByInterface(ctx context.Context, in *ClassifyTableByInterface) (*ClassifyTableByInterfaceReply, error) {
149         out := new(ClassifyTableByInterfaceReply)
150         err := c.conn.Invoke(ctx, in, out)
151         if err != nil {
152                 return nil, err
153         }
154         return out, api.RetvalToVPPApiError(out.Retval)
155 }
156
157 func (c *serviceClient) ClassifyTableIds(ctx context.Context, in *ClassifyTableIds) (*ClassifyTableIdsReply, error) {
158         out := new(ClassifyTableIdsReply)
159         err := c.conn.Invoke(ctx, in, out)
160         if err != nil {
161                 return nil, err
162         }
163         return out, api.RetvalToVPPApiError(out.Retval)
164 }
165
166 func (c *serviceClient) ClassifyTableInfo(ctx context.Context, in *ClassifyTableInfo) (*ClassifyTableInfoReply, error) {
167         out := new(ClassifyTableInfoReply)
168         err := c.conn.Invoke(ctx, in, out)
169         if err != nil {
170                 return nil, err
171         }
172         return out, api.RetvalToVPPApiError(out.Retval)
173 }
174
175 func (c *serviceClient) ClassifyTraceGetTables(ctx context.Context, in *ClassifyTraceGetTables) (*ClassifyTraceGetTablesReply, error) {
176         out := new(ClassifyTraceGetTablesReply)
177         err := c.conn.Invoke(ctx, in, out)
178         if err != nil {
179                 return nil, err
180         }
181         return out, api.RetvalToVPPApiError(out.Retval)
182 }
183
184 func (c *serviceClient) ClassifyTraceLookupTable(ctx context.Context, in *ClassifyTraceLookupTable) (*ClassifyTraceLookupTableReply, error) {
185         out := new(ClassifyTraceLookupTableReply)
186         err := c.conn.Invoke(ctx, in, out)
187         if err != nil {
188                 return nil, err
189         }
190         return out, api.RetvalToVPPApiError(out.Retval)
191 }
192
193 func (c *serviceClient) ClassifyTraceSetTable(ctx context.Context, in *ClassifyTraceSetTable) (*ClassifyTraceSetTableReply, error) {
194         out := new(ClassifyTraceSetTableReply)
195         err := c.conn.Invoke(ctx, in, out)
196         if err != nil {
197                 return nil, err
198         }
199         return out, api.RetvalToVPPApiError(out.Retval)
200 }
201
202 func (c *serviceClient) FlowClassifyDump(ctx context.Context, in *FlowClassifyDump) (RPCService_FlowClassifyDumpClient, error) {
203         stream, err := c.conn.NewStream(ctx)
204         if err != nil {
205                 return nil, err
206         }
207         x := &serviceClient_FlowClassifyDumpClient{stream}
208         if err := x.Stream.SendMsg(in); err != nil {
209                 return nil, err
210         }
211         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
212                 return nil, err
213         }
214         return x, nil
215 }
216
217 type RPCService_FlowClassifyDumpClient interface {
218         Recv() (*FlowClassifyDetails, error)
219         api.Stream
220 }
221
222 type serviceClient_FlowClassifyDumpClient struct {
223         api.Stream
224 }
225
226 func (c *serviceClient_FlowClassifyDumpClient) Recv() (*FlowClassifyDetails, error) {
227         msg, err := c.Stream.RecvMsg()
228         if err != nil {
229                 return nil, err
230         }
231         switch m := msg.(type) {
232         case *FlowClassifyDetails:
233                 return m, nil
234         case *vpe.ControlPingReply:
235                 return nil, io.EOF
236         default:
237                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
238         }
239 }
240
241 func (c *serviceClient) FlowClassifySetInterface(ctx context.Context, in *FlowClassifySetInterface) (*FlowClassifySetInterfaceReply, error) {
242         out := new(FlowClassifySetInterfaceReply)
243         err := c.conn.Invoke(ctx, in, out)
244         if err != nil {
245                 return nil, err
246         }
247         return out, api.RetvalToVPPApiError(out.Retval)
248 }
249
250 func (c *serviceClient) InputACLSetInterface(ctx context.Context, in *InputACLSetInterface) (*InputACLSetInterfaceReply, error) {
251         out := new(InputACLSetInterfaceReply)
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) OutputACLSetInterface(ctx context.Context, in *OutputACLSetInterface) (*OutputACLSetInterfaceReply, error) {
260         out := new(OutputACLSetInterfaceReply)
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) PolicerClassifyDump(ctx context.Context, in *PolicerClassifyDump) (RPCService_PolicerClassifyDumpClient, error) {
269         stream, err := c.conn.NewStream(ctx)
270         if err != nil {
271                 return nil, err
272         }
273         x := &serviceClient_PolicerClassifyDumpClient{stream}
274         if err := x.Stream.SendMsg(in); err != nil {
275                 return nil, err
276         }
277         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
278                 return nil, err
279         }
280         return x, nil
281 }
282
283 type RPCService_PolicerClassifyDumpClient interface {
284         Recv() (*PolicerClassifyDetails, error)
285         api.Stream
286 }
287
288 type serviceClient_PolicerClassifyDumpClient struct {
289         api.Stream
290 }
291
292 func (c *serviceClient_PolicerClassifyDumpClient) Recv() (*PolicerClassifyDetails, error) {
293         msg, err := c.Stream.RecvMsg()
294         if err != nil {
295                 return nil, err
296         }
297         switch m := msg.(type) {
298         case *PolicerClassifyDetails:
299                 return m, nil
300         case *vpe.ControlPingReply:
301                 return nil, io.EOF
302         default:
303                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
304         }
305 }
306
307 func (c *serviceClient) PolicerClassifySetInterface(ctx context.Context, in *PolicerClassifySetInterface) (*PolicerClassifySetInterfaceReply, error) {
308         out := new(PolicerClassifySetInterfaceReply)
309         err := c.conn.Invoke(ctx, in, out)
310         if err != nil {
311                 return nil, err
312         }
313         return out, api.RetvalToVPPApiError(out.Retval)
314 }