INET Framework for OMNeT++/OMNEST
inet::ospfv3::Ospfv3InterfaceStateDown Class Reference

#include <Ospfv3InterfaceStateDown.h>

Inheritance diagram for inet::ospfv3::Ospfv3InterfaceStateDown:
inet::ospfv3::Ospfv3InterfaceState

Public Member Functions

 ~Ospfv3InterfaceStateDown ()
 
void processEvent (Ospfv3Interface *intf, Ospfv3Interface::Ospfv3InterfaceEvent event) override
 
Ospfv3Interface::Ospfv3InterfaceFaState getState () const override
 
std::string getInterfaceStateString () const override
 
- Public Member Functions inherited from inet::ospfv3::Ospfv3InterfaceState
virtual ~Ospfv3InterfaceState ()
 

Additional Inherited Members

- Protected Member Functions inherited from inet::ospfv3::Ospfv3InterfaceState
void changeState (Ospfv3Interface *intf, Ospfv3InterfaceState *newState, Ospfv3InterfaceState *currentState)
 
void calculateDesignatedRouter (Ospfv3Interface *intf)
 

Constructor & Destructor Documentation

◆ ~Ospfv3InterfaceStateDown()

inet::ospfv3::Ospfv3InterfaceStateDown::~Ospfv3InterfaceStateDown ( )
inline
15 {};

Member Function Documentation

◆ getInterfaceStateString()

std::string inet::ospfv3::Ospfv3InterfaceStateDown::getInterfaceStateString ( ) const
inlineoverridevirtual

Implements inet::ospfv3::Ospfv3InterfaceState.

18 { return std::string("Ospfv3InterfaceStateDown"); }

◆ getState()

Ospfv3Interface::Ospfv3InterfaceFaState inet::ospfv3::Ospfv3InterfaceStateDown::getState ( ) const
inlineoverridevirtual

◆ processEvent()

void inet::ospfv3::Ospfv3InterfaceStateDown::processEvent ( Ospfv3Interface intf,
Ospfv3Interface::Ospfv3InterfaceEvent  event 
)
overridevirtual

Implements inet::ospfv3::Ospfv3InterfaceState.

12 {
13  /*
14  * Two different actions for P2P and for Broadcast (or NBMA)
15  */
17  EV_DEBUG << "Interface " << interface->getIntName() << " is in up state\n";
18  if (!interface->isInterfacePassive()) {
19  LinkLSA *lsa = interface->originateLinkLSA();
20  interface->installLinkLSA(lsa);
21  delete lsa;
22  interface->getArea()->getInstance()->getProcess()->setTimer(interface->getHelloTimer(), 0);
23  interface->getArea()->getInstance()->getProcess()->setTimer(interface->getAcknowledgementTimer(), interface->getAckDelay());
24 
25  switch (interface->getType()) {
29  changeState(interface, new Ospfv3InterfaceStatePointToPoint, this);
30  break;
31 
33  if (interface->getRouterPriority() == 0) {
34  changeState(interface, new Ospfv3InterfaceStateDrOther, this);
35  }
36  else {
37  changeState(interface, new Ospfv3InterfaceStateWaiting, this);
38  interface->getArea()->getInstance()->getProcess()->setTimer(interface->getWaitTimer(), interface->getDeadInterval());
39 
40  long neighborCount = interface->getNeighborCount();
41  for (long i = 0; i < neighborCount; i++) {
42  Ospfv3Neighbor *neighbor = interface->getNeighbor(i);
43  if (neighbor->getNeighborPriority() > 0) {
44  neighbor->processEvent(Ospfv3Neighbor::START);
45  }
46  }
47  }
48  break;
49 
51  if (interface->getRouterPriority() == 0) {
52  changeState(interface, new Ospfv3InterfaceStateDrOther, this);
53  }
54  else {
55  changeState(interface, new Ospfv3InterfaceStateWaiting, this);
56  interface->getArea()->getInstance()->getProcess()->setTimer(interface->getWaitTimer(), interface->getDeadInterval());
57  }
58  break;
59 
60  default:
61  break;
62  }
63  }
64  else if (interface->isInterfacePassive()) {
65  LinkLSA *lsa = interface->originateLinkLSA();
66  interface->installLinkLSA(lsa);
67  delete lsa;
68  IntraAreaPrefixLSA *prefLsa = interface->getArea()->originateIntraAreaPrefixLSA();
69  if (prefLsa != nullptr) {
70  if (!interface->getArea()->installIntraAreaPrefixLSA(prefLsa))
71  EV_DEBUG << "Intra Area Prefix LSA for network beyond interface " << interface->getIntName() << " was not created!\n";
72  delete prefLsa;
73  }
74  changeState(interface, new Ospfv3InterfacePassive, this);
75  }
76  if (event == Ospfv3Interface::LOOP_IND_EVENT) {
77  interface->reset();
78  changeState(interface, new Ospfv3InterfaceStateLoopback, this);
79  }
80  }
81 } // processEvent

The documentation for this class was generated from the following files:
inet::ospfv3::Ospfv3Interface::NBMA_TYPE
@ NBMA_TYPE
Definition: Ospfv3Interface.h:54
inet::ospfv3::Ospfv3Interface::BROADCAST_TYPE
@ BROADCAST_TYPE
Definition: Ospfv3Interface.h:53
inet::ospfv3::Ospfv3Interface::LOOP_IND_EVENT
@ LOOP_IND_EVENT
Definition: Ospfv3Interface.h:44
inet::ospfv3::Ospfv3Interface::INTERFACE_STATE_DOWN
@ INTERFACE_STATE_DOWN
Definition: Ospfv3Interface.h:27
inet::ospfv3::Ospfv3Interface::INTERFACE_UP_EVENT
@ INTERFACE_UP_EVENT
Definition: Ospfv3Interface.h:38
inet::ospfv3::Ospfv3InterfaceState::changeState
void changeState(Ospfv3Interface *intf, Ospfv3InterfaceState *newState, Ospfv3InterfaceState *currentState)
Definition: Ospfv3InterfaceState.cc:10
inet::ospfv3::Ospfv3Interface::POINTTOMULTIPOINT_TYPE
@ POINTTOMULTIPOINT_TYPE
Definition: Ospfv3Interface.h:55
inet::ospfv3::Ospfv3Interface::POINTTOPOINT_TYPE
@ POINTTOPOINT_TYPE
Definition: Ospfv3Interface.h:52
inet::ospfv3::Ospfv3Neighbor::START
@ START
Definition: Ospfv3Neighbor.h:24
inet::ospfv3::Ospfv3Interface::VIRTUAL_TYPE
@ VIRTUAL_TYPE
Definition: Ospfv3Interface.h:56