|
INET Framework for OMNeT++/OMNEST
|
#include <OSPFInterfaceStatePointToPoint.h>
Public Member Functions | |
| virtual void | ProcessEvent (Interface *intf, Interface::InterfaceEventType event) |
| virtual Interface::InterfaceStateType | GetState (void) const |
| virtual Interface::InterfaceStateType OSPF::InterfaceStatePointToPoint::GetState | ( | void | ) | const [inline, virtual] |
Implements OSPF::InterfaceState.
{ return Interface::PointToPointState; }
| void OSPF::InterfaceStatePointToPoint::ProcessEvent | ( | OSPF::Interface * | intf, |
| Interface::InterfaceEventType | event | ||
| ) | [virtual] |
Implements OSPF::InterfaceState.
{
if (event == OSPF::Interface::InterfaceDown) {
intf->Reset();
ChangeState(intf, new OSPF::InterfaceStateDown, this);
}
if (event == OSPF::Interface::LoopIndication) {
intf->Reset();
ChangeState(intf, new OSPF::InterfaceStateLoopback, this);
}
if (event == OSPF::Interface::HelloTimer) {
if (intf->GetType() == OSPF::Interface::Virtual) {
if (intf->GetNeighborCount() > 0) {
intf->SendHelloPacket(intf->GetNeighbor(0)->GetAddress(), VIRTUAL_LINK_TTL);
}
} else {
intf->SendHelloPacket(OSPF::AllSPFRouters);
}
intf->GetArea()->GetRouter()->GetMessageHandler()->StartTimer(intf->GetHelloTimer(), intf->GetHelloInterval());
}
if (event == OSPF::Interface::AcknowledgementTimer) {
intf->SendDelayedAcknowledgements();
}
}