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

#include <OSPFNeighborStateLoading.h>

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

Implements inet::ospf::NeighborState.

32 { return Neighbor::LOADING_STATE; }
Definition: OSPFNeighbor.h:68
void inet::ospf::NeighborStateLoading::processEvent ( Neighbor neighbor,
Neighbor::NeighborEventType  event 
)
overridevirtual

Implements inet::ospf::NeighborState.

35 {
36  if ((event == Neighbor::KILL_NEIGHBOR) || (event == Neighbor::LINK_DOWN)) {
37  MessageHandler *messageHandler = neighbor->getInterface()->getArea()->getRouter()->getMessageHandler();
38  neighbor->reset();
39  messageHandler->clearTimer(neighbor->getInactivityTimer());
40  changeState(neighbor, new NeighborStateDown, this);
41  }
42  if (event == Neighbor::INACTIVITY_TIMER) {
43  neighbor->reset();
44  if (neighbor->getInterface()->getType() == Interface::NBMA) {
45  MessageHandler *messageHandler = neighbor->getInterface()->getArea()->getRouter()->getMessageHandler();
46  messageHandler->startTimer(neighbor->getPollTimer(), neighbor->getInterface()->getPollInterval());
47  }
48  changeState(neighbor, new NeighborStateDown, this);
49  }
50  if (event == Neighbor::ONEWAY_RECEIVED) {
51  neighbor->reset();
52  changeState(neighbor, new NeighborStateInit, this);
53  }
54  if (event == Neighbor::HELLO_RECEIVED) {
55  MessageHandler *messageHandler = neighbor->getInterface()->getArea()->getRouter()->getMessageHandler();
56  messageHandler->clearTimer(neighbor->getInactivityTimer());
57  messageHandler->startTimer(neighbor->getInactivityTimer(), neighbor->getRouterDeadInterval());
58  }
59  if (event == Neighbor::LOADING_DONE) {
60  neighbor->clearRequestRetransmissionTimer();
61  changeState(neighbor, new NeighborStateFull, this);
62  }
63  if (event == Neighbor::IS_ADJACENCY_OK) {
64  if (!neighbor->needAdjacency()) {
65  neighbor->reset();
66  changeState(neighbor, new NeighborStateTwoWay, this);
67  }
68  }
70  MessageHandler *messageHandler = neighbor->getInterface()->getArea()->getRouter()->getMessageHandler();
71  neighbor->reset();
72  neighbor->incrementDDSequenceNumber();
73  neighbor->sendDatabaseDescriptionPacket(true);
74  messageHandler->startTimer(neighbor->getDDRetransmissionTimer(), neighbor->getInterface()->getRetransmissionInterval());
75  changeState(neighbor, new NeighborStateExchangeStart, this);
76  }
78  neighbor->sendLinkStateRequestPacket();
79  neighbor->startRequestRetransmissionTimer();
80  }
82  neighbor->retransmitUpdatePacket();
83  neighbor->startUpdateRetransmissionTimer();
84  }
85  if (event == Neighbor::DD_RETRANSMISSION_TIMER) {
86  neighbor->deleteLastSentDDPacket();
87  }
88 }
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:48
Definition: OSPFNeighbor.h:49

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