summaryrefslogtreecommitdiffhomepage
path: root/table
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-04-25 23:52:21 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-04-25 23:52:21 +0900
commit45050d9b97f3821c6dbdbc98678a62ddfcf81aad (patch)
treee54184769a3e441d763e0cecad93ed13372b849a /table
parent6f95b7dc62b0ce8523e4f6da2e2bff5f4a4d3b78 (diff)
remove collector mode support
We need to update yang config collector mode (split into config and state). before that, let's remove the feature itself to see if there is any user of it. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'table')
-rw-r--r--table/adj.go19
-rw-r--r--table/table_manager_test.go2
2 files changed, 8 insertions, 13 deletions
diff --git a/table/adj.go b/table/adj.go
index a58f87aa..8d298be4 100644
--- a/table/adj.go
+++ b/table/adj.go
@@ -21,22 +21,20 @@ import (
)
type AdjRib struct {
- id string
- accepted map[bgp.RouteFamily]int
- table map[bgp.RouteFamily]map[string]*Path
- isCollector bool
+ id string
+ accepted map[bgp.RouteFamily]int
+ table map[bgp.RouteFamily]map[string]*Path
}
-func NewAdjRib(id string, rfList []bgp.RouteFamily, isCollector bool) *AdjRib {
+func NewAdjRib(id string, rfList []bgp.RouteFamily) *AdjRib {
table := make(map[bgp.RouteFamily]map[string]*Path)
for _, rf := range rfList {
table[rf] = make(map[string]*Path)
}
return &AdjRib{
- id: id,
- table: table,
- accepted: make(map[bgp.RouteFamily]int),
- isCollector: isCollector,
+ id: id,
+ table: table,
+ accepted: make(map[bgp.RouteFamily]int),
}
}
@@ -47,9 +45,6 @@ func (adj *AdjRib) Update(pathList []*Path) {
}
rf := path.GetRouteFamily()
key := path.getPrefix()
- if adj.isCollector {
- key += path.GetSource().Address.String()
- }
old, found := adj.table[rf][key]
if path.IsWithdraw {
diff --git a/table/table_manager_test.go b/table/table_manager_test.go
index 8b072c44..193890f3 100644
--- a/table/table_manager_test.go
+++ b/table/table_manager_test.go
@@ -2127,7 +2127,7 @@ func TestProcessBGPUpdate_Timestamp(t *testing.T) {
nlri := []*bgp.IPAddrPrefix{bgp.NewIPAddrPrefix(24, "10.10.10.0")}
- adjRib := NewAdjRib("test", []bgp.RouteFamily{bgp.RF_IPv4_UC, bgp.RF_IPv6_UC}, false)
+ adjRib := NewAdjRib("test", []bgp.RouteFamily{bgp.RF_IPv4_UC, bgp.RF_IPv6_UC})
m1 := bgp.NewBGPUpdateMessage(nil, pathAttributes, nlri)
peer := peerR1()
pList1 := ProcessMessage(m1, peer, time.Now())