private void UnloopInd(InterfaceState state, InterfaceEventType eventType, object data) { }
private void WaitTimer(InterfaceState state, InterfaceEventType eventType, object data) { CalculateDRAndBDR(); }
private void NeighborChange(InterfaceState state, InterfaceEventType eventType, object data) { CalculateDRAndBDR(); }
private void InterfaceDown(InterfaceState state, InterfaceEventType eventType, object data) { }
private void BackupSeen(InterfaceState state, InterfaceEventType eventType, object data) { _waitTimer.Stop(); CalculateDRAndBDR(); }
internal void RaiseEvent(InterfaceEventType eventType, object data = null) { Log.Write("OSPF", "INTERFACEEVENT", string.Format("State: {0}, Event: {1}", InterfaceState, eventType)); _stateMachine.RaiseEvent(InterfaceState, eventType, data); }
public void InterfaceUp(InterfaceState state, InterfaceEventType eventType, object data) { if (_controller.DeviceConfigurationMap[DeviceID].IsLoopback) { RaiseEvent(InterfaceEventType.LoopInd); return; } _helloTimer = new Timer(); Timer helloTimer = _helloTimer; helloTimer.Interval = 1000; helloTimer.Elapsed += HelloElapsed; helloTimer.Start(); switch (OspfNetworkType) { case OspfNetworkType.PointToPoint: case OspfNetworkType.PointToMultiPoint: case OspfNetworkType.VirtualLink: InterfaceState = InterfaceState.PointToPoint; break; default: if (Priority == 0) { InterfaceState = InterfaceState.DROther; } else { InterfaceState = InterfaceState.Waiting; _beginWaitTime = DateTime.Now; _waitTimer = new Timer(); _waitTimer.Interval = 1000; _waitTimer.Elapsed += (s, e) => { if ((DateTime.Now - _beginWaitTime).Seconds < RouterDeadInterval) { return; } _waitTimer.Stop(); CalculateDRAndBDR(); }; if (OspfNetworkType == OspfNetworkType.NBMA) { SetupManualNeighborData(); } _waitTimer.Start(); } break; } }