diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-08-09 23:30:45 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-08-09 23:30:45 +0900 |
commit | 41ef6e5b62da686bc81d55c6b0d0b887bfa78d5b (patch) | |
tree | e32030d556ae19dce492cfa19431de4e66e309c7 /server | |
parent | 4e7ace6ade12150daddc7f1af97df614d6cbead6 (diff) |
server: support adminDown'ed peer startup
The config file should be like:
[Neighbors]
[[Neighbors.NeighborList]]
[Neighbors.NeighborList.NeighborConfig]
PeerAs = 65001
NeighborAddress = "10.0.255.1"
[Neighbors.NeighborList.NeighborState]
AdminDown = true
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server')
-rw-r--r-- | server/fsm.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/server/fsm.go b/server/fsm.go index ffba35f1..2b287dfb 100644 --- a/server/fsm.go +++ b/server/fsm.go @@ -130,13 +130,17 @@ func (fsm *FSM) bgpMessageStateUpdate(MessageType uint8, isIn bool) { } func NewFSM(gConf *config.Global, pConf *config.Neighbor) *FSM { + adminState := ADMIN_STATE_UP + if pConf.NeighborState.AdminDown == true { + adminState = ADMIN_STATE_DOWN + } fsm := &FSM{ gConf: gConf, pConf: pConf, state: bgp.BGP_FSM_IDLE, connCh: make(chan net.Conn), opensentHoldTime: float64(HOLDTIME_OPENSENT), - adminState: ADMIN_STATE_UP, + adminState: adminState, adminStateCh: make(chan AdminState, 1), getActiveCh: make(chan struct{}), } |