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

#include <OSPFInterfaceStateWaiting.h>

Inheritance diagram for inet::ospf::InterfaceStateWaiting:
inet::ospf::InterfaceState

Public Member Functions

virtual void processEvent (Interface *intf, Interface::InterfaceEventType event) override
 
virtual Interface::InterfaceStateType getState () const override
 
- Public Member Functions inherited from inet::ospf::InterfaceState
virtual ~InterfaceState ()
 

Additional Inherited Members

- Protected Member Functions inherited from inet::ospf::InterfaceState
void changeState (Interface *intf, InterfaceState *newState, InterfaceState *currentState)
 
void calculateDesignatedRouter (Interface *intf)
 

Member Function Documentation

virtual Interface::InterfaceStateType inet::ospf::InterfaceStateWaiting::getState ( ) const
inlineoverridevirtual

Implements inet::ospf::InterfaceState.

32 { return Interface::WAITING_STATE; }
Definition: OSPFInterface.h:66
void inet::ospf::InterfaceStateWaiting::processEvent ( Interface intf,
Interface::InterfaceEventType  event 
)
overridevirtual

Implements inet::ospf::InterfaceState.

31 {
32  if ((event == Interface::BACKUP_SEEN) ||
33  (event == Interface::WAIT_TIMER))
34  {
36  }
37  if (event == Interface::INTERFACE_DOWN) {
38  intf->reset();
39  changeState(intf, new InterfaceStateDown, this);
40  }
41  if (event == Interface::LOOP_INDICATION) {
42  intf->reset();
43  changeState(intf, new InterfaceStateLoopback, this);
44  }
45  if (event == Interface::HELLO_TIMER) {
46  if (intf->getType() == Interface::BROADCAST) {
47  intf->sendHelloPacket(IPv4Address::ALL_OSPF_ROUTERS_MCAST);
48  }
49  else { // Interface::NBMA
50  unsigned long neighborCount = intf->getNeighborCount();
51  int ttl = (intf->getType() == Interface::VIRTUAL) ? VIRTUAL_LINK_TTL : 1;
52  for (unsigned long i = 0; i < neighborCount; i++) {
53  Neighbor *neighbor = intf->getNeighbor(i);
54  if (neighbor->getPriority() > 0) {
55  intf->sendHelloPacket(neighbor->getAddress(), ttl);
56  }
57  }
58  }
59  intf->getArea()->getRouter()->getMessageHandler()->startTimer(intf->getHelloTimer(), intf->getHelloInterval());
60  }
61  if (event == Interface::ACKNOWLEDGEMENT_TIMER) {
62  intf->sendDelayedAcknowledgements();
63  }
64 }
#define VIRTUAL_LINK_TTL
Definition: OSPFcommon.h:45
Definition: OSPFInterface.h:60
Definition: OSPFInterface.h:47
Definition: OSPFInterface.h:45
Definition: OSPFInterface.h:46
Definition: OSPFInterface.h:57
Definition: OSPFInterface.h:44
void changeState(Interface *intf, InterfaceState *newState, InterfaceState *currentState)
Definition: OSPFInterfaceState.cc:33
void calculateDesignatedRouter(Interface *intf)
Definition: OSPFInterfaceState.cc:122
Definition: OSPFInterface.h:51
Definition: OSPFInterface.h:49
uint8_t ttl
Definition: TCP_NSC.cc:87
static const IPv4Address ALL_OSPF_ROUTERS_MCAST
224.0.0.5 All OSPF routers (DR Others)
Definition: IPv4Address.h:110

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