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

#include <OSPFNeighborStateDown.h>

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

Implements inet::ospf::NeighborState.

32 { return Neighbor::DOWN_STATE; }
Definition: OSPFNeighbor.h:62
void inet::ospf::NeighborStateDown::processEvent ( Neighbor neighbor,
Neighbor::NeighborEventType  event 
)
overridevirtual

Implements inet::ospf::NeighborState.

32 {
33  if (event == Neighbor::START) {
34  MessageHandler *messageHandler = neighbor->getInterface()->getArea()->getRouter()->getMessageHandler();
35  int ttl = (neighbor->getInterface()->getType() == Interface::VIRTUAL) ? VIRTUAL_LINK_TTL : 1;
36 
37  messageHandler->clearTimer(neighbor->getPollTimer());
38  neighbor->getInterface()->sendHelloPacket(neighbor->getAddress(), ttl);
39  messageHandler->startTimer(neighbor->getInactivityTimer(), neighbor->getRouterDeadInterval());
40  changeState(neighbor, new NeighborStateAttempt, this);
41  }
42  if (event == Neighbor::HELLO_RECEIVED) {
43  MessageHandler *messageHandler = neighbor->getInterface()->getArea()->getRouter()->getMessageHandler();
44  messageHandler->clearTimer(neighbor->getPollTimer());
45  messageHandler->startTimer(neighbor->getInactivityTimer(), neighbor->getRouterDeadInterval());
46  changeState(neighbor, new NeighborStateInit, this);
47  }
48  if (event == Neighbor::POLL_TIMER) {
49  int ttl = (neighbor->getInterface()->getType() == Interface::VIRTUAL) ? VIRTUAL_LINK_TTL : 1;
50  neighbor->getInterface()->sendHelloPacket(neighbor->getAddress(), ttl);
51  MessageHandler *messageHandler = neighbor->getInterface()->getArea()->getRouter()->getMessageHandler();
52  messageHandler->startTimer(neighbor->getPollTimer(), neighbor->getInterface()->getPollInterval());
53  }
54 }
#define VIRTUAL_LINK_TTL
Definition: OSPFcommon.h:45
void changeState(Neighbor *neighbor, NeighborState *newState, NeighborState *currentState)
Definition: OSPFNeighborState.cc:28
Definition: OSPFInterface.h:60
Definition: OSPFNeighbor.h:42
Definition: OSPFNeighbor.h:54
Definition: OSPFNeighbor.h:43
uint8_t ttl
Definition: TCP_NSC.cc:87

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