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

#include <OSPFInterfaceStatePointToPoint.h>

Inheritance diagram for inet::ospf::InterfaceStatePointToPoint:
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::InterfaceStatePointToPoint::getState ( ) const
inlineoverridevirtual
void inet::ospf::InterfaceStatePointToPoint::processEvent ( Interface intf,
Interface::InterfaceEventType  event 
)
overridevirtual

Implements inet::ospf::InterfaceState.

31 {
32  if (event == Interface::INTERFACE_DOWN) {
33  intf->reset();
34  changeState(intf, new InterfaceStateDown, this);
35  }
36  if (event == Interface::LOOP_INDICATION) {
37  intf->reset();
38  changeState(intf, new InterfaceStateLoopback, this);
39  }
40  if (event == Interface::HELLO_TIMER) {
41  if (intf->getType() == Interface::VIRTUAL) {
42  if (intf->getNeighborCount() > 0) {
43  intf->sendHelloPacket(intf->getNeighbor(0)->getAddress(), VIRTUAL_LINK_TTL);
44  }
45  }
46  else {
47  intf->sendHelloPacket(IPv4Address::ALL_OSPF_ROUTERS_MCAST);
48  }
49  intf->getArea()->getRouter()->getMessageHandler()->startTimer(intf->getHelloTimer(), intf->getHelloInterval());
50  }
51  if (event == Interface::ACKNOWLEDGEMENT_TIMER) {
52  intf->sendDelayedAcknowledgements();
53  }
54 }
#define VIRTUAL_LINK_TTL
Definition: OSPFcommon.h:45
Definition: OSPFInterface.h:60
Definition: OSPFInterface.h:46
Definition: OSPFInterface.h:44
void changeState(Interface *intf, InterfaceState *newState, InterfaceState *currentState)
Definition: OSPFInterfaceState.cc:33
Definition: OSPFInterface.h:51
Definition: OSPFInterface.h:49
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: