From 9a45ed09b0a1b55be1391e3e5ba0e008b776d262 Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Mon, 13 Feb 2017 07:49:42 +0000 Subject: cli: add current option to monitor commands Signed-off-by: ISHIDA Wataru --- client/client.go | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'client/client.go') diff --git a/client/client.go b/client/client.go index fea22e5d..211e55ef 100644 --- a/client/client.go +++ b/client/client.go @@ -912,10 +912,13 @@ func (c *MonitorRIBClient) Recv() (*table.Destination, error) { return d.ToNativeDestination() } -func (cli *Client) MonitorRIB(family bgp.RouteFamily) (*MonitorRIBClient, error) { - stream, err := cli.cli.MonitorRib(context.Background(), &api.Table{ - Type: api.Resource_GLOBAL, - Family: uint32(family), +func (cli *Client) MonitorRIB(family bgp.RouteFamily, current bool) (*MonitorRIBClient, error) { + stream, err := cli.cli.MonitorRib(context.Background(), &api.MonitorRibRequest{ + Table: &api.Table{ + Type: api.Resource_GLOBAL, + Family: uint32(family), + }, + Current: current, }) if err != nil { return nil, err @@ -923,11 +926,14 @@ func (cli *Client) MonitorRIB(family bgp.RouteFamily) (*MonitorRIBClient, error) return &MonitorRIBClient{stream}, nil } -func (cli *Client) MonitorAdjRIBIn(name string, family bgp.RouteFamily) (*MonitorRIBClient, error) { - stream, err := cli.cli.MonitorRib(context.Background(), &api.Table{ - Type: api.Resource_ADJ_IN, - Name: name, - Family: uint32(family), +func (cli *Client) MonitorAdjRIBIn(name string, family bgp.RouteFamily, current bool) (*MonitorRIBClient, error) { + stream, err := cli.cli.MonitorRib(context.Background(), &api.MonitorRibRequest{ + Table: &api.Table{ + Type: api.Resource_ADJ_IN, + Name: name, + Family: uint32(family), + }, + Current: current, }) if err != nil { return nil, err -- cgit v1.2.3