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

#include <OSPFNeighborStateFull.h>

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

Implements inet::ospf::NeighborState.

32 { return Neighbor::FULL_STATE; }
Definition: OSPFNeighbor.h:69
void inet::ospf::NeighborStateFull::processEvent ( Neighbor neighbor,
Neighbor::NeighborEventType  event 
)
overridevirtual

Implements inet::ospf::NeighborState.

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