Update generated binapi to v22.02 & makefile changes
[govpp.git] / internal / testbinapi / binapi2001 / 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/internal/testbinapi/binapi2001/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         ClassifySessionDump(ctx context.Context, in *ClassifySessionDump) (RPCService_ClassifySessionDumpClient, error)
19         ClassifySetInterfaceIPTable(ctx context.Context, in *ClassifySetInterfaceIPTable) (*ClassifySetInterfaceIPTableReply, error)
20         ClassifySetInterfaceL2Tables(ctx context.Context, in *ClassifySetInterfaceL2Tables) (*ClassifySetInterfaceL2TablesReply, error)
21         ClassifyTableByInterface(ctx context.Context, in *ClassifyTableByInterface) (*ClassifyTableByInterfaceReply, error)
22         ClassifyTableIds(ctx context.Context, in *ClassifyTableIds) (*ClassifyTableIdsReply, error)
23         ClassifyTableInfo(ctx context.Context, in *ClassifyTableInfo) (*ClassifyTableInfoReply, error)
24         FlowClassifyDump(ctx context.Context, in *FlowClassifyDump) (RPCService_FlowClassifyDumpClient, error)
25         FlowClassifySetInterface(ctx context.Context, in *FlowClassifySetInterface) (*FlowClassifySetInterfaceReply, error)
26         InputACLSetInterface(ctx context.Context, in *InputACLSetInterface) (*InputACLSetInterfaceReply, error)
27         OutputACLSetInterface(ctx context.Context, in *OutputACLSetInterface) (*OutputACLSetInterfaceReply, error)
28         PolicerClassifyDump(ctx context.Context, in *PolicerClassifyDump) (RPCService_PolicerClassifyDumpClient, error)
29         PolicerClassifySetInterface(ctx context.Context, in *PolicerClassifySetInterface) (*PolicerClassifySetInterfaceReply, error)
30 }
31
32 type serviceClient struct {
33         conn api.Connection
34 }
35
36 func NewServiceClient(conn api.Connection) RPCService {
37         return &serviceClient{conn}
38 }
39
40 func (c *serviceClient) ClassifyAddDelSession(ctx context.Context, in *ClassifyAddDelSession) (*ClassifyAddDelSessionReply, error) {
41         out := new(ClassifyAddDelSessionReply)
42         err := c.conn.Invoke(ctx, in, out)
43         if err != nil {
44                 return nil, err
45         }
46         return out, api.RetvalToVPPApiError(out.Retval)
47 }
48
49 func (c *serviceClient) ClassifyAddDelTable(ctx context.Context, in *ClassifyAddDelTable) (*ClassifyAddDelTableReply, error) {
50         out := new(ClassifyAddDelTableReply)
51         err := c.conn.Invoke(ctx, in, out)
52         if err != nil {
53                 return nil, err
54         }
55         return out, api.RetvalToVPPApiError(out.Retval)
56 }
57
58 func (c *serviceClient) ClassifySessionDump(ctx context.Context, in *ClassifySessionDump) (RPCService_ClassifySessionDumpClient, error) {
59         stream, err := c.conn.NewStream(ctx)
60         if err != nil {
61                 return nil, err
62         }
63         x := &serviceClient_ClassifySessionDumpClient{stream}
64         if err := x.Stream.SendMsg(in); err != nil {
65                 return nil, err
66         }
67         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
68                 return nil, err
69         }
70         return x, nil
71 }
72
73 type RPCService_ClassifySessionDumpClient interface {
74         Recv() (*ClassifySessionDetails, error)
75         api.Stream
76 }
77
78 type serviceClient_ClassifySessionDumpClient struct {
79         api.Stream
80 }
81
82 func (c *serviceClient_ClassifySessionDumpClient) Recv() (*ClassifySessionDetails, error) {
83         msg, err := c.Stream.RecvMsg()
84         if err != nil {
85                 return nil, err
86         }
87         switch m := msg.(type) {
88         case *ClassifySessionDetails:
89                 return m, nil
90         case *vpe.ControlPingReply:
91                 err = c.Stream.Close()
92                 if err != nil {
93                         return nil, err
94                 }
95                 return nil, io.EOF
96         default:
97                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
98         }
99 }
100
101 func (c *serviceClient) ClassifySetInterfaceIPTable(ctx context.Context, in *ClassifySetInterfaceIPTable) (*ClassifySetInterfaceIPTableReply, error) {
102         out := new(ClassifySetInterfaceIPTableReply)
103         err := c.conn.Invoke(ctx, in, out)
104         if err != nil {
105                 return nil, err
106         }
107         return out, api.RetvalToVPPApiError(out.Retval)
108 }
109
110 func (c *serviceClient) ClassifySetInterfaceL2Tables(ctx context.Context, in *ClassifySetInterfaceL2Tables) (*ClassifySetInterfaceL2TablesReply, error) {
111         out := new(ClassifySetInterfaceL2TablesReply)
112         err := c.conn.Invoke(ctx, in, out)
113         if err != nil {
114                 return nil, err
115         }
116         return out, api.RetvalToVPPApiError(out.Retval)
117 }
118
119 func (c *serviceClient) ClassifyTableByInterface(ctx context.Context, in *ClassifyTableByInterface) (*ClassifyTableByInterfaceReply, error) {
120         out := new(ClassifyTableByInterfaceReply)
121         err := c.conn.Invoke(ctx, in, out)
122         if err != nil {
123                 return nil, err
124         }
125         return out, api.RetvalToVPPApiError(out.Retval)
126 }
127
128 func (c *serviceClient) ClassifyTableIds(ctx context.Context, in *ClassifyTableIds) (*ClassifyTableIdsReply, error) {
129         out := new(ClassifyTableIdsReply)
130         err := c.conn.Invoke(ctx, in, out)
131         if err != nil {
132                 return nil, err
133         }
134         return out, api.RetvalToVPPApiError(out.Retval)
135 }
136
137 func (c *serviceClient) ClassifyTableInfo(ctx context.Context, in *ClassifyTableInfo) (*ClassifyTableInfoReply, error) {
138         out := new(ClassifyTableInfoReply)
139         err := c.conn.Invoke(ctx, in, out)
140         if err != nil {
141                 return nil, err
142         }
143         return out, api.RetvalToVPPApiError(out.Retval)
144 }
145
146 func (c *serviceClient) FlowClassifyDump(ctx context.Context, in *FlowClassifyDump) (RPCService_FlowClassifyDumpClient, error) {
147         stream, err := c.conn.NewStream(ctx)
148         if err != nil {
149                 return nil, err
150         }
151         x := &serviceClient_FlowClassifyDumpClient{stream}
152         if err := x.Stream.SendMsg(in); err != nil {
153                 return nil, err
154         }
155         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
156                 return nil, err
157         }
158         return x, nil
159 }
160
161 type RPCService_FlowClassifyDumpClient interface {
162         Recv() (*FlowClassifyDetails, error)
163         api.Stream
164 }
165
166 type serviceClient_FlowClassifyDumpClient struct {
167         api.Stream
168 }
169
170 func (c *serviceClient_FlowClassifyDumpClient) Recv() (*FlowClassifyDetails, error) {
171         msg, err := c.Stream.RecvMsg()
172         if err != nil {
173                 return nil, err
174         }
175         switch m := msg.(type) {
176         case *FlowClassifyDetails:
177                 return m, nil
178         case *vpe.ControlPingReply:
179                 err = c.Stream.Close()
180                 if err != nil {
181                         return nil, err
182                 }
183                 return nil, io.EOF
184         default:
185                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
186         }
187 }
188
189 func (c *serviceClient) FlowClassifySetInterface(ctx context.Context, in *FlowClassifySetInterface) (*FlowClassifySetInterfaceReply, error) {
190         out := new(FlowClassifySetInterfaceReply)
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) InputACLSetInterface(ctx context.Context, in *InputACLSetInterface) (*InputACLSetInterfaceReply, error) {
199         out := new(InputACLSetInterfaceReply)
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) OutputACLSetInterface(ctx context.Context, in *OutputACLSetInterface) (*OutputACLSetInterfaceReply, error) {
208         out := new(OutputACLSetInterfaceReply)
209         err := c.conn.Invoke(ctx, in, out)
210         if err != nil {
211                 return nil, err
212         }
213         return out, api.RetvalToVPPApiError(out.Retval)
214 }
215
216 func (c *serviceClient) PolicerClassifyDump(ctx context.Context, in *PolicerClassifyDump) (RPCService_PolicerClassifyDumpClient, error) {
217         stream, err := c.conn.NewStream(ctx)
218         if err != nil {
219                 return nil, err
220         }
221         x := &serviceClient_PolicerClassifyDumpClient{stream}
222         if err := x.Stream.SendMsg(in); err != nil {
223                 return nil, err
224         }
225         if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
226                 return nil, err
227         }
228         return x, nil
229 }
230
231 type RPCService_PolicerClassifyDumpClient interface {
232         Recv() (*PolicerClassifyDetails, error)
233         api.Stream
234 }
235
236 type serviceClient_PolicerClassifyDumpClient struct {
237         api.Stream
238 }
239
240 func (c *serviceClient_PolicerClassifyDumpClient) Recv() (*PolicerClassifyDetails, error) {
241         msg, err := c.Stream.RecvMsg()
242         if err != nil {
243                 return nil, err
244         }
245         switch m := msg.(type) {
246         case *PolicerClassifyDetails:
247                 return m, nil
248         case *vpe.ControlPingReply:
249                 err = c.Stream.Close()
250                 if err != nil {
251                         return nil, err
252                 }
253                 return nil, io.EOF
254         default:
255                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
256         }
257 }
258
259 func (c *serviceClient) PolicerClassifySetInterface(ctx context.Context, in *PolicerClassifySetInterface) (*PolicerClassifySetInterfaceReply, error) {
260         out := new(PolicerClassifySetInterfaceReply)
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 }