X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=binapi%2Fvrrp%2Fvrrp_rpc.ba.go;h=5f18b1c1464dfdf9075c3c825651bf4411d40f49;hb=67cea0df30f7ef348e265c9326f7a9f15ba26240;hp=12be3c8391b38f5fef01119ec9036a37096d1711;hpb=c94a962279858fb13eaacc689f47aed358373e44;p=govpp.git diff --git a/binapi/vrrp/vrrp_rpc.ba.go b/binapi/vrrp/vrrp_rpc.ba.go index 12be3c8..5f18b1c 100644 --- a/binapi/vrrp/vrrp_rpc.ba.go +++ b/binapi/vrrp/vrrp_rpc.ba.go @@ -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 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) @@ -20,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 { @@ -36,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) { @@ -48,7 +49,7 @@ func (c *serviceClient) VrrpVrDump(ctx context.Context, in *VrrpVrDump) (RPCServ 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 @@ -71,7 +72,11 @@ func (c *serviceClient_VrrpVrDumpClient) Recv() (*VrrpVrDetails, error) { switch m := msg.(type) { case *VrrpVrDetails: 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) @@ -87,7 +92,7 @@ func (c *serviceClient) VrrpVrPeerDump(ctx context.Context, in *VrrpVrPeerDump) 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 @@ -110,7 +115,11 @@ func (c *serviceClient_VrrpVrPeerDumpClient) Recv() (*VrrpVrPeerDetails, error) switch m := msg.(type) { case *VrrpVrPeerDetails: 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) @@ -123,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) { @@ -132,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) { @@ -141,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) { @@ -153,7 +162,7 @@ func (c *serviceClient) VrrpVrTrackIfDump(ctx context.Context, in *VrrpVrTrackIf 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 @@ -176,9 +185,22 @@ func (c *serviceClient_VrrpVrTrackIfDumpClient) Recv() (*VrrpVrTrackIfDetails, e switch m := msg.(type) { case *VrrpVrTrackIfDetails: 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) } } + +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) +}