|
INET Framework for OMNeT++/OMNEST
|
#include <ansaOspfArea6.h>
Definition at line 28 of file ansaOspfArea6.h.
Definition at line 20 of file ansaOspfArea6.cc.
:
areaID(id),
transitCapability(false),
externalRoutingCapability(true),
stubDefaultCost(1),
spfTreeRoot(NULL),
parentRouter(NULL){
//
}
| 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();
}
| 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); }
| void AnsaOspf6::Area::AddInterface | ( | AnsaOspf6::Interface * | intf | ) |
Definition at line 69 of file ansaOspfArea6.cc.
Referenced by AnsaOspfRouting6::loadInterfaceConfig().
{
intf->SetArea(this);
associatedInterfaces.push_back(intf);
}
| void AnsaOspf6::Area::AgeDatabase | ( | void | ) |
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 | ) |
| bool AnsaOspf6::Area::ContainsAddress | ( | IPv6Address | address | ) | const |
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();
}
| AnsaOspf6::InterAreaPrefixLsa * AnsaOspf6::Area::FindInterAreaPrefixLSA | ( | AnsaOspf6::LinkStateID | linkStateID | ) |
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;
}
}
| const AnsaOspf6::InterAreaPrefixLsa * AnsaOspf6::Area::FindInterAreaPrefixLSA | ( | AnsaOspf6::LinkStateID | linkStateID | ) | const |
Definition at line 366 of file ansaOspfArea6.cc.
{
return FindInterAreaPrefixLSA(linkStateID);
}
| AnsaOspf6::InterAreaRouterLsa * AnsaOspf6::Area::FindInterAreaRouterLSA | ( | AnsaOspf6::LinkStateID | 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;
}
}
| const AnsaOspf6::InterAreaRouterLsa * AnsaOspf6::Area::FindInterAreaRouterLSA | ( | AnsaOspf6::LinkStateID | linkStateID | ) | const |
Definition at line 379 of file ansaOspfArea6.cc.
{
return FindInterAreaRouterLSA(linkStateID);
}
| AnsaOspf6::IntraAreaPrefixLsa * AnsaOspf6::Area::FindIntraAreaPrefixLSA | ( | AnsaOspf6::LinkStateID | 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;
}
}
| const AnsaOspf6::IntraAreaPrefixLsa * AnsaOspf6::Area::FindIntraAreaPrefixLSA | ( | AnsaOspf6::LinkStateID | linkStateID | ) | const |
Definition at line 392 of file ansaOspfArea6.cc.
{
return FindIntraAreaPrefixLSA(linkStateID);
}
| AnsaOspf6::NetworkLsa * AnsaOspf6::Area::FindNetworkLSA | ( | AnsaOspf6::LinkStateID | 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;
}
}
| const AnsaOspf6::NetworkLsa * AnsaOspf6::Area::FindNetworkLSA | ( | AnsaOspf6::LinkStateID | linkStateID | ) | const |
Definition at line 353 of file ansaOspfArea6.cc.
{
return FindNetworkLSA(linkStateID);
}
| AnsaOspf6::RouterLsa * AnsaOspf6::Area::FindRouterLSA | ( | AnsaOspf6::LinkStateID | 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;
}
}
| const AnsaOspf6::RouterLsa * AnsaOspf6::Area::FindRouterLSA | ( | AnsaOspf6::LinkStateID | linkStateID | ) | const |
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.
{ return areaAddressPrefixes[index]; }
| unsigned int AnsaOspf6::Area::GetAddressPrefixCount | ( | void | ) | const [inline] |
Definition at line 61 of file ansaOspfArea6.h.
{ return areaAddressPrefixes.size(); }
| AreaID AnsaOspf6::Area::GetAreaID | ( | void | ) | const [inline] |
Definition at line 59 of file ansaOspfArea6.h.
Referenced by AnsaOspf6::LinkStateUpdateHandler::AcknowledgeLSA(), AnsaOspf6::Router::AddArea(), AnsaOspfRouting6::loadInterfaceConfig(), operator<<(), AnsaOspf6::DatabaseDescriptionHandler::ProcessDDPacket(), and AnsaOspf6::LinkStateRequestHandler::ProcessPacket().
{ return areaID; }
| AnsaOspf6::IPv6AddressPrefix AnsaOspf6::Area::GetContainingAddressRange | ( | AnsaOspf6::IPv6AddressPrefix | addressPrefix, |
| bool * | advertise = NULL |
||
| ) | const |
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;
}
| bool AnsaOspf6::Area::GetExternalRoutingCapability | ( | void | ) | const [inline] |
Definition at line 67 of file ansaOspfArea6.h.
Referenced by AnsaOspf6::Neighbor::CreateDatabaseSummary(), AnsaOspf6::DatabaseDescriptionHandler::ProcessDDPacket(), AnsaOspf6::HelloHandler::ProcessPacket(), and AnsaOspf6::LinkStateUpdateHandler::ProcessPacket().
{ return externalRoutingCapability; }
| InterAreaPrefixLsa* AnsaOspf6::Area::GetInterAreaPrefixLSA | ( | unsigned long | i | ) | [inline] |
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(); }
| InterAreaRouterLsa* AnsaOspf6::Area::GetInterAreaRouterLSA | ( | unsigned long | i | ) | [inline] |
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(); }
| AnsaOspf6::Interface * AnsaOspf6::Area::GetInterface | ( | unsigned char | ifIndex | ) |
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;
}
| AnsaOspf6::Interface * AnsaOspf6::Area::GetInterface | ( | IPv6Address | address | ) |
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;
}
| Interface * AnsaOspf6::Area::GetInterfaceByIndex | ( | unsigned int | index | ) |
Definition at line 74 of file ansaOspfArea6.cc.
Referenced by operator<<().
{
if (index < associatedInterfaces.size()){
return associatedInterfaces[index];
}else{
return NULL;
}
}
| IntraAreaPrefixLsa* AnsaOspf6::Area::GetIntraAreaPrefixLSA | ( | unsigned long | i | ) | [inline] |
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(); }
| Router* AnsaOspf6::Area::GetRouter | ( | void | ) | [inline] |
Definition at line 73 of file ansaOspfArea6.h.
Referenced by AnsaOspf6::InterfaceState::CalculateDesignatedRouter(), AnsaOspf6::Neighbor::CreateDatabaseSummary(), AnsaOspfRouting6::handleMessage(), AnsaOspf6::NeighborStateLoading::ProcessEvent(), AnsaOspf6::NeighborStateTwoWay::ProcessEvent(), AnsaOspf6::NeighborStateAttempt::ProcessEvent(), AnsaOspf6::NeighborStateDown::ProcessEvent(), AnsaOspf6::NeighborStateExchange::ProcessEvent(), AnsaOspf6::NeighborStateExchangeStart::ProcessEvent(), AnsaOspf6::NeighborStateFull::ProcessEvent(), AnsaOspf6::NeighborStateInit::ProcessEvent(), AnsaOspf6::InterfaceStateBackup::ProcessEvent(), AnsaOspf6::InterfaceStateNotDesignatedRouter::ProcessEvent(), AnsaOspf6::InterfaceStatePointToPoint::ProcessEvent(), AnsaOspf6::InterfaceStateWaiting::ProcessEvent(), AnsaOspf6::InterfaceStateDown::ProcessEvent(), and AnsaOspf6::InterfaceStateDesignatedRouter::ProcessEvent().
{ return parentRouter; }
| 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(); }
| RouterLsa* AnsaOspf6::Area::GetSPFTreeRoot | ( | void | ) | [inline] |
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; }
| bool AnsaOspf6::Area::HasAddressPrefix | ( | AnsaOspf6::IPv6AddressPrefix | addressPrefix | ) | const |
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;
}
}
| bool AnsaOspf6::Area::InstallNetworkLSA | ( | OspfNetworkLsa6 * | lsa | ) |
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;
}
}
| bool AnsaOspf6::Area::InstallRouterLSA | ( | OspfRouterLsa6 * | lsa | ) |
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;
}
}
| bool AnsaOspf6::Area::IsLocalAddress | ( | IPv6Address | address | ) | const |
| bool AnsaOspf6::Area::IsOnAnyRetransmissionList | ( | AnsaOspf6::LsaKeyType6 | lsaKey | ) | const |
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;
}
| AnsaOspf6::NetworkLsa * AnsaOspf6::Area::OriginateNetworkLSA | ( | const Interface * | intf | ) |
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);
}
}
| void AnsaOspf6::Area::RemoveParentFromRoutingInfo | ( | OspfLsa6 * | parent | ) |
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.
{ externalRoutingCapability = flooded; }
| 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; }
std::map<IPv6AddressPrefix, bool, IPv6AddressPrefix_Less> AnsaOspf6::Area::advertiseAddressPrefixes [private] |
Definition at line 31 of file ansaOspfArea6.h.
Referenced by AddAddressPrefix().
std::vector<IPv6AddressPrefix> AnsaOspf6::Area::areaAddressPrefixes [private] |
Definition at line 32 of file ansaOspfArea6.h.
Referenced by AddAddressPrefix(), GetAddressPrefix(), and GetAddressPrefixCount().
AreaID AnsaOspf6::Area::areaID [private] |
Definition at line 30 of file ansaOspfArea6.h.
Referenced by GetAreaID(), and SetAreaID().
std::vector<Interface*> AnsaOspf6::Area::associatedInterfaces [private] |
Definition at line 33 of file ansaOspfArea6.h.
Referenced by GetNumberOfInterfaces().
bool AnsaOspf6::Area::externalRoutingCapability [private] |
Definition at line 46 of file ansaOspfArea6.h.
Referenced by GetExternalRoutingCapability(), and SetExternalRoutingCapability().
std::vector<HostRouteParameters> AnsaOspf6::Area::hostRoutes [private] |
Definition at line 34 of file ansaOspfArea6.h.
Referenced by AddHostRoute().
std::vector<InterAreaPrefixLsa*> AnsaOspf6::Area::interAreaPrefixLSAs [private] |
Definition at line 40 of file ansaOspfArea6.h.
Referenced by GetInterAreaPrefixLSA(), and GetInterAreaPrefixLSACount().
std::map<LinkStateID, InterAreaPrefixLsa*> AnsaOspf6::Area::interAreaPrefixLSAsByID [private] |
Definition at line 39 of file ansaOspfArea6.h.
std::vector<InterAreaRouterLsa*> AnsaOspf6::Area::interAreaRouterLSAs [private] |
Definition at line 42 of file ansaOspfArea6.h.
Referenced by GetInterAreaRouterLSA(), and GetInterAreaRouterLSACount().
std::map<LinkStateID, InterAreaRouterLsa*> AnsaOspf6::Area::interAreaRouterLSAsByID [private] |
Definition at line 41 of file ansaOspfArea6.h.
std::vector<IntraAreaPrefixLsa*> AnsaOspf6::Area::intraAreaPrefixLSAs [private] |
Definition at line 44 of file ansaOspfArea6.h.
Referenced by GetIntraAreaPrefixLSA(), and GetIntraAreaPrefixLSACount().
std::map<LinkStateID, IntraAreaPrefixLsa*> AnsaOspf6::Area::intraAreaPrefixLSAsByID [private] |
Definition at line 43 of file ansaOspfArea6.h.
std::vector<NetworkLsa*> AnsaOspf6::Area::networkLSAs [private] |
Definition at line 38 of file ansaOspfArea6.h.
Referenced by GetNetworkLSA(), and GetNetworkLSACount().
std::map<LinkStateID, NetworkLsa*> AnsaOspf6::Area::networkLSAsByID [private] |
Definition at line 37 of file ansaOspfArea6.h.
Router* AnsaOspf6::Area::parentRouter [private] |
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().
std::map<LinkStateID, RouterLsa*> AnsaOspf6::Area::routerLSAsByID [private] |
Definition at line 35 of file ansaOspfArea6.h.
RouterLsa* AnsaOspf6::Area::spfTreeRoot [private] |
Definition at line 48 of file ansaOspfArea6.h.
Referenced by GetSPFTreeRoot(), and SetSPFTreeRoot().
Metric AnsaOspf6::Area::stubDefaultCost [private] |
Definition at line 47 of file ansaOspfArea6.h.
bool AnsaOspf6::Area::transitCapability [private] |
Definition at line 45 of file ansaOspfArea6.h.
Referenced by GetTransitCapability(), and SetTransitCapability().