summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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
}