summaryrefslogtreecommitdiffhomepage
path: root/client/client.go
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2017-02-13 07:49:42 +0000
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-02-15 00:10:15 +0900
commit9a45ed09b0a1b55be1391e3e5ba0e008b776d262 (patch)
treecb7f53dd331a635a006c3cc1543f83f560d91a46 /client/client.go
parent52356c26f821fdebb3fdf943a1b898a2d1b4d0db (diff)
cli: add current option to monitor commands
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'client/client.go')
-rw-r--r--client/client.go24
1 files changed, 15 insertions, 9 deletions
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