X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=binapi%2Fvrrp%2Fvrrp_rpc.ba.go;h=023854a9991284a9b58a6ab7976872ea0b4f0617;hb=c09ee3241377aae2530a73d48c4e20641d76d0ee;hp=c001082d6cfde7b409230b41d40fa7dc303efa1e;hpb=d1f24d37bd447b64e402298bb8eb2479681facf9;p=govpp.git diff --git a/binapi/vrrp/vrrp_rpc.ba.go b/binapi/vrrp/vrrp_rpc.ba.go index c001082..023854a 100644 --- a/binapi/vrrp/vrrp_rpc.ba.go +++ b/binapi/vrrp/vrrp_rpc.ba.go @@ -5,12 +5,13 @@ package vrrp import ( "context" "fmt" + "io" + api "git.fd.io/govpp.git/api" vpe "git.fd.io/govpp.git/binapi/vpe" - "io" ) -// RPCService defines RPC service vrrp. +// RPCService defines RPC service vrrp. type RPCService interface { VrrpVrAddDel(ctx context.Context, in *VrrpVrAddDel) (*VrrpVrAddDelReply, error) VrrpVrDump(ctx context.Context, in *VrrpVrDump) (RPCService_VrrpVrDumpClient, error) @@ -19,6 +20,7 @@ type RPCService interface { VrrpVrStartStop(ctx context.Context, in *VrrpVrStartStop) (*VrrpVrStartStopReply, error) VrrpVrTrackIfAddDel(ctx context.Context, in *VrrpVrTrackIfAddDel) (*VrrpVrTrackIfAddDelReply, error) VrrpVrTrackIfDump(ctx context.Context, in *VrrpVrTrackIfDump) (RPCService_VrrpVrTrackIfDumpClient, error) + WantVrrpVrEvents(ctx context.Context, in *WantVrrpVrEvents) (*WantVrrpVrEventsReply, error) } type serviceClient struct { @@ -35,7 +37,7 @@ func (c *serviceClient) VrrpVrAddDel(ctx context.Context, in *VrrpVrAddDel) (*Vr if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) VrrpVrDump(ctx context.Context, in *VrrpVrDump) (RPCService_VrrpVrDumpClient, error) { @@ -71,6 +73,10 @@ func (c *serviceClient_VrrpVrDumpClient) Recv() (*VrrpVrDetails, error) { case *VrrpVrDetails: return m, nil case *vpe.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) @@ -110,6 +116,10 @@ func (c *serviceClient_VrrpVrPeerDumpClient) Recv() (*VrrpVrPeerDetails, error) case *VrrpVrPeerDetails: return m, nil case *vpe.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) @@ -122,7 +132,7 @@ func (c *serviceClient) VrrpVrSetPeers(ctx context.Context, in *VrrpVrSetPeers) if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) VrrpVrStartStop(ctx context.Context, in *VrrpVrStartStop) (*VrrpVrStartStopReply, error) { @@ -131,7 +141,7 @@ func (c *serviceClient) VrrpVrStartStop(ctx context.Context, in *VrrpVrStartStop if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) VrrpVrTrackIfAddDel(ctx context.Context, in *VrrpVrTrackIfAddDel) (*VrrpVrTrackIfAddDelReply, error) { @@ -140,7 +150,7 @@ func (c *serviceClient) VrrpVrTrackIfAddDel(ctx context.Context, in *VrrpVrTrack if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) VrrpVrTrackIfDump(ctx context.Context, in *VrrpVrTrackIfDump) (RPCService_VrrpVrTrackIfDumpClient, error) { @@ -176,8 +186,21 @@ func (c *serviceClient_VrrpVrTrackIfDumpClient) Recv() (*VrrpVrTrackIfDetails, e case *VrrpVrTrackIfDetails: return m, nil case *vpe.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) } } + +func (c *serviceClient) WantVrrpVrEvents(ctx context.Context, in *WantVrrpVrEvents) (*WantVrrpVrEventsReply, error) { + out := new(WantVrrpVrEventsReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +}