summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorEiichiro Watanabe <a16tochjp@gmail.com>2017-08-24 18:15:01 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-08-29 18:38:33 +0900
commitd92d3199318f609985a978cf0c87f77a56131104 (patch)
tree29caba309eb3af6ed966c151fd0326a43bb96f57
parent2d65055028a1eb3528ff6f3f5aaa486083d7e38e (diff)
gobgp: support local-rib/all option in command "gobgp bmp add"
-rw-r--r--api/gobgp.pb.go18
-rw-r--r--api/gobgp.proto2
-rw-r--r--gobgp/cmd/bmp.go8
3 files changed, 20 insertions, 8 deletions
diff --git a/api/gobgp.pb.go b/api/gobgp.pb.go
index 97d46bd6..c9908723 100644
--- a/api/gobgp.pb.go
+++ b/api/gobgp.pb.go
@@ -432,20 +432,26 @@ func (SoftResetNeighborRequest_SoftResetDirection) EnumDescriptor() ([]byte, []i
type AddBmpRequest_MonitoringPolicy int32
const (
- AddBmpRequest_PRE AddBmpRequest_MonitoringPolicy = 0
- AddBmpRequest_POST AddBmpRequest_MonitoringPolicy = 1
- AddBmpRequest_BOTH AddBmpRequest_MonitoringPolicy = 2
+ AddBmpRequest_PRE AddBmpRequest_MonitoringPolicy = 0
+ AddBmpRequest_POST AddBmpRequest_MonitoringPolicy = 1
+ AddBmpRequest_BOTH AddBmpRequest_MonitoringPolicy = 2
+ AddBmpRequest_LOCAL AddBmpRequest_MonitoringPolicy = 3
+ AddBmpRequest_ALL AddBmpRequest_MonitoringPolicy = 4
)
var AddBmpRequest_MonitoringPolicy_name = map[int32]string{
0: "PRE",
1: "POST",
2: "BOTH",
+ 3: "LOCAL",
+ 4: "ALL",
}
var AddBmpRequest_MonitoringPolicy_value = map[string]int32{
- "PRE": 0,
- "POST": 1,
- "BOTH": 2,
+ "PRE": 0,
+ "POST": 1,
+ "BOTH": 2,
+ "LOCAL": 3,
+ "ALL": 4,
}
func (x AddBmpRequest_MonitoringPolicy) String() string {
diff --git a/api/gobgp.proto b/api/gobgp.proto
index 907d3898..cc12f6ba 100644
--- a/api/gobgp.proto
+++ b/api/gobgp.proto
@@ -204,6 +204,8 @@ message AddBmpRequest {
PRE = 0;
POST = 1;
BOTH = 2;
+ LOCAL = 3;
+ ALL = 4;
}
MonitoringPolicy type = 3;
}
diff --git a/gobgp/cmd/bmp.go b/gobgp/cmd/bmp.go
index f7d26022..78fff114 100644
--- a/gobgp/cmd/bmp.go
+++ b/gobgp/cmd/bmp.go
@@ -27,7 +27,7 @@ import (
func modBmpServer(cmdType string, args []string) error {
if len(args) < 1 {
- return fmt.Errorf("usage: gobgp bmp %s <addr>[:<port>] [{pre|post|both}]", cmdType)
+ return fmt.Errorf("usage: gobgp bmp %s <addr>[:<port>] [{pre|post|both|local-rib|all}]", cmdType)
}
var address string
@@ -55,8 +55,12 @@ func modBmpServer(cmdType string, args []string) error {
policyType = config.BMP_ROUTE_MONITORING_POLICY_TYPE_POST_POLICY
case "both":
policyType = config.BMP_ROUTE_MONITORING_POLICY_TYPE_BOTH
+ case "local-rib":
+ policyType = config.BMP_ROUTE_MONITORING_POLICY_TYPE_LOCAL_RIB
+ case "all":
+ policyType = config.BMP_ROUTE_MONITORING_POLICY_TYPE_ALL
default:
- return fmt.Errorf("invalid bmp policy type. valid type is {pre|post|both}")
+ return fmt.Errorf("invalid bmp policy type. valid type is {pre|post|both|local-rib|all}")
}
}
err = client.AddBMP(&config.BmpServerConfig{