diff options
-rw-r--r-- | config/bgp_configs.go | 3 | ||||
-rw-r--r-- | server/bmp.go | 8 | ||||
-rw-r--r-- | tools/pyang_plugins/gobgp.yang | 4 |
3 files changed, 12 insertions, 3 deletions
diff --git a/config/bgp_configs.go b/config/bgp_configs.go index b70ab5b5..848b21b7 100644 --- a/config/bgp_configs.go +++ b/config/bgp_configs.go @@ -859,6 +859,7 @@ const ( BMP_ROUTE_MONITORING_POLICY_TYPE_POST_POLICY BmpRouteMonitoringPolicyType = "post-policy" BMP_ROUTE_MONITORING_POLICY_TYPE_BOTH BmpRouteMonitoringPolicyType = "both" BMP_ROUTE_MONITORING_POLICY_TYPE_LOCAL_RIB BmpRouteMonitoringPolicyType = "local-rib" + BMP_ROUTE_MONITORING_POLICY_TYPE_ALL BmpRouteMonitoringPolicyType = "all" ) var BmpRouteMonitoringPolicyTypeToIntMap = map[BmpRouteMonitoringPolicyType]int{ @@ -866,6 +867,7 @@ var BmpRouteMonitoringPolicyTypeToIntMap = map[BmpRouteMonitoringPolicyType]int{ BMP_ROUTE_MONITORING_POLICY_TYPE_POST_POLICY: 1, BMP_ROUTE_MONITORING_POLICY_TYPE_BOTH: 2, BMP_ROUTE_MONITORING_POLICY_TYPE_LOCAL_RIB: 3, + BMP_ROUTE_MONITORING_POLICY_TYPE_ALL: 4, } func (v BmpRouteMonitoringPolicyType) ToInt() int { @@ -881,6 +883,7 @@ var IntToBmpRouteMonitoringPolicyTypeMap = map[int]BmpRouteMonitoringPolicyType{ 1: BMP_ROUTE_MONITORING_POLICY_TYPE_POST_POLICY, 2: BMP_ROUTE_MONITORING_POLICY_TYPE_BOTH, 3: BMP_ROUTE_MONITORING_POLICY_TYPE_LOCAL_RIB, + 4: BMP_ROUTE_MONITORING_POLICY_TYPE_ALL, } func (v BmpRouteMonitoringPolicyType) Validate() error { diff --git a/server/bmp.go b/server/bmp.go index 85016f47..30efaeb1 100644 --- a/server/bmp.go +++ b/server/bmp.go @@ -113,11 +113,13 @@ func (b *bmpClient) loop() { if func() bool { ops := []WatchOption{WatchPeerState(true)} - if b.typ == config.BMP_ROUTE_MONITORING_POLICY_TYPE_PRE_POLICY || b.typ == config.BMP_ROUTE_MONITORING_POLICY_TYPE_BOTH { + if b.typ == config.BMP_ROUTE_MONITORING_POLICY_TYPE_PRE_POLICY || b.typ == config.BMP_ROUTE_MONITORING_POLICY_TYPE_ALL || b.typ == config.BMP_ROUTE_MONITORING_POLICY_TYPE_BOTH { ops = append(ops, WatchUpdate(true)) - } else if b.typ == config.BMP_ROUTE_MONITORING_POLICY_TYPE_POST_POLICY || b.typ == config.BMP_ROUTE_MONITORING_POLICY_TYPE_BOTH { + } + if b.typ == config.BMP_ROUTE_MONITORING_POLICY_TYPE_POST_POLICY || b.typ == config.BMP_ROUTE_MONITORING_POLICY_TYPE_ALL || b.typ == config.BMP_ROUTE_MONITORING_POLICY_TYPE_BOTH { ops = append(ops, WatchPostUpdate(true)) - } else if b.typ == config.BMP_ROUTE_MONITORING_POLICY_TYPE_LOCAL_RIB { + } + if b.typ == config.BMP_ROUTE_MONITORING_POLICY_TYPE_LOCAL_RIB || b.typ == config.BMP_ROUTE_MONITORING_POLICY_TYPE_ALL { ops = append(ops, WatchBestPath(true)) } w := b.s.Watch(ops...) diff --git a/tools/pyang_plugins/gobgp.yang b/tools/pyang_plugins/gobgp.yang index b37c7898..fd1551ea 100644 --- a/tools/pyang_plugins/gobgp.yang +++ b/tools/pyang_plugins/gobgp.yang @@ -52,6 +52,10 @@ module gobgp { value 3; description "send local rib routes"; } + enum ALL { + value 4; + description "send pre-policy, post-policy, and local rib routes"; + } } } |