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

#include <OSPFNeighborStateInit.h>

Inheritance diagram for inet::ospf::NeighborStateInit:
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::NeighborStateInit::getState ( ) const
inlineoverridevirtual

Implements inet::ospf::NeighborState.

32 { return Neighbor::INIT_STATE; }
Definition: OSPFNeighbor.h:64
void inet::ospf::NeighborStateInit::processEvent ( Neighbor neighbor,
Neighbor::NeighborEventType  event 
)
overridevirtual

Implements inet::ospf::NeighborState.

33 {
34  if ((event == Neighbor::KILL_NEIGHBOR) || (event == Neighbor::LINK_DOWN)) {
35  MessageHandler *messageHandler = neighbor->getInterface()->getArea()->getRouter()->getMessageHandler();
36  neighbor->reset();
37  messageHandler->clearTimer(neighbor->getInactivityTimer());
38  changeState(neighbor, new NeighborStateDown, this);
39  }
40  if (event == Neighbor::INACTIVITY_TIMER) {
41  neighbor->reset();
42  if (neighbor->getInterface()->getType() == Interface::NBMA) {
43  MessageHandler *messageHandler = neighbor->getInterface()->getArea()->getRouter()->getMessageHandler();
44  messageHandler->startTimer(neighbor->getPollTimer(), neighbor->getInterface()->getPollInterval());
45  }
46  changeState(neighbor, new NeighborStateDown, this);
47  }
48  if (event == Neighbor::HELLO_RECEIVED) {
49  MessageHandler *messageHandler = neighbor->getInterface()->getArea()->getRouter()->getMessageHandler();
50  messageHandler->clearTimer(neighbor->getInactivityTimer());
51  messageHandler->startTimer(neighbor->getInactivityTimer(), neighbor->getRouterDeadInterval());
52  }
53  if (event == Neighbor::TWOWAY_RECEIVED) {
54  if (neighbor->needAdjacency()) {
55  MessageHandler *messageHandler = neighbor->getInterface()->getArea()->getRouter()->getMessageHandler();
56  if (!(neighbor->isFirstAdjacencyInited())) {
57  neighbor->initFirstAdjacency();
58  }
59  else {
60  neighbor->incrementDDSequenceNumber();
61  }
62  neighbor->sendDatabaseDescriptionPacket(true);
63  messageHandler->startTimer(neighbor->getDDRetransmissionTimer(), neighbor->getInterface()->getRetransmissionInterval());
64  changeState(neighbor, new NeighborStateExchangeStart, this);
65  }
66  else {
67  changeState(neighbor, new NeighborStateTwoWay, this);
68  }
69  }
70 }
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: OSPFNeighbor.h:44
Definition: OSPFInterface.h:58
Definition: OSPFNeighbor.h:55

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