diff options
author | Naoto Hanaue <hanaue.naoto@po.ntts.co.jp> | 2015-08-05 13:56:53 +0900 |
---|---|---|
committer | Naoto Hanaue <hanaue.naoto@po.ntts.co.jp> | 2015-08-05 15:05:12 +0900 |
commit | ca99c628a1a1aa65b3a32d42117d0ed712330b68 (patch) | |
tree | ddb6fd236a2a6b5a25654fa0db3566611bab4526 | |
parent | b7d8d53c486eff0370e9908e75a97b7d8816725c (diff) |
config: change the structure of Neighbor.RouteServer as the Neighbor.RouteReflector
-rw-r--r-- | config/bgp_configs.go | 19 | ||||
-rw-r--r-- | server/peer.go | 2 | ||||
-rw-r--r-- | server/server.go | 2 | ||||
-rw-r--r-- | table/path.go | 2 | ||||
-rw-r--r-- | test/scenario_test/quagga-rsconfig.go | 4 |
5 files changed, 22 insertions, 7 deletions
diff --git a/config/bgp_configs.go b/config/bgp_configs.go index 12af5fcb..24e89482 100644 --- a/config/bgp_configs.go +++ b/config/bgp_configs.go @@ -279,13 +279,28 @@ type AsPathOptions struct { AsPathOptionsState AsPathOptionsState } -//struct for container bgp:route-server -type RouteServer struct { +//struct for container bgp:state +type RouteServerState struct { // original -> bgp:route-server-client //bgp:route-server-client's original type is boolean RouteServerClient bool } +//struct for container bgp:config +type RouteServerConfig struct { + // original -> bgp:route-server-client + //bgp:route-server-client's original type is boolean + RouteServerClient bool +} + +//struct for container bgp:route-server +type RouteServer struct { + // original -> bgp:route-server-config + RouteServerConfig RouteServerConfig + // original -> bgp:route-server-state + RouteServerState RouteServerState +} + //struct for container bgp:state type RouteReflectorState struct { // original -> bgp:route-reflector-cluster-id diff --git a/server/peer.go b/server/peer.go index 66b4c3a8..39859c3c 100644 --- a/server/peer.go +++ b/server/peer.go @@ -83,7 +83,7 @@ func NewPeer(g config.Global, conf config.Neighbor) *Peer { } func (peer *Peer) isRouteServerClient() bool { - return peer.conf.RouteServer.RouteServerClient + return peer.conf.RouteServer.RouteServerConfig.RouteServerClient } func (peer *Peer) configuredRFlist() []bgp.RouteFamily { diff --git a/server/server.go b/server/server.go index 78d1928e..984762e6 100644 --- a/server/server.go +++ b/server/server.go @@ -246,7 +246,7 @@ func (server *BgpServer) Serve() { peer := NewPeer(g, config) name := config.NeighborConfig.NeighborAddress.String() - if config.RouteServer.RouteServerClient == true { + if config.RouteServer.RouteServerConfig.RouteServerClient { loc := NewLocalRib(name, peer.configuredRFlist(), make(map[string]*policy.Policy)) server.addLocalRib(loc) loc.setPolicy(peer, server.policyMap) diff --git a/table/path.go b/table/path.go index 18b118b9..a3b609e9 100644 --- a/table/path.go +++ b/table/path.go @@ -72,7 +72,7 @@ func cloneAsPath(asAttr *bgp.PathAttributeAsPath) *bgp.PathAttributeAsPath { func (path *Path) UpdatePathAttrs(global *config.Global, peer *config.Neighbor) { - if peer.RouteServer.RouteServerClient { + if peer.RouteServer.RouteServerConfig.RouteServerClient { return } diff --git a/test/scenario_test/quagga-rsconfig.go b/test/scenario_test/quagga-rsconfig.go index 76b93ae8..60ae9fd0 100644 --- a/test/scenario_test/quagga-rsconfig.go +++ b/test/scenario_test/quagga-rsconfig.go @@ -102,7 +102,7 @@ func create_config_files(nr int, outputDir string, IPVersion string, nonePeer bo c.NeighborConfig.NeighborAddress = net.ParseIP(fmt.Sprintf("%s%d", baseNeighborAddress[IPVersion], i)) c.NeighborConfig.AuthPassword = fmt.Sprintf("hoge%d", i) c.Transport.TransportConfig.PassiveMode = true - c.RouteServer.RouteServerClient = !normalBGP + c.RouteServer.RouteServerConfig.RouteServerClient = !normalBGP timers := config.Timers{} timers.TimersConfig.HoldTime = 30 @@ -149,7 +149,7 @@ func append_config_files(ar int, outputDir string, IPVersion string, noQuagga bo c.NeighborConfig.PeerAs = 65000 + uint32(ar) c.NeighborConfig.NeighborAddress = net.ParseIP(fmt.Sprintf("%s%d", baseNeighborAddress[IPVersion], ar)) c.NeighborConfig.AuthPassword = fmt.Sprintf("hoge%d", ar) - c.RouteServer.RouteServerClient = !normalBGP + c.RouteServer.RouteServerConfig.RouteServerClient = !normalBGP c.Transport.TransportConfig.PassiveMode = true timers := config.Timers{} |