INET Framework for OMNeT++/OMNEST
AnsaOSPF::InterfaceStateWaiting Class Reference

#include <AnsaOSPFInterfaceStateWaiting.h>

Inheritance diagram for AnsaOSPF::InterfaceStateWaiting:
AnsaOSPF::InterfaceState

List of all members.

Public Member Functions

virtual void ProcessEvent (Interface *intf, Interface::InterfaceEventType event)
virtual
Interface::InterfaceStateType 
GetState (void) const

Detailed Description

Definition at line 8 of file AnsaOSPFInterfaceStateWaiting.h.


Member Function Documentation

Implements AnsaOSPF::InterfaceState.

Definition at line 12 of file AnsaOSPFInterfaceStateWaiting.h.

Implements AnsaOSPF::InterfaceState.

Definition at line 8 of file AnsaOSPFInterfaceStateWaiting.cc.

{
    if ((event == AnsaOSPF::Interface::BackupSeen) ||
        (event == AnsaOSPF::Interface::WaitTimer))
    {
        CalculateDesignatedRouter(intf);
    }
    if (event == AnsaOSPF::Interface::InterfaceDown) {
        intf->SetIsGoingDown(true);
        intf->Reset();
        ChangeState(intf, new AnsaOSPF::InterfaceStateDown, this);
        intf->SetIsGoingDown(false);
    }
    if (event == AnsaOSPF::Interface::LoopIndication) {
        intf->Reset();
        ChangeState(intf, new AnsaOSPF::InterfaceStateLoopback, this);
    }
    if (event == AnsaOSPF::Interface::HelloTimer) {
        if (intf->GetType() == AnsaOSPF::Interface::Broadcast) {
            intf->SendHelloPacket(AnsaOSPF::AllSPFRouters);
        } else {    // AnsaOSPF::Interface::NBMA
            unsigned long neighborCount = intf->GetNeighborCount();
            int           ttl           = (intf->GetType() == AnsaOSPF::Interface::Virtual) ? VIRTUAL_LINK_TTL : 1;
            for (unsigned long i = 0; i < neighborCount; i++) {
                AnsaOSPF::Neighbor* neighbor = intf->GetNeighbor(i);
                if (neighbor->GetPriority() > 0) {
                    intf->SendHelloPacket(neighbor->GetAddress(), ttl);
                }
            }
        }
        intf->GetArea()->GetRouter()->GetMessageHandler()->StartTimer(intf->GetHelloTimer(), intf->GetHelloInterval());
    }
    if (event == AnsaOSPF::Interface::AcknowledgementTimer) {
        intf->SendDelayedAcknowledgements();
    }
}

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