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

#include <OSPFNeighborStateExchangeStart.h>

Inheritance diagram for inet::ospf::NeighborStateExchangeStart:
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::NeighborStateExchangeStart::getState ( ) const
inlineoverridevirtual
void inet::ospf::NeighborStateExchangeStart::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  }
64  if (event == Neighbor::DD_RETRANSMISSION_TIMER) {
65  MessageHandler *messageHandler = neighbor->getInterface()->getArea()->getRouter()->getMessageHandler();
66  neighbor->retransmitDatabaseDescriptionPacket();
67  messageHandler->startTimer(neighbor->getDDRetransmissionTimer(), neighbor->getInterface()->getRetransmissionInterval());
68  }
69  if (event == Neighbor::NEGOTIATION_DONE) {
70  neighbor->createDatabaseSummary();
71  neighbor->sendDatabaseDescriptionPacket();
72  MessageHandler *messageHandler = neighbor->getInterface()->getArea()->getRouter()->getMessageHandler();
73  messageHandler->clearTimer(neighbor->getDDRetransmissionTimer());
74  changeState(neighbor, new NeighborStateExchange, this);
75  }
76 }
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:45
Definition: OSPFNeighbor.h:55
Definition: OSPFNeighbor.h:49

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