INET Framework for OMNeT++/OMNEST
inet::ospfv3::Ospfv3NeighborStateInit Class Reference

#include <Ospfv3NeighborStateInit.h>

Inheritance diagram for inet::ospfv3::Ospfv3NeighborStateInit:
inet::ospfv3::Ospfv3NeighborState

Public Member Functions

 ~Ospfv3NeighborStateInit ()
 
virtual void processEvent (Ospfv3Neighbor *neighbor, Ospfv3Neighbor::Ospfv3NeighborEventType event) override
 
virtual Ospfv3Neighbor::Ospfv3NeighborStateType getState () const override
 
virtual std::string getNeighborStateString () override
 
- Public Member Functions inherited from inet::ospfv3::Ospfv3NeighborState
virtual ~Ospfv3NeighborState ()
 

Additional Inherited Members

- Protected Member Functions inherited from inet::ospfv3::Ospfv3NeighborState
void changeState (Ospfv3Neighbor *neighbor, Ospfv3NeighborState *newState, Ospfv3NeighborState *currentState)
 

Constructor & Destructor Documentation

◆ ~Ospfv3NeighborStateInit()

inet::ospfv3::Ospfv3NeighborStateInit::~Ospfv3NeighborStateInit ( )
inline
19 {}

Member Function Documentation

◆ getNeighborStateString()

virtual std::string inet::ospfv3::Ospfv3NeighborStateInit::getNeighborStateString ( )
inlineoverridevirtual

Implements inet::ospfv3::Ospfv3NeighborState.

22 { return std::string("Ospfv3NeighborStateInit"); }

◆ getState()

virtual Ospfv3Neighbor::Ospfv3NeighborStateType inet::ospfv3::Ospfv3NeighborStateInit::getState ( ) const
inlineoverridevirtual

◆ processEvent()

void inet::ospfv3::Ospfv3NeighborStateInit::processEvent ( Ospfv3Neighbor neighbor,
Ospfv3Neighbor::Ospfv3NeighborEventType  event 
)
overridevirtual

Implements inet::ospfv3::Ospfv3NeighborState.

35 {
36  if ((event == Ospfv3Neighbor::KILL_NEIGHBOR) || (event == Ospfv3Neighbor::LINK_DOWN)) {
37  neighbor->reset();
38  neighbor->getInterface()->getArea()->getInstance()->getProcess()->clearTimer(neighbor->getInactivityTimer());
39  changeState(neighbor, new Ospfv3NeighborStateDown, this);
40  }
41  if (event == Ospfv3Neighbor::INACTIVITY_TIMER) {
42  neighbor->reset();
43  if (neighbor->getInterface()->getType() == Ospfv3Interface::NBMA_TYPE)
44  neighbor->getInterface()->getArea()->getInstance()->getProcess()->setTimer(neighbor->getPollTimer(), neighbor->getInterface()->getPollInterval());
45 
46  changeState(neighbor, new Ospfv3NeighborStateDown, this);
47  }
48  if (event == Ospfv3Neighbor::HELLO_RECEIVED) {
49  neighbor->getInterface()->getArea()->getInstance()->getProcess()->clearTimer(neighbor->getInactivityTimer());
50  neighbor->getInterface()->getArea()->getInstance()->getProcess()->setTimer(neighbor->getInactivityTimer(), neighbor->getInterface()->getDeadInterval());
51  }
52  if (event == Ospfv3Neighbor::TWOWAY_RECEIVED) {
53  EV_DEBUG << "Ospfv3Neighbor::TWOWAY_RECEIVED caught in StateInit\n";
54  if (neighbor->needAdjacency()) {
55  if (!(neighbor->isFirstAdjacencyInited())) {
56  neighbor->initFirstAdjacency();
57  }
58  else {
59  neighbor->incrementDDSequenceNumber();
60  }
61  neighbor->sendDDPacket(true);
62  neighbor->getInterface()->getArea()->getInstance()->getProcess()->setTimer(neighbor->getDDRetransmissionTimer(), neighbor->getInterface()->getRetransmissionInterval());
63  changeState(neighbor, new Ospfv3NeighborStateExStart, this);
64  }
65  else {
66  changeState(neighbor, new Ospfv3NeighborState2Way, this);
67  }
68  }
69 }

The documentation for this class was generated from the following files:
inet::ospfv3::Ospfv3Neighbor::TWOWAY_RECEIVED
@ TWOWAY_RECEIVED
Definition: Ospfv3Neighbor.h:25
inet::ospfv3::Ospfv3Interface::NBMA_TYPE
@ NBMA_TYPE
Definition: Ospfv3Interface.h:54
inet::ospfv3::Ospfv3Neighbor::INACTIVITY_TIMER
@ INACTIVITY_TIMER
Definition: Ospfv3Neighbor.h:34
inet::ospfv3::Ospfv3NeighborState::changeState
void changeState(Ospfv3Neighbor *neighbor, Ospfv3NeighborState *newState, Ospfv3NeighborState *currentState)
Definition: Ospfv3NeighborState.cc:14
inet::ospfv3::Ospfv3Neighbor::HELLO_RECEIVED
@ HELLO_RECEIVED
Definition: Ospfv3Neighbor.h:23
inet::ospfv3::Ospfv3Neighbor::LINK_DOWN
@ LINK_DOWN
Definition: Ospfv3Neighbor.h:36
inet::ospfv3::Ospfv3Neighbor::INIT_STATE
@ INIT_STATE
Definition: Ospfv3Neighbor.h:45
inet::ospfv3::Ospfv3Neighbor::KILL_NEIGHBOR
@ KILL_NEIGHBOR
Definition: Ospfv3Neighbor.h:33