OSPF::Neighbor Class Reference

#include <OSPFNeighbor.h>

List of all members.

Public Types

enum  NeighborEventType {
  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
}
enum  NeighborStateType {
  DownState = 0, AttemptState = 1, InitState = 2, TwoWayState = 4,
  ExchangeStartState = 8, ExchangeState = 16, LoadingState = 32, FullState = 64
}
enum  DatabaseExchangeRelationshipType { Master = 0, Slave = 1 }

Public Member Functions

 Neighbor (RouterID neighbor=NullRouterID)
virtual ~Neighbor (void)
void ProcessEvent (NeighborEventType event)
void Reset (void)
void InitFirstAdjacency (void)
NeighborStateType GetState (void) const
void SendDatabaseDescriptionPacket (bool init=false)
bool RetransmitDatabaseDescriptionPacket (void)
void CreateDatabaseSummary (void)
void SendLinkStateRequestPacket (void)
void RetransmitUpdatePacket (void)
bool NeedAdjacency (void)
void AddToRetransmissionList (OSPFLSA *lsa)
void RemoveFromRetransmissionList (LSAKeyType lsaKey)
bool IsLSAOnRetransmissionList (LSAKeyType lsaKey) const
OSPFLSA * FindOnRetransmissionList (LSAKeyType lsaKey)
void StartUpdateRetransmissionTimer (void)
void ClearUpdateRetransmissionTimer (void)
void AddToRequestList (OSPFLSAHeader *lsaHeader)
void RemoveFromRequestList (LSAKeyType lsaKey)
bool IsLSAOnRequestList (LSAKeyType lsaKey) const
OSPFLSAHeader * FindOnRequestList (LSAKeyType lsaKey)
void StartRequestRetransmissionTimer (void)
void ClearRequestRetransmissionTimer (void)
void AddToTransmittedLSAList (LSAKeyType lsaKey)
bool IsOnTransmittedLSAList (LSAKeyType lsaKey) const
void AgeTransmittedLSAList (void)
unsigned long GetUniqueULong (void)
void DeleteLastSentDDPacket (void)
void SetNeighborID (RouterID id)
RouterID GetNeighborID (void) const
void SetPriority (unsigned char priority)
unsigned char GetPriority (void) const
void SetAddress (IPv4Address address)
IPv4Address GetAddress (void) const
void SetDesignatedRouter (DesignatedRouterID routerID)
DesignatedRouterID GetDesignatedRouter (void) const
void SetBackupDesignatedRouter (DesignatedRouterID routerID)
DesignatedRouterID GetBackupDesignatedRouter (void) const
void SetRouterDeadInterval (short interval)
short GetRouterDeadInterval (void) const
void SetDDSequenceNumber (unsigned long sequenceNumber)
unsigned long GetDDSequenceNumber (void) const
void SetOptions (OSPFOptions options)
OSPFOptions GetOptions (void) const
void SetLastReceivedDDPacket (DDPacketID packetID)
DDPacketID GetLastReceivedDDPacket (void) const
void SetDatabaseExchangeRelationship (DatabaseExchangeRelationshipType relation)
DatabaseExchangeRelationshipType GetDatabaseExchangeRelationship (void) const
void SetInterface (Interface *intf)
InterfaceGetInterface (void)
const InterfaceGetInterface (void) const
OSPFTimer * GetInactivityTimer (void)
OSPFTimer * GetPollTimer (void)
OSPFTimer * GetDDRetransmissionTimer (void)
OSPFTimer * GetUpdateRetransmissionTimer (void)
bool IsUpdateRetransmissionTimerActive (void) const
bool IsRequestRetransmissionTimerActive (void) const
bool IsFirstAdjacencyInited (void) const
bool DesignatedRoutersAreSetUp (void) const
void SetUpDesignatedRouters (bool setUp)
unsigned long GetDatabaseSummaryListCount (void) const
void IncrementDDSequenceNumber (void)
bool IsLinkStateRequestListEmpty (void) const
bool IsLinkStateRetransmissionListEmpty (void) const
void PopFirstLinkStateRequest (void)

Static Public Member Functions

static const char * GetStateString (NeighborStateType stateType)

Private Member Functions

void ChangeState (NeighborState *newState, NeighborState *currentState)

Private Attributes

NeighborStatestate
NeighborStatepreviousState
OSPFTimer * inactivityTimer
OSPFTimer * pollTimer
OSPFTimer * ddRetransmissionTimer
OSPFTimer * updateRetransmissionTimer
bool updateRetransmissionTimerActive
OSPFTimer * requestRetransmissionTimer
bool requestRetransmissionTimerActive
DatabaseExchangeRelationshipType databaseExchangeRelationship
bool firstAdjacencyInited
unsigned long ddSequenceNumber
DDPacketID lastReceivedDDPacket
RouterID neighborID
unsigned char neighborPriority
IPv4Address neighborIPAddress
OSPFOptions neighborOptions
DesignatedRouterID neighborsDesignatedRouter
DesignatedRouterID neighborsBackupDesignatedRouter
bool designatedRoutersSetUp
short neighborsRouterDeadInterval
std::list< OSPFLSA * > linkStateRetransmissionList
std::list< OSPFLSAHeader * > databaseSummaryList
std::list< OSPFLSAHeader * > linkStateRequestList
std::list< TransmittedLSAtransmittedLSAs
OSPFDatabaseDescriptionPacket * lastTransmittedDDPacket
InterfaceparentInterface

Static Private Attributes

static unsigned long ddSequenceNumberInitSeed = 0

Friends

class NeighborState

Classes

struct  DDPacketID
struct  TransmittedLSA


Member Enumeration Documentation

Enumerator:
HelloReceived 
Start 
TwoWayReceived 
NegotiationDone 
ExchangeDone 
BadLinkStateRequest 
LoadingDone 
IsAdjacencyOK 
SequenceNumberMismatch 
OneWayReceived 
KillNeighbor 
InactivityTimer 
PollTimer 
LinkDown 
DDRetransmissionTimer 
UpdateRetransmissionTimer 
RequestRetransmissionTimer 
00037                            {
00038         HelloReceived               = 0,
00039         Start                       = 1,
00040         TwoWayReceived              = 2,
00041         NegotiationDone             = 3,
00042         ExchangeDone                = 4,
00043         BadLinkStateRequest         = 5,
00044         LoadingDone                 = 6,
00045         IsAdjacencyOK               = 7,
00046         SequenceNumberMismatch      = 8,
00047         OneWayReceived              = 9,
00048         KillNeighbor                = 10,
00049         InactivityTimer             = 11,
00050         PollTimer                   = 12,
00051         LinkDown                    = 13,
00052         DDRetransmissionTimer       = 14,
00053         UpdateRetransmissionTimer   = 15,
00054         RequestRetransmissionTimer  = 16
00055     };

Enumerator:
DownState 
AttemptState 
InitState 
TwoWayState 
ExchangeStartState 
ExchangeState 
LoadingState 
FullState 
00057                            {
00058         DownState          = 0,
00059         AttemptState       = 1,
00060         InitState          = 2,
00061         TwoWayState        = 4,
00062         ExchangeStartState = 8,
00063         ExchangeState      = 16,
00064         LoadingState       = 32,
00065         FullState          = 64
00066     };

Enumerator:
Master 
Slave 
00068                                           {
00069         Master = 0,
00070         Slave = 1
00071     };


Constructor & Destructor Documentation

OSPF::Neighbor::Neighbor ( RouterID  neighbor = NullRouterID  ) 

00029                                         :
00030     updateRetransmissionTimerActive(false),
00031     requestRetransmissionTimerActive(false),
00032     firstAdjacencyInited(false),
00033     ddSequenceNumber(0),
00034     neighborID(neighbor),
00035     neighborPriority(0),
00036     neighborIPAddress(OSPF::NullIPv4Address),
00037     neighborsDesignatedRouter(OSPF::NullDesignatedRouterID),
00038     neighborsBackupDesignatedRouter(OSPF::NullDesignatedRouterID),
00039     designatedRoutersSetUp(false),
00040     neighborsRouterDeadInterval(40),
00041     lastTransmittedDDPacket(NULL)
00042 {
00043     memset(&lastReceivedDDPacket, 0, sizeof(OSPF::Neighbor::DDPacketID));
00044     // setting only I and M bits is invalid -> good initializer
00045     lastReceivedDDPacket.ddOptions.I_Init = true;
00046     lastReceivedDDPacket.ddOptions.M_More = true;
00047     inactivityTimer = new OSPFTimer;
00048     inactivityTimer->setTimerKind(NeighborInactivityTimer);
00049     inactivityTimer->setContextPointer(this);
00050     inactivityTimer->setName("OSPF::Neighbor::NeighborInactivityTimer");
00051     pollTimer = new OSPFTimer;
00052     pollTimer->setTimerKind(NeighborPollTimer);
00053     pollTimer->setContextPointer(this);
00054     pollTimer->setName("OSPF::Neighbor::NeighborPollTimer");
00055     ddRetransmissionTimer = new OSPFTimer;
00056     ddRetransmissionTimer->setTimerKind(NeighborDDRetransmissionTimer);
00057     ddRetransmissionTimer->setContextPointer(this);
00058     ddRetransmissionTimer->setName("OSPF::Neighbor::NeighborDDRetransmissionTimer");
00059     updateRetransmissionTimer = new OSPFTimer;
00060     updateRetransmissionTimer->setTimerKind(NeighborUpdateRetransmissionTimer);
00061     updateRetransmissionTimer->setContextPointer(this);
00062     updateRetransmissionTimer->setName("OSPF::Neighbor::Neighbor::NeighborUpdateRetransmissionTimer");
00063     requestRetransmissionTimer = new OSPFTimer;
00064     requestRetransmissionTimer->setTimerKind(NeighborRequestRetransmissionTimer);
00065     requestRetransmissionTimer->setContextPointer(this);
00066     requestRetransmissionTimer->setName("OSPF::Neighbor::NeighborRequestRetransmissionTimer");
00067     state = new OSPF::NeighborStateDown;
00068     previousState = NULL;
00069 }

OSPF::Neighbor::~Neighbor ( void   )  [virtual]

00072 {
00073     Reset();
00074     MessageHandler* messageHandler = parentInterface->GetArea()->GetRouter()->GetMessageHandler();
00075     messageHandler->ClearTimer(inactivityTimer);
00076     messageHandler->ClearTimer(pollTimer);
00077     delete inactivityTimer;
00078     delete pollTimer;
00079     delete ddRetransmissionTimer;
00080     delete updateRetransmissionTimer;
00081     delete requestRetransmissionTimer;
00082     if (previousState != NULL) {
00083         delete previousState;
00084     }
00085     delete state;
00086 }


Member Function Documentation

void OSPF::Neighbor::ChangeState ( NeighborState newState,
NeighborState currentState 
) [private]

Referenced by OSPF::NeighborState::ChangeState().

00089 {
00090     if (previousState != NULL) {
00091         delete previousState;
00092     }
00093     state = newState;
00094     previousState = currentState;
00095 }

void OSPF::Neighbor::ProcessEvent ( NeighborEventType  event  ) 

void OSPF::Neighbor::Reset ( void   ) 

Referenced by OSPF::NeighborStateTwoWay::ProcessEvent(), OSPF::NeighborStateLoading::ProcessEvent(), OSPF::NeighborStateInit::ProcessEvent(), OSPF::NeighborStateFull::ProcessEvent(), OSPF::NeighborStateExchangeStart::ProcessEvent(), OSPF::NeighborStateExchange::ProcessEvent(), OSPF::NeighborStateAttempt::ProcessEvent(), and ~Neighbor().

00103 {
00104     for (std::list<OSPFLSA*>::iterator retIt = linkStateRetransmissionList.begin();
00105          retIt != linkStateRetransmissionList.end();
00106          retIt++)
00107     {
00108         delete(*retIt);
00109     }
00110     linkStateRetransmissionList.clear();
00111 
00112     std::list<OSPFLSAHeader*>::iterator it;
00113     for (it = databaseSummaryList.begin(); it != databaseSummaryList.end(); it++) {
00114         delete(*it);
00115     }
00116     databaseSummaryList.clear();
00117     for (it = linkStateRequestList.begin(); it != linkStateRequestList.end(); it++)
00118     {
00119         delete(*it);
00120     }
00121     linkStateRequestList.clear();
00122 
00123     parentInterface->GetArea()->GetRouter()->GetMessageHandler()->ClearTimer(ddRetransmissionTimer);
00124     ClearUpdateRetransmissionTimer();
00125     ClearRequestRetransmissionTimer();
00126 
00127     if (lastTransmittedDDPacket != NULL) {
00128         delete lastTransmittedDDPacket;
00129         lastTransmittedDDPacket = NULL;
00130     }
00131 }

void OSPF::Neighbor::InitFirstAdjacency ( void   ) 

OSPF::Neighbor::NeighborStateType OSPF::Neighbor::GetState ( void   )  const

const char * OSPF::Neighbor::GetStateString ( NeighborStateType  stateType  )  [static]

Referenced by OSPF::MessageHandler::PrintEvent().

00151 {
00152     switch (stateType) {
00153         case DownState:             return "Down";
00154         case AttemptState:          return "Attempt";
00155         case InitState:             return "Init";
00156         case TwoWayState:           return "TwoWay";
00157         case ExchangeStartState:    return "ExchangeStart";
00158         case ExchangeState:         return "Exchange";
00159         case LoadingState:          return "Loading";
00160         case FullState:             return "Full";
00161         default:                    ASSERT(false);
00162     }
00163     return "";
00164 }

void OSPF::Neighbor::SendDatabaseDescriptionPacket ( bool  init = false  ) 

Referenced by OSPF::DatabaseDescriptionHandler::ProcessDDPacket(), OSPF::NeighborStateTwoWay::ProcessEvent(), OSPF::NeighborStateLoading::ProcessEvent(), OSPF::NeighborStateInit::ProcessEvent(), OSPF::NeighborStateFull::ProcessEvent(), OSPF::NeighborStateExchangeStart::ProcessEvent(), OSPF::NeighborStateExchange::ProcessEvent(), and OSPF::DatabaseDescriptionHandler::ProcessPacket().

00167 {
00168     OSPFDatabaseDescriptionPacket* ddPacket = new OSPFDatabaseDescriptionPacket;
00169 
00170     ddPacket->setType(DatabaseDescriptionPacket);
00171     ddPacket->setRouterID(parentInterface->GetArea()->GetRouter()->GetRouterID());
00172     ddPacket->setAreaID(parentInterface->GetArea()->GetAreaID());
00173     ddPacket->setAuthenticationType(parentInterface->GetAuthenticationType());
00174     OSPF::AuthenticationKeyType authKey = parentInterface->GetAuthenticationKey();
00175     for (int i = 0; i < 8; i++) {
00176         ddPacket->setAuthentication(i, authKey.bytes[i]);
00177     }
00178 
00179     if (parentInterface->GetType() != OSPF::Interface::Virtual) {
00180         ddPacket->setInterfaceMTU(parentInterface->GetMTU());
00181     } else {
00182         ddPacket->setInterfaceMTU(0);
00183     }
00184 
00185     OSPFOptions options;
00186     memset(&options, 0, sizeof(OSPFOptions));
00187     options.E_ExternalRoutingCapability = parentInterface->GetArea()->GetExternalRoutingCapability();
00188     ddPacket->setOptions(options);
00189 
00190     ddPacket->setDdSequenceNumber(ddSequenceNumber);
00191 
00192     long maxPacketSize = ((IPV4_HEADER_LENGTH + OSPF_HEADER_LENGTH + OSPF_DD_HEADER_LENGTH + OSPF_LSA_HEADER_LENGTH) > parentInterface->GetMTU()) ?
00193                           IPV4_DATAGRAM_LENGTH :
00194                           parentInterface->GetMTU();
00195 
00196     if (init || databaseSummaryList.empty()) {
00197         ddPacket->setLsaHeadersArraySize(0);
00198     } else {
00199         // delete included LSAs from summary list
00200         // (they are still in lastTransmittedDDPacket)
00201         long packetSize = IPV4_HEADER_LENGTH + OSPF_HEADER_LENGTH + OSPF_DD_HEADER_LENGTH;
00202         while ((!databaseSummaryList.empty()) && (packetSize <= (maxPacketSize - OSPF_LSA_HEADER_LENGTH))) {
00203             unsigned long   headerCount = ddPacket->getLsaHeadersArraySize();
00204             OSPFLSAHeader*  lsaHeader   = *(databaseSummaryList.begin());
00205             ddPacket->setLsaHeadersArraySize(headerCount + 1);
00206             ddPacket->setLsaHeaders(headerCount, *lsaHeader);
00207             delete lsaHeader;
00208             databaseSummaryList.pop_front();
00209             packetSize += OSPF_LSA_HEADER_LENGTH;
00210         }
00211     }
00212 
00213     OSPFDDOptions ddOptions;
00214     memset(&ddOptions, 0, sizeof(OSPFDDOptions));
00215     if (init) {
00216         ddOptions.I_Init = true;
00217         ddOptions.M_More = true;
00218         ddOptions.MS_MasterSlave = true;
00219     } else {
00220         ddOptions.I_Init = false;
00221         ddOptions.M_More = (databaseSummaryList.empty()) ? false : true;
00222         ddOptions.MS_MasterSlave = (databaseExchangeRelationship == OSPF::Neighbor::Master) ? true : false;
00223     }
00224     ddPacket->setDdOptions(ddOptions);
00225 
00226     ddPacket->setPacketLength(0); // TODO: Calculate correct length
00227     ddPacket->setChecksum(0); // TODO: Calculate correct cheksum(16-bit one's complement of the entire packet)
00228 
00229     OSPF::MessageHandler* messageHandler = parentInterface->GetArea()->GetRouter()->GetMessageHandler();
00230     int ttl = (parentInterface->GetType() == OSPF::Interface::Virtual) ? VIRTUAL_LINK_TTL : 1;
00231     if (parentInterface->GetType() == OSPF::Interface::PointToPoint) {
00232         messageHandler->SendPacket(ddPacket, OSPF::AllSPFRouters, parentInterface->GetIfIndex(), ttl);
00233     } else {
00234         messageHandler->SendPacket(ddPacket, neighborIPAddress, parentInterface->GetIfIndex(), ttl);
00235     }
00236 
00237     if (lastTransmittedDDPacket != NULL) {
00238         delete lastTransmittedDDPacket;
00239     }
00240     lastTransmittedDDPacket = new OSPFDatabaseDescriptionPacket(*ddPacket);
00241 }

bool OSPF::Neighbor::RetransmitDatabaseDescriptionPacket ( void   ) 

Referenced by OSPF::NeighborStateExchangeStart::ProcessEvent(), and OSPF::DatabaseDescriptionHandler::ProcessPacket().

00244 {
00245     if (lastTransmittedDDPacket != NULL) {
00246         OSPFDatabaseDescriptionPacket* ddPacket       = new OSPFDatabaseDescriptionPacket(*lastTransmittedDDPacket);
00247         OSPF::MessageHandler*          messageHandler = parentInterface->GetArea()->GetRouter()->GetMessageHandler();
00248         int                            ttl            = (parentInterface->GetType() == OSPF::Interface::Virtual) ? VIRTUAL_LINK_TTL : 1;
00249 
00250         if (parentInterface->GetType() == OSPF::Interface::PointToPoint) {
00251             messageHandler->SendPacket(ddPacket, OSPF::AllSPFRouters, parentInterface->GetIfIndex(), ttl);
00252         } else {
00253             messageHandler->SendPacket(ddPacket, neighborIPAddress, parentInterface->GetIfIndex(), ttl);
00254         }
00255 
00256         return true;
00257     } else {
00258         return false;
00259     }
00260 }

void OSPF::Neighbor::CreateDatabaseSummary ( void   ) 

Referenced by OSPF::NeighborStateExchangeStart::ProcessEvent().

00263 {
00264     OSPF::Area*   area           = parentInterface->GetArea();
00265     unsigned long routerLSACount = area->GetRouterLSACount();
00266 
00267     /* Note: OSPF specification says:
00268      * "LSAs whose age is equal to MaxAge are instead added to the neighbor's
00269      *  Link state retransmission list."
00270      * But this task has been already done during the aging of the database. (???)
00271      * So we'll skip this.
00272      */
00273     for (unsigned long i = 0; i < routerLSACount; i++) {
00274         if (area->GetRouterLSA(i)->getHeader().getLsAge() < MAX_AGE) {
00275             OSPFLSAHeader* routerLSA = new OSPFLSAHeader(area->GetRouterLSA(i)->getHeader());
00276             databaseSummaryList.push_back(routerLSA);
00277         }
00278     }
00279 
00280     unsigned long networkLSACount = area->GetNetworkLSACount();
00281     for (unsigned long j = 0; j < networkLSACount; j++) {
00282         if (area->GetNetworkLSA(j)->getHeader().getLsAge() < MAX_AGE) {
00283             OSPFLSAHeader* networkLSA = new OSPFLSAHeader(area->GetNetworkLSA(j)->getHeader());
00284             databaseSummaryList.push_back(networkLSA);
00285         }
00286     }
00287 
00288     unsigned long summaryLSACount = area->GetSummaryLSACount();
00289     for (unsigned long k = 0; k < summaryLSACount; k++) {
00290         if (area->GetSummaryLSA(k)->getHeader().getLsAge() < MAX_AGE) {
00291             OSPFLSAHeader* summaryLSA = new OSPFLSAHeader(area->GetSummaryLSA(k)->getHeader());
00292             databaseSummaryList.push_back(summaryLSA);
00293         }
00294     }
00295 
00296     if ((parentInterface->GetType() != OSPF::Interface::Virtual) &&
00297         (area->GetExternalRoutingCapability()))
00298     {
00299         OSPF::Router* router             = area->GetRouter();
00300         unsigned long asExternalLSACount = router->GetASExternalLSACount();
00301 
00302         for (unsigned long m = 0; m < asExternalLSACount; m++) {
00303             if (router->GetASExternalLSA(m)->getHeader().getLsAge() < MAX_AGE) {
00304                 OSPFLSAHeader* asExternalLSA = new OSPFLSAHeader(router->GetASExternalLSA(m)->getHeader());
00305                 databaseSummaryList.push_back(asExternalLSA);
00306             }
00307         }
00308     }
00309 }

void OSPF::Neighbor::SendLinkStateRequestPacket ( void   ) 

Referenced by OSPF::NeighborStateLoading::ProcessEvent(), OSPF::NeighborStateExchange::ProcessEvent(), and OSPF::DatabaseDescriptionHandler::ProcessPacket().

00312 {
00313     OSPFLinkStateRequestPacket* requestPacket = new OSPFLinkStateRequestPacket;
00314 
00315     requestPacket->setType(LinkStateRequestPacket);
00316     requestPacket->setRouterID(parentInterface->GetArea()->GetRouter()->GetRouterID());
00317     requestPacket->setAreaID(parentInterface->GetArea()->GetAreaID());
00318     requestPacket->setAuthenticationType(parentInterface->GetAuthenticationType());
00319     OSPF::AuthenticationKeyType authKey = parentInterface->GetAuthenticationKey();
00320     for (int i = 0; i < 8; i++) {
00321         requestPacket->setAuthentication(i, authKey.bytes[i]);
00322     }
00323 
00324     long maxPacketSize = ((IPV4_HEADER_LENGTH + OSPF_HEADER_LENGTH + OSPF_REQUEST_LENGTH) > parentInterface->GetMTU()) ?
00325                           IPV4_DATAGRAM_LENGTH :
00326                           parentInterface->GetMTU();
00327 
00328     if (linkStateRequestList.empty()) {
00329         requestPacket->setRequestsArraySize(0);
00330     } else {
00331         long packetSize = IPV4_HEADER_LENGTH + OSPF_HEADER_LENGTH;
00332         std::list<OSPFLSAHeader*>::iterator it = linkStateRequestList.begin();
00333 
00334         while ((it != linkStateRequestList.end()) && (packetSize <= (maxPacketSize - OSPF_REQUEST_LENGTH))) {
00335             unsigned long  requestCount  = requestPacket->getRequestsArraySize();
00336             OSPFLSAHeader* requestHeader = (*it);
00337             LSARequest     request;
00338 
00339             request.lsType = requestHeader->getLsType();
00340             request.linkStateID = requestHeader->getLinkStateID();
00341             request.advertisingRouter = requestHeader->getAdvertisingRouter();
00342 
00343             requestPacket->setRequestsArraySize(requestCount + 1);
00344             requestPacket->setRequests(requestCount, request);
00345 
00346             packetSize += OSPF_REQUEST_LENGTH;
00347             it++;
00348         }
00349     }
00350 
00351     requestPacket->setPacketLength(0); // TODO: Calculate correct length
00352     requestPacket->setChecksum(0); // TODO: Calculate correct cheksum(16-bit one's complement of the entire packet)
00353 
00354     OSPF::MessageHandler* messageHandler = parentInterface->GetArea()->GetRouter()->GetMessageHandler();
00355     int ttl = (parentInterface->GetType() == OSPF::Interface::Virtual) ? VIRTUAL_LINK_TTL : 1;
00356     if (parentInterface->GetType() == OSPF::Interface::PointToPoint) {
00357         messageHandler->SendPacket(requestPacket, OSPF::AllSPFRouters, parentInterface->GetIfIndex(), ttl);
00358     } else {
00359         messageHandler->SendPacket(requestPacket, neighborIPAddress, parentInterface->GetIfIndex(), ttl);
00360     }
00361 }

void OSPF::Neighbor::RetransmitUpdatePacket ( void   ) 

