INET Framework for OMNeT++/OMNEST
AnsaOspf6::Area Class Reference

#include <ansaOspfArea6.h>

List of all members.

Public Member Functions

 Area (AreaID id=BackboneAreaID)
virtual ~Area (void)
void SetAreaID (AreaID id)
AreaID GetAreaID (void) const
void AddAddressPrefix (IPv6AddressPrefix prefix, bool advertise)
unsigned int GetAddressPrefixCount (void) const
IPv6AddressPrefix GetAddressPrefix (unsigned int index) const
void AddHostRoute (HostRouteParameters &hostRouteParameters)
void SetTransitCapability (bool transit)
bool GetTransitCapability (void) const
void SetExternalRoutingCapability (bool flooded)
bool GetExternalRoutingCapability (void) const
void SetSPFTreeRoot (RouterLsa *root)
RouterLsaGetSPFTreeRoot (void)
const RouterLsaGetSPFTreeRoot (void) const
void SetRouter (Router *router)
RouterGetRouter (void)
const RouterGetRouter (void) const
unsigned long GetRouterLSACount (void) const
RouterLsaGetRouterLSA (unsigned long i)
const RouterLsaGetRouterLSA (unsigned long i) const
unsigned long GetNetworkLSACount (void) const
NetworkLsaGetNetworkLSA (unsigned long i)
const NetworkLsaGetNetworkLSA (unsigned long i) const
unsigned long GetInterAreaPrefixLSACount (void) const
InterAreaPrefixLsaGetInterAreaPrefixLSA (unsigned long i)
const InterAreaPrefixLsaGetInterAreaPrefixLSA (unsigned long i) const
unsigned long GetInterAreaRouterLSACount (void) const
InterAreaRouterLsaGetInterAreaRouterLSA (unsigned long i)
const InterAreaRouterLsaGetInterAreaRouterLSA (unsigned long i) const
unsigned long GetIntraAreaPrefixLSACount (void) const
IntraAreaPrefixLsaGetIntraAreaPrefixLSA (unsigned long i)
const IntraAreaPrefixLsaGetIntraAreaPrefixLSA (unsigned long i) const
bool ContainsAddress (IPv6Address address) const
bool HasAddressPrefix (IPv6AddressPrefix prefix) const
IPv6AddressPrefix GetContainingAddressRange (IPv6AddressPrefix prefix, bool *advertise=NULL) const
void AddInterface (Interface *intf)
unsigned int GetNumberOfInterfaces (void)
InterfaceGetInterfaceByIndex (unsigned int index)
InterfaceGetInterface (unsigned char ifIndex)
InterfaceGetInterface (IPv6Address address)
bool HasVirtualLink (AreaID withTransitArea) const
InterfaceFindVirtualLink (RouterID routerID)
bool InstallRouterLSA (OspfRouterLsa6 *lsa)
bool InstallNetworkLSA (OspfNetworkLsa6 *lsa)
bool InstallInterAreaPrefixLSA (OspfInterAreaPrefixLsa6 *lsa)
bool InstallInterAreaRouterLSA (OspfInterAreaRouterLsa6 *lsa)
bool InstallIntraAreaPrefixLSA (OspfIntraAreaPrefixLsa6 *lsa)
RouterLsaFindRouterLSA (LinkStateID linkStateID)
const RouterLsaFindRouterLSA (LinkStateID linkStateID) const
NetworkLsaFindNetworkLSA (LinkStateID linkStateID)
const NetworkLsaFindNetworkLSA (LinkStateID linkStateID) const
InterAreaPrefixLsaFindInterAreaPrefixLSA (LinkStateID linkStateID)
const InterAreaPrefixLsaFindInterAreaPrefixLSA (LinkStateID linkStateID) const
InterAreaRouterLsaFindInterAreaRouterLSA (LinkStateID linkStateID)
const InterAreaRouterLsaFindInterAreaRouterLSA (LinkStateID linkStateID) const
IntraAreaPrefixLsaFindIntraAreaPrefixLSA (LinkStateID linkStateID)
const IntraAreaPrefixLsaFindIntraAreaPrefixLSA (LinkStateID linkStateID) const
void AgeDatabase (void)
void RemoveParentFromRoutingInfo (OspfLsa6 *parent)
bool HasAnyNeighborInStates (int states) const
void RemoveFromAllRetransmissionLists (LsaKeyType6 lsaKey)
bool IsOnAnyRetransmissionList (LsaKeyType6 lsaKey) const
bool FloodLSA (OspfLsa6 *lsa, Interface *intf=NULL, Neighbor *neighbor=NULL)
bool IsLocalAddress (IPv6Address address) const
RouterLsaOriginateRouterLSA (void)
NetworkLsaOriginateNetworkLSA (const Interface *intf)
InterAreaPrefixLsaOriginateInterAreaPrefixLSA (void)
InterAreaRouterLsaOriginateInterAreaRouterLSA (void)
IntraAreaPrefixLsaOriginateIntraAreaPrefixLSA (void)
void CalculateShortestPathTree (std::vector< RoutingTableEntry * > &newRoutingTable)
void CalculateInterAreaRoutes (std::vector< RoutingTableEntry * > &newRoutingTable)
void info (char *buffer)
std::string detailedInfo (void) const

Private Attributes

AreaID areaID
std::map< IPv6AddressPrefix,
bool, IPv6AddressPrefix_Less
advertiseAddressPrefixes
std::vector< IPv6AddressPrefixareaAddressPrefixes
std::vector< Interface * > associatedInterfaces
std::vector< HostRouteParametershostRoutes
std::map< LinkStateID,
RouterLsa * > 
routerLSAsByID
std::vector< RouterLsa * > routerLSAs
std::map< LinkStateID,
NetworkLsa * > 
networkLSAsByID
std::vector< NetworkLsa * > networkLSAs
std::map< LinkStateID,
InterAreaPrefixLsa * > 
interAreaPrefixLSAsByID
std::vector< InterAreaPrefixLsa * > interAreaPrefixLSAs
std::map< LinkStateID,
InterAreaRouterLsa * > 
interAreaRouterLSAsByID
std::vector< InterAreaRouterLsa * > interAreaRouterLSAs
std::map< LinkStateID,
IntraAreaPrefixLsa * > 
intraAreaPrefixLSAsByID
std::vector< IntraAreaPrefixLsa * > intraAreaPrefixLSAs
bool transitCapability
bool externalRoutingCapability
Metric stubDefaultCost
RouterLsaspfTreeRoot
RouterparentRouter

