INET Framework for OMNeT++/OMNEST
inet::ospf::NeighborStateAttempt Class Reference

#include <OSPFNeighborStateAttempt.h>

Inheritance diagram for inet::ospf::NeighborStateAttempt:
inet::ospf::NeighborState

Public Member Functions

virtual void processEvent (Neighbor *neighbor, Neighbor::NeighborEventType event) override
 
virtual Neighbor::NeighborStateType getState () const override
 
- Public Member Functions inherited from inet::ospf::NeighborState
virtual ~NeighborState ()
 

Additional Inherited Members

- Protected Member Functions inherited from inet::ospf::NeighborState
void changeState (Neighbor *neighbor, NeighborState *newState, NeighborState *currentState)
 

Member Function Documentation

virtual Neighbor::NeighborStateType inet::ospf::NeighborStateAttempt::getState ( ) const
inlineoverridevirtual

Implements inet::ospf::NeighborState.

32 { return Neighbor::ATTEMPT_STATE; }
Definition: OSPFNeighbor.h:63
void inet::ospf::NeighborStateAttempt::processEvent ( Neighbor neighbor,
Neighbor::NeighborEventType  event 
)
overridevirtual

Implements inet::ospf::NeighborState.

32 {
33  if ((event == Neighbor::KILL_NEIGHBOR) || (event == Neighbor::LINK_DOWN)) {
34  MessageHandler *messageHandler = neighbor->getInterface()->getArea()->getRouter()->getMessageHandler();
35  neighbor->reset();
36  messageHandler->clearTimer(neighbor->getInactivityTimer());
37  changeState(neighbor, new NeighborStateDown, this);
38  }
39  if (event == Neighbor::INACTIVITY_TIMER) {
40  neighbor->reset();
41  if (neighbor->getInterface()->getType() == Interface::NBMA) {
42  MessageHandler *messageHandler = neighbor->getInterface()->getArea()->getRouter()->getMessageHandler();
43  messageHandler->startTimer(neighbor->getPollTimer(), neighbor->getInterface()->getPollInterval());
44  }
45  changeState(neighbor, new NeighborStateDown, this);
46  }
47  if (event == Neighbor::HELLO_RECEIVED) {
48  MessageHandler *messageHandler = neighbor->getInterface()->getArea()->getRouter()->getMessageHandler();
49  messageHandler->clearTimer(neighbor->getInactivityTimer());
50  messageHandler->startTimer(neighbor->getInactivityTimer(), neighbor->getRouterDeadInterval());
51  changeState(neighbor, new NeighborStateInit, this);
52  }
53 }
Definition: OSPFNeighbor.h:52
void changeState(Neighbor *neighbor, NeighborState *newState, NeighborState *currentState)
Definition: OSPFNeighborState.cc:28
Definition: OSPFNeighbor.h:42
Definition: OSPFNeighbor.h:53
Definition: OSPFInterface.h:58
Definition: OSPFNeighbor.h:55

The documentation for this class was generated from the following files: