diff options
author | Satoshi Fujimoto <satoshi.fujimoto7@gmail.com> | 2017-12-12 11:35:43 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2017-12-16 22:10:33 +0900 |
commit | 61cdca78d7ee84ac2f0384f2096a42fa54acb6b7 (patch) | |
tree | f5383109893e78f0d8504a7b26da8dbe7e63b255 /server | |
parent | eb5e3b8ff21726f819e431751777b489ba7da546 (diff) |
config/util: Refactor to make arguments to receivers
For code readability, this commit make some arguments
to receivers.
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Diffstat (limited to 'server')
-rw-r--r-- | server/fsm.go | 2 | ||||
-rw-r--r-- | server/server.go | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/server/fsm.go b/server/fsm.go index 556e1029..c3c2910e 100644 --- a/server/fsm.go +++ b/server/fsm.go @@ -999,7 +999,7 @@ func open2Cap(open *bgp.BGPOpen, n *config.Neighbor) (map[bgp.BGPCapabilityCode] capMap[bgp.BGP_CAP_MULTIPROTOCOL] = []bgp.ParameterCapabilityInterface{bgp.NewCapMultiProtocol(bgp.RF_IPv4_UC)} } - local := config.CreateRfMap(n) + local := n.CreateRfMap() remote := make(map[bgp.RouteFamily]bgp.BGPAddPathMode) for _, c := range capMap[bgp.BGP_CAP_MULTIPROTOCOL] { family := c.(*bgp.CapMultiProtocol).CapValue diff --git a/server/server.go b/server/server.go index edea141d..8e3b362f 100644 --- a/server/server.go +++ b/server/server.go @@ -951,7 +951,7 @@ func (server *BgpServer) handleFSMMessage(peer *Peer, e *FsmMsg) { // any routes (and EORs) before we send ours (or deferral-timer expires). var pathList []*table.Path _, y := peer.fsm.rfMap[bgp.RF_RTC_UC] - if c := config.GetAfiSafi(peer.fsm.pConf, bgp.RF_RTC_UC); y && !peer.fsm.pConf.GracefulRestart.State.PeerRestarting && c.RouteTargetMembership.Config.DeferralTime > 0 { + if c := peer.fsm.pConf.GetAfiSafi(bgp.RF_RTC_UC); y && !peer.fsm.pConf.GracefulRestart.State.PeerRestarting && c.RouteTargetMembership.Config.DeferralTime > 0 { pathList, _ = peer.getBestFromLocal([]bgp.RouteFamily{bgp.RF_RTC_UC}) t := c.RouteTargetMembership.Config.DeferralTime for _, f := range peer.configuredRFlist() { @@ -1102,7 +1102,7 @@ func (server *BgpServer) handleFSMMessage(peer *Peer, e *FsmMsg) { // received EOR of route-target address family // outbound filter is now ready, let's flash non-route-target NLRIs - if c := config.GetAfiSafi(peer.fsm.pConf, bgp.RF_RTC_UC); rtc && c != nil && c.RouteTargetMembership.Config.DeferralTime > 0 { + if c := peer.fsm.pConf.GetAfiSafi(bgp.RF_RTC_UC); rtc && c != nil && c.RouteTargetMembership.Config.DeferralTime > 0 { log.WithFields(log.Fields{ "Topic": "Peer", "Key": peer.ID(), @@ -1559,7 +1559,7 @@ func (s *BgpServer) softResetOut(addr string, family bgp.RouteFamily, deferral b "Key": peer.ID(), "Families": families, }).Debug("deferral timer expired") - } else if c := config.GetAfiSafi(peer.fsm.pConf, bgp.RF_RTC_UC); y && !c.MpGracefulRestart.State.EndOfRibReceived { + } else if c := peer.fsm.pConf.GetAfiSafi(bgp.RF_RTC_UC); y && !c.MpGracefulRestart.State.EndOfRibReceived { log.WithFields(log.Fields{ "Topic": "Peer", "Key": peer.ID(), @@ -1775,7 +1775,7 @@ func (server *BgpServer) addPeerGroup(c *config.PeerGroup) error { } func (server *BgpServer) addNeighbor(c *config.Neighbor) error { - addr, err := config.ExtractNeighborAddress(c) + addr, err := c.ExtractNeighborAddress() if err != nil { return err } @@ -1905,7 +1905,7 @@ func (server *BgpServer) deleteNeighbor(c *config.Neighbor, code, subcode uint8) } } - addr, err := config.ExtractNeighborAddress(c) + addr, err := c.ExtractNeighborAddress() if err != nil { return err } @@ -1999,7 +1999,7 @@ func (s *BgpServer) updateNeighbor(c *config.Neighbor) (needsSoftResetIn bool, e } } - addr, err := config.ExtractNeighborAddress(c) + addr, err := c.ExtractNeighborAddress() if err != nil { return needsSoftResetIn, err } |