summaryrefslogtreecommitdiffhomepage
path: root/pkg/server/bmp.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-10-29 18:59:09 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-11-07 20:19:23 +0900
commitdf8ad76b5ca5316ae2a9ca88c5aa6af5f2dc9b4e (patch)
treef811d7694ca0cf98613e6e09684356ad98322774 /pkg/server/bmp.go
parent96c129e5d0cc91a2b291527898e70093545e54b6 (diff)
server: unexported Watcher stuff
Replace it with the new API using api/. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'pkg/server/bmp.go')
-rw-r--r--pkg/server/bmp.go24
1 files changed, 12 insertions, 12 deletions
diff --git a/pkg/server/bmp.go b/pkg/server/bmp.go
index b9821b58..a7d088bd 100644
--- a/pkg/server/bmp.go
+++ b/pkg/server/bmp.go
@@ -113,25 +113,25 @@ func (b *bmpClient) loop() {
}
if func() bool {
- ops := []WatchOption{WatchPeerState(true)}
+ ops := []watchOption{watchPeerState(true)}
if b.c.RouteMonitoringPolicy == config.BMP_ROUTE_MONITORING_POLICY_TYPE_BOTH {
log.WithFields(
log.Fields{"Topic": "bmp"},
).Warn("both option for route-monitoring-policy is obsoleted")
}
if b.c.RouteMonitoringPolicy == config.BMP_ROUTE_MONITORING_POLICY_TYPE_PRE_POLICY || b.c.RouteMonitoringPolicy == config.BMP_ROUTE_MONITORING_POLICY_TYPE_ALL {
- ops = append(ops, WatchUpdate(true))
+ ops = append(ops, watchUpdate(true))
}
if b.c.RouteMonitoringPolicy == config.BMP_ROUTE_MONITORING_POLICY_TYPE_POST_POLICY || b.c.RouteMonitoringPolicy == config.BMP_ROUTE_MONITORING_POLICY_TYPE_ALL {
- ops = append(ops, WatchPostUpdate(true))
+ ops = append(ops, watchPostUpdate(true))
}
if b.c.RouteMonitoringPolicy == config.BMP_ROUTE_MONITORING_POLICY_TYPE_LOCAL_RIB || b.c.RouteMonitoringPolicy == config.BMP_ROUTE_MONITORING_POLICY_TYPE_ALL {
- ops = append(ops, WatchBestPath(true))
+ ops = append(ops, watchBestPath(true))
}
if b.c.RouteMirroringEnabled {
- ops = append(ops, WatchMessage(false))
+ ops = append(ops, watchMessage(false))
}
- w := b.s.Watch(ops...)
+ w := b.s.watch(ops...)
defer w.Stop()
var tickerCh <-chan time.Time
@@ -160,7 +160,7 @@ func (b *bmpClient) loop() {
select {
case ev := <-w.Event():
switch msg := ev.(type) {
- case *WatchEventUpdate:
+ case *watchEventUpdate:
info := &table.PeerInfo{
Address: msg.PeerAddress,
AS: msg.PeerAS,
@@ -190,7 +190,7 @@ func (b *bmpClient) loop() {
return false
}
}
- case *WatchEventBestPath:
+ case *watchEventBestPath:
info := &table.PeerInfo{
Address: net.ParseIP("0.0.0.0").To4(),
AS: b.s.bgpConfig.Global.Config.As,
@@ -204,7 +204,7 @@ func (b *bmpClient) loop() {
return false
}
}
- case *WatchEventPeerState:
+ case *watchEventPeerState:
if msg.State == bgp.BGP_FSM_ESTABLISHED {
if err := write(bmpPeerUp(msg, bmp.BMP_PEER_TYPE_GLOBAL, false, 0)); err != nil {
return false
@@ -214,7 +214,7 @@ func (b *bmpClient) loop() {
return false
}
}
- case *WatchEventMessage:
+ case *watchEventMessage:
info := &table.PeerInfo{
Address: msg.PeerAddress,
AS: msg.PeerAS,
@@ -259,7 +259,7 @@ type bmpClient struct {
ribout ribout
}
-func bmpPeerUp(ev *WatchEventPeerState, t uint8, policy bool, pd uint64) *bmp.BMPMessage {
+func bmpPeerUp(ev *watchEventPeerState, t uint8, policy bool, pd uint64) *bmp.BMPMessage {
var flags uint8 = 0
if policy {
flags |= bmp.BMP_PEER_FLAG_POST_POLICY
@@ -268,7 +268,7 @@ func bmpPeerUp(ev *WatchEventPeerState, t uint8, policy bool, pd uint64) *bmp.BM
return bmp.NewBMPPeerUpNotification(*ph, ev.LocalAddress.String(), ev.LocalPort, ev.PeerPort, ev.SentOpen, ev.RecvOpen)
}
-func bmpPeerDown(ev *WatchEventPeerState, t uint8, policy bool, pd uint64) *bmp.BMPMessage {
+func bmpPeerDown(ev *watchEventPeerState, t uint8, policy bool, pd uint64) *bmp.BMPMessage {
var flags uint8 = 0
if policy {
flags |= bmp.BMP_PEER_FLAG_POST_POLICY