Change module name to go.fd.io/govpp
[govpp.git] / binapi / ip6_nd / ip6_nd_rpc.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2
3 package ip6_nd
4
5 import (
6         "context"
7         "fmt"
8         "io"
9
10         api "go.fd.io/govpp/api"
11         memclnt "go.fd.io/govpp/binapi/memclnt"
12 )
13
14 // RPCService defines RPC service ip6_nd.
15 type RPCService interface {
16         IP6ndProxyAddDel(ctx context.Context, in *IP6ndProxyAddDel) (*IP6ndProxyAddDelReply, error)
17         IP6ndProxyDump(ctx context.Context, in *IP6ndProxyDump) (RPCService_IP6ndProxyDumpClient, error)
18         IP6ndProxyEnableDisable(ctx context.Context, in *IP6ndProxyEnableDisable) (*IP6ndProxyEnableDisableReply, error)
19         IP6ndSendRouterSolicitation(ctx context.Context, in *IP6ndSendRouterSolicitation) (*IP6ndSendRouterSolicitationReply, error)
20         SwInterfaceIP6ndRaConfig(ctx context.Context, in *SwInterfaceIP6ndRaConfig) (*SwInterfaceIP6ndRaConfigReply, error)
21         SwInterfaceIP6ndRaPrefix(ctx context.Context, in *SwInterfaceIP6ndRaPrefix) (*SwInterfaceIP6ndRaPrefixReply, error)
22         WantIP6RaEvents(ctx context.Context, in *WantIP6RaEvents) (*WantIP6RaEventsReply, error)
23 }
24
25 type serviceClient struct {
26         conn api.Connection
27 }
28
29 func NewServiceClient(conn api.Connection) RPCService {
30         return &serviceClient{conn}
31 }
32
33 func (c *serviceClient) IP6ndProxyAddDel(ctx context.Context, in *IP6ndProxyAddDel) (*IP6ndProxyAddDelReply, error) {
34         out := new(IP6ndProxyAddDelReply)
35         err := c.conn.Invoke(ctx, in, out)
36         if err != nil {
37                 return nil, err
38         }
39         return out, api.RetvalToVPPApiError(out.Retval)
40 }
41
42 func (c *serviceClient) IP6ndProxyDump(ctx context.Context, in *IP6ndProxyDump) (RPCService_IP6ndProxyDumpClient, error) {
43         stream, err := c.conn.NewStream(ctx)
44         if err != nil {
45                 return nil, err
46         }
47         x := &serviceClient_IP6ndProxyDumpClient{stream}
48         if err := x.Stream.SendMsg(in); err != nil {
49                 return nil, err
50         }
51         if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil {
52                 return nil, err
53         }
54         return x, nil
55 }
56
57 type RPCService_IP6ndProxyDumpClient interface {
58         Recv() (*IP6ndProxyDetails, error)
59         api.Stream
60 }
61
62 type serviceClient_IP6ndProxyDumpClient struct {
63         api.Stream
64 }
65
66 func (c *serviceClient_IP6ndProxyDumpClient) Recv() (*IP6ndProxyDetails, error) {
67         msg, err := c.Stream.RecvMsg()
68         if err != nil {
69                 return nil, err
70         }
71         switch m := msg.(type) {
72         case *IP6ndProxyDetails:
73                 return m, nil
74         case *memclnt.ControlPingReply:
75                 err = c.Stream.Close()
76                 if err != nil {
77                         return nil, err
78                 }
79                 return nil, io.EOF
80         default:
81                 return nil, fmt.Errorf("unexpected message: %T %v", m, m)
82         }
83 }
84
85 func (c *serviceClient) IP6ndProxyEnableDisable(ctx context.Context, in *IP6ndProxyEnableDisable) (*IP6ndProxyEnableDisableReply, error) {
86         out := new(IP6ndProxyEnableDisableReply)
87         err := c.conn.Invoke(ctx, in, out)
88         if err != nil {
89                 return nil, err
90         }
91         return out, api.RetvalToVPPApiError(out.Retval)
92 }
93
94 func (c *serviceClient) IP6ndSendRouterSolicitation(ctx context.Context, in *IP6ndSendRouterSolicitation) (*IP6ndSendRouterSolicitationReply, error) {
95         out := new(IP6ndSendRouterSolicitationReply)
96         err := c.conn.Invoke(ctx, in, out)
97         if err != nil {
98                 return nil, err
99         }
100         return out, api.RetvalToVPPApiError(out.Retval)
101 }
102
103 func (c *serviceClient) SwInterfaceIP6ndRaConfig(ctx context.Context, in *SwInterfaceIP6ndRaConfig) (*SwInterfaceIP6ndRaConfigReply, error) {
104         out := new(SwInterfaceIP6ndRaConfigReply)
105         err := c.conn.Invoke(ctx, in, out)
106         if err != nil {
107                 return nil, err
108         }
109         return out, api.RetvalToVPPApiError(out.Retval)
110 }
111
112 func (c *serviceClient) SwInterfaceIP6ndRaPrefix(ctx context.Context, in *SwInterfaceIP6ndRaPrefix) (*SwInterfaceIP6ndRaPrefixReply, error) {
113         out := new(SwInterfaceIP6ndRaPrefixReply)
114         err := c.conn.Invoke(ctx, in, out)
115         if err != nil {
116                 return nil, err
117         }
118         return out, api.RetvalToVPPApiError(out.Retval)
119 }
120
121 func (c *serviceClient) WantIP6RaEvents(ctx context.Context, in *WantIP6RaEvents) (*WantIP6RaEventsReply, error) {
122         out := new(WantIP6RaEventsReply)
123         err := c.conn.Invoke(ctx, in, out)
124         if err != nil {
125                 return nil, err
126         }
127         return out, api.RetvalToVPPApiError(out.Retval)
128 }