Change module name to go.fd.io/govpp
[govpp.git] / binapi / ipip / ipip_rpc.ba.go
index bab3b22..54fd4cd 100644 (file)
@@ -5,12 +5,13 @@ package ipip
 import (
        "context"
        "fmt"
-       api "git.fd.io/govpp.git/api"
-       vpe "git.fd.io/govpp.git/binapi/vpe"
        "io"
+
+       api "go.fd.io/govpp/api"
+       memclnt "go.fd.io/govpp/binapi/memclnt"
 )
 
-// RPCService defines RPC service  ipip.
+// RPCService defines RPC service ipip.
 type RPCService interface {
        Ipip6rdAddTunnel(ctx context.Context, in *Ipip6rdAddTunnel) (*Ipip6rdAddTunnelReply, error)
        Ipip6rdDelTunnel(ctx context.Context, in *Ipip6rdDelTunnel) (*Ipip6rdDelTunnelReply, error)
@@ -33,7 +34,7 @@ func (c *serviceClient) Ipip6rdAddTunnel(ctx context.Context, in *Ipip6rdAddTunn
        if err != nil {
                return nil, err
        }
-       return out, nil
+       return out, api.RetvalToVPPApiError(out.Retval)
 }
 
 func (c *serviceClient) Ipip6rdDelTunnel(ctx context.Context, in *Ipip6rdDelTunnel) (*Ipip6rdDelTunnelReply, error) {
@@ -42,7 +43,7 @@ func (c *serviceClient) Ipip6rdDelTunnel(ctx context.Context, in *Ipip6rdDelTunn
        if err != nil {
                return nil, err
        }
-       return out, nil
+       return out, api.RetvalToVPPApiError(out.Retval)
 }
 
 func (c *serviceClient) IpipAddTunnel(ctx context.Context, in *IpipAddTunnel) (*IpipAddTunnelReply, error) {
@@ -51,7 +52,7 @@ func (c *serviceClient) IpipAddTunnel(ctx context.Context, in *IpipAddTunnel) (*
        if err != nil {
                return nil, err
        }
-       return out, nil
+       return out, api.RetvalToVPPApiError(out.Retval)
 }
 
 func (c *serviceClient) IpipDelTunnel(ctx context.Context, in *IpipDelTunnel) (*IpipDelTunnelReply, error) {
@@ -60,7 +61,7 @@ func (c *serviceClient) IpipDelTunnel(ctx context.Context, in *IpipDelTunnel) (*
        if err != nil {
                return nil, err
        }
-       return out, nil
+       return out, api.RetvalToVPPApiError(out.Retval)
 }
 
 func (c *serviceClient) IpipTunnelDump(ctx context.Context, in *IpipTunnelDump) (RPCService_IpipTunnelDumpClient, error) {
@@ -72,7 +73,7 @@ func (c *serviceClient) IpipTunnelDump(ctx context.Context, in *IpipTunnelDump)
        if err := x.Stream.SendMsg(in); err != nil {
                return nil, err
        }
-       if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil {
+       if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil {
                return nil, err
        }
        return x, nil
@@ -95,7 +96,11 @@ func (c *serviceClient_IpipTunnelDumpClient) Recv() (*IpipTunnelDetails, error)
        switch m := msg.(type) {
        case *IpipTunnelDetails:
                return m, nil
-       case *vpe.ControlPingReply:
+       case *memclnt.ControlPingReply:
+               err = c.Stream.Close()
+               if err != nil {
+                       return nil, err
+               }
                return nil, io.EOF
        default:
                return nil, fmt.Errorf("unexpected message: %T %v", m, m)