Detailed Description

Definition at line 28 of file ansaOspfArea6.h.


Constructor & Destructor Documentation

AnsaOspf6::Area::~Area ( void  ) [virtual]

Definition at line 31 of file ansaOspfArea6.cc.

                         {
   int interfaceNum = associatedInterfaces.size();
   for (int i = 0; i < interfaceNum; i++){
      delete (associatedInterfaces[i]);
   }


   long lsaCount = routerLSAs.size();
   for (long j = 0; j < lsaCount; j++){
      delete routerLSAs[j];
   }
   routerLSAs.clear();

   lsaCount = networkLSAs.size();
   for (long k = 0; k < lsaCount; k++){
      delete networkLSAs[k];
   }
   networkLSAs.clear();

   lsaCount = interAreaPrefixLSAs.size();
   for (long k = 0; k < lsaCount; k++){
      delete interAreaPrefixLSAs[k];
   }
   interAreaPrefixLSAs.clear();

   lsaCount = interAreaRouterLSAs.size();
   for (long k = 0; k < lsaCount; k++){
      delete interAreaRouterLSAs[k];
   }
   interAreaRouterLSAs.clear();

   lsaCount = intraAreaPrefixLSAs.size();
   for (long k = 0; k < lsaCount; k++){
      delete intraAreaPrefixLSAs[k];
   }
   intraAreaPrefixLSAs.clear();
}

Member Function Documentation

void AnsaOspf6::Area::AddAddressPrefix ( IPv6AddressPrefix  prefix,
bool  advertise 
) [inline]

Definition at line 60 of file ansaOspfArea6.h.

Referenced by AnsaOspfRouting6::loadInterfaceConfig().

{ areaAddressPrefixes.push_back(prefix); advertiseAddressPrefixes[prefix] = advertise; }
void AnsaOspf6::Area::AddHostRoute ( HostRouteParameters hostRouteParameters) [inline]

Definition at line 63 of file ansaOspfArea6.h.

{ hostRoutes.push_back(hostRouteParameters); }

Definition at line 69 of file ansaOspfArea6.cc.

Referenced by AnsaOspfRouting6::loadInterfaceConfig().

                                                         {
   intf->SetArea(this);
   associatedInterfaces.push_back(intf);
}

