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

#include <Ospfv2NeighborStateDown.h>

Inheritance diagram for inet::ospfv2::NeighborStateDown:
inet::ospfv2::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::ospfv2::NeighborState
virtual ~NeighborState ()
 

Additional Inherited Members

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

Member Function Documentation

◆ getState()

virtual Neighbor::NeighborStateType inet::ospfv2::NeighborStateDown::getState ( ) const
inlineoverridevirtual

◆ processEvent()

void inet::ospfv2::NeighborStateDown::processEvent ( Neighbor neighbor,
Neighbor::NeighborEventType  event 
)
overridevirtual

Implements inet::ospfv2::NeighborState.

21 {
22  if (event == Neighbor::START) {
23  MessageHandler *messageHandler = neighbor->getInterface()->getArea()->getRouter()->getMessageHandler();
24  int ttl = (neighbor->getInterface()->getType() == Ospfv2Interface::VIRTUAL) ? VIRTUAL_LINK_TTL : 1;
25 
26  messageHandler->clearTimer(neighbor->getPollTimer());
27  neighbor->getInterface()->sendHelloPacket(neighbor->getAddress(), ttl);
28  messageHandler->startTimer(neighbor->getInactivityTimer(), neighbor->getRouterDeadInterval());
29  changeState(neighbor, new NeighborStateAttempt, this);
30  }
31  else if (event == Neighbor::HELLO_RECEIVED) {
32  MessageHandler *messageHandler = neighbor->getInterface()->getArea()->getRouter()->getMessageHandler();
33  messageHandler->clearTimer(neighbor->getPollTimer());
34  messageHandler->startTimer(neighbor->getInactivityTimer(), neighbor->getRouterDeadInterval());
35  changeState(neighbor, new NeighborStateInit, this);
36  }
37  else if (event == Neighbor::POLL_TIMER) {
38  int ttl = (neighbor->getInterface()->getType() == Ospfv2Interface::VIRTUAL) ? VIRTUAL_LINK_TTL : 1;
39  neighbor->getInterface()->sendHelloPacket(neighbor->getAddress(), ttl);
40  MessageHandler *messageHandler = neighbor->getInterface()->getArea()->getRouter()->getMessageHandler();
41  messageHandler->startTimer(neighbor->getPollTimer(), neighbor->getInterface()->getPollInterval());
42  }
43 }

The documentation for this class was generated from the following files:
VIRTUAL_LINK_TTL
#define VIRTUAL_LINK_TTL
Definition: Ospfv2Common.h:36
inet::ospfv2::Neighbor::HELLO_RECEIVED
@ HELLO_RECEIVED
Definition: Ospfv2Neighbor.h:30
inet::ospfv2::NeighborState::changeState
void changeState(Neighbor *neighbor, NeighborState *newState, NeighborState *currentState)
Definition: Ospfv2NeighborState.cc:16
inet::ospfv2::Neighbor::START
@ START
Definition: Ospfv2Neighbor.h:31
inet::ospfv2::Ospfv2Interface::VIRTUAL
@ VIRTUAL
Definition: Ospfv2Interface.h:36
inet::ospfv2::Neighbor::DOWN_STATE
@ DOWN_STATE
Definition: Ospfv2Neighbor.h:50
inet::ospfv2::Neighbor::POLL_TIMER
@ POLL_TIMER
Definition: Ospfv2Neighbor.h:42