diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-03-06 17:05:18 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-03-06 17:05:18 +0900 |
commit | 162a6137ac625552c5e248fa36d56edf89ddd06c (patch) | |
tree | 065dbcda7eb30202dbd1c59caeaf00699d951aef /server | |
parent | a085ce2d338e9a79b98d0f9ea24c5b80bccdf0e1 (diff) |
table: NewTableManager takes route families
NewTableManager creates tables for only specified route families.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server')
-rw-r--r-- | server/peer.go | 2 | ||||
-rw-r--r-- | server/peer_test.go | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/server/peer.go b/server/peer.go index 8f456b83..4e079c13 100644 --- a/server/peer.go +++ b/server/peer.go @@ -92,7 +92,7 @@ func NewPeer(g config.Global, peer config.Neighbor, serverMsgCh chan *serverMsg, Address: peer.NeighborAddress, } p.adjRib = table.NewAdjRib() - p.rib = table.NewTableManager(p.peerConfig.NeighborAddress.String()) + p.rib = table.NewTableManager(p.peerConfig.NeighborAddress.String(), []bgp.RouteFamily{p.rf}) p.t.Go(p.loop) return p } diff --git a/server/peer_test.go b/server/peer_test.go index 9c5a9452..7c78427c 100644 --- a/server/peer_test.go +++ b/server/peer_test.go @@ -62,7 +62,7 @@ func update_fromRC3() *bgp.BGPMessage { } func TestProcessBGPUpdate_fourbyteAS(t *testing.T) { - rib1 := table.NewTableManager("peer_test") + rib1 := table.NewTableManager("peer_test", []bgp.RouteFamily{bgp.RF_IPv4_UC, bgp.RF_IPv6_UC}) m := update_fromRC3() peerInfo := peerRC3() @@ -86,7 +86,7 @@ func TestProcessBGPUpdate_fourbyteAS(t *testing.T) { assert.Equal(t, len(attrAS.Value), 1) assert.Equal(t, attrAS.Value[0].(*bgp.AsPathParam).AS, []uint16{bgp.AS_TRANS, 4000, bgp.AS_TRANS}) - rib2 := table.NewTableManager("peer_test") + rib2 := table.NewTableManager("peer_test", []bgp.RouteFamily{bgp.RF_IPv4_UC, bgp.RF_IPv6_UC}) pList2, wList2, _ := rib2.ProcessPaths(pathList) assert.Equal(t, len(pList2), 1) assert.Equal(t, len(wList2), 0) @@ -524,7 +524,7 @@ func makePeer(globalConfig config.Global, peerConfig config.Neighbor) *Peer { Address: peerConfig.NeighborAddress, } p.adjRib = table.NewAdjRib() - p.rib = table.NewTableManager(p.peerConfig.NeighborAddress.String()) + p.rib = table.NewTableManager(p.peerConfig.NeighborAddress.String(), []bgp.RouteFamily{bgp.RF_IPv4_UC, bgp.RF_IPv6_UC}) return p } |