Definition at line 462 of file ansaOspfArea6.cc.

                                    {
   /*
   bool rebuildRoutingTable = false;
   long i;

   RouterID routerId = GetRouter()->GetRouterID();
   EV << IPAddress(routerId);

   long lsaCount = routerLSAs.size();
   for (i = 0; i < lsaCount; i++){
      unsigned short lsAge = routerLSAs[i]->getHeader().getLsAge();
      bool selfOriginated = (routerLSAs[i]->getHeader().getAdvertisingRouter() == parentRouter->GetRouterID());
      bool unreachable = parentRouter->IsDestinationUnreachable(routerLSAs[i]);
      AnsaOspf6::RouterLsa* lsa = routerLSAs[i];

      unsigned int linkCount = lsa->getLinksArraySize();
      for (unsigned int j = 0; j < linkCount; j++) {
         const Link6& link = lsa->getLinks(j);
         printLsaLink(link, ev.getOStream());
        }

        if (   (selfOriginated && (lsAge < (LS_REFRESH_TIME - 1)))
            || (!selfOriginated && (lsAge < (MAX_AGE - 1)))) {
            lsa->getHeader().setLsAge(lsAge + 1);
            lsa->IncrementInstallTime();
        }

        if (selfOriginated && (lsAge == (LS_REFRESH_TIME - 1))){
           if (unreachable) {
              lsa->getHeader().setLsAge(MAX_AGE);
              FloodLSA(lsa);
              lsa->IncrementInstallTime();
           }else{
              long sequenceNumber = lsa->getHeader().getLsSequenceNumber();
              if (sequenceNumber == MAX_SEQUENCE_NUMBER) {
                 lsa->getHeader().setLsAge(MAX_AGE);
                 FloodLSA(lsa);
                 lsa->IncrementInstallTime();
              }else{
                 AnsaOspf6::RouterLsa* newLSA = OriginateRouterLSA();

                 newLSA->getHeader().setLsSequenceNumber(sequenceNumber + 1);
                 rebuildRoutingTable |= lsa->Update(newLSA);
                 delete newLSA;

                 FloodLSA(lsa);
              }
           }
        }

        if (!selfOriginated && (lsAge == MAX_AGE - 1)) {
           lsa->getHeader().setLsAge(MAX_AGE);
           FloodLSA(lsa);
           lsa->IncrementInstallTime();
        }

        if (lsAge == MAX_AGE) {
           AnsaOspf6::LsaKeyType6 lsaKey;

           lsaKey.linkStateID = lsa->getHeader().getLinkStateID();
           lsaKey.advertisingRouter = lsa->getHeader().getAdvertisingRouter();

           if (   !IsOnAnyRetransmissionList(lsaKey)
              &&  !HasAnyNeighborInStates(AnsaOspf6::Neighbor::ExchangeState | AnsaOspf6::Neighbor::LoadingState)){

              if (!selfOriginated || unreachable) {
                 routerLSAsByID.erase(lsa->getHeader().getLinkStateID());
                 delete lsa;
                 routerLSAs[i] = NULL;
                 rebuildRoutingTable = true;
              }else{
                 AnsaOspf6::RouterLsa* newLSA = OriginateRouterLSA();
                 long sequenceNumber = lsa->getHeader().getLsSequenceNumber();

                 newLSA->getHeader().setLsSequenceNumber((sequenceNumber == MAX_SEQUENCE_NUMBER) ? INITIAL_SEQUENCE_NUMBER : sequenceNumber + 1);
                 rebuildRoutingTable |= lsa->Update(newLSA);
                 delete newLSA;

                 FloodLSA(lsa);
              }
           }
        }
   }


    std::vector<RouterLsa*>::iterator routerIt = routerLSAs.begin();
    while (routerIt != routerLSAs.end()) {
       if ((*routerIt) == NULL) {
          routerIt = routerLSAs.erase(routerIt);
       }else{
          routerIt++;
       }
    }

    lsaCount = networkLSAs.size();
    for (i = 0; i < lsaCount; i++) {
        unsigned short    lsAge          = networkLSAs[i]->getHeader().getLsAge();
        bool              unreachable    = parentRouter->IsDestinationUnreachable(networkLSAs[i]);
        AnsaOspf6::NetworkLSA* lsa            = networkLSAs[i];
        AnsaOspf6::Interface*  localIntf      = GetInterface(IPv4AddressFromULong(lsa->getHeader().getLinkStateID()));
        bool              selfOriginated = false;


        if ((localIntf != NULL) &&
            (localIntf->GetState() == AnsaOspf6::Interface::DesignatedRouterState) &&
            (localIntf->GetNeighborCount() > 0) &&
            (localIntf->HasAnyNeighborInStates(AnsaOspf6::Neighbor::FullState)))
        {
            selfOriginated = true;
        }

        if ((selfOriginated && (lsAge < (LS_REFRESH_TIME - 1))) || (!selfOriginated && (lsAge < (MAX_AGE - 1)))) {
            lsa->getHeader().setLsAge(lsAge + 1);
            if ((lsAge + 1) % CHECK_AGE == 0) {
                if (!lsa->ValidateLSChecksum()) {
                    EV << "Invalid LS checksum. Memory error detected!\n";
                }
            }
            lsa->IncrementInstallTime();
        }
        if (selfOriginated && (lsAge == (LS_REFRESH_TIME - 1))) {
            if (unreachable) {
                lsa->getHeader().setLsAge(MAX_AGE);
                FloodLSA(lsa);
                lsa->IncrementInstallTime();
            } else {
                long sequenceNumber = lsa->getHeader().getLsSequenceNumber();
                if (sequenceNumber == MAX_SEQUENCE_NUMBER) {
                    lsa->getHeader().setLsAge(MAX_AGE);
                    FloodLSA(lsa);
                    lsa->IncrementInstallTime();
                } else {
                    AnsaOspf6::NetworkLSA* newLSA = OriginateNetworkLSA(localIntf);

                    if (newLSA != NULL) {
                        newLSA->getHeader().setLsSequenceNumber(sequenceNumber + 1);
                        newLSA->getHeader().setLsChecksum(0);    // TODO: calculate correct LS checksum
                        rebuildRoutingTable |= lsa->Update(newLSA);
                        delete newLSA;
                    } else {    // no neighbors on the network -> old NetworkLSA must be flushed
                        lsa->getHeader().setLsAge(MAX_AGE);
                        lsa->IncrementInstallTime();
                    }

                    FloodLSA(lsa);
                }
            }
        }
        if (!selfOriginated && (lsAge == MAX_AGE - 1)) {
            lsa->getHeader().setLsAge(MAX_AGE);
            FloodLSA(lsa);
            lsa->IncrementInstallTime();
        }
        if (lsAge == MAX_AGE) {
            AnsaOspf6::LSAKeyType lsaKey;

            lsaKey.linkStateID = lsa->getHeader().getLinkStateID();
            lsaKey.advertisingRouter = lsa->getHeader().getAdvertisingRouter().getInt();

            if (!IsOnAnyRetransmissionList(lsaKey) &&
                !HasAnyNeighborInStates(AnsaOspf6::Neighbor::ExchangeState | AnsaOspf6::Neighbor::LoadingState))
            {
                if (!selfOriginated || unreachable) {
                    networkLSAsByID.erase(lsa->getHeader().getLinkStateID());
                    RemoveParentFromRoutingInfo(check_and_cast<OSPFLSA*> (lsa));
                    delete lsa;
                    networkLSAs[i] = NULL;
                    rebuildRoutingTable = true;
                } else {
                    AnsaOspf6::NetworkLSA* newLSA              = OriginateNetworkLSA(localIntf);
                    long              sequenceNumber      = lsa->getHeader().getLsSequenceNumber();

                    if (newLSA != NULL) {
                        newLSA->getHeader().setLsSequenceNumber((sequenceNumber == MAX_SEQUENCE_NUMBER) ? INITIAL_SEQUENCE_NUMBER : sequenceNumber + 1);
                        newLSA->getHeader().setLsChecksum(0);    // TODO: calculate correct LS checksum
                        rebuildRoutingTable |= lsa->Update(newLSA);
                        delete newLSA;

                        FloodLSA(lsa);
                    } else {    // no neighbors on the network -> old NetworkLSA must be deleted
                        delete networkLSAs[i];
                    }
                }
            }
        }
    }
    std::vector<NetworkLSA*>::iterator networkIt = networkLSAs.begin();
    while (networkIt != networkLSAs.end()) {
        if ((*networkIt) == NULL) {
            networkIt = networkLSAs.erase(networkIt);
        } else {
            networkIt++;
        }
    }

    lsaCount = summaryLSAs.size();
    for (i = 0; i < lsaCount; i++) {
        unsigned short    lsAge          = summaryLSAs[i]->getHeader().getLsAge();
        bool              selfOriginated = (summaryLSAs[i]->getHeader().getAdvertisingRouter().getInt() == parentRouter->GetRouterID());
        bool              unreachable    = parentRouter->IsDestinationUnreachable(summaryLSAs[i]);
        AnsaOspf6::SummaryLSA* lsa            = summaryLSAs[i];


        if ((selfOriginated && (lsAge < (LS_REFRESH_TIME - 1))) || (!selfOriginated && (lsAge < (MAX_AGE - 1)))) {
            lsa->getHeader().setLsAge(lsAge + 1);
            if ((lsAge + 1) % CHECK_AGE == 0) {
                if (!lsa->ValidateLSChecksum()) {
                    EV << "Invalid LS checksum. Memory error detected!\n";
                }
            }
            lsa->IncrementInstallTime();
        }
        if (selfOriginated && (lsAge == (LS_REFRESH_TIME - 1))) {
            if (unreachable) {
                lsa->getHeader().setLsAge(MAX_AGE);
                FloodLSA(lsa);
                lsa->IncrementInstallTime();
            } else {
                long sequenceNumber = lsa->getHeader().getLsSequenceNumber();
                if (sequenceNumber == MAX_SEQUENCE_NUMBER) {
                    lsa->getHeader().setLsAge(MAX_AGE);
                    FloodLSA(lsa);
                    lsa->IncrementInstallTime();
                } else {
                    AnsaOspf6::SummaryLSA* newLSA = OriginateSummaryLSA(lsa);

                    if (newLSA != NULL) {
                        newLSA->getHeader().setLsSequenceNumber(sequenceNumber + 1);
                        newLSA->getHeader().setLsChecksum(0);    // TODO: calculate correct LS checksum
                        rebuildRoutingTable |= lsa->Update(newLSA);
                        delete newLSA;

                        FloodLSA(lsa);
                    } else {
                        lsa->getHeader().setLsAge(MAX_AGE);
                        FloodLSA(lsa);
                        lsa->IncrementInstallTime();
                    }
                }
            }
        }
        if (!selfOriginated && (lsAge == MAX_AGE - 1)) {
            lsa->getHeader().setLsAge(MAX_AGE);
            FloodLSA(lsa);
            lsa->IncrementInstallTime();
        }
        if (lsAge == MAX_AGE) {
            AnsaOspf6::LSAKeyType lsaKey;

            lsaKey.linkStateID = lsa->getHeader().getLinkStateID();
            lsaKey.advertisingRouter = lsa->getHeader().getAdvertisingRouter().getInt();

            if (!IsOnAnyRetransmissionList(lsaKey) &&
                !HasAnyNeighborInStates(AnsaOspf6::Neighbor::ExchangeState | AnsaOspf6::Neighbor::LoadingState))
            {
                if (!selfOriginated || unreachable) {
                    summaryLSAsByID.erase(lsaKey);
                    delete lsa;
                    summaryLSAs[i] = NULL;
                    rebuildRoutingTable = true;
                } else {
                    AnsaOspf6::SummaryLSA* newLSA = OriginateSummaryLSA(lsa);
                    if (newLSA != NULL) {
                        long sequenceNumber = lsa->getHeader().getLsSequenceNumber();

                        newLSA->getHeader().setLsSequenceNumber((sequenceNumber == MAX_SEQUENCE_NUMBER) ? INITIAL_SEQUENCE_NUMBER : sequenceNumber + 1);
                        newLSA->getHeader().setLsChecksum(0);    // TODO: calculate correct LS checksum
                        rebuildRoutingTable |= lsa->Update(newLSA);
                        delete newLSA;

                        FloodLSA(lsa);
                    } else {
                        summaryLSAsByID.erase(lsaKey);
                        delete lsa;
                        summaryLSAs[i] = NULL;
                        rebuildRoutingTable = true;
                    }
                }
            }
        }
    }

    std::vector<SummaryLSA*>::iterator summaryIt = summaryLSAs.begin();
    while (summaryIt != summaryLSAs.end()) {
        if ((*summaryIt) == NULL) {
            summaryIt = summaryLSAs.erase(summaryIt);
        } else {
            summaryIt++;
        }
    }


    long interfaceCount = associatedInterfaces.size();
    for (long m = 0; m < interfaceCount; m++) {
        associatedInterfaces[m]->AgeTransmittedLSALists();
    }

    if (rebuildRoutingTable) {
        parentRouter->RebuildRoutingTable();
    }
    */
}
void AnsaOspf6::Area::CalculateInterAreaRoutes ( std::vector< RoutingTableEntry * > &  newRoutingTable)
void AnsaOspf6::Area::CalculateShortestPathTree ( std::vector< RoutingTableEntry * > &  newRoutingTable)

Definition at line 145 of file ansaOspfArea6.cc.

                                                             {
   int addressPrefixesNum = areaAddressPrefixes.size();
   for (int i = 0; i < addressPrefixesNum; i++){
      if (address.matches(areaAddressPrefixes[i].address, areaAddressPrefixes[i].prefixLen)){
         return true;
      }
   }
   return false;
}
std::string AnsaOspf6::Area::detailedInfo ( void  ) const

Definition at line 89 of file ansaOspfArea6.cc.

Referenced by operator<<().

                                                {
   std::stringstream out;
   char addressString[16];
   int i;
   out << "\n    areaID: " << areaID << ", ";
   out << "transitCapability: " << (transitCapability ? "true" : "false") << ", ";
   out << "externalRoutingCapability: " << (externalRoutingCapability ? "true" : "false") << ", ";
   out << "stubDefaultCost: " << stubDefaultCost << "\n";
   int addressPrefixNum = areaAddressPrefixes.size();
   for (i = 0; i < addressPrefixNum; i++) {
      out << "    addressPrefix[" << i << "]: ";
      out << areaAddressPrefixes[i].address;
      out << "/" << areaAddressPrefixes[i].prefixLen << "\n";
   }
   int interfaceNum = associatedInterfaces.size();
   for (i = 0; i < interfaceNum; i++) {
      out << "    interface[" << i << "]: link-local address: ";
      out << associatedInterfaces[i]->GetInterfaceAddress() << "\n";
   }

   out << "\n";
   out << "    Database:\n";
   out << "      RouterLSAs:\n";
   long lsaCount = routerLSAs.size();
   for (i = 0; i < lsaCount; i++) {
      out << "        " << *routerLSAs[i] << "\n";
   }
   out << "      NetworkLSAs:\n";
   lsaCount = networkLSAs.size();
   for (i = 0; i < lsaCount; i++) {
      out << "        " << *networkLSAs[i] << "\n";
   }

   out << "      InterAreaPrefixLSAs:\n";
   lsaCount = interAreaPrefixLSAs.size();
   for (i = 0; i < lsaCount; i++) {
      out << "        " << *interAreaPrefixLSAs[i] << "\n";
   }

   out << "      InterAreaRouterLSAs:\n";
   lsaCount = interAreaRouterLSAs.size();
   for (i = 0; i < lsaCount; i++) {
      out << "        " << *interAreaRouterLSAs[i] << "\n";
   }

   out << "      IntraAreaPrefixLSAs:\n";
   lsaCount = intraAreaPrefixLSAs.size();
   for (i = 0; i < lsaCount; i++) {
      out << "        " << *intraAreaPrefixLSAs[i] << "\n";
   }

   out << "--------------------------------------------------------------------------------";

   return out.str();
}