Referenced by OSPF::NeighborStateLoading::ProcessEvent(), OSPF::NeighborStateFull::ProcessEvent(), and OSPF::NeighborStateExchange::ProcessEvent().

00585 {
00586     OSPFLinkStateUpdatePacket* updatePacket = new OSPFLinkStateUpdatePacket;
00587 
00588     updatePacket->setType(LinkStateUpdatePacket);
00589     updatePacket->setRouterID(parentInterface->GetArea()->GetRouter()->GetRouterID());
00590     updatePacket->setAreaID(parentInterface->GetArea()->GetAreaID());
00591     updatePacket->setAuthenticationType(parentInterface->GetAuthenticationType());
00592     OSPF::AuthenticationKeyType authKey = parentInterface->GetAuthenticationKey();
00593     for (int i = 0; i < 8; i++) {
00594         updatePacket->setAuthentication(i, authKey.bytes[i]);
00595     }
00596 
00597     bool                          packetFull   = false;
00598     unsigned short                lsaCount     = 0;
00599     unsigned long                 packetLength = IPV4_HEADER_LENGTH + OSPF_LSA_HEADER_LENGTH;
00600     std::list<OSPFLSA*>::iterator it           = linkStateRetransmissionList.begin();
00601 
00602     while (!packetFull && (it != linkStateRetransmissionList.end())) {
00603         LSAType            lsaType       = static_cast<LSAType> ((*it)->getHeader().getLsType());
00604         OSPFRouterLSA*     routerLSA     = (lsaType == RouterLSAType) ? dynamic_cast<OSPFRouterLSA*> (*it) : NULL;
00605         OSPFNetworkLSA*    networkLSA    = (lsaType == NetworkLSAType) ? dynamic_cast<OSPFNetworkLSA*> (*it) : NULL;
00606         OSPFSummaryLSA*    summaryLSA    = ((lsaType == SummaryLSA_NetworksType) ||
00607                                             (lsaType == SummaryLSA_ASBoundaryRoutersType)) ? dynamic_cast<OSPFSummaryLSA*> (*it) : NULL;
00608         OSPFASExternalLSA* asExternalLSA = (lsaType == ASExternalLSAType) ? dynamic_cast<OSPFASExternalLSA*> (*it) : NULL;
00609         long               lsaSize       = 0;
00610         bool               includeLSA    = false;
00611 
00612         switch (lsaType) {
00613             case RouterLSAType:
00614                 if (routerLSA != NULL) {
00615                     lsaSize = CalculateLSASize(routerLSA);
00616                 }
00617                 break;
00618             case NetworkLSAType:
00619                 if (networkLSA != NULL) {
00620                     lsaSize = CalculateLSASize(networkLSA);
00621                 }
00622                 break;
00623             case SummaryLSA_NetworksType:
00624             case SummaryLSA_ASBoundaryRoutersType:
00625                 if (summaryLSA != NULL) {
00626                     lsaSize = CalculateLSASize(summaryLSA);
00627                 }
00628                 break;
00629             case ASExternalLSAType:
00630                 if (asExternalLSA != NULL) {
00631                     lsaSize = CalculateLSASize(asExternalLSA);
00632                 }
00633                 break;
00634             default: break;
00635         }
00636 
00637         if (packetLength + lsaSize < parentInterface->GetMTU()) {
00638             includeLSA = true;
00639             lsaCount++;
00640         } else {
00641             if ((lsaCount == 0) && (packetLength + lsaSize < IPV4_DATAGRAM_LENGTH)) {
00642                 includeLSA = true;
00643                 lsaCount++;
00644                 packetFull = true;
00645             }
00646         }
00647 
00648         if (includeLSA) {
00649             switch (lsaType) {
00650                 case RouterLSAType:
00651                     if (routerLSA != NULL) {
00652                         unsigned int routerLSACount = updatePacket->getRouterLSAsArraySize();
00653 
00654                         updatePacket->setRouterLSAsArraySize(routerLSACount + 1);
00655                         updatePacket->setRouterLSAs(routerLSACount, *routerLSA);
00656 
00657                         unsigned short lsAge = updatePacket->getRouterLSAs(routerLSACount).getHeader().getLsAge();
00658                         if (lsAge < MAX_AGE - parentInterface->GetTransmissionDelay()) {
00659                             updatePacket->getRouterLSAs(routerLSACount).getHeader().setLsAge(lsAge + parentInterface->GetTransmissionDelay());
00660                         } else {
00661                             updatePacket->getRouterLSAs(routerLSACount).getHeader().setLsAge(MAX_AGE);
00662                         }
00663                     }
00664                     break;
00665                 case NetworkLSAType:
00666                     if (networkLSA != NULL) {
00667                         unsigned int networkLSACount = updatePacket->getNetworkLSAsArraySize();
00668 
00669                         updatePacket->setNetworkLSAsArraySize(networkLSACount + 1);
00670                         updatePacket->setNetworkLSAs(networkLSACount, *networkLSA);
00671 
00672                         unsigned short lsAge = updatePacket->getNetworkLSAs(networkLSACount).getHeader().getLsAge();
00673                         if (lsAge < MAX_AGE - parentInterface->GetTransmissionDelay()) {
00674                             updatePacket->getNetworkLSAs(networkLSACount).getHeader().setLsAge(lsAge + parentInterface->GetTransmissionDelay());
00675                         } else {
00676                             updatePacket->getNetworkLSAs(networkLSACount).getHeader().setLsAge(MAX_AGE);
00677                         }
00678                     }
00679                     break;
00680                 case SummaryLSA_NetworksType:
00681                 case SummaryLSA_ASBoundaryRoutersType:
00682                     if (summaryLSA != NULL) {
00683                         unsigned int summaryLSACount = updatePacket->getSummaryLSAsArraySize();
00684 
00685                         updatePacket->setSummaryLSAsArraySize(summaryLSACount + 1);
00686                         updatePacket->setSummaryLSAs(summaryLSACount, *summaryLSA);
00687 
00688                         unsigned short lsAge = updatePacket->getSummaryLSAs(summaryLSACount).getHeader().getLsAge();
00689                         if (lsAge < MAX_AGE - parentInterface->GetTransmissionDelay()) {
00690                             updatePacket->getSummaryLSAs(summaryLSACount).getHeader().setLsAge(lsAge + parentInterface->GetTransmissionDelay());
00691                         } else {
00692                             updatePacket->getSummaryLSAs(summaryLSACount).getHeader().setLsAge(MAX_AGE);
00693                         }
00694                     }
00695                     break;
00696                 case ASExternalLSAType:
00697                     if (asExternalLSA != NULL) {
00698                         unsigned int asExternalLSACount = updatePacket->getAsExternalLSAsArraySize();
00699 
00700                         updatePacket->setAsExternalLSAsArraySize(asExternalLSACount + 1);
00701                         updatePacket->setAsExternalLSAs(asExternalLSACount, *asExternalLSA);
00702 
00703                         unsigned short lsAge = updatePacket->getAsExternalLSAs(asExternalLSACount).getHeader().getLsAge();
00704                         if (lsAge < MAX_AGE - parentInterface->GetTransmissionDelay()) {
00705                             updatePacket->getAsExternalLSAs(asExternalLSACount).getHeader().setLsAge(lsAge + parentInterface->GetTransmissionDelay());
00706                         } else {
00707                             updatePacket->getAsExternalLSAs(asExternalLSACount).getHeader().setLsAge(MAX_AGE);
00708                         }
00709                     }
00710                     break;
00711                 default: break;
00712             }
00713         }
00714 
00715         it++;
00716     }
00717 
00718     updatePacket->setPacketLength(0); // TODO: Calculate correct length
00719     updatePacket->setChecksum(0); // TODO: Calculate correct cheksum(16-bit one's complement of the entire packet)
00720 
00721     OSPF::MessageHandler* messageHandler = parentInterface->GetArea()->GetRouter()->GetMessageHandler();
00722     int ttl = (parentInterface->GetType() == OSPF::Interface::Virtual) ? VIRTUAL_LINK_TTL : 1;
00723     messageHandler->SendPacket(updatePacket, neighborIPAddress, parentInterface->GetIfIndex(), ttl);
00724 }

bool OSPF::Neighbor::NeedAdjacency ( void   ) 

Referenced by OSPF::NeighborStateTwoWay::ProcessEvent(), OSPF::NeighborStateLoading::ProcessEvent(), OSPF::NeighborStateInit::ProcessEvent(), OSPF::NeighborStateFull::ProcessEvent(), OSPF::NeighborStateExchangeStart::ProcessEvent(), and OSPF::NeighborStateExchange::ProcessEvent().

00364 {
00365     OSPF::Interface::OSPFInterfaceType interfaceType = parentInterface->GetType();
00366     OSPF::RouterID                     routerID      = parentInterface->GetArea()->GetRouter()->GetRouterID();
00367     OSPF::DesignatedRouterID           dRouter       = parentInterface->GetDesignatedRouter();
00368     OSPF::DesignatedRouterID           backupDRouter = parentInterface->GetBackupDesignatedRouter();
00369 
00370     if ((interfaceType == OSPF::Interface::PointToPoint) ||
00371         (interfaceType == OSPF::Interface::PointToMultiPoint) ||
00372         (interfaceType == OSPF::Interface::Virtual) ||
00373         (dRouter.routerID == routerID) ||
00374         (backupDRouter.routerID == routerID) ||
00375         ((neighborsDesignatedRouter.routerID == dRouter.routerID) ||
00376          (!designatedRoutersSetUp &&
00377           (neighborsDesignatedRouter.ipInterfaceAddress == dRouter.ipInterfaceAddress))) ||
00378         ((neighborsBackupDesignatedRouter.routerID == backupDRouter.routerID) ||
00379          (!designatedRoutersSetUp &&
00380           (neighborsBackupDesignatedRouter.ipInterfaceAddress == backupDRouter.ipInterfaceAddress))))
00381     {
00382         return true;
00383     } else {
00384         return false;
00385     }
00386 }

void OSPF::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.

Parameters:
lsa [in] The LSA to be added.
00394 {
00395     std::list<OSPFLSA*>::iterator it;
00396     for (it = linkStateRetransmissionList.begin(); it != linkStateRetransmissionList.end(); it++) {
00397         if (((*it)->getHeader().getLinkStateID() == lsa->getHeader().getLinkStateID()) &&
00398             ((*it)->getHeader().getAdvertisingRouter().getInt() == lsa->getHeader().getAdvertisingRouter().getInt()))
00399         {
00400             break;
00401         }
00402     }
00403 
00404     OSPFLSA* lsaCopy = NULL;
00405     switch (lsa->getHeader().getLsType()) {
00406         case RouterLSAType:
00407             lsaCopy = new OSPFRouterLSA(*(check_and_cast<OSPFRouterLSA*> (lsa)));
00408             break;
00409         case NetworkLSAType:
00410             lsaCopy = new OSPFNetworkLSA(*(check_and_cast<OSPFNetworkLSA*> (lsa)));
00411             break;
00412         case SummaryLSA_NetworksType:
00413         case SummaryLSA_ASBoundaryRoutersType:
00414             lsaCopy = new OSPFSummaryLSA(*(check_and_cast<OSPFSummaryLSA*> (lsa)));
00415             break;
00416         case ASExternalLSAType:
00417             lsaCopy = new OSPFASExternalLSA(*(check_and_cast<OSPFASExternalLSA*> (lsa)));
00418             break;
00419         default:
00420             ASSERT(false); // error
00421             break;
00422     }
00423 
00424     if (it != linkStateRetransmissionList.end()) {
00425         delete(*it);
00426         *it = static_cast<OSPFLSA*> (lsaCopy);
00427     } else {
00428         linkStateRetransmissionList.push_back(static_cast<OSPFLSA*> (lsaCopy));
00429     }
00430 }

void OSPF::Neighbor::RemoveFromRetransmissionList ( OSPF::LSAKeyType  lsaKey  ) 

Referenced by OSPF::LinkStateUpdateHandler::ProcessPacket(), and OSPF::LinkStateAcknowledgementHandler::ProcessPacket().

00433 {
00434     std::list<OSPFLSA*>::iterator it = linkStateRetransmissionList.begin();
00435     while (it != linkStateRetransmissionList.end()) {
00436         if (((*it)->getHeader().getLinkStateID() == lsaKey.linkStateID) &&
00437             ((*it)->getHeader().getAdvertisingRouter().getInt() == lsaKey.advertisingRouter))
00438         {
00439             delete(*it);
00440             it = linkStateRetransmissionList.erase(it);
00441         } else {
00442             it++;
00443         }
00444     }
00445 }

bool OSPF::Neighbor::IsLSAOnRetransmissionList ( OSPF::LSAKeyType  lsaKey  )  const

Referenced by OSPF::LinkStateUpdateHandler::ProcessPacket().

00448 {
00449     for (std::list<OSPFLSA*>::const_iterator it = linkStateRetransmissionList.begin(); it != linkStateRetransmissionList.end(); it++) {
00450         const OSPFLSA* lsa = *it;
00451         if ((lsa->getHeader().getLinkStateID() == lsaKey.linkStateID) &&
00452             (lsa->getHeader().getAdvertisingRouter().getInt() == lsaKey.advertisingRouter))
00453         {
00454             return true;
00455         }
00456     }
00457     return false;
00458 }

OSPFLSA * OSPF::Neighbor::FindOnRetransmissionList ( OSPF::LSAKeyType  lsaKey  ) 

Referenced by OSPF::LinkStateAcknowledgementHandler::ProcessPacket().

00461 {
00462     for (std::list<OSPFLSA*>::iterator it = linkStateRetransmissionList.begin(); it != linkStateRetransmissionList.end(); it++) {
00463         if (((*it)->getHeader().getLinkStateID() == lsaKey.linkStateID) &&
00464             ((*it)->getHeader().getAdvertisingRouter().getInt() == lsaKey.advertisingRouter))
00465         {
00466             return (*it);
00467         }
00468     }
00469     return NULL;
00470 }

void OSPF::Neighbor::StartUpdateRetransmissionTimer ( void   ) 

Referenced by OSPF::Interface::FloodLSA(), OSPF::NeighborStateLoading::ProcessEvent(), OSPF::NeighborStateFull::ProcessEvent(), and OSPF::NeighborStateExchange::ProcessEvent().

00473 {
00474     MessageHandler* messageHandler = parentInterface->GetArea()->GetRouter()->GetMessageHandler();
00475     messageHandler->StartTimer(updateRetransmissionTimer, parentInterface->GetRetransmissionInterval());
00476     updateRetransmissionTimerActive = true;
00477 }

void OSPF::Neighbor::ClearUpdateRetransmissionTimer ( void   ) 

Referenced by OSPF::LinkStateAcknowledgementHandler::ProcessPacket(), and Reset().

00480 {
00481     MessageHandler* messageHandler = parentInterface->GetArea()->GetRouter()->GetMessageHandler();
00482     messageHandler->ClearTimer(updateRetransmissionTimer);
00483     updateRetransmissionTimerActive = false;
00484 }

void OSPF::Neighbor::AddToRequestList ( OSPFLSAHeader *  lsaHeader  ) 

Referenced by OSPF::DatabaseDescriptionHandler::ProcessDDPacket().

00487 {
00488     linkStateRequestList.push_back(new OSPFLSAHeader(*lsaHeader));
00489 }

void OSPF::Neighbor::RemoveFromRequestList ( OSPF::LSAKeyType  lsaKey  ) 

00492 {
00493     std::list<OSPFLSAHeader*>::iterator it = linkStateRequestList.begin();
00494     while (it != linkStateRequestList.end()) {
00495         if (((*it)->getLinkStateID() == lsaKey.linkStateID) &&
00496             ((*it)->getAdvertisingRouter().getInt() == lsaKey.advertisingRouter))
00497         {
00498             delete(*it);
00499             it = linkStateRequestList.erase(it);
00500         } else {
00501             it++;
00502         }
00503     }
00504 
00505     if ((GetState() == OSPF::Neighbor::LoadingState) && (linkStateRequestList.empty())) {
00506         ClearRequestRetransmissionTimer();
00507         ProcessEvent(OSPF::Neighbor::LoadingDone);
00508     }
00509 }

bool OSPF::Neighbor::IsLSAOnRequestList ( OSPF::LSAKeyType  lsaKey  )  const

Referenced by OSPF::LinkStateUpdateHandler::ProcessPacket().

00512 {
00513     for (std::list<OSPFLSAHeader*>::const_iterator it = linkStateRequestList.begin(); it != linkStateRequestList.end(); it++) {
00514         const OSPFLSAHeader* lsaHeader = *it;
00515         if ((lsaHeader->getLinkStateID() == lsaKey.linkStateID) &&
00516             (lsaHeader->getAdvertisingRouter().getInt() == lsaKey.advertisingRouter))
00517         {
00518             return true;
00519         }
00520     }
00521     return false;
00522 }

OSPFLSAHeader * OSPF::Neighbor::FindOnRequestList ( OSPF::LSAKeyType  lsaKey  ) 

00525 {
00526     for (std::list<OSPFLSAHeader*>::iterator it = linkStateRequestList.begin(); it != linkStateRequestList.end(); it++) {
00527         if (((*it)->getLinkStateID() == lsaKey.linkStateID) &&
00528             ((*it)->getAdvertisingRouter().getInt() == lsaKey.advertisingRouter))
00529         {
00530             return (*it);
00531         }
00532     }
00533     return NULL;
00534 }

void OSPF::Neighbor::StartRequestRetransmissionTimer ( void   ) 

Referenced by OSPF::NeighborStateLoading::ProcessEvent(), OSPF::NeighborStateExchange::ProcessEvent(), and OSPF::DatabaseDescriptionHandler::ProcessPacket().

00537 {
00538     MessageHandler* messageHandler = parentInterface->GetArea()->GetRouter()->GetMessageHandler();
00539     messageHandler->StartTimer(requestRetransmissionTimer, parentInterface->GetRetransmissionInterval());
00540     requestRetransmissionTimerActive = true;
00541 }

void OSPF::Neighbor::ClearRequestRetransmissionTimer ( void   ) 

Referenced by OSPF::NeighborStateLoading::ProcessEvent(), OSPF::NeighborStateExchange::ProcessEvent(), OSPF::DatabaseDescriptionHandler::ProcessPacket(), RemoveFromRequestList(), and Reset().

00544 {
00545     MessageHandler* messageHandler = parentInterface->GetArea()->GetRouter()->GetMessageHandler();
00546     messageHandler->ClearTimer(requestRetransmissionTimer);
00547     requestRetransmissionTimerActive = false;
00548 }

void OSPF::Neighbor::AddToTransmittedLSAList ( OSPF::LSAKeyType  lsaKey  ) 

Referenced by OSPF::Interface::FloodLSA().

00551 {
00552     TransmittedLSA transmit;
00553 
00554     transmit.lsaKey = lsaKey;
00555     transmit.age = 0;
00556 
00557     transmittedLSAs.push_back(transmit);
00558 }

bool OSPF::Neighbor::IsOnTransmittedLSAList ( OSPF::LSAKeyType  lsaKey  )  const

Referenced by OSPF::LinkStateUpdateHandler::ProcessPacket().

00561 {
00562     for (std::list<TransmittedLSA>::const_iterator it = transmittedLSAs.begin(); it != transmittedLSAs.end(); it++) {
00563         if ((it->lsaKey.linkStateID == lsaKey.linkStateID) &&
00564             (it->lsaKey.advertisingRouter == lsaKey.advertisingRouter))
00565         {
00566             return true;
00567         }
00568     }
00569     return false;
00570 }

void OSPF::Neighbor::AgeTransmittedLSAList ( void   ) 

00573 {
00574     std::list<TransmittedLSA>::iterator it = transmittedLSAs.begin();
00575     while ((it != transmittedLSAs.end()) && (it->age == MIN_LS_ARRIVAL)) {
00576         transmittedLSAs.pop_front();
00577         it = transmittedLSAs.begin();
00578     }
00579     for (it = transmittedLSAs.begin(); it != transmittedLSAs.end(); it++) {
00580         it->age++;
00581     }
00582 }

unsigned long OSPF::Neighbor::GetUniqueULong ( void   ) 

Referenced by InitFirstAdjacency().

00140 {
00141     // FIXME!!! Should come from a global unique number generator module.
00142     return (ddSequenceNumberInitSeed++);
00143 }

void OSPF::Neighbor::DeleteLastSentDDPacket ( void   ) 

void OSPF::Neighbor::SetNeighborID ( RouterID  id  )  [inline]

RouterID OSPF::Neighbor::GetNeighborID ( void   )  const [inline]

void OSPF::Neighbor::SetPriority ( unsigned char  priority  )  [inline]

unsigned char OSPF::Neighbor::GetPriority ( void   )  const [inline]

void OSPF::Neighbor::SetAddress ( IPv4Address  address  )  [inline]

IPv4Address OSPF::Neighbor::GetAddress ( void   )  const [inline]

void OSPF::Neighbor::SetDesignatedRouter ( DesignatedRouterID  routerID  )  [inline]

Referenced by OSPF::HelloHandler::ProcessPacket().

00160 { neighborsDesignatedRouter = routerID; }

DesignatedRouterID OSPF::Neighbor::GetDesignatedRouter ( void   )  const [inline]

void OSPF::Neighbor::SetBackupDesignatedRouter ( DesignatedRouterID  routerID  )  [inline]

DesignatedRouterID OSPF::Neighbor::GetBackupDesignatedRouter ( void   )  const [inline]

void OSPF::Neighbor::SetRouterDeadInterval ( short  interval  )  [inline]

short OSPF::Neighbor::GetRouterDeadInterval ( void   )  const [inline]

void OSPF::Neighbor::SetDDSequenceNumber ( unsigned long  sequenceNumber  )  [inline]

unsigned long OSPF::Neighbor::GetDDSequenceNumber ( void   )  const [inline]

void OSPF::Neighbor::SetOptions ( OSPFOptions  options  )  [inline]

OSPFOptions OSPF::Neighbor::GetOptions ( void   )  const [inline]

00169 { return neighborOptions; }

void OSPF::Neighbor::SetLastReceivedDDPacket ( DDPacketID  packetID  )  [inline]

DDPacketID OSPF::Neighbor::GetLastReceivedDDPacket ( void   )  const [inline]

void OSPF::Neighbor::SetDatabaseExchangeRelationship ( DatabaseExchangeRelationshipType  relation  )  [inline]

DatabaseExchangeRelationshipType OSPF::Neighbor::GetDatabaseExchangeRelationship ( void   )  const [inline]

void OSPF::Neighbor::SetInterface ( Interface intf  )  [inline]

Referenced by OSPF::Interface::AddNeighbor().

00176 { parentInterface = intf; }

Interface* OSPF::Neighbor::GetInterface ( void   )  [inline]

const Interface* OSPF::Neighbor::GetInterface ( void   )  const [inline]

00178 { return parentInterface; }

OSPFTimer* OSPF::Neighbor::GetInactivityTimer ( void   )  [inline]

OSPFTimer* OSPF::Neighbor::GetPollTimer ( void   )  [inline]

OSPFTimer* OSPF::Neighbor::GetDDRetransmissionTimer ( void   )  [inline]

OSPFTimer* OSPF::Neighbor::GetUpdateRetransmissionTimer ( void   )  [inline]

00183 { return updateRetransmissionTimer; }

bool OSPF::Neighbor::IsUpdateRetransmissionTimerActive ( void   )  const [inline]

bool OSPF::Neighbor::IsRequestRetransmissionTimerActive ( void   )  const [inline]

bool OSPF::Neighbor::IsFirstAdjacencyInited ( void   )  const [inline]

bool OSPF::Neighbor::DesignatedRoutersAreSetUp ( void   )  const [inline]

void OSPF::Neighbor::SetUpDesignatedRouters ( bool  setUp  )  [inline]

unsigned long OSPF::Neighbor::GetDatabaseSummaryListCount ( void   )  const [inline]

void OSPF::Neighbor::IncrementDDSequenceNumber ( void   )  [inline]

bool OSPF::Neighbor::IsLinkStateRequestListEmpty ( void   )  const [inline]

bool OSPF::Neighbor::IsLinkStateRetransmissionListEmpty ( void   )  const [inline]

void OSPF::Neighbor::PopFirstLinkStateRequest ( void   )  [inline]

00194 { linkStateRequestList.pop_front(); }


Friends And Related Function Documentation

friend class NeighborState [friend]


Member Data Documentation

Referenced by ChangeState(), Neighbor(), and ~Neighbor().

OSPFTimer* OSPF::Neighbor::inactivityTimer [private]

OSPFTimer* OSPF::Neighbor::pollTimer [private]

Referenced by GetPollTimer(), Neighbor(), and ~Neighbor().

unsigned long OSPF::Neighbor::ddSequenceNumber [private]

Referenced by GetNeighborID(), and SetNeighborID().

unsigned char OSPF::Neighbor::neighborPriority [private]

Referenced by GetPriority(), and SetPriority().

OSPFOptions OSPF::Neighbor::neighborOptions [private]

Referenced by GetOptions(), and SetOptions().

std::list<OSPFLSA*> OSPF::Neighbor::linkStateRetransmissionList [private]

std::list<OSPFLSAHeader*> OSPF::Neighbor::databaseSummaryList [private]

std::list<OSPFLSAHeader*> OSPF::Neighbor::linkStateRequestList [private]

OSPFDatabaseDescriptionPacket* OSPF::Neighbor::lastTransmittedDDPacket [private]

unsigned long OSPF::Neighbor::ddSequenceNumberInitSeed = 0 [static, private]

Referenced by GetUniqueULong().


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

Generated on Fri Mar 20 18:51:23 2009 for INET Framework for OMNeT++/OMNEST by  doxygen 1.5.5