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

#include <OSPFNeighborStateExchange.h>

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

Implements inet::ospf::NeighborState.

32 { return Neighbor::EXCHANGE_STATE; }
Definition: OSPFNeighbor.h:67
void inet::ospf::NeighborStateExchange::processEvent ( Neighbor neighbor,
Neighbor::NeighborEventType  event 
)
overridevirtual

Implements inet::ospf::NeighborState.

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

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