Change module name to go.fd.io/govpp
[govpp.git] / binapi / lb / lb_rpc.ba.go
index 72b027a..c520f58 100644 (file)
@@ -7,11 +7,11 @@ import (
        "fmt"
        "io"
 
-       api "git.fd.io/govpp.git/api"
-       vpe "git.fd.io/govpp.git/binapi/vpe"
+       api "go.fd.io/govpp/api"
+       memclnt "go.fd.io/govpp/binapi/memclnt"
 )
 
-// RPCService defines RPC service  lb.
+// RPCService defines RPC service lb.
 type RPCService interface {
        LbAddDelAs(ctx context.Context, in *LbAddDelAs) (*LbAddDelAsReply, error)
        LbAddDelIntfNat4(ctx context.Context, in *LbAddDelIntfNat4) (*LbAddDelIntfNat4Reply, error)
@@ -37,7 +37,7 @@ func (c *serviceClient) LbAddDelAs(ctx context.Context, in *LbAddDelAs) (*LbAddD
        if err != nil {
                return nil, err
        }
-       return out, nil
+       return out, api.RetvalToVPPApiError(out.Retval)
 }
 
 func (c *serviceClient) LbAddDelIntfNat4(ctx context.Context, in *LbAddDelIntfNat4) (*LbAddDelIntfNat4Reply, error) {
@@ -46,7 +46,7 @@ func (c *serviceClient) LbAddDelIntfNat4(ctx context.Context, in *LbAddDelIntfNa
        if err != nil {
                return nil, err
        }
-       return out, nil
+       return out, api.RetvalToVPPApiError(out.Retval)
 }
 
 func (c *serviceClient) LbAddDelIntfNat6(ctx context.Context, in *LbAddDelIntfNat6) (*LbAddDelIntfNat6Reply, error) {
@@ -55,7 +55,7 @@ func (c *serviceClient) LbAddDelIntfNat6(ctx context.Context, in *LbAddDelIntfNa
        if err != nil {
                return nil, err
        }
-       return out, nil
+       return out, api.RetvalToVPPApiError(out.Retval)
 }
 
 func (c *serviceClient) LbAddDelVip(ctx context.Context, in *LbAddDelVip) (*LbAddDelVipReply, error) {
@@ -64,7 +64,7 @@ func (c *serviceClient) LbAddDelVip(ctx context.Context, in *LbAddDelVip) (*LbAd
        if err != nil {
                return nil, err
        }
-       return out, nil
+       return out, api.RetvalToVPPApiError(out.Retval)
 }
 
 func (c *serviceClient) LbAsDump(ctx context.Context, in *LbAsDump) (RPCService_LbAsDumpClient, error) {
@@ -76,7 +76,7 @@ func (c *serviceClient) LbAsDump(ctx context.Context, in *LbAsDump) (RPCService_
        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
@@ -99,7 +99,11 @@ func (c *serviceClient_LbAsDumpClient) Recv() (*LbAsDetails, error) {
        switch m := msg.(type) {
        case *LbAsDetails:
                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)
@@ -112,7 +116,7 @@ func (c *serviceClient) LbConf(ctx context.Context, in *LbConf) (*LbConfReply, e
        if err != nil {
                return nil, err
        }
-       return out, nil
+       return out, api.RetvalToVPPApiError(out.Retval)
 }
 
 func (c *serviceClient) LbFlushVip(ctx context.Context, in *LbFlushVip) (*LbFlushVipReply, error) {
@@ -121,7 +125,7 @@ func (c *serviceClient) LbFlushVip(ctx context.Context, in *LbFlushVip) (*LbFlus
        if err != nil {
                return nil, err
        }
-       return out, nil
+       return out, api.RetvalToVPPApiError(out.Retval)
 }
 
 func (c *serviceClient) LbVipDump(ctx context.Context, in *LbVipDump) (RPCService_LbVipDumpClient, error) {
@@ -133,7 +137,7 @@ func (c *serviceClient) LbVipDump(ctx context.Context, in *LbVipDump) (RPCServic
        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
@@ -156,7 +160,11 @@ func (c *serviceClient_LbVipDumpClient) Recv() (*LbVipDetails, error) {
        switch m := msg.(type) {
        case *LbVipDetails:
                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)