Definition at line 357 of file ansaOspfArea6.cc.

                                                                                                  {
   std::map<AnsaOspf6::LinkStateID, AnsaOspf6::InterAreaPrefixLsa*>::iterator lsaIt = interAreaPrefixLSAsByID.find(linkStateID);
   if (lsaIt != interAreaPrefixLSAsByID.end()) {
      return lsaIt->second;
   } else {
      return NULL;
   }
}

Definition at line 366 of file ansaOspfArea6.cc.

                                                                                                               {
   return FindInterAreaPrefixLSA(linkStateID);
}

Definition at line 370 of file ansaOspfArea6.cc.

                                                                                                  {
   std::map<AnsaOspf6::LinkStateID, AnsaOspf6::InterAreaRouterLsa*>::iterator lsaIt = interAreaRouterLSAsByID.find(linkStateID);
   if (lsaIt != interAreaRouterLSAsByID.end()) {
      return lsaIt->second;
   } else {
      return NULL;
   }
}

Definition at line 379 of file ansaOspfArea6.cc.

                                                                                                               {
   return FindInterAreaRouterLSA(linkStateID);
}

Definition at line 383 of file ansaOspfArea6.cc.

                                                                                                  {
   std::map<AnsaOspf6::LinkStateID, AnsaOspf6::IntraAreaPrefixLsa*>::iterator lsaIt = intraAreaPrefixLSAsByID.find(linkStateID);
   if (lsaIt != intraAreaPrefixLSAsByID.end()) {
      return lsaIt->second;
   } else {
      return NULL;
   }
}

Definition at line 392 of file ansaOspfArea6.cc.

                                                                                                               {
   return FindIntraAreaPrefixLSA(linkStateID);
}

Definition at line 344 of file ansaOspfArea6.cc.

                                                                                  {
   std::map<AnsaOspf6::LinkStateID, AnsaOspf6::NetworkLsa*>::iterator lsaIt = networkLSAsByID.find(linkStateID);
   if (lsaIt != networkLSAsByID.end()) {
      return lsaIt->second;
   } else {
      return NULL;
   }
}

Definition at line 353 of file ansaOspfArea6.cc.

                                                                                               {
   return FindNetworkLSA(linkStateID);
}

Definition at line 331 of file ansaOspfArea6.cc.

                                                                                {
   std::map<AnsaOspf6::LinkStateID, AnsaOspf6::RouterLsa*>::iterator lsaIt = routerLSAsByID.find(linkStateID);
   if (lsaIt != routerLSAsByID.end()){
      return lsaIt->second;
   }else{
      return NULL;
   }
}

Definition at line 340 of file ansaOspfArea6.cc.

                                                                                             {
   return FindRouterLSA(linkStateID);
}

Definition at line 222 of file ansaOspfArea6.cc.

Referenced by AnsaOspf6::MessageHandler::ProcessPacket().

                                                                             {
   int interfaceNum = associatedInterfaces.size();
   for (int i = 0; i < interfaceNum; i++){
      if (  (associatedInterfaces[i]->GetType() == AnsaOspf6::Interface::Virtual)
         && (associatedInterfaces[i]->GetNeighborByID(routerID) != NULL)){
         return associatedInterfaces[i];
      }
   }
   return NULL;
}
bool AnsaOspf6::Area::FloodLSA ( OspfLsa6 lsa,
AnsaOspf6::Interface intf = NULL,
AnsaOspf6::Neighbor neighbor = NULL 
)

Definition at line 793 of file ansaOspfArea6.cc.

                                                                                                {
   bool floodedBackOut  = false;
   long interfaceCount = associatedInterfaces.size();

   for (long i = 0; i < interfaceCount; i++) {
      if (associatedInterfaces[i]->FloodLSA(lsa, intf, neighbor)) {
         floodedBackOut = true;
      }
   }

   return floodedBackOut;
}
IPv6AddressPrefix AnsaOspf6::Area::GetAddressPrefix ( unsigned int  index) const [inline]

Definition at line 62 of file ansaOspfArea6.h.

unsigned int AnsaOspf6::Area::GetAddressPrefixCount ( void  ) const [inline]

Definition at line 61 of file ansaOspfArea6.h.

{ return areaAddressPrefixes.size(); }

Definition at line 165 of file ansaOspfArea6.cc.

                                                                                                                                   {
   int addressPrefixesNum = areaAddressPrefixes.size();
   for (int i = 0; i < addressPrefixesNum; i++){
      if ((addressPrefix == areaAddressPrefixes[i]) && (advertise != NULL)){
         std::map<AnsaOspf6::IPv6AddressPrefix, bool, AnsaOspf6::IPv6AddressPrefix_Less>::const_iterator prefixIt;
         prefixIt = advertiseAddressPrefixes.find(areaAddressPrefixes[i]);
         if (prefixIt != advertiseAddressPrefixes.end()){
            *advertise = prefixIt->second;
         }else{
            *advertise = true;
         }
         return areaAddressPrefixes[i];
      }
   }
   if (advertise != NULL){
      *advertise = false;
   }
   return AnsaOspf6::NullAddressPrefix;
}

Definition at line 83 of file ansaOspfArea6.h.

Referenced by AnsaOspf6::Neighbor::CreateDatabaseSummary().

{ return interAreaPrefixLSAs[i]; }
const InterAreaPrefixLsa* AnsaOspf6::Area::GetInterAreaPrefixLSA ( unsigned long  i) const [inline]

