summaryrefslogtreecommitdiffhomepage
path: root/table/table_manager.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-03-08 22:05:35 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-03-08 22:05:35 +0900
commit856fcbd7bdbb25c5fd7cbe6bfa23246323aa5511 (patch)
tree71fd697ac5dd904f201e81d025f87ecada7c91f1 /table/table_manager.go
parent1c982d8336c9d89732e8a481a8c90b3e7e283f6f (diff)
server: adj-in/out supports route families rather than v4/v6
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'table/table_manager.go')
-rw-r--r--table/table_manager.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/table/table_manager.go b/table/table_manager.go
index e135f58e..d14fec5b 100644
--- a/table/table_manager.go
+++ b/table/table_manager.go
@@ -287,15 +287,15 @@ type AdjRib struct {
adjRibOut map[bgp.RouteFamily]map[string]*ReceivedRoute
}
-func NewAdjRib() *AdjRib {
+func NewAdjRib(rfList []bgp.RouteFamily) *AdjRib {
r := &AdjRib{
adjRibIn: make(map[bgp.RouteFamily]map[string]*ReceivedRoute),
adjRibOut: make(map[bgp.RouteFamily]map[string]*ReceivedRoute),
}
- r.adjRibIn[bgp.RF_IPv4_UC] = make(map[string]*ReceivedRoute)
- r.adjRibIn[bgp.RF_IPv6_UC] = make(map[string]*ReceivedRoute)
- r.adjRibOut[bgp.RF_IPv4_UC] = make(map[string]*ReceivedRoute)
- r.adjRibOut[bgp.RF_IPv6_UC] = make(map[string]*ReceivedRoute)
+ for _, rf := range rfList {
+ r.adjRibIn[rf] = make(map[string]*ReceivedRoute)
+ r.adjRibOut[rf] = make(map[string]*ReceivedRoute)
+ }
return r
}