summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2018-01-11 10:04:35 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-01-12 21:36:57 +0900
commita61d468da585db352f5745663ed07ba28878b95b (patch)
tree6f61680c78693d5f2b2116c61e2be35eb4f7e273
parent568c7aab62cc7a755debcf5e29e8354a73791622 (diff)
cli: "monitor neighbor" command supports current flag
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
-rw-r--r--client/client.go5
-rw-r--r--gobgp/cmd/monitor.go6
2 files changed, 6 insertions, 5 deletions
diff --git a/client/client.go b/client/client.go
index a48f3c17..50d55319 100644
--- a/client/client.go
+++ b/client/client.go
@@ -993,9 +993,10 @@ func (c *MonitorNeighborStateClient) Recv() (*config.Neighbor, error) {
return api.NewNeighborFromAPIStruct(p)
}
-func (cli *Client) MonitorNeighborState(name string) (*MonitorNeighborStateClient, error) {
+func (cli *Client) MonitorNeighborState(name string, current bool) (*MonitorNeighborStateClient, error) {
stream, err := cli.cli.MonitorPeerState(context.Background(), &api.Arguments{
- Name: name,
+ Name: name,
+ Current: current,
})
if err != nil {
return nil, err
diff --git a/gobgp/cmd/monitor.go b/gobgp/cmd/monitor.go
index 9a0f25b6..b99575ae 100644
--- a/gobgp/cmd/monitor.go
+++ b/gobgp/cmd/monitor.go
@@ -115,7 +115,6 @@ func NewMonitorCmd() *cobra.Command {
},
}
ribCmd.PersistentFlags().StringVarP(&subOpts.AddressFamily, "address-family", "a", "", "address family")
- ribCmd.PersistentFlags().BoolVarP(&current, "current", "", false, "dump current contents")
globalCmd := &cobra.Command{
Use: CMD_GLOBAL,
@@ -130,7 +129,7 @@ func NewMonitorCmd() *cobra.Command {
if len(args) > 0 {
name = args[0]
}
- stream, err := client.MonitorNeighborState(name)
+ stream, err := client.MonitorNeighborState(name, current)
if err != nil {
exitWithError(err)
}
@@ -178,7 +177,6 @@ func NewMonitorCmd() *cobra.Command {
},
}
adjInCmd.PersistentFlags().StringVarP(&subOpts.AddressFamily, "address-family", "a", "", "address family")
- adjInCmd.PersistentFlags().BoolVarP(&current, "current", "", false, "dump current contents")
monitorCmd := &cobra.Command{
Use: CMD_MONITOR,
@@ -187,5 +185,7 @@ func NewMonitorCmd() *cobra.Command {
monitorCmd.AddCommand(neighborCmd)
monitorCmd.AddCommand(adjInCmd)
+ monitorCmd.PersistentFlags().BoolVarP(&current, "current", "", false, "dump current contents")
+
return monitorCmd
}