Definition at line 84 of file ansaOspfArea6.h.

{ return interAreaPrefixLSAs[i]; }
unsigned long AnsaOspf6::Area::GetInterAreaPrefixLSACount ( void  ) const [inline]

Definition at line 82 of file ansaOspfArea6.h.

Referenced by AnsaOspf6::Neighbor::CreateDatabaseSummary().

{ return interAreaPrefixLSAs.size(); }

Definition at line 86 of file ansaOspfArea6.h.

Referenced by AnsaOspf6::Neighbor::CreateDatabaseSummary().

{ return interAreaRouterLSAs[i]; }
const InterAreaRouterLsa* AnsaOspf6::Area::GetInterAreaRouterLSA ( unsigned long  i) const [inline]

Definition at line 87 of file ansaOspfArea6.h.

{ return interAreaRouterLSAs[i]; }
unsigned long AnsaOspf6::Area::GetInterAreaRouterLSACount ( void  ) const [inline]

Definition at line 85 of file ansaOspfArea6.h.

Referenced by AnsaOspf6::Neighbor::CreateDatabaseSummary().

{ return interAreaRouterLSAs.size(); }

Definition at line 185 of file ansaOspfArea6.cc.

Referenced by AnsaOspf6::MessageHandler::ProcessPacket().

                                                                     {
   int interfaceNum = associatedInterfaces.size();
   for (int i = 0; i < interfaceNum; i++){
      if ((associatedInterfaces[i]->GetType() != AnsaOspf6::Interface::Virtual)
            && (associatedInterfaces[i]->GetIfIndex() == ifIndex)){
         return associatedInterfaces[i];
      }
   }
   return NULL;
}

Definition at line 196 of file ansaOspfArea6.cc.

                                                                   {
   int interfaceNum = associatedInterfaces.size();
   for (int i = 0; i < interfaceNum; i++){
      if (  (associatedInterfaces[i]->GetType() != AnsaOspf6::Interface::Virtual)
         && (associatedInterfaces[i]->GetInterfaceAddress() == address)){
         return associatedInterfaces[i];
      }
   }
   return NULL;
}

Definition at line 74 of file ansaOspfArea6.cc.

Referenced by operator<<().

                                                                {
   if (index < associatedInterfaces.size()){
      return associatedInterfaces[index];
   }else{
      return NULL;
   }
}

Definition at line 89 of file ansaOspfArea6.h.

Referenced by AnsaOspf6::Neighbor::CreateDatabaseSummary().

{ return intraAreaPrefixLSAs[i]; }
const IntraAreaPrefixLsa* AnsaOspf6::Area::GetIntraAreaPrefixLSA ( unsigned long  i) const [inline]

Definition at line 90 of file ansaOspfArea6.h.

{ return intraAreaPrefixLSAs[i]; }
unsigned long AnsaOspf6::Area::GetIntraAreaPrefixLSACount ( void  ) const [inline]

Definition at line 88 of file ansaOspfArea6.h.

Referenced by AnsaOspf6::Neighbor::CreateDatabaseSummary().

{ return intraAreaPrefixLSAs.size(); }
NetworkLsa* AnsaOspf6::Area::GetNetworkLSA ( unsigned long  i) [inline]

Definition at line 80 of file ansaOspfArea6.h.

Referenced by AnsaOspf6::Neighbor::CreateDatabaseSummary().

{ return networkLSAs[i]; }
const NetworkLsa* AnsaOspf6::Area::GetNetworkLSA ( unsigned long  i) const [inline]

Definition at line 81 of file ansaOspfArea6.h.

{ return networkLSAs[i]; }
unsigned long AnsaOspf6::Area::GetNetworkLSACount ( void  ) const [inline]

Definition at line 79 of file ansaOspfArea6.h.

Referenced by AnsaOspf6::Neighbor::CreateDatabaseSummary().

{ return networkLSAs.size(); }
unsigned int AnsaOspf6::Area::GetNumberOfInterfaces ( void  ) [inline]

Definition at line 96 of file ansaOspfArea6.h.

Referenced by operator<<().

{ return associatedInterfaces.size(); }
const Router* AnsaOspf6::Area::GetRouter ( void  ) const [inline]

Definition at line 74 of file ansaOspfArea6.h.

{ return parentRouter; }
RouterLsa* AnsaOspf6::Area::GetRouterLSA ( unsigned long  i) [inline]

Definition at line 77 of file ansaOspfArea6.h.

Referenced by AnsaOspf6::Neighbor::CreateDatabaseSummary().

{ return routerLSAs[i]; }
const RouterLsa* AnsaOspf6::Area::GetRouterLSA ( unsigned long  i) const [inline]

Definition at line 78 of file ansaOspfArea6.h.

{ return routerLSAs[i]; }
unsigned long AnsaOspf6::Area::GetRouterLSACount ( void  ) const [inline]

Definition at line 76 of file ansaOspfArea6.h.

Referenced by AnsaOspf6::Neighbor::CreateDatabaseSummary().

{ return routerLSAs.size(); }

Definition at line 69 of file ansaOspfArea6.h.

{ return spfTreeRoot; }
const RouterLsa* AnsaOspf6::Area::GetSPFTreeRoot ( void  ) const [inline]

Definition at line 70 of file ansaOspfArea6.h.

{ return spfTreeRoot; }
bool AnsaOspf6::Area::GetTransitCapability ( void  ) const [inline]

Definition at line 65 of file ansaOspfArea6.h.

{ return transitCapability; }

Definition at line 155 of file ansaOspfArea6.cc.

                                                                                   {
   int addressPrefixesNum = areaAddressPrefixes.size();
   for (int i = 0; i < addressPrefixesNum; i++){
      if (areaAddressPrefixes[i] == addressPrefix){
         return true;
      }
   }
   return false;
}
bool AnsaOspf6::Area::HasAnyNeighborInStates ( int  states) const

Definition at line 766 of file ansaOspfArea6.cc.

                                                           {
   long interfaceCount = associatedInterfaces.size();
   for (long i = 0; i < interfaceCount; i++){
      if (associatedInterfaces[i]->HasAnyNeighborInStates(states)){
         return true;
      }
   }
   return false;
}
bool AnsaOspf6::Area::HasVirtualLink ( AnsaOspf6::AreaID  withTransitArea) const

