Exemple #1
0
 private void UnloopInd(InterfaceState state, InterfaceEventType eventType, object data)
 {
 }
Exemple #2
0
 private void WaitTimer(InterfaceState state, InterfaceEventType eventType, object data)
 {
     CalculateDRAndBDR();
 }
Exemple #3
0
 private void NeighborChange(InterfaceState state, InterfaceEventType eventType, object data)
 {
     CalculateDRAndBDR();
 }
Exemple #4
0
 private void InterfaceDown(InterfaceState state, InterfaceEventType eventType, object data)
 {
 }
Exemple #5
0
 private void BackupSeen(InterfaceState state, InterfaceEventType eventType, object data)
 {
     _waitTimer.Stop();
     CalculateDRAndBDR();
 }
Exemple #6
0
 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);
 }
Exemple #7
0
 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;
     }
 }