INET Framework for OMNeT++/OMNEST
inet::ospfv2::InterfaceStateWaiting Class Reference

#include <Ospfv2InterfaceStateWaiting.h>

Inheritance diagram for inet::ospfv2::InterfaceStateWaiting:
inet::ospfv2::Ospfv2InterfaceState

Public Member Functions

virtual void processEvent (Ospfv2Interface *intf, Ospfv2Interface::Ospfv2InterfaceEventType event) override
 
virtual Ospfv2Interface::Ospfv2InterfaceStateType getState () const override
 
- Public Member Functions inherited from inet::ospfv2::Ospfv2InterfaceState
virtual ~Ospfv2InterfaceState ()
 

Additional Inherited Members

- Protected Member Functions inherited from inet::ospfv2::Ospfv2InterfaceState
void changeState (Ospfv2Interface *intf, Ospfv2InterfaceState *newState, Ospfv2InterfaceState *currentState)
 
void calculateDesignatedRouter (Ospfv2Interface *intf)
 
void printElectionResult (const Ospfv2Interface *onInterface, DesignatedRouterId DR, DesignatedRouterId BDR)
 

Member Function Documentation

◆ getState()

virtual Ospfv2Interface::Ospfv2InterfaceStateType inet::ospfv2::InterfaceStateWaiting::getState ( ) const
inlineoverridevirtual

◆ processEvent()

void inet::ospfv2::InterfaceStateWaiting::processEvent ( Ospfv2Interface intf,
Ospfv2Interface::Ospfv2InterfaceEventType  event 
)
overridevirtual

Implements inet::ospfv2::Ospfv2InterfaceState.

19 {
20  if ((event == Ospfv2Interface::BACKUP_SEEN) ||
21  (event == Ospfv2Interface::WAIT_TIMER))
22  {
24  }
25  else if (event == Ospfv2Interface::INTERFACE_DOWN) {
26  intf->reset();
27  changeState(intf, new InterfaceStateDown, this);
28  }
29  else if (event == Ospfv2Interface::LOOP_INDICATION) {
30  intf->reset();
31  changeState(intf, new InterfaceStateLoopback, this);
32  }
33  else if (event == Ospfv2Interface::HELLO_TIMER) {
34  if (intf->getType() == Ospfv2Interface::BROADCAST) {
35  intf->sendHelloPacket(Ipv4Address::ALL_OSPF_ROUTERS_MCAST);
36  }
37  else { // Ospfv2Interface::NBMA
38  unsigned long neighborCount = intf->getNeighborCount();
39  int ttl = (intf->getType() == Ospfv2Interface::VIRTUAL) ? VIRTUAL_LINK_TTL : 1;
40  for (unsigned long i = 0; i < neighborCount; i++) {
41  Neighbor *neighbor = intf->getNeighbor(i);
42  if (neighbor->getPriority() > 0) {
43  intf->sendHelloPacket(neighbor->getAddress(), ttl);
44  }
45  }
46  }
47  intf->getArea()->getRouter()->getMessageHandler()->startTimer(intf->getHelloTimer(), intf->getHelloInterval());
48  }
49  else if (event == Ospfv2Interface::ACKNOWLEDGEMENT_TIMER) {
50  intf->sendDelayedAcknowledgements();
51  }
52 }

The documentation for this class was generated from the following files:
VIRTUAL_LINK_TTL
#define VIRTUAL_LINK_TTL
Definition: Ospfv2Common.h:36
inet::ospfv2::Ospfv2InterfaceState::calculateDesignatedRouter
void calculateDesignatedRouter(Ospfv2Interface *intf)
Definition: Ospfv2InterfaceState.cc:111
inet::ospfv2::Ospfv2Interface::WAITING_STATE
@ WAITING_STATE
Definition: Ospfv2Interface.h:54
inet::ospfv2::Ospfv2Interface::WAIT_TIMER
@ WAIT_TIMER
Definition: Ospfv2Interface.h:42
inet::ospfv2::Ospfv2Interface::LOOP_INDICATION
@ LOOP_INDICATION
Definition: Ospfv2Interface.h:46
inet::ospfv2::Ospfv2Interface::ACKNOWLEDGEMENT_TIMER
@ ACKNOWLEDGEMENT_TIMER
Definition: Ospfv2Interface.h:43
inet::ospfv2::Ospfv2Interface::BACKUP_SEEN
@ BACKUP_SEEN
Definition: Ospfv2Interface.h:44
inet::ospfv2::Ospfv2Interface::VIRTUAL
@ VIRTUAL
Definition: Ospfv2Interface.h:36
inet::ospfv2::Ospfv2Interface::HELLO_TIMER
@ HELLO_TIMER
Definition: Ospfv2Interface.h:41
inet::ospfv2::Ospfv2Interface::INTERFACE_DOWN
@ INTERFACE_DOWN
Definition: Ospfv2Interface.h:48
inet::ospfv2::Ospfv2Interface::BROADCAST
@ BROADCAST
Definition: Ospfv2Interface.h:33
inet::Ipv4Address::ALL_OSPF_ROUTERS_MCAST
static const Ipv4Address ALL_OSPF_ROUTERS_MCAST
224.0.0.5 All OSPF routers (DR Others)
Definition: Ipv4Address.h:99
inet::ospfv2::Ospfv2InterfaceState::changeState
void changeState(Ospfv2Interface *intf, Ospfv2InterfaceState *newState, Ospfv2InterfaceState *currentState)
Definition: Ospfv2InterfaceState.cc:22