Definition at line 207 of file ansaOspfArea6.cc.

                                                                        {
   if ((areaID != AnsaOspf6::BackboneAreaID) || (withTransitArea == AnsaOspf6::BackboneAreaID)){
      return false;
   }

   int interfaceNum = associatedInterfaces.size();
   for (int i = 0; i < interfaceNum; i++){
      if (  (associatedInterfaces[i]->GetType() == AnsaOspf6::Interface::Virtual)
         && (associatedInterfaces[i]->GetTransitAreaID() == withTransitArea)){
         return true;
      }
   }
   return false;
}
void AnsaOspf6::Area::info ( char *  buffer)

Definition at line 82 of file ansaOspfArea6.cc.

                                     {
   std::stringstream out;
   char areaString[16];
   out << "areaID: " << areaID;
   strcpy(buffer, out.str().c_str());
}

Definition at line 273 of file ansaOspfArea6.cc.

                                                                         {
   AnsaOspf6::LinkStateID linkStateID = lsa->getHeader().getLinkStateID();
   std::map<AnsaOspf6::LinkStateID, AnsaOspf6::InterAreaPrefixLsa*>::iterator lsaIt = interAreaPrefixLSAsByID.find(linkStateID);
   if (lsaIt != interAreaPrefixLSAsByID.end()) {
       AnsaOspf6::LsaKeyType6 lsaKey;

       lsaKey.linkStateID = lsa->getHeader().getLinkStateID();
       lsaKey.advertisingRouter = lsa->getHeader().getAdvertisingRouter();

       RemoveFromAllRetransmissionLists(lsaKey);
       return lsaIt->second->Update(lsa);
   } else {
       AnsaOspf6::InterAreaPrefixLsa* lsaCopy = new AnsaOspf6::InterAreaPrefixLsa(*lsa);
       interAreaPrefixLSAsByID[linkStateID] = lsaCopy;
       interAreaPrefixLSAs.push_back(lsaCopy);
       return true;
   }
}

Definition at line 292 of file ansaOspfArea6.cc.

                                                                         {
   AnsaOspf6::LinkStateID linkStateID = lsa->getHeader().getLinkStateID();
   std::map<AnsaOspf6::LinkStateID, AnsaOspf6::InterAreaRouterLsa*>::iterator lsaIt = interAreaRouterLSAsByID.find(linkStateID);
   if (lsaIt != interAreaRouterLSAsByID.end()) {
       AnsaOspf6::LsaKeyType6 lsaKey;

       lsaKey.linkStateID = lsa->getHeader().getLinkStateID();
       lsaKey.advertisingRouter = lsa->getHeader().getAdvertisingRouter();

       RemoveFromAllRetransmissionLists(lsaKey);
       return lsaIt->second->Update(lsa);
   } else {
       AnsaOspf6::InterAreaRouterLsa* lsaCopy = new AnsaOspf6::InterAreaRouterLsa(*lsa);
       interAreaRouterLSAsByID[linkStateID] = lsaCopy;
       interAreaRouterLSAs.push_back(lsaCopy);
       return true;
   }
}

Definition at line 311 of file ansaOspfArea6.cc.

                                                                         {
   AnsaOspf6::LinkStateID linkStateID = lsa->getHeader().getLinkStateID();
   std::map<AnsaOspf6::LinkStateID, AnsaOspf6::IntraAreaPrefixLsa*>::iterator lsaIt = intraAreaPrefixLSAsByID.find(linkStateID);
   if (lsaIt != intraAreaPrefixLSAsByID.end()) {
       AnsaOspf6::LsaKeyType6 lsaKey;

       lsaKey.linkStateID = lsa->getHeader().getLinkStateID();
       lsaKey.advertisingRouter = lsa->getHeader().getAdvertisingRouter();

       RemoveFromAllRetransmissionLists(lsaKey);
       return lsaIt->second->Update(lsa);
   } else {
       AnsaOspf6::IntraAreaPrefixLsa* lsaCopy = new AnsaOspf6::IntraAreaPrefixLsa(*lsa);
       intraAreaPrefixLSAsByID[linkStateID] = lsaCopy;
       intraAreaPrefixLSAs.push_back(lsaCopy);
       return true;
   }
}

Definition at line 254 of file ansaOspfArea6.cc.

                                                         {
    AnsaOspf6::LinkStateID linkStateID = lsa->getHeader().getLinkStateID();
    std::map<AnsaOspf6::LinkStateID, AnsaOspf6::NetworkLsa*>::iterator lsaIt = networkLSAsByID.find(linkStateID);
    if (lsaIt != networkLSAsByID.end()) {
        AnsaOspf6::LsaKeyType6 lsaKey;

        lsaKey.linkStateID = lsa->getHeader().getLinkStateID();
        lsaKey.advertisingRouter = lsa->getHeader().getAdvertisingRouter();

        RemoveFromAllRetransmissionLists(lsaKey);
        return lsaIt->second->Update(lsa);
    } else {
        AnsaOspf6::NetworkLsa* lsaCopy = new AnsaOspf6::NetworkLsa(*lsa);
        networkLSAsByID[linkStateID] = lsaCopy;
        networkLSAs.push_back(lsaCopy);
        return true;
    }
}

Definition at line 234 of file ansaOspfArea6.cc.

                                                       {
   AnsaOspf6::LinkStateID linkStateID = lsa->getHeader().getLinkStateID();
   std::map<AnsaOspf6::LinkStateID, AnsaOspf6::RouterLsa*>::iterator lsaIt = routerLSAsByID.find(linkStateID);
   if (lsaIt != routerLSAsByID.end()){
      AnsaOspf6::LsaKeyType6 lsaKey;

      lsaKey.linkStateID = lsa->getHeader().getLinkStateID();
      lsaKey.advertisingRouter = lsa->getHeader().getAdvertisingRouter();

      RemoveFromAllRetransmissionLists(lsaKey);
      return lsaIt->second->Update(lsa);
   } else {
      AnsaOspf6::RouterLsa* lsaCopy = new AnsaOspf6::RouterLsa(*lsa);
      routerLSAsByID[linkStateID] = lsaCopy;
      routerLSAs.push_back(lsaCopy);
      return true;
   }
}

