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

#include <OSPFNeighborStateTwoWay.h>

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

Implements inet::ospf::NeighborState.

32 { return Neighbor::TWOWAY_STATE; }
Definition: OSPFNeighbor.h:65
void inet::ospf::NeighborStateTwoWay::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::ONEWAY_RECEIVED) {
49  neighbor->reset();
50  changeState(neighbor, new NeighborStateInit, this);
51  }
52  if (event == Neighbor::HELLO_RECEIVED) {
53  MessageHandler *messageHandler = neighbor->getInterface()->getArea()->getRouter()->getMessageHandler();
54  messageHandler->clearTimer(neighbor->getInactivityTimer());
55  messageHandler->startTimer(neighbor->getInactivityTimer(), neighbor->getRouterDeadInterval());
56  }
57  if (event == Neighbor::IS_ADJACENCY_OK) {
58  if (neighbor->needAdjacency()) {
59  MessageHandler *messageHandler = neighbor->getInterface()->getArea()->getRouter()->getMessageHandler();
60  if (!(neighbor->isFirstAdjacencyInited())) {
61  neighbor->initFirstAdjacency();
62  }
63  else {
64  neighbor->incrementDDSequenceNumber();
65  }
66  neighbor->sendDatabaseDescriptionPacket(true);
67  messageHandler->startTimer(neighbor->getDDRetransmissionTimer(), neighbor->getInterface()->getRetransmissionInterval());
68  changeState(neighbor, new NeighborStateExchangeStart, this);
69  }
70  }
71 }
Definition: OSPFNeighbor.h:52
void changeState(Neighbor *neighbor, NeighborState *newState, NeighborState *currentState)
Definition: OSPFNeighborState.cc:28
Definition: OSPFNeighbor.h:51
Definition: OSPFNeighbor.h:42
Definition: OSPFNeighbor.h:53
Definition: OSPFInterface.h:58
Definition: OSPFNeighbor.h:55
Definition: OSPFNeighbor.h:49

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