|
INET Framework for OMNeT++/OMNEST
|
#include <AnsaOSPFNeighbor.h>
Definition at line 15 of file AnsaOSPFNeighbor.h.
Definition at line 51 of file AnsaOSPFNeighbor.h.
Definition at line 20 of file AnsaOSPFNeighbor.h.
{
HelloReceived = 0,
Start = 1,
TwoWayReceived = 2,
NegotiationDone = 3,
ExchangeDone = 4,
BadLinkStateRequest = 5,
LoadingDone = 6,
IsAdjacencyOK = 7,
SequenceNumberMismatch = 8,
OneWayReceived = 9,
KillNeighbor = 10,
InactivityTimer = 11,
PollTimer = 12,
LinkDown = 13,
DDRetransmissionTimer = 14,
UpdateRetransmissionTimer = 15,
RequestRetransmissionTimer = 16
};
| DownState | |
| AttemptState | |
| InitState | |
| TwoWayState | |
| ExchangeStartState | |
| ExchangeState | |
| LoadingState | |
| FullState |
Definition at line 40 of file AnsaOSPFNeighbor.h.
{
DownState = 0,
AttemptState = 1,
InitState = 2,
TwoWayState = 4,
ExchangeStartState = 8,
ExchangeState = 16,
LoadingState = 32,
FullState = 64
};
| AnsaOSPF::Neighbor::Neighbor | ( | RouterID | neighbor = NullRouterID | ) |
Definition at line 12 of file AnsaOSPFNeighbor.cc.
:
updateRetransmissionTimerActive(false),
requestRetransmissionTimerActive(false),
firstAdjacencyInited(false),
ddSequenceNumber(0),
neighborID(neighbor),
neighborPriority(0),
neighborIPAddress(AnsaOSPF::NullIPv4Address),
neighborsDesignatedRouter(AnsaOSPF::NullDesignatedRouterID),
neighborsBackupDesignatedRouter(AnsaOSPF::NullDesignatedRouterID),
designatedRoutersSetUp(false),
neighborsRouterDeadInterval(40),
lastTransmittedDDPacket(NULL)
{
memset(&lastReceivedDDPacket, 0, sizeof(AnsaOSPF::Neighbor::DDPacketID));
// setting only I and M bits is invalid -> good initializer
lastReceivedDDPacket.ddOptions.I_Init = true;
lastReceivedDDPacket.ddOptions.M_More = true;
inactivityTimer = new OSPFTimer;
inactivityTimer->setTimerKind(NeighborInactivityTimer);
inactivityTimer->setContextPointer(this);
inactivityTimer->setName("AnsaOSPF::Neighbor::NeighborInactivityTimer");
pollTimer = new OSPFTimer;
pollTimer->setTimerKind(NeighborPollTimer);
pollTimer->setContextPointer(this);
pollTimer->setName("AnsaOSPF::Neighbor::NeighborPollTimer");
ddRetransmissionTimer = new OSPFTimer;
ddRetransmissionTimer->setTimerKind(NeighborDDRetransmissionTimer);
ddRetransmissionTimer->setContextPointer(this);
ddRetransmissionTimer->setName("AnsaOSPF::Neighbor::NeighborDDRetransmissionTimer");
updateRetransmissionTimer = new OSPFTimer;
updateRetransmissionTimer->setTimerKind(NeighborUpdateRetransmissionTimer);
updateRetransmissionTimer->setContextPointer(this);
updateRetransmissionTimer->setName("AnsaOSPF::Neighbor::Neighbor::NeighborUpdateRetransmissionTimer");
requestRetransmissionTimer = new OSPFTimer;
requestRetransmissionTimer->setTimerKind(NeighborRequestRetransmissionTimer);
requestRetransmissionTimer->setContextPointer(this);
requestRetransmissionTimer->setName("AnsaOSPF::Neighbor::NeighborRequestRetransmissionTimer");
state = new AnsaOSPF::NeighborStateDown;
previousState = NULL;
}
| AnsaOSPF::Neighbor::~Neighbor | ( | void | ) | [virtual] |
Definition at line 54 of file AnsaOSPFNeighbor.cc.
{
Reset();
MessageHandler* messageHandler = parentInterface->GetArea()->GetRouter()->GetMessageHandler();
messageHandler->ClearTimer(inactivityTimer);
messageHandler->ClearTimer(pollTimer);
delete inactivityTimer;
delete pollTimer;
delete ddRetransmissionTimer;
delete updateRetransmissionTimer;
delete requestRetransmissionTimer;
if (previousState != NULL) {
delete previousState;
}
delete state;
}
| void AnsaOSPF::Neighbor::AddToRequestList | ( | OSPFLSAHeader * | lsaHeader | ) |
Definition at line 469 of file AnsaOSPFNeighbor.cc.
Referenced by AnsaOSPF::DatabaseDescriptionHandler::ProcessDDPacket().
{
linkStateRequestList.push_back(new OSPFLSAHeader(*lsaHeader));
}
| void AnsaOSPF::Neighbor::AddToRetransmissionList | ( | OSPFLSA * | lsa | ) |
If the LSA is already on the retransmission list then it is replaced, else a copy of the LSA is added to the end of the retransmission list.
| lsa | [in] The LSA to be added. |
Definition at line 376 of file AnsaOSPFNeighbor.cc.
{
std::list<OSPFLSA*>::iterator it;
for (it = linkStateRetransmissionList.begin(); it != linkStateRetransmissionList.end(); it++) {
if (((*it)->getHeader().getLinkStateID() == lsa->getHeader().getLinkStateID()) &&
((*it)->getHeader().getAdvertisingRouter().getInt() == lsa->getHeader().getAdvertisingRouter().getInt()))
{
break;
}
}
OSPFLSA* lsaCopy = NULL;
switch (lsa->getHeader().getLsType()) {
case RouterLSAType:
lsaCopy = new OSPFRouterLSA(*(check_and_cast<OSPFRouterLSA*> (lsa)));
break;
case NetworkLSAType:
lsaCopy = new OSPFNetworkLSA(*(check_and_cast<OSPFNetworkLSA*> (lsa)));
break;
case SummaryLSA_NetworksType:
case SummaryLSA_ASBoundaryRoutersType:
lsaCopy = new OSPFSummaryLSA(*(check_and_cast<OSPFSummaryLSA*> (lsa)));
break;
case ASExternalLSAType:
lsaCopy = new OSPFASExternalLSA(*(check_and_cast<OSPFASExternalLSA*> (lsa)));
break;
default:
ASSERT(false); // error
break;
}
if (it != linkStateRetransmissionList.end()) {
delete(*it);
*it = static_cast<OSPFLSA*> (lsaCopy);
} else {
linkStateRetransmissionList.push_back(static_cast<OSPFLSA*> (lsaCopy));
}
}
| void AnsaOSPF::Neighbor::AddToTransmittedLSAList | ( | AnsaOSPF::LSAKeyType | lsaKey | ) |
Definition at line 533 of file AnsaOSPFNeighbor.cc.
Referenced by AnsaOSPF::Interface::FloodLSA().
{
TransmittedLSA transmit;
transmit.lsaKey = lsaKey;
transmit.age = 0;
transmittedLSAs.push_back(transmit);
}
| void AnsaOSPF::Neighbor::AgeTransmittedLSAList | ( | void | ) |
Definition at line 555 of file AnsaOSPFNeighbor.cc.
{
std::list<TransmittedLSA>::iterator it = transmittedLSAs.begin();
while ((it != transmittedLSAs.end()) && (it->age == MIN_LS_ARRIVAL)) {
transmittedLSAs.pop_front();
it = transmittedLSAs.begin();
}
for (it = transmittedLSAs.begin(); it != transmittedLSAs.end(); it++) {
it->age++;
}
}
| void AnsaOSPF::Neighbor::ChangeState | ( | NeighborState * | newState, |
| NeighborState * | currentState | ||
| ) | [private] |
Definition at line 71 of file AnsaOSPFNeighbor.cc.
Referenced by AnsaOSPF::NeighborState::ChangeState().
{
if (previousState != NULL) {
delete previousState;
}
state = newState;
previousState = currentState;
}
| void AnsaOSPF::Neighbor::ClearRequestRetransmissionTimer | ( | void | ) |
Definition at line 526 of file AnsaOSPFNeighbor.cc.
Referenced by AnsaOSPF::NeighborStateExchange::ProcessEvent(), AnsaOSPF::NeighborStateLoading::ProcessEvent(), and AnsaOSPF::DatabaseDescriptionHandler::ProcessPacket().
{
MessageHandler* messageHandler = parentInterface->GetArea()->GetRouter()->GetMessageHandler();
messageHandler->ClearTimer(requestRetransmissionTimer);
requestRetransmissionTimerActive = false;
}
| void AnsaOSPF::Neighbor::ClearUpdateRetransmissionTimer | ( | void | ) |
Definition at line 462 of file AnsaOSPFNeighbor.cc.
Referenced by AnsaOSPF::LinkStateAcknowledgementHandler::ProcessPacket().
{
MessageHandler* messageHandler = parentInterface->GetArea()->GetRouter()->GetMessageHandler();
messageHandler->ClearTimer(updateRetransmissionTimer);
updateRetransmissionTimerActive = false;
}
| void AnsaOSPF::Neighbor::CreateDatabaseSummary | ( | void | ) |
Definition at line 245 of file AnsaOSPFNeighbor.cc.
Referenced by AnsaOSPF::NeighborStateExchangeStart::ProcessEvent().
{
AnsaOSPF::Area* area = parentInterface->GetArea();
unsigned long routerLSACount = area->GetRouterLSACount();
/* Note: OSPF specification says:
* "LSAs whose age is equal to MaxAge are instead added to the neighbor's
* Link state retransmission list."
* But this task has been already done during the aging of the database. (???)
* So we'll skip this.
*/
for (unsigned long i = 0; i < routerLSACount; i++) {
if (area->GetRouterLSA(i)->getHeader().getLsAge() < MAX_AGE) {
OSPFLSAHeader* routerLSA = new OSPFLSAHeader(area->GetRouterLSA(i)->getHeader());
databaseSummaryList.push_back(routerLSA);
}
}
unsigned long networkLSACount = area->GetNetworkLSACount();
for (unsigned long j = 0; j < networkLSACount; j++) {
if (area->GetNetworkLSA(j)->getHeader().getLsAge() < MAX_AGE) {
OSPFLSAHeader* networkLSA = new OSPFLSAHeader(area->GetNetworkLSA(j)->getHeader());
databaseSummaryList.push_back(networkLSA);
}
}
unsigned long summaryLSACount = area->GetSummaryLSACount();
for (unsigned long k = 0; k < summaryLSACount; k++) {
if (area->GetSummaryLSA(k)->getHeader().getLsAge() < MAX_AGE) {
OSPFLSAHeader* summaryLSA = new OSPFLSAHeader(area->GetSummaryLSA(k)->getHeader());
databaseSummaryList.push_back(summaryLSA);
}
}
if ((parentInterface->GetType() != AnsaOSPF::Interface::Virtual) &&
(area->GetExternalRoutingCapability()))
{
AnsaOSPF::Router* router = area->GetRouter();
unsigned long asExternalLSACount = router->GetASExternalLSACount();
for (unsigned long m = 0; m < asExternalLSACount; m++) {
if (router->GetASExternalLSA(m)->getHeader().getLsAge() < MAX_AGE) {
OSPFLSAHeader* asExternalLSA = new OSPFLSAHeader(router->GetASExternalLSA(m)->getHeader());
databaseSummaryList.push_back(asExternalLSA);
}
}
}
}
| void AnsaOSPF::Neighbor::DeleteLastSentDDPacket | ( | void | ) |
Definition at line 709 of file AnsaOSPFNeighbor.cc.
Referenced by AnsaOSPF::NeighborStateFull::ProcessEvent(), and AnsaOSPF::NeighborStateLoading::ProcessEvent().
{
if (lastTransmittedDDPacket != NULL) {
delete lastTransmittedDDPacket;
lastTransmittedDDPacket = NULL;
}
}
| bool AnsaOSPF::Neighbor::DesignatedRoutersAreSetUp | ( | void | ) | const [inline] |
Definition at line 170 of file AnsaOSPFNeighbor.h.
Referenced by AnsaOSPF::HelloHandler::ProcessPacket().
{ return designatedRoutersSetUp; }
Definition at line 507 of file AnsaOSPFNeighbor.cc.
{
for (std::list<OSPFLSAHeader*>::iterator it = linkStateRequestList.begin(); it != linkStateRequestList.end(); it++) {
if (((*it)->getLinkStateID() == lsaKey.linkStateID) &&
((*it)->getAdvertisingRouter().getInt() == lsaKey.advertisingRouter))
{
return (*it);
}
}
return NULL;
}
Definition at line 443 of file AnsaOSPFNeighbor.cc.
Referenced by AnsaOSPF::LinkStateAcknowledgementHandler::ProcessPacket().
{
for (std::list<OSPFLSA*>::iterator it = linkStateRetransmissionList.begin(); it != linkStateRetransmissionList.end(); it++) {
if (((*it)->getHeader().getLinkStateID() == lsaKey.linkStateID) &&
((*it)->getHeader().getAdvertisingRouter().getInt() == lsaKey.advertisingRouter))
{
return (*it);
}
}
return NULL;
}
| IPv4Address AnsaOSPF::Neighbor::GetAddress | ( | void | ) | const [inline] |
Definition at line 142 of file AnsaOSPFNeighbor.h.
Referenced by AnsaOSPF::LinkStateUpdateHandler::AcknowledgeLSA(), AnsaOSPF::Interface::AddNeighbor(), AnsaOSPF::InterfaceState::CalculateDesignatedRouter(), AnsaOSPF::Area::CalculateNextHops(), AnsaOSPF::Area::OriginateRouterLSA(), AnsaOSPF::InterfaceStateNotDesignatedRouter::ProcessEvent(), AnsaOSPF::InterfaceStateWaiting::ProcessEvent(), AnsaOSPF::InterfaceStateBackup::ProcessEvent(), AnsaOSPF::NeighborStateDown::ProcessEvent(), AnsaOSPF::InterfaceStateDesignatedRouter::ProcessEvent(), AnsaOSPF::InterfaceStatePointToPoint::ProcessEvent(), AnsaOSPF::HelloHandler::ProcessPacket(), AnsaOSPF::LinkStateRequestHandler::ProcessPacket(), and AnsaOSPF::LinkStateUpdateHandler::ProcessPacket().
{ return neighborIPAddress; }
| DesignatedRouterID AnsaOSPF::Neighbor::GetBackupDesignatedRouter | ( | void | ) | const [inline] |
Definition at line 146 of file AnsaOSPFNeighbor.h.
Referenced by AnsaOSPF::InterfaceState::CalculateDesignatedRouter(), and AnsaOSPF::HelloHandler::ProcessPacket().
{ return neighborsBackupDesignatedRouter; }
| DatabaseExchangeRelationshipType AnsaOSPF::Neighbor::GetDatabaseExchangeRelationship | ( | void | ) | const [inline] |
Definition at line 157 of file AnsaOSPFNeighbor.h.
Referenced by AnsaOSPF::DatabaseDescriptionHandler::ProcessDDPacket(), and AnsaOSPF::DatabaseDescriptionHandler::ProcessPacket().
{ return databaseExchangeRelationship; }
| unsigned long AnsaOSPF::Neighbor::GetDatabaseSummaryListCount | ( | void | ) | const [inline] |
Definition at line 172 of file AnsaOSPFNeighbor.h.
Referenced by AnsaOSPF::DatabaseDescriptionHandler::ProcessDDPacket().
{ return databaseSummaryList.size(); }
| OSPFTimer* AnsaOSPF::Neighbor::GetDDRetransmissionTimer | ( | void | ) | [inline] |
Definition at line 165 of file AnsaOSPFNeighbor.h.
Referenced by AnsaOSPF::NeighborStateExchange::ProcessEvent(), AnsaOSPF::NeighborStateTwoWay::ProcessEvent(), AnsaOSPF::NeighborStateLoading::ProcessEvent(), AnsaOSPF::NeighborStateInit::ProcessEvent(), AnsaOSPF::NeighborStateFull::ProcessEvent(), and AnsaOSPF::NeighborStateExchangeStart::ProcessEvent().
{ return ddRetransmissionTimer; }
| unsigned long AnsaOSPF::Neighbor::GetDDSequenceNumber | ( | void | ) | const [inline] |
Definition at line 150 of file AnsaOSPFNeighbor.h.
Referenced by AnsaOSPF::DatabaseDescriptionHandler::ProcessPacket().
{ return ddSequenceNumber; }
| DesignatedRouterID AnsaOSPF::Neighbor::GetDesignatedRouter | ( | void | ) | const [inline] |
Definition at line 144 of file AnsaOSPFNeighbor.h.
Referenced by AnsaOSPF::InterfaceState::CalculateDesignatedRouter(), and AnsaOSPF::HelloHandler::ProcessPacket().
{ return neighborsDesignatedRouter; }
| OSPFTimer* AnsaOSPF::Neighbor::GetInactivityTimer | ( | void | ) | [inline] |
Definition at line 163 of file AnsaOSPFNeighbor.h.
Referenced by AnsaOSPF::NeighborStateAttempt::ProcessEvent(), AnsaOSPF::NeighborStateTwoWay::ProcessEvent(), AnsaOSPF::NeighborStateLoading::ProcessEvent(), AnsaOSPF::NeighborStateInit::ProcessEvent(), AnsaOSPF::NeighborStateFull::ProcessEvent(), AnsaOSPF::NeighborStateExchangeStart::ProcessEvent(), AnsaOSPF::NeighborStateExchange::ProcessEvent(), and AnsaOSPF::NeighborStateDown::ProcessEvent().
{ return inactivityTimer; }
| Interface* AnsaOSPF::Neighbor::GetInterface | ( | void | ) | [inline] |
Definition at line 160 of file AnsaOSPFNeighbor.h.
Referenced by AnsaOSPF::NeighborState::ChangeState(), AnsaOSPF::MessageHandler::HandleTimer(), AnsaOSPF::NeighborStateLoading::ProcessEvent(), AnsaOSPF::NeighborStateInit::ProcessEvent(), AnsaOSPF::NeighborStateFull::ProcessEvent(), AnsaOSPF::NeighborStateExchangeStart::ProcessEvent(), AnsaOSPF::NeighborStateExchange::ProcessEvent(), AnsaOSPF::NeighborStateDown::ProcessEvent(), AnsaOSPF::NeighborStateAttempt::ProcessEvent(), and AnsaOSPF::NeighborStateTwoWay::ProcessEvent().
{ return parentInterface; }
| const Interface* AnsaOSPF::Neighbor::GetInterface | ( | void | ) | const [inline] |
Definition at line 161 of file AnsaOSPFNeighbor.h.
{ return parentInterface; }
| DDPacketID AnsaOSPF::Neighbor::GetLastReceivedDDPacket | ( | void | ) | const [inline] |
Definition at line 154 of file AnsaOSPFNeighbor.h.
Referenced by AnsaOSPF::DatabaseDescriptionHandler::ProcessPacket().
{ return lastReceivedDDPacket; }
| RouterID AnsaOSPF::Neighbor::GetNeighborID | ( | void | ) | const [inline] |
Definition at line 138 of file AnsaOSPFNeighbor.h.
Referenced by AnsaOSPF::Interface::AddNeighbor(), AnsaOSPF::InterfaceState::CalculateDesignatedRouter(), AnsaOSPF::Area::CalculateNextHops(), AnsaOSPF::Interface::FloodLSA(), AnsaOSPF::Area::OriginateNetworkLSA(), AnsaOSPF::Area::OriginateRouterLSA(), AnsaOSPF::MessageHandler::PrintEvent(), AnsaOSPF::HelloHandler::ProcessPacket(), and AnsaOSPF::DatabaseDescriptionHandler::ProcessPacket().
{ return neighborID; }
| OSPFOptions AnsaOSPF::Neighbor::GetOptions | ( | void | ) | const [inline] |
Definition at line 152 of file AnsaOSPFNeighbor.h.
{ return neighborOptions; }
| OSPFTimer* AnsaOSPF::Neighbor::GetPollTimer | ( | void | ) | [inline] |
Definition at line 164 of file AnsaOSPFNeighbor.h.
Referenced by AnsaOSPF::NeighborStateAttempt::ProcessEvent(), AnsaOSPF::NeighborStateTwoWay::ProcessEvent(), AnsaOSPF::NeighborStateLoading::ProcessEvent(), AnsaOSPF::NeighborStateInit::ProcessEvent(), AnsaOSPF::NeighborStateFull::ProcessEvent(), AnsaOSPF::NeighborStateExchangeStart::ProcessEvent(), AnsaOSPF::NeighborStateExchange::ProcessEvent(), and AnsaOSPF::NeighborStateDown::ProcessEvent().
{ return pollTimer; }
| unsigned char AnsaOSPF::Neighbor::GetPriority | ( | void | ) | const [inline] |
Definition at line 140 of file AnsaOSPFNeighbor.h.
Referenced by AnsaOSPF::InterfaceState::CalculateDesignatedRouter(), AnsaOSPF::InterfaceStateWaiting::ProcessEvent(), AnsaOSPF::InterfaceStateNotDesignatedRouter::ProcessEvent(), AnsaOSPF::InterfaceStateDown::ProcessEvent(), and AnsaOSPF::HelloHandler::ProcessPacket().
{ return neighborPriority; }
| short AnsaOSPF::Neighbor::GetRouterDeadInterval | ( | void | ) | const [inline] |
Definition at line 148 of file AnsaOSPFNeighbor.h.
Referenced by AnsaOSPF::NeighborStateAttempt::ProcessEvent(), AnsaOSPF::NeighborStateTwoWay::ProcessEvent(), AnsaOSPF::NeighborStateLoading::ProcessEvent(), AnsaOSPF::NeighborStateInit::ProcessEvent(), AnsaOSPF::NeighborStateFull::ProcessEvent(), AnsaOSPF::NeighborStateExchangeStart::ProcessEvent(), AnsaOSPF::NeighborStateExchange::ProcessEvent(), and AnsaOSPF::NeighborStateDown::ProcessEvent().
{ return neighborsRouterDeadInterval; }
Definition at line 128 of file AnsaOSPFNeighbor.cc.
Referenced by AnsaOSPF::InterfaceState::CalculateDesignatedRouter(), AnsaOSPF::Area::OriginateNetworkLSA(), AnsaOSPF::Area::OriginateRouterLSA(), AnsaOSPF::MessageHandler::PrintEvent(), AnsaOSPF::LinkStateAcknowledgementHandler::ProcessPacket(), AnsaOSPF::LinkStateRequestHandler::ProcessPacket(), AnsaOSPF::HelloHandler::ProcessPacket(), AnsaOSPF::DatabaseDescriptionHandler::ProcessPacket(), and AnsaOSPF::LinkStateUpdateHandler::ProcessPacket().
| const char * AnsaOSPF::Neighbor::GetStateString | ( | NeighborStateType | stateType | ) | [static] |
Definition at line 133 of file AnsaOSPFNeighbor.cc.
Referenced by AnsaOSPF::MessageHandler::PrintEvent().
{
switch (stateType) {
case DownState: return "Down";
case AttemptState: return "Attempt";
case InitState: return "Init";
case TwoWayState: return "TwoWay";
case ExchangeStartState: return "ExchangeStart";
case ExchangeState: return "Exchange";
case LoadingState: return "Loading";
case FullState: return "Full";
default: ASSERT(false);
}
return "";
}
| unsigned long AnsaOSPF::Neighbor::GetUniqueULong | ( | void | ) |
Definition at line 122 of file AnsaOSPFNeighbor.cc.
{
// FIXME!!! Should come from a global unique number generator module.
return (ddSequenceNumberInitSeed++);
}
| OSPFTimer* AnsaOSPF::Neighbor::GetUpdateRetransmissionTimer | ( | void | ) | [inline] |
Definition at line 166 of file AnsaOSPFNeighbor.h.
{ return updateRetransmissionTimer; }
| void AnsaOSPF::Neighbor::IncrementDDSequenceNumber | ( | void | ) | [inline] |
Definition at line 174 of file AnsaOSPFNeighbor.h.
Referenced by AnsaOSPF::DatabaseDescriptionHandler::ProcessDDPacket(), AnsaOSPF::NeighborStateTwoWay::ProcessEvent(), AnsaOSPF::NeighborStateLoading::ProcessEvent(), AnsaOSPF::NeighborStateInit::ProcessEvent(), AnsaOSPF::NeighborStateFull::ProcessEvent(), and AnsaOSPF::NeighborStateExchange::ProcessEvent().
{ ddSequenceNumber++; }
| void AnsaOSPF::Neighbor::InitFirstAdjacency | ( | void | ) |
Definition at line 116 of file AnsaOSPFNeighbor.cc.
Referenced by AnsaOSPF::NeighborStateInit::ProcessEvent(), and AnsaOSPF::NeighborStateTwoWay::ProcessEvent().
{
ddSequenceNumber = GetUniqueULong();
firstAdjacencyInited = true;
}
| bool AnsaOSPF::Neighbor::IsFirstAdjacencyInited | ( | void | ) | const [inline] |
Definition at line 169 of file AnsaOSPFNeighbor.h.
Referenced by AnsaOSPF::NeighborStateInit::ProcessEvent(), and AnsaOSPF::NeighborStateTwoWay::ProcessEvent().
{ return firstAdjacencyInited; }
| bool AnsaOSPF::Neighbor::IsLinkStateRequestListEmpty | ( | void | ) | const [inline] |
Definition at line 175 of file AnsaOSPFNeighbor.h.
Referenced by AnsaOSPF::NeighborStateExchange::ProcessEvent(), and AnsaOSPF::DatabaseDescriptionHandler::ProcessPacket().
{ return linkStateRequestList.empty(); }
| bool AnsaOSPF::Neighbor::IsLinkStateRetransmissionListEmpty | ( | void | ) | const [inline] |
Definition at line 176 of file AnsaOSPFNeighbor.h.
Referenced by AnsaOSPF::LinkStateAcknowledgementHandler::ProcessPacket().
{ return linkStateRetransmissionList.empty(); }
| bool AnsaOSPF::Neighbor::IsLSAOnRequestList | ( | AnsaOSPF::LSAKeyType | lsaKey | ) | const |
Definition at line 494 of file AnsaOSPFNeighbor.cc.
Referenced by AnsaOSPF::LinkStateUpdateHandler::ProcessPacket().
{
for (std::list<OSPFLSAHeader*>::const_iterator it = linkStateRequestList.begin(); it != linkStateRequestList.end(); it++) {
const OSPFLSAHeader* lsaHeader = *it;
if ((lsaHeader->getLinkStateID() == lsaKey.linkStateID) &&
(lsaHeader->getAdvertisingRouter().getInt() == lsaKey.advertisingRouter))
{
return true;
}
}
return false;
}
| bool AnsaOSPF::Neighbor::IsLSAOnRetransmissionList | ( | AnsaOSPF::LSAKeyType | lsaKey | ) | const |
Definition at line 430 of file AnsaOSPFNeighbor.cc.
Referenced by AnsaOSPF::LinkStateUpdateHandler::ProcessPacket().
{
for (std::list<OSPFLSA*>::const_iterator it = linkStateRetransmissionList.begin(); it != linkStateRetransmissionList.end(); it++) {
const OSPFLSA* lsa = *it;
if ((lsa->getHeader().getLinkStateID() == lsaKey.linkStateID) &&
(lsa->getHeader().getAdvertisingRouter().getInt() == lsaKey.advertisingRouter))
{
return true;
}
}
return false;
}
| bool AnsaOSPF::Neighbor::IsOnTransmittedLSAList | ( | AnsaOSPF::LSAKeyType | lsaKey | ) | const |
Definition at line 543 of file AnsaOSPFNeighbor.cc.
Referenced by AnsaOSPF::LinkStateUpdateHandler::ProcessPacket().
{
for (std::list<TransmittedLSA>::const_iterator it = transmittedLSAs.begin(); it != transmittedLSAs.end(); it++) {
if ((it->lsaKey.linkStateID == lsaKey.linkStateID) &&
(it->lsaKey.advertisingRouter == lsaKey.advertisingRouter))
{
return true;
}
}
return false;
}
| bool AnsaOSPF::Neighbor::IsRequestRetransmissionTimerActive | ( | void | ) | const [inline] |
Definition at line 168 of file AnsaOSPFNeighbor.h.
Referenced by AnsaOSPF::DatabaseDescriptionHandler::ProcessPacket().
{ return requestRetransmissionTimerActive; }
| bool AnsaOSPF::Neighbor::IsUpdateRetransmissionTimerActive | ( | void | ) | const [inline] |
Definition at line 167 of file AnsaOSPFNeighbor.h.
Referenced by AnsaOSPF::Interface::FloodLSA().
{ return updateRetransmissionTimerActive; }
| bool AnsaOSPF::Neighbor::NeedAdjacency | ( | void | ) |
Definition at line 346 of file AnsaOSPFNeighbor.cc.
Referenced by AnsaOSPF::NeighborStateExchange::ProcessEvent(), AnsaOSPF::NeighborStateTwoWay::ProcessEvent(), AnsaOSPF::NeighborStateLoading::ProcessEvent(), AnsaOSPF::NeighborStateInit::ProcessEvent(), AnsaOSPF::NeighborStateFull::ProcessEvent(), and AnsaOSPF::NeighborStateExchangeStart::ProcessEvent().
{
AnsaOSPF::Interface::OSPFInterfaceType interfaceType = parentInterface->GetType();
AnsaOSPF::RouterID routerID = parentInterface->GetArea()->GetRouter()->GetRouterID();
AnsaOSPF::DesignatedRouterID dRouter = parentInterface->GetDesignatedRouter();
AnsaOSPF::DesignatedRouterID backupDRouter = parentInterface->GetBackupDesignatedRouter();
if ((interfaceType == AnsaOSPF::Interface::PointToPoint) ||
(interfaceType == AnsaOSPF::Interface::PointToMultiPoint) ||
(interfaceType == AnsaOSPF::Interface::Virtual) ||
(dRouter.routerID == routerID) ||
(backupDRouter.routerID == routerID) ||
((neighborsDesignatedRouter.routerID == dRouter.routerID) ||
(!designatedRoutersSetUp &&
(neighborsDesignatedRouter.ipInterfaceAddress == dRouter.ipInterfaceAddress))) ||
((neighborsBackupDesignatedRouter.routerID == backupDRouter.routerID) ||
(!designatedRoutersSetUp &&
(neighborsBackupDesignatedRouter.ipInterfaceAddress == backupDRouter.ipInterfaceAddress))))
{
return true;
} else {
return false;
}
}
| void AnsaOSPF::Neighbor::PopFirstLinkStateRequest | ( | void | ) | [inline] |
Definition at line 177 of file AnsaOSPFNeighbor.h.
{ linkStateRequestList.pop_front(); }
| void AnsaOSPF::Neighbor::ProcessEvent | ( | NeighborEventType | event | ) |
Definition at line 80 of file AnsaOSPFNeighbor.cc.
Referenced by AnsaOSPF::MessageHandler::HandleTimer(), AnsaOSPF::DatabaseDescriptionHandler::ProcessDDPacket(), AnsaOSPF::InterfaceStateDown::ProcessEvent(), AnsaOSPF::LinkStateRequestHandler::ProcessPacket(), AnsaOSPF::HelloHandler::ProcessPacket(), AnsaOSPF::DatabaseDescriptionHandler::ProcessPacket(), and AnsaOSPF::LinkStateUpdateHandler::ProcessPacket().
{
state->ProcessEvent(this, event);
}
| void AnsaOSPF::Neighbor::RemoveFromRequestList | ( | AnsaOSPF::LSAKeyType | lsaKey | ) |
Definition at line 474 of file AnsaOSPFNeighbor.cc.
{
std::list<OSPFLSAHeader*>::iterator it = linkStateRequestList.begin();
while (it != linkStateRequestList.end()) {
if (((*it)->getLinkStateID() == lsaKey.linkStateID) &&
((*it)->getAdvertisingRouter().getInt() == lsaKey.advertisingRouter))
{
delete(*it);
it = linkStateRequestList.erase(it);
} else {
it++;
}
}
if ((GetState() == AnsaOSPF::Neighbor::LoadingState) && (linkStateRequestList.empty())) {
ClearRequestRetransmissionTimer();
ProcessEvent(AnsaOSPF::Neighbor::LoadingDone);
}
}
Definition at line 415 of file AnsaOSPFNeighbor.cc.
Referenced by AnsaOSPF::LinkStateAcknowledgementHandler::ProcessPacket(), and AnsaOSPF::LinkStateUpdateHandler::ProcessPacket().
{
std::list<OSPFLSA*>::iterator it = linkStateRetransmissionList.begin();
while (it != linkStateRetransmissionList.end()) {
if (((*it)->getHeader().getLinkStateID() == lsaKey.linkStateID) &&
((*it)->getHeader().getAdvertisingRouter().getInt() == lsaKey.advertisingRouter))
{
delete(*it);
it = linkStateRetransmissionList.erase(it);
} else {
it++;
}
}
}
| void AnsaOSPF::Neighbor::Reset | ( | void | ) |
Definition at line 85 of file AnsaOSPFNeighbor.cc.
Referenced by AnsaOSPF::NeighborStateAttempt::ProcessEvent(), AnsaOSPF::NeighborStateTwoWay::ProcessEvent(), AnsaOSPF::NeighborStateLoading::ProcessEvent(), AnsaOSPF::NeighborStateInit::ProcessEvent(), AnsaOSPF::NeighborStateFull::ProcessEvent(), AnsaOSPF::NeighborStateExchangeStart::ProcessEvent(), and AnsaOSPF::NeighborStateExchange::ProcessEvent().
{
for (std::list<OSPFLSA*>::iterator retIt = linkStateRetransmissionList.begin();
retIt != linkStateRetransmissionList.end();
retIt++)
{
delete(*retIt);
}
linkStateRetransmissionList.clear();
std::list<OSPFLSAHeader*>::iterator it;
for (it = databaseSummaryList.begin(); it != databaseSummaryList.end(); it++) {
delete(*it);
}
databaseSummaryList.clear();
for (it = linkStateRequestList.begin(); it != linkStateRequestList.end(); it++)
{
delete(*it);
}
linkStateRequestList.clear();
parentInterface->GetArea()->GetRouter()->GetMessageHandler()->ClearTimer(ddRetransmissionTimer);
ClearUpdateRetransmissionTimer();
ClearRequestRetransmissionTimer();
if (lastTransmittedDDPacket != NULL) {
delete lastTransmittedDDPacket;
lastTransmittedDDPacket = NULL;
}
}
| bool AnsaOSPF::Neighbor::RetransmitDatabaseDescriptionPacket | ( | void | ) |
Definition at line 226 of file AnsaOSPFNeighbor.cc.
Referenced by AnsaOSPF::NeighborStateExchangeStart::ProcessEvent(), and AnsaOSPF::DatabaseDescriptionHandler::ProcessPacket().
{
if (lastTransmittedDDPacket != NULL) {
OSPFDatabaseDescriptionPacket* ddPacket = new OSPFDatabaseDescriptionPacket(*lastTransmittedDDPacket);
AnsaOSPF::MessageHandler* messageHandler = parentInterface->GetArea()->GetRouter()->GetMessageHandler();
int ttl = (parentInterface->GetType() == AnsaOSPF::Interface::Virtual) ? VIRTUAL_LINK_TTL : 1;
if (parentInterface->GetType() == AnsaOSPF::Interface::PointToPoint) {
messageHandler->SendPacket(ddPacket, AnsaOSPF::AllSPFRouters, parentInterface->GetIfIndex(), ttl);
} else {
messageHandler->SendPacket(ddPacket, neighborIPAddress, parentInterface->GetIfIndex(), ttl);
}
return true;
} else {
return false;
}
}
| void AnsaOSPF::Neighbor::RetransmitUpdatePacket | ( | void | ) |
Definition at line 567 of file AnsaOSPFNeighbor.cc.
Referenced by AnsaOSPF::NeighborStateExchange::ProcessEvent(), AnsaOSPF::NeighborStateLoading::ProcessEvent(), and AnsaOSPF::NeighborStateFull::ProcessEvent().
{
OSPFLinkStateUpdatePacket* updatePacket = new OSPFLinkStateUpdatePacket;
updatePacket->setType(LinkStateUpdatePacket);
updatePacket->setRouterID(parentInterface->GetArea()->GetRouter()->GetRouterID());
updatePacket->setAreaID(parentInterface->GetArea()->GetAreaID());
updatePacket->setAuthenticationType(parentInterface->GetAuthenticationType());
AnsaOSPF::AuthenticationKeyType authKey = parentInterface->GetAuthenticationKey();
for (int i = 0; i < 8; i++) {
updatePacket->setAuthentication(i, authKey.bytes[i]);
}
bool packetFull = false;
unsigned short lsaCount = 0;
unsigned long packetLength = IPV4_HEADER_LENGTH + OSPF_LSA_HEADER_LENGTH;
std::list<OSPFLSA*>::iterator it = linkStateRetransmissionList.begin();
while (!packetFull && (it != linkStateRetransmissionList.end())) {
LSAType lsaType = static_cast<LSAType> ((*it)->getHeader().getLsType());
OSPFRouterLSA* routerLSA = (lsaType == RouterLSAType) ? dynamic_cast<OSPFRouterLSA*> (*it) : NULL;
OSPFNetworkLSA* networkLSA = (lsaType == NetworkLSAType) ? dynamic_cast<OSPFNetworkLSA*> (*it) : NULL;
OSPFSummaryLSA* summaryLSA = ((lsaType == SummaryLSA_NetworksType) ||
(lsaType == SummaryLSA_ASBoundaryRoutersType)) ? dynamic_cast<OSPFSummaryLSA*> (*it) : NULL;
OSPFASExternalLSA* asExternalLSA = (lsaType == ASExternalLSAType) ? dynamic_cast<OSPFASExternalLSA*> (*it) : NULL;
long lsaSize = 0;
bool includeLSA = false;
switch (lsaType) {
case RouterLSAType:
if (routerLSA != NULL) {
lsaSize = CalculateLSASize(routerLSA);
}
break;
case NetworkLSAType:
if (networkLSA != NULL) {
lsaSize = CalculateLSASize(networkLSA);
}
break;
case SummaryLSA_NetworksType:
case SummaryLSA_ASBoundaryRoutersType:
if (summaryLSA != NULL) {
lsaSize = CalculateLSASize(summaryLSA);
}
break;
case ASExternalLSAType:
if (asExternalLSA != NULL) {
lsaSize = CalculateLSASize(asExternalLSA);
}
break;
default: break;
}
if (packetLength + lsaSize < parentInterface->GetMTU()) {
includeLSA = true;
lsaCount++;
} else {
if ((lsaCount == 0) && (packetLength + lsaSize < IPV4_DATAGRAM_LENGTH)) {
includeLSA = true;
lsaCount++;
packetFull = true;
}
}
if (includeLSA) {
switch (lsaType) {
case RouterLSAType:
if (routerLSA != NULL) {
unsigned int routerLSACount = updatePacket->getRouterLSAsArraySize();
updatePacket->setRouterLSAsArraySize(routerLSACount + 1);
updatePacket->setRouterLSAs(routerLSACount, *routerLSA);
unsigned short lsAge = updatePacket->getRouterLSAs(routerLSACount).getHeader().getLsAge();
if (lsAge < MAX_AGE - parentInterface->GetTransmissionDelay()) {
updatePacket->getRouterLSAs(routerLSACount).getHeader().setLsAge(lsAge + parentInterface->GetTransmissionDelay());
} else {
updatePacket->getRouterLSAs(routerLSACount).getHeader().setLsAge(MAX_AGE);
}
}
break;
case NetworkLSAType:
if (networkLSA != NULL) {
unsigned int networkLSACount = updatePacket->getNetworkLSAsArraySize();
updatePacket->setNetworkLSAsArraySize(networkLSACount + 1);
updatePacket->setNetworkLSAs(networkLSACount, *networkLSA);
unsigned short lsAge = updatePacket->getNetworkLSAs(networkLSACount).getHeader().getLsAge();
if (lsAge < MAX_AGE - parentInterface->GetTransmissionDelay()) {
updatePacket->getNetworkLSAs(networkLSACount).getHeader().setLsAge(lsAge + parentInterface->GetTransmissionDelay());
} else {
updatePacket->getNetworkLSAs(networkLSACount).getHeader().setLsAge(MAX_AGE);
}
}
break;
case SummaryLSA_NetworksType:
case SummaryLSA_ASBoundaryRoutersType:
if (summaryLSA != NULL) {
unsigned int summaryLSACount = updatePacket->getSummaryLSAsArraySize();
updatePacket->setSummaryLSAsArraySize(summaryLSACount + 1);
updatePacket->setSummaryLSAs(summaryLSACount, *summaryLSA);
unsigned short lsAge = updatePacket->getSummaryLSAs(summaryLSACount).getHeader().getLsAge();
if (lsAge < MAX_AGE - parentInterface->GetTransmissionDelay()) {
updatePacket->getSummaryLSAs(summaryLSACount).getHeader().setLsAge(lsAge + parentInterface->GetTransmissionDelay());
} else {
updatePacket->getSummaryLSAs(summaryLSACount).getHeader().setLsAge(MAX_AGE);
}
}
break;
case ASExternalLSAType:
if (asExternalLSA != NULL) {
unsigned int asExternalLSACount = updatePacket->getAsExternalLSAsArraySize();
updatePacket->setAsExternalLSAsArraySize(asExternalLSACount + 1);
updatePacket->setAsExternalLSAs(asExternalLSACount, *asExternalLSA);
unsigned short lsAge = updatePacket->getAsExternalLSAs(asExternalLSACount).getHeader().getLsAge();
if (lsAge < MAX_AGE - parentInterface->GetTransmissionDelay()) {
updatePacket->getAsExternalLSAs(asExternalLSACount).getHeader().setLsAge(lsAge + parentInterface->GetTransmissionDelay());
} else {
updatePacket->getAsExternalLSAs(asExternalLSACount).getHeader().setLsAge(MAX_AGE);
}
}
break;
default: break;
}
}
it++;
}
updatePacket->setPacketLength(0); // TODO: Calculate correct length
updatePacket->setChecksum(0); // TODO: Calculate correct cheksum(16-bit one's complement of the entire packet)
AnsaOSPF::MessageHandler* messageHandler = parentInterface->GetArea()->GetRouter()->GetMessageHandler();
int ttl = (parentInterface->GetType() == AnsaOSPF::Interface::Virtual) ? VIRTUAL_LINK_TTL : 1;
messageHandler->SendPacket(updatePacket, neighborIPAddress, parentInterface->GetIfIndex(), ttl);
}
| void AnsaOSPF::Neighbor::SendDatabaseDescriptionPacket | ( | bool | init = false | ) |
Definition at line 149 of file AnsaOSPFNeighbor.cc.
Referenced by AnsaOSPF::DatabaseDescriptionHandler::ProcessDDPacket(), AnsaOSPF::NeighborStateExchangeStart::ProcessEvent(), AnsaOSPF::NeighborStateLoading::ProcessEvent(), AnsaOSPF::NeighborStateInit::ProcessEvent(), AnsaOSPF::NeighborStateFull::ProcessEvent(), AnsaOSPF::NeighborStateTwoWay::ProcessEvent(), AnsaOSPF::NeighborStateExchange::ProcessEvent(), and AnsaOSPF::DatabaseDescriptionHandler::ProcessPacket().
{
OSPFDatabaseDescriptionPacket* ddPacket = new OSPFDatabaseDescriptionPacket;
ddPacket->setType(DatabaseDescriptionPacket);
ddPacket->setRouterID(parentInterface->GetArea()->GetRouter()->GetRouterID());
ddPacket->setAreaID(parentInterface->GetArea()->GetAreaID());
ddPacket->setAuthenticationType(parentInterface->GetAuthenticationType());
AnsaOSPF::AuthenticationKeyType authKey = parentInterface->GetAuthenticationKey();
for (int i = 0; i < 8; i++) {
ddPacket->setAuthentication(i, authKey.bytes[i]);
}
if (parentInterface->GetType() != AnsaOSPF::Interface::Virtual) {
ddPacket->setInterfaceMTU(parentInterface->GetMTU());
} else {
ddPacket->setInterfaceMTU(0);
}
OSPFOptions options;
memset(&options, 0, sizeof(OSPFOptions));
options.E_ExternalRoutingCapability = parentInterface->GetArea()->GetExternalRoutingCapability();
ddPacket->setOptions(options);
ddPacket->setDdSequenceNumber(ddSequenceNumber);
long maxPacketSize = ((IPV4_HEADER_LENGTH + OSPF_HEADER_LENGTH + OSPF_DD_HEADER_LENGTH + OSPF_LSA_HEADER_LENGTH) > parentInterface->GetMTU()) ?
IPV4_DATAGRAM_LENGTH :
parentInterface->GetMTU();
if (init || databaseSummaryList.empty()) {
ddPacket->setLsaHeadersArraySize(0);
} else {
// delete included LSAs from summary list
// (they are still in lastTransmittedDDPacket)
long packetSize = IPV4_HEADER_LENGTH + OSPF_HEADER_LENGTH + OSPF_DD_HEADER_LENGTH;
while ((!databaseSummaryList.empty()) && (packetSize <= (maxPacketSize - OSPF_LSA_HEADER_LENGTH))) {
unsigned long headerCount = ddPacket->getLsaHeadersArraySize();
OSPFLSAHeader* lsaHeader = *(databaseSummaryList.begin());
ddPacket->setLsaHeadersArraySize(headerCount + 1);
ddPacket->setLsaHeaders(headerCount, *lsaHeader);
delete lsaHeader;
databaseSummaryList.pop_front();
packetSize += OSPF_LSA_HEADER_LENGTH;
}
}
OSPFDDOptions ddOptions;
memset(&ddOptions, 0, sizeof(OSPFDDOptions));
if (init) {
ddOptions.I_Init = true;
ddOptions.M_More = true;
ddOptions.MS_MasterSlave = true;
} else {
ddOptions.I_Init = false;
ddOptions.M_More = (databaseSummaryList.empty()) ? false : true;
ddOptions.MS_MasterSlave = (databaseExchangeRelationship == AnsaOSPF::Neighbor::Master) ? true : false;
}
ddPacket->setDdOptions(ddOptions);
ddPacket->setPacketLength(0); // TODO: Calculate correct length
ddPacket->setChecksum(0); // TODO: Calculate correct cheksum(16-bit one's complement of the entire packet)
AnsaOSPF::MessageHandler* messageHandler = parentInterface->GetArea()->GetRouter()->GetMessageHandler();
int ttl = (parentInterface->GetType() == AnsaOSPF::Interface::Virtual) ? VIRTUAL_LINK_TTL : 1;
if (parentInterface->GetType() == AnsaOSPF::Interface::PointToPoint) {
messageHandler->SendPacket(ddPacket, AnsaOSPF::AllSPFRouters, parentInterface->GetIfIndex(), ttl);
} else {
messageHandler->SendPacket(ddPacket, neighborIPAddress, parentInterface->GetIfIndex(), ttl);
}
if (lastTransmittedDDPacket != NULL) {
delete lastTransmittedDDPacket;
}
lastTransmittedDDPacket = new OSPFDatabaseDescriptionPacket(*ddPacket);
}
| void AnsaOSPF::Neighbor::SendLinkStateRequestPacket | ( | void | ) |
Definition at line 294 of file AnsaOSPFNeighbor.cc.
Referenced by AnsaOSPF::NeighborStateExchange::ProcessEvent(), AnsaOSPF::NeighborStateLoading::ProcessEvent(), and AnsaOSPF::DatabaseDescriptionHandler::ProcessPacket().
{
OSPFLinkStateRequestPacket* requestPacket = new OSPFLinkStateRequestPacket;
requestPacket->setType(LinkStateRequestPacket);
requestPacket->setRouterID(parentInterface->GetArea()->GetRouter()->GetRouterID());
requestPacket->setAreaID(parentInterface->GetArea()->GetAreaID());
requestPacket->setAuthenticationType(parentInterface->GetAuthenticationType());
AnsaOSPF::AuthenticationKeyType authKey = parentInterface->GetAuthenticationKey();
for (int i = 0; i < 8; i++) {
requestPacket->setAuthentication(i, authKey.bytes[i]);
}
long maxPacketSize = ((IPV4_HEADER_LENGTH + OSPF_HEADER_LENGTH + OSPF_REQUEST_LENGTH) > parentInterface->GetMTU()) ?
IPV4_DATAGRAM_LENGTH :
parentInterface->GetMTU();
if (linkStateRequestList.empty()) {
requestPacket->setRequestsArraySize(0);
} else {
long packetSize = IPV4_HEADER_LENGTH + OSPF_HEADER_LENGTH;
std::list<OSPFLSAHeader*>::iterator it = linkStateRequestList.begin();
while ((it != linkStateRequestList.end()) && (packetSize <= (maxPacketSize - OSPF_REQUEST_LENGTH))) {
unsigned long requestCount = requestPacket->getRequestsArraySize();
OSPFLSAHeader* requestHeader = (*it);
LSARequest request;
request.lsType = requestHeader->getLsType();
request.linkStateID = requestHeader->getLinkStateID();
request.advertisingRouter = requestHeader->getAdvertisingRouter();
requestPacket->setRequestsArraySize(requestCount + 1);
requestPacket->setRequests(requestCount, request);
packetSize += OSPF_REQUEST_LENGTH;
it++;
}
}
requestPacket->setPacketLength(0); // TODO: Calculate correct length
requestPacket->setChecksum(0); // TODO: Calculate correct cheksum(16-bit one's complement of the entire packet)
AnsaOSPF::MessageHandler* messageHandler = parentInterface->GetArea()->GetRouter()->GetMessageHandler();
int ttl = (parentInterface->GetType() == AnsaOSPF::Interface::Virtual) ? VIRTUAL_LINK_TTL : 1;
if (parentInterface->GetType() == AnsaOSPF::Interface::PointToPoint) {
messageHandler->SendPacket(requestPacket, AnsaOSPF::AllSPFRouters, parentInterface->GetIfIndex(), ttl);
} else {
messageHandler->SendPacket(requestPacket, neighborIPAddress, parentInterface->GetIfIndex(), ttl);
}
}
| void AnsaOSPF::Neighbor::SetAddress | ( | IPv4Address | address | ) | [inline] |
Definition at line 141 of file AnsaOSPFNeighbor.h.
Referenced by AnsaOSPFRouting::LoadInterfaceParameters(), and AnsaOSPF::HelloHandler::ProcessPacket().
{ neighborIPAddress = address; }
| void AnsaOSPF::Neighbor::SetBackupDesignatedRouter | ( | DesignatedRouterID | routerID | ) | [inline] |
Definition at line 145 of file AnsaOSPFNeighbor.h.
Referenced by AnsaOSPF::HelloHandler::ProcessPacket().
{ neighborsBackupDesignatedRouter = routerID; }
| void AnsaOSPF::Neighbor::SetDatabaseExchangeRelationship | ( | DatabaseExchangeRelationshipType | relation | ) | [inline] |
Definition at line 156 of file AnsaOSPFNeighbor.h.
Referenced by AnsaOSPF::DatabaseDescriptionHandler::ProcessPacket().
{ databaseExchangeRelationship = relation; }
| void AnsaOSPF::Neighbor::SetDDSequenceNumber | ( | unsigned long | sequenceNumber | ) | [inline] |
Definition at line 149 of file AnsaOSPFNeighbor.h.
Referenced by AnsaOSPF::DatabaseDescriptionHandler::ProcessDDPacket(), and AnsaOSPF::DatabaseDescriptionHandler::ProcessPacket().
{ ddSequenceNumber = sequenceNumber; }
| void AnsaOSPF::Neighbor::SetDesignatedRouter | ( | DesignatedRouterID | routerID | ) | [inline] |
Definition at line 143 of file AnsaOSPFNeighbor.h.
Referenced by AnsaOSPF::HelloHandler::ProcessPacket().
{ neighborsDesignatedRouter = routerID; }
| void AnsaOSPF::Neighbor::SetInterface | ( | Interface * | intf | ) | [inline] |
Definition at line 159 of file AnsaOSPFNeighbor.h.
Referenced by AnsaOSPF::Interface::AddNeighbor().
{ parentInterface = intf; }
| void AnsaOSPF::Neighbor::SetLastReceivedDDPacket | ( | DDPacketID | packetID | ) | [inline] |
Definition at line 153 of file AnsaOSPFNeighbor.h.
Referenced by AnsaOSPF::DatabaseDescriptionHandler::ProcessPacket().
{ lastReceivedDDPacket = packetID; }
| void AnsaOSPF::Neighbor::SetNeighborID | ( | RouterID | id | ) | [inline] |
Definition at line 137 of file AnsaOSPFNeighbor.h.
Referenced by AnsaOSPFRouting::LoadVirtualLink(), and AnsaOSPF::HelloHandler::ProcessPacket().
{ neighborID = id; }
| void AnsaOSPF::Neighbor::SetOptions | ( | OSPFOptions | options | ) | [inline] |
Definition at line 151 of file AnsaOSPFNeighbor.h.
Referenced by AnsaOSPF::DatabaseDescriptionHandler::ProcessPacket().
{ neighborOptions = options; }
| void AnsaOSPF::Neighbor::SetPriority | ( | unsigned char | priority | ) | [inline] |
Definition at line 139 of file AnsaOSPFNeighbor.h.
Referenced by AnsaOSPFRouting::LoadInterfaceParameters(), and AnsaOSPF::HelloHandler::ProcessPacket().
{ neighborPriority = priority; }
| void AnsaOSPF::Neighbor::SetRouterDeadInterval | ( | short | interval | ) | [inline] |
Definition at line 147 of file AnsaOSPFNeighbor.h.
Referenced by AnsaOSPF::HelloHandler::ProcessPacket().
{ neighborsRouterDeadInterval = interval; }
| void AnsaOSPF::Neighbor::SetUpDesignatedRouters | ( | bool | setUp | ) | [inline] |
Definition at line 171 of file AnsaOSPFNeighbor.h.
Referenced by AnsaOSPF::HelloHandler::ProcessPacket().
{ designatedRoutersSetUp = setUp; }
| void AnsaOSPF::Neighbor::StartRequestRetransmissionTimer | ( | void | ) |
Definition at line 519 of file AnsaOSPFNeighbor.cc.
Referenced by AnsaOSPF::NeighborStateExchange::ProcessEvent(), AnsaOSPF::NeighborStateLoading::ProcessEvent(), and AnsaOSPF::DatabaseDescriptionHandler::ProcessPacket().
{
MessageHandler* messageHandler = parentInterface->GetArea()->GetRouter()->GetMessageHandler();
messageHandler->StartTimer(requestRetransmissionTimer, parentInterface->GetRetransmissionInterval());
requestRetransmissionTimerActive = true;
}
| void AnsaOSPF::Neighbor::StartUpdateRetransmissionTimer | ( | void | ) |
Definition at line 455 of file AnsaOSPFNeighbor.cc.
Referenced by AnsaOSPF::Interface::FloodLSA(), AnsaOSPF::NeighborStateLoading::ProcessEvent(), AnsaOSPF::NeighborStateFull::ProcessEvent(), and AnsaOSPF::NeighborStateExchange::ProcessEvent().
{
MessageHandler* messageHandler = parentInterface->GetArea()->GetRouter()->GetMessageHandler();
messageHandler->StartTimer(updateRetransmissionTimer, parentInterface->GetRetransmissionInterval());
updateRetransmissionTimerActive = true;
}
friend class NeighborState [friend] |
Definition at line 17 of file AnsaOSPFNeighbor.h.
Definition at line 78 of file AnsaOSPFNeighbor.h.
Referenced by GetDatabaseExchangeRelationship(), and SetDatabaseExchangeRelationship().
std::list<OSPFLSAHeader*> AnsaOSPF::Neighbor::databaseSummaryList [private] |
Definition at line 91 of file AnsaOSPFNeighbor.h.
Referenced by GetDatabaseSummaryListCount().
Definition at line 73 of file AnsaOSPFNeighbor.h.
Referenced by GetDDRetransmissionTimer(), and Neighbor().
unsigned long AnsaOSPF::Neighbor::ddSequenceNumber [private] |
Definition at line 80 of file AnsaOSPFNeighbor.h.
Referenced by GetDDSequenceNumber(), IncrementDDSequenceNumber(), and SetDDSequenceNumber().
unsigned long AnsaOSPF::Neighbor::ddSequenceNumberInitSeed = 0 [static, private] |
Definition at line 99 of file AnsaOSPFNeighbor.h.
bool AnsaOSPF::Neighbor::designatedRoutersSetUp [private] |
Definition at line 88 of file AnsaOSPFNeighbor.h.
Referenced by DesignatedRoutersAreSetUp(), and SetUpDesignatedRouters().
bool AnsaOSPF::Neighbor::firstAdjacencyInited [private] |
Definition at line 79 of file AnsaOSPFNeighbor.h.
Referenced by IsFirstAdjacencyInited().
OSPFTimer* AnsaOSPF::Neighbor::inactivityTimer [private] |
Definition at line 71 of file AnsaOSPFNeighbor.h.
Referenced by GetInactivityTimer(), and Neighbor().
Definition at line 81 of file AnsaOSPFNeighbor.h.
Referenced by GetLastReceivedDDPacket(), Neighbor(), and SetLastReceivedDDPacket().
Definition at line 94 of file AnsaOSPFNeighbor.h.
std::list<OSPFLSAHeader*> AnsaOSPF::Neighbor::linkStateRequestList [private] |
Definition at line 92 of file AnsaOSPFNeighbor.h.
Referenced by IsLinkStateRequestListEmpty(), and PopFirstLinkStateRequest().
std::list<OSPFLSA*> AnsaOSPF::Neighbor::linkStateRetransmissionList [private] |
Definition at line 90 of file AnsaOSPFNeighbor.h.
Referenced by IsLinkStateRetransmissionListEmpty().
RouterID AnsaOSPF::Neighbor::neighborID [private] |
Definition at line 82 of file AnsaOSPFNeighbor.h.
Referenced by GetNeighborID(), and SetNeighborID().
Definition at line 84 of file AnsaOSPFNeighbor.h.
Referenced by GetAddress(), and SetAddress().
Definition at line 85 of file AnsaOSPFNeighbor.h.
Referenced by GetOptions(), and SetOptions().
unsigned char AnsaOSPF::Neighbor::neighborPriority [private] |
Definition at line 83 of file AnsaOSPFNeighbor.h.
Referenced by GetPriority(), and SetPriority().
Definition at line 87 of file AnsaOSPFNeighbor.h.
Referenced by GetBackupDesignatedRouter(), and SetBackupDesignatedRouter().
Definition at line 86 of file AnsaOSPFNeighbor.h.
Referenced by GetDesignatedRouter(), and SetDesignatedRouter().
short AnsaOSPF::Neighbor::neighborsRouterDeadInterval [private] |
Definition at line 89 of file AnsaOSPFNeighbor.h.
Referenced by GetRouterDeadInterval(), and SetRouterDeadInterval().
Interface* AnsaOSPF::Neighbor::parentInterface [private] |
Definition at line 96 of file AnsaOSPFNeighbor.h.
Referenced by GetInterface(), and SetInterface().
OSPFTimer* AnsaOSPF::Neighbor::pollTimer [private] |
Definition at line 72 of file AnsaOSPFNeighbor.h.
Referenced by GetPollTimer(), and Neighbor().
NeighborState* AnsaOSPF::Neighbor::previousState [private] |
Definition at line 70 of file AnsaOSPFNeighbor.h.
Referenced by Neighbor().
Definition at line 76 of file AnsaOSPFNeighbor.h.
Referenced by Neighbor().
bool AnsaOSPF::Neighbor::requestRetransmissionTimerActive [private] |
Definition at line 77 of file AnsaOSPFNeighbor.h.
Referenced by IsRequestRetransmissionTimerActive().
NeighborState* AnsaOSPF::Neighbor::state [private] |
Definition at line 69 of file AnsaOSPFNeighbor.h.
Referenced by Neighbor().
std::list<TransmittedLSA> AnsaOSPF::Neighbor::transmittedLSAs [private] |
Definition at line 93 of file AnsaOSPFNeighbor.h.
Definition at line 74 of file AnsaOSPFNeighbor.h.
Referenced by GetUpdateRetransmissionTimer(), and Neighbor().
bool AnsaOSPF::Neighbor::updateRetransmissionTimerActive [private] |
Definition at line 75 of file AnsaOSPFNeighbor.h.
Referenced by IsUpdateRetransmissionTimerActive().