From ea56b24395b29025c0ad4ce2fac10be9b6c8895b Mon Sep 17 00:00:00 2001 From: IWASE Yusuke Date: Fri, 12 May 2017 13:24:27 +0900 Subject: bmp: Enable to specify all route monitoring policies This patch adds the new key "all" for specifying the all BMP route monitoring policies. Configuration Example: [[bmp-servers]] [bmp-servers.config] address = "127.0.0.1" port=11019 route-monitoring-policy = "all" Signed-off-by: IWASE Yusuke --- server/bmp.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'server') 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...) -- cgit v1.2.3