Definition at line 783 of file ansaOspfArea6.cc.

                                                                               {
   long interfaceCount = associatedInterfaces.size();
   for (long i = 0; i < interfaceCount; i++){
      if (associatedInterfaces[i]->IsOnAnyRetransmissionList(lsaKey)){
         return true;
      }
   }
   return false;
}

Definition at line 811 of file ansaOspfArea6.cc.

                                                                                     {

}

Definition at line 807 of file ansaOspfArea6.cc.

                                                         {

}

Definition at line 776 of file ansaOspfArea6.cc.

                                                                                {
   long interfaceCount = associatedInterfaces.size();
   for (long i = 0; i < interfaceCount; i++){
      associatedInterfaces[i]->RemoveFromAllRetransmissionLists(lsaKey);
   }
}

Definition at line 397 of file ansaOspfArea6.cc.

                                                                {

   long lsaCount = routerLSAs.size();
   long i;

   for (i = 0; i < lsaCount; i++){
      if (routerLSAs[i] != NULL){
         AnsaOspf6::RouterLsa* routerLSA = routerLSAs[i];
         AnsaOspf6::RoutingInfo* routingInfo = check_and_cast<AnsaOspf6::RoutingInfo*> (routerLSA);

         if (routingInfo->GetParent() == parent)
            routingInfo->SetParent(NULL);
      }
   }

   lsaCount = networkLSAs.size();

   for (i = 0; i < lsaCount; i++){
      if (networkLSAs[i] != NULL){
         AnsaOspf6::NetworkLsa* networkLSA = networkLSAs[i];
         AnsaOspf6::RoutingInfo* routingInfo = check_and_cast<AnsaOspf6::RoutingInfo*> (networkLSA);

         if (routingInfo->GetParent() == parent)
            routingInfo->SetParent(NULL);
      }
   }

   lsaCount = interAreaPrefixLSAs.size();

   for (i = 0; i < lsaCount; i++){
      if (interAreaPrefixLSAs[i] != NULL){
         AnsaOspf6::InterAreaPrefixLsa* interAreaPrefixLSA = interAreaPrefixLSAs[i];
         AnsaOspf6::RoutingInfo* routingInfo = check_and_cast<AnsaOspf6::RoutingInfo*> (interAreaPrefixLSA);

         if (routingInfo->GetParent() == parent)
            routingInfo->SetParent(NULL);
      }
   }

   lsaCount = interAreaRouterLSAs.size();

   for (i = 0; i < lsaCount; i++){
      if (interAreaRouterLSAs[i] != NULL){
         AnsaOspf6::InterAreaRouterLsa* interAreaRouterLSA = interAreaRouterLSAs[i];
         AnsaOspf6::RoutingInfo* routingInfo = check_and_cast<AnsaOspf6::RoutingInfo*> (interAreaRouterLSA);

         if (routingInfo->GetParent() == parent)
            routingInfo->SetParent(NULL);
      }
   }

   lsaCount = intraAreaPrefixLSAs.size();

   for (i = 0; i < lsaCount; i++){
      if (intraAreaPrefixLSAs[i] != NULL){
         AnsaOspf6::IntraAreaPrefixLsa* intraAreaPrefixLSA = intraAreaPrefixLSAs[i];
         AnsaOspf6::RoutingInfo* routingInfo = check_and_cast<AnsaOspf6::RoutingInfo*> (intraAreaPrefixLSA);

         if (routingInfo->GetParent() == parent)
            routingInfo->SetParent(NULL);
      }
   }
}
void AnsaOspf6::Area::SetAreaID ( AreaID  id) [inline]

Definition at line 58 of file ansaOspfArea6.h.

{ areaID = id; }
void AnsaOspf6::Area::SetExternalRoutingCapability ( bool  flooded) [inline]

Definition at line 66 of file ansaOspfArea6.h.

void AnsaOspf6::Area::SetRouter ( Router router) [inline]

Definition at line 72 of file ansaOspfArea6.h.

Referenced by AnsaOspf6::Router::AddArea().

{ parentRouter = router; }
void AnsaOspf6::Area::SetSPFTreeRoot ( RouterLsa root) [inline]

Definition at line 68 of file ansaOspfArea6.h.

{ spfTreeRoot = root; }
void AnsaOspf6::Area::SetTransitCapability ( bool  transit) [inline]

Definition at line 64 of file ansaOspfArea6.h.

{ transitCapability = transit; }

Member Data Documentation

Definition at line 31 of file ansaOspfArea6.h.

Referenced by AddAddressPrefix().

Definition at line 30 of file ansaOspfArea6.h.

Referenced by GetAreaID(), and SetAreaID().

Definition at line 33 of file ansaOspfArea6.h.

Referenced by GetNumberOfInterfaces().

Definition at line 34 of file ansaOspfArea6.h.

Referenced by AddHostRoute().

std::vector<NetworkLsa*> AnsaOspf6::Area::networkLSAs [private]

Definition at line 38 of file ansaOspfArea6.h.

Referenced by GetNetworkLSA(), and GetNetworkLSACount().

Definition at line 37 of file ansaOspfArea6.h.

Definition at line 52 of file ansaOspfArea6.h.

Referenced by GetRouter(), and SetRouter().

std::vector<RouterLsa*> AnsaOspf6::Area::routerLSAs [private]

Definition at line 36 of file ansaOspfArea6.h.

Referenced by GetRouterLSA(), and GetRouterLSACount().

Definition at line 35 of file ansaOspfArea6.h.

Definition at line 48 of file ansaOspfArea6.h.

Referenced by GetSPFTreeRoot(), and SetSPFTreeRoot().

Definition at line 47 of file ansaOspfArea6.h.

Definition at line 45 of file ansaOspfArea6.h.

Referenced by GetTransitCapability(), and SetTransitCapability().


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