github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/ip6_nd/ip6_nd_rpc.ba.go (about)

     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  	memclnt "github.com/networkservicemesh/govpp/binapi/memclnt"
    11  	api "go.fd.io/govpp/api"
    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  	SwInterfaceIP6ndRaDump(ctx context.Context, in *SwInterfaceIP6ndRaDump) (RPCService_SwInterfaceIP6ndRaDumpClient, error)
    22  	SwInterfaceIP6ndRaPrefix(ctx context.Context, in *SwInterfaceIP6ndRaPrefix) (*SwInterfaceIP6ndRaPrefixReply, error)
    23  	WantIP6RaEvents(ctx context.Context, in *WantIP6RaEvents) (*WantIP6RaEventsReply, error)
    24  }
    25  
    26  type serviceClient struct {
    27  	conn api.Connection
    28  }
    29  
    30  func NewServiceClient(conn api.Connection) RPCService {
    31  	return &serviceClient{conn}
    32  }
    33  
    34  func (c *serviceClient) IP6ndProxyAddDel(ctx context.Context, in *IP6ndProxyAddDel) (*IP6ndProxyAddDelReply, error) {
    35  	out := new(IP6ndProxyAddDelReply)
    36  	err := c.conn.Invoke(ctx, in, out)
    37  	if err != nil {
    38  		return nil, err
    39  	}
    40  	return out, api.RetvalToVPPApiError(out.Retval)
    41  }
    42  
    43  func (c *serviceClient) IP6ndProxyDump(ctx context.Context, in *IP6ndProxyDump) (RPCService_IP6ndProxyDumpClient, error) {
    44  	stream, err := c.conn.NewStream(ctx)
    45  	if err != nil {
    46  		return nil, err
    47  	}
    48  	x := &serviceClient_IP6ndProxyDumpClient{stream}
    49  	if err := x.Stream.SendMsg(in); err != nil {
    50  		return nil, err
    51  	}
    52  	if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil {
    53  		return nil, err
    54  	}
    55  	return x, nil
    56  }
    57  
    58  type RPCService_IP6ndProxyDumpClient interface {
    59  	Recv() (*IP6ndProxyDetails, error)
    60  	api.Stream
    61  }
    62  
    63  type serviceClient_IP6ndProxyDumpClient struct {
    64  	api.Stream
    65  }
    66  
    67  func (c *serviceClient_IP6ndProxyDumpClient) Recv() (*IP6ndProxyDetails, error) {
    68  	msg, err := c.Stream.RecvMsg()
    69  	if err != nil {
    70  		return nil, err
    71  	}
    72  	switch m := msg.(type) {
    73  	case *IP6ndProxyDetails:
    74  		return m, nil
    75  	case *memclnt.ControlPingReply:
    76  		err = c.Stream.Close()
    77  		if err != nil {
    78  			return nil, err
    79  		}
    80  		return nil, io.EOF
    81  	default:
    82  		return nil, fmt.Errorf("unexpected message: %T %v", m, m)
    83  	}
    84  }
    85  
    86  func (c *serviceClient) IP6ndProxyEnableDisable(ctx context.Context, in *IP6ndProxyEnableDisable) (*IP6ndProxyEnableDisableReply, error) {
    87  	out := new(IP6ndProxyEnableDisableReply)
    88  	err := c.conn.Invoke(ctx, in, out)
    89  	if err != nil {
    90  		return nil, err
    91  	}
    92  	return out, api.RetvalToVPPApiError(out.Retval)
    93  }
    94  
    95  func (c *serviceClient) IP6ndSendRouterSolicitation(ctx context.Context, in *IP6ndSendRouterSolicitation) (*IP6ndSendRouterSolicitationReply, error) {
    96  	out := new(IP6ndSendRouterSolicitationReply)
    97  	err := c.conn.Invoke(ctx, in, out)
    98  	if err != nil {
    99  		return nil, err
   100  	}
   101  	return out, api.RetvalToVPPApiError(out.Retval)
   102  }
   103  
   104  func (c *serviceClient) SwInterfaceIP6ndRaConfig(ctx context.Context, in *SwInterfaceIP6ndRaConfig) (*SwInterfaceIP6ndRaConfigReply, error) {
   105  	out := new(SwInterfaceIP6ndRaConfigReply)
   106  	err := c.conn.Invoke(ctx, in, out)
   107  	if err != nil {
   108  		return nil, err
   109  	}
   110  	return out, api.RetvalToVPPApiError(out.Retval)
   111  }
   112  
   113  func (c *serviceClient) SwInterfaceIP6ndRaDump(ctx context.Context, in *SwInterfaceIP6ndRaDump) (RPCService_SwInterfaceIP6ndRaDumpClient, error) {
   114  	stream, err := c.conn.NewStream(ctx)
   115  	if err != nil {
   116  		return nil, err
   117  	}
   118  	x := &serviceClient_SwInterfaceIP6ndRaDumpClient{stream}
   119  	if err := x.Stream.SendMsg(in); err != nil {
   120  		return nil, err
   121  	}
   122  	if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil {
   123  		return nil, err
   124  	}
   125  	return x, nil
   126  }
   127  
   128  type RPCService_SwInterfaceIP6ndRaDumpClient interface {
   129  	Recv() (*SwInterfaceIP6ndRaDetails, error)
   130  	api.Stream
   131  }
   132  
   133  type serviceClient_SwInterfaceIP6ndRaDumpClient struct {
   134  	api.Stream
   135  }
   136  
   137  func (c *serviceClient_SwInterfaceIP6ndRaDumpClient) Recv() (*SwInterfaceIP6ndRaDetails, error) {
   138  	msg, err := c.Stream.RecvMsg()
   139  	if err != nil {
   140  		return nil, err
   141  	}
   142  	switch m := msg.(type) {
   143  	case *SwInterfaceIP6ndRaDetails:
   144  		return m, nil
   145  	case *memclnt.ControlPingReply:
   146  		err = c.Stream.Close()
   147  		if err != nil {
   148  			return nil, err
   149  		}
   150  		return nil, io.EOF
   151  	default:
   152  		return nil, fmt.Errorf("unexpected message: %T %v", m, m)
   153  	}
   154  }
   155  
   156  func (c *serviceClient) SwInterfaceIP6ndRaPrefix(ctx context.Context, in *SwInterfaceIP6ndRaPrefix) (*SwInterfaceIP6ndRaPrefixReply, error) {
   157  	out := new(SwInterfaceIP6ndRaPrefixReply)
   158  	err := c.conn.Invoke(ctx, in, out)
   159  	if err != nil {
   160  		return nil, err
   161  	}
   162  	return out, api.RetvalToVPPApiError(out.Retval)
   163  }
   164  
   165  func (c *serviceClient) WantIP6RaEvents(ctx context.Context, in *WantIP6RaEvents) (*WantIP6RaEventsReply, error) {
   166  	out := new(WantIP6RaEventsReply)
   167  	err := c.conn.Invoke(ctx, in, out)
   168  	if err != nil {
   169  		return nil, err
   170  	}
   171  	return out, api.RetvalToVPPApiError(out.Retval)
   172  }