diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-02-27 22:18:36 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-02-27 22:18:36 +0900 |
commit | c847a87307ad360b526cd0de96e3dec2963b5076 (patch) | |
tree | a5f96ef63f215951bf99641bc931a96c5013cfc7 /server | |
parent | fb0a718339af7e2e18cf2c488959ae3e5dd5fc70 (diff) |
server: implement softresetin and softreset
soft-reconfiguration inbound
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server')
-rw-r--r-- | server/peer.go | 23 | ||||
-rw-r--r-- | server/server.go | 2 |
2 files changed, 18 insertions, 7 deletions
diff --git a/server/peer.go b/server/peer.go index 6a728768..ad8a72f7 100644 --- a/server/peer.go +++ b/server/peer.go @@ -223,12 +223,23 @@ func (peer *Peer) handleREST(restReq *api.RestRequest) { case api.REQ_NEIGHBOR_RESET: peer.fsm.idleHoldTime = peer.peerConfig.Timers.IdleHoldTImeAfterReset peer.outgoing <- bgp.NewBGPNotificationMessage(bgp.BGP_ERROR_CEASE, bgp.BGP_ERROR_SUB_ADMINISTRATIVE_RESET, nil) - case api.REQ_NEIGHBOR_SOFT_RESET: - case api.REQ_NEIGHBOR_SOFT_RESET_IN: - // check capability - // drop allIn and other peers? - // peer.adjRib.DropAllIn(peer.rf) - peer.outgoing <- bgp.NewBGPRouteRefreshMessage(uint16(int(peer.rf)>>16), 0, uint8(int(peer.rf)&0xff)) + case api.REQ_NEIGHBOR_SOFT_RESET, api.REQ_NEIGHBOR_SOFT_RESET_IN: + // soft-reconfiguration inbound + pathList := peer.adjRib.GetInPathList(peer.rf) + pm := &peerMsg{ + msgType: PEER_MSG_PATH, + msgData: pathList, + } + for _, s := range peer.siblings { + if s.rf != peer.rf { + continue + } + s.peerMsgCh <- pm + } + if restReq.RequestType == api.REQ_NEIGHBOR_SOFT_RESET_IN { + break + } + fallthrough case api.REQ_NEIGHBOR_SOFT_RESET_OUT: pathList := peer.adjRib.GetOutPathList(peer.rf) peer.sendMessages(table.CreateUpdateMsgFromPaths(pathList)) diff --git a/server/server.go b/server/server.go index 9e03a270..8fa743bd 100644 --- a/server/server.go +++ b/server/server.go @@ -242,7 +242,7 @@ func (server *BgpServer) handleRest(restReq *api.RestRequest) { restReq.ResponseCh <- result close(restReq.ResponseCh) case api.REQ_LOCAL_RIB, api.REQ_NEIGHBOR_SHUTDOWN, api.REQ_NEIGHBOR_RESET, - api.REQ_NEIGHBOR_SOFT_RESET_IN, api.REQ_NEIGHBOR_SOFT_RESET_OUT, + api.REQ_NEIGHBOR_SOFT_RESET, api.REQ_NEIGHBOR_SOFT_RESET_IN, api.REQ_NEIGHBOR_SOFT_RESET_OUT, api.REQ_ADJ_RIB_IN, api.REQ_ADJ_RIB_OUT, api.REQ_NEIGHBOR_ENABLE, api.REQ_NEIGHBOR_DISABLE: |