summaryrefslogtreecommitdiffhomepage
path: root/server/server.go
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-10-07 22:58:50 +0900
committerISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-10-07 22:58:50 +0900
commit28ecbd5b2e7f16b6914e6cccffbc8cd5f1048e04 (patch)
tree849a9505960c70c7d265507625a02a1776103ec4 /server/server.go
parent8669c4ecea81038d2a09dcd6121ad488528f04b9 (diff)
cli: support monitoring specific route family
// monitor only ipv6 best path changes $ gobgp monitor global rib -a ipv6 Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'server/server.go')
-rw-r--r--server/server.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/server/server.go b/server/server.go
index f41066a9..261f3e9a 100644
--- a/server/server.go
+++ b/server/server.go
@@ -608,6 +608,8 @@ func (server *BgpServer) broadcastBests(bests []*table.Path) {
}
}
+ rf := path.GetRouteFamily()
+
result := &GrpcResponse{
Data: &api.Destination{
Prefix: path.GetNlri().String(),
@@ -625,11 +627,13 @@ func (server *BgpServer) broadcastBests(bests []*table.Path) {
remainReqs = append(remainReqs, req)
continue
}
- m := &broadcastGrpcMsg{
- req: req,
- result: result,
+ if req.RouteFamily == bgp.RouteFamily(0) || req.RouteFamily == rf {
+ m := &broadcastGrpcMsg{
+ req: req,
+ result: result,
+ }
+ server.broadcastMsgs = append(server.broadcastMsgs, m)
}
- server.broadcastMsgs = append(server.broadcastMsgs, m)
remainReqs = append(remainReqs, req)
}
server.broadcastReqs = remainReqs