INET Framework for OMNeT++/OMNEST
ansaLsa6.h File Reference
#include "ansaOspfCommon6.h"
#include "ansaOspfPacket6_m.h"

Go to the source code of this file.

Classes

struct  AnsaOspf6::NextHop
class  AnsaOspf6::RoutingInfo
class  AnsaOspf6::LsaTrackingInfo
class  AnsaOspf6::RouterLsa
class  AnsaOspf6::NetworkLsa
class  AnsaOspf6::InterAreaPrefixLsa
class  AnsaOspf6::InterAreaRouterLsa
class  AnsaOspf6::AsExternalLsa
class  AnsaOspf6::LinkLsa
class  AnsaOspf6::IntraAreaPrefixLsa

Namespaces

namespace  AnsaOspf6

Functions

bool operator< (const OspfLsaHeader6 &leftLSA, const OspfLsaHeader6 &rightLSA)
bool operator== (const OspfLsaHeader6 &leftLSA, const OspfLsaHeader6 &rightLSA)
bool operator== (const OspfOptions6 &leftOptions, const OspfOptions6 &rightOptions)
bool operator!= (const OspfOptions6 &leftOptions, const OspfOptions6 &rightOptions)
bool operator== (const OspfPrefixOptions6 &left, const OspfPrefixOptions6 &right)
bool operator!= (const OspfPrefixOptions6 &left, const OspfPrefixOptions6 &right)
bool operator== (const OspfPrefix6 &left, const OspfPrefix6 &right)
bool operator!= (const OspfPrefix6 &left, const OspfPrefix6 &right)
bool operator== (const Link6 &left, const Link6 &right)
bool operator!= (const Link6 &left, const Link6 &right)
bool operator== (const AnsaOspf6::NextHop &leftHop, const AnsaOspf6::NextHop &rightHop)
bool operator!= (const AnsaOspf6::NextHop &leftHop, const AnsaOspf6::NextHop &rightHop)
void PrintLsaHeader6 (const OspfLsaHeader6 &lsaHeader, std::ostream &o)
void printLsaLink (const Link6 &link, std::ostream &o)
void PrintRouterLsa (const OspfRouterLsa6 &lsa, std::ostream &o)
void PrintNetworkLsa (const OspfNetworkLsa6 &lsa, std::ostream &o)
void PrintInterAreaPrefixLsa (const OspfInterAreaPrefixLsa6 &lsa, std::ostream &o)
void PrintInterAreaRouterLsa (const OspfInterAreaRouterLsa6 &lsa, std::ostream &o)
void PrintAsExternalLsa (const OspfAsExternalLsa6 &lsa, std::ostream &o)
void PrintLinkLsa (const OspfLinkLsa6 &lsa, std::ostream &o)
void PrintIntraAreaPrefixLsa (const OspfIntraAreaPrefixLsa6 &lsa, std::ostream &o)
std::ostream & operator<< (std::ostream &ostr, OspfLsa6 &lsa)

Function Documentation

bool operator!= ( const OspfOptions6 leftOptions,
const OspfOptions6 rightOptions 
) [inline]

Definition at line 239 of file ansaLsa6.h.

                                                                                          {
   return (!(leftOptions == rightOptions));
}
bool operator!= ( const OspfPrefixOptions6 left,
const OspfPrefixOptions6 right 
) [inline]

Definition at line 248 of file ansaLsa6.h.

                                                                                        {
   return (!(left == right));
}
bool operator!= ( const OspfPrefix6 left,
const OspfPrefix6 right 
) [inline]

Definition at line 259 of file ansaLsa6.h.

                                                                          {
   return (!(left == right));
}
bool operator!= ( const Link6 left,
const Link6 right 
) [inline]

Definition at line 271 of file ansaLsa6.h.

                                                              {
   return (!(left == right));
}
bool operator!= ( const AnsaOspf6::NextHop leftHop,
const AnsaOspf6::NextHop rightHop 
) [inline]

Definition at line 281 of file ansaLsa6.h.

                                                                                          {
   return (!(leftHop == rightHop));
}
bool operator< ( const OspfLsaHeader6 leftLSA,
const OspfLsaHeader6 rightLSA 
) [inline]

Returns true if leftLSA is older than rightLSA.

Definition at line 186 of file ansaLsa6.h.

                                                                                     {
   long leftSequenceNumber = leftLSA.getLsSequenceNumber();
   long rightSequenceNumber = rightLSA.getLsSequenceNumber();

   if (leftSequenceNumber < rightSequenceNumber){
      return true;
   }
   if (leftSequenceNumber == rightSequenceNumber){
      unsigned short leftAge = leftLSA.getLsAge();
      unsigned short rightAge = rightLSA.getLsAge();

      if ((leftAge != MAX_AGE) && (rightAge == MAX_AGE)){
         return true;
      }
      if ((abs(leftAge - rightAge) > MAX_AGE_DIFF) && (leftAge > rightAge)){
         return true;
      }
   }
   return false;
}
std::ostream& operator<< ( std::ostream &  ostr,
OspfLsa6 lsa 
) [inline]

Definition at line 409 of file ansaLsa6.h.

                                                               {
   PrintLsaHeader6(lsa.getHeader(), ostr);
   return ostr;
}
bool operator== ( const OspfLsaHeader6 leftLSA,
const OspfLsaHeader6 rightLSA 
) [inline]

Returns true if leftLSA is the same age as rightLSA.

Definition at line 210 of file ansaLsa6.h.

                                                                                      {
   long leftSequenceNumber = leftLSA.getLsSequenceNumber();
   long rightSequenceNumber = rightLSA.getLsSequenceNumber();
   unsigned short leftAge = leftLSA.getLsAge();
   unsigned short rightAge = rightLSA.getLsAge();

   if (  (leftSequenceNumber == rightSequenceNumber)
      && (
            (
                  (leftAge == MAX_AGE) && (rightAge == MAX_AGE)
            ) || (((leftAge != MAX_AGE) && (rightAge != MAX_AGE))
                  && (abs(leftAge - rightAge) <= MAX_AGE_DIFF)
            )
      )
   ){
      return true;
   }else{
      return false;
   }
}
bool operator== ( const OspfOptions6 leftOptions,
const OspfOptions6 rightOptions 
) [inline]

Definition at line 231 of file ansaLsa6.h.

                                                                                          {
   return ((leftOptions.V6_IPv6Routing == rightOptions.V6_IPv6Routing)
         && (leftOptions.E_ExternalRoutingCapability == rightOptions.E_ExternalRoutingCapability)
         && (leftOptions.N_NSSA == rightOptions.N_NSSA)
         && (leftOptions.R_Router == rightOptions.R_Router)
         && (leftOptions.DC_DemandCircuits == rightOptions.DC_DemandCircuits));
}
bool operator== ( const OspfPrefixOptions6 left,
const OspfPrefixOptions6 right 
) [inline]

Definition at line 243 of file ansaLsa6.h.

                                                                                        {
   return ( (left.NU_NoUnicast == right.NU_NoUnicast)
         && (left.LA_LocalAddress == right.LA_LocalAddress));
}
bool operator== ( const OspfPrefix6 left,
const OspfPrefix6 right 
) [inline]

Definition at line 252 of file ansaLsa6.h.

                                                                          {
   return ( (left.getPrefixLenght() == right.getPrefixLenght())
         && (left.getPrefixOptions() == right.getPrefixOptions())
         && (left.getMetric() == right.getMetric())
         && (left.getAddressPrefix() == right.getAddressPrefix()));
}
bool operator== ( const Link6 left,
const Link6 right 
) [inline]

Definition at line 263 of file ansaLsa6.h.

                                                              {
   return ( (left.getType() == right.getType())
         && (left.getMetric() == right.getMetric())
         && (left.getInterfaceID() == right.getInterfaceID())
         && (left.getNeighborInterfaceID() == right.getNeighborInterfaceID())
         && (left.getNeighborRouterID() == right.getNeighborRouterID()));
}
bool operator== ( const AnsaOspf6::NextHop leftHop,
const AnsaOspf6::NextHop rightHop 
) [inline]

Definition at line 275 of file ansaLsa6.h.

                                                                                          {
   return ( (leftHop.ifIndex           == rightHop.ifIndex) &&
            (leftHop.hopAddress        == rightHop.hopAddress) &&
            (leftHop.advertisingRouter == rightHop.advertisingRouter));
}
void PrintAsExternalLsa ( const OspfAsExternalLsa6 lsa,
std::ostream &  o 
) [inline]

Definition at line 370 of file ansaLsa6.h.

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

                                                                             {
   o << "   " << lsa.getMetric();
   o << ", bits=" << ((lsa.getE_ExternalMetricType()) ? "E " : "_ ")
                  << ((lsa.getF_ForwardingAddress()) ? "F " : "_ ")
                  << ((lsa.getT_ExternalRouteTag()) ? "T" : "_") << endl;
   o << ", " << lsa.getAddressPrefix() << "/" << lsa.getPrefixLenght();
   if (lsa.getF_ForwardingAddress()){
      o << ", forward=" << lsa.getForwardingAddress();
   }
   if (lsa.getT_ExternalRouteTag()){
      o << ", routeTag=" << lsa.getExternalRouteTag();
   }
   o << endl;
}
void PrintInterAreaPrefixLsa ( const OspfInterAreaPrefixLsa6 lsa,
std::ostream &  o 
) [inline]

Definition at line 358 of file ansaLsa6.h.

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

                                                                                       {
   o << "   " << lsa.getMetric();
   o << ", " << lsa.getAddressPrefix() << "/" << lsa.getPrefixLenght() << endl;
   // TODO: prefixOptions?
}
void PrintInterAreaRouterLsa ( const OspfInterAreaRouterLsa6 lsa,
std::ostream &  o 
) [inline]

Definition at line 364 of file ansaLsa6.h.

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

                                                                                       {
   o << "   " << lsa.getMetric();
   o << ", " << IPAddress(lsa.getDestinationRouterID()) << endl;
   // TODO: options?
}
void PrintIntraAreaPrefixLsa ( const OspfIntraAreaPrefixLsa6 lsa,
std::ostream &  o 
) [inline]

Definition at line 397 of file ansaLsa6.h.

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

                                                                                       {
   o << "   refType=" << lsa.getReferencedLsType();
   o << ", refLinkId=" << lsa.getReferencedLinkStateID();
   o << ", refRouter=" << IPAddress(lsa.getReferencedAdvertisingRouter()) << " prefixes:"<< endl;
   unsigned int prefixCount = lsa.getPrefixesArraySize();
   for (unsigned int i = 0; i < prefixCount; i++) {
      OspfPrefix6 prefix = lsa.getPrefixes(i);
      o << "   " << prefix.getMetric() << ", "
        << prefix.getAddressPrefix() << "/" << prefix.getPrefixLenght() << endl;
   }
}
void PrintLinkLsa ( const OspfLinkLsa6 lsa,
std::ostream &  o 
) [inline]

Definition at line 385 of file ansaLsa6.h.

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

                                                                 {
   o << "   " << lsa.getRtrPriority();
   o << ", " << lsa.getLinkLocalAddress() << " prefixes:" << endl;
   // TODO: options?
   unsigned int prefixCount = lsa.getPrefixesArraySize();
   for (unsigned int i = 0; i < prefixCount; i++) {
      OspfPrefix6 prefix = lsa.getPrefixes(i);
      o << "   " << prefix.getMetric() << ", "
        << prefix.getAddressPrefix() << "/" << prefix.getPrefixLenght() << endl;
   }
}
void PrintLsaHeader6 ( const OspfLsaHeader6 lsaHeader,
std::ostream &  o 
) [inline]

Definition at line 285 of file ansaLsa6.h.

Referenced by operator<<(), AnsaOspf6::MessageHandler::PrintDatabaseDescriptionPacket(), AnsaOspf6::MessageHandler::PrintLinkStateAcknowledgementPacket(), AnsaOspf6::MessageHandler::PrintLinkStateUpdatePacket(), AnsaOspf6::DatabaseDescriptionHandler::ProcessDDPacket(), AnsaOspf6::LinkStateAcknowledgementHandler::ProcessPacket(), AnsaOspf6::LinkStateUpdateHandler::ProcessPacket(), and AnsaOspf6::RouterLsa::Update().

                                                                            {
   o << "LsaHeader: age=" << lsaHeader.getLsAge() << ", type=";
   switch (lsaHeader.getLsType()){
      case RouterLsaType:
         o << "RouterLsa";
         break;
      case NetworkLsaType:
         o << "NetworkLsa";
         break;
      case InterAreaPrefixLsaType:
         o << "InterAreaPrefixLsa";
         break;
      case InterAreaRouterLsaType:
         o << "InterAreaRouterLsa";
         break;
      case AsExternalLsaType:
         o << "AsExternalLsa";
         break;
      case LinkLsaType:
         o << "LinkLsa";
         break;
      case IntraAreaPrefixLsaType:
         o << "IntraAreaPrefixLsa";
         break;
      default:
         o << "UnknownLsa";
         break;
   }
   o << ", LSID="
     << lsaHeader.getLinkStateID();
   o << ", advertisingRouter="
     << IPAddress(lsaHeader.getAdvertisingRouter())
     << ", seqNumber=" << lsaHeader.getLsSequenceNumber();
   o << endl;
}
void printLsaLink ( const Link6 link,
std::ostream &  o 
) [inline]

Definition at line 321 of file ansaLsa6.h.

Referenced by PrintRouterLsa().

                                                           {
   o << "   " << link.getMetric();
   o << ", neighbor=" << IPAddress(link.getNeighborRouterID());
   o << ", neighbor iface=" << link.getNeighborInterfaceID();
   o << ", type=";
   switch (link.getType()) {
      case PointToPointLink:  o << "PointToPoint";   break;
      case TransitLink:       o << "Transit";        break;
      case VirtualLink:       o << "Virtual";        break;
      default:                o << "Unknown";        break;
   }

   o << ", iface=" << link.getInterfaceID() << endl;;
}
void PrintNetworkLsa ( const OspfNetworkLsa6 lsa,
std::ostream &  o 
) [inline]

Definition at line 350 of file ansaLsa6.h.

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

                                                                       {
   unsigned int routerCount = lsa.getAttachedRoutersArraySize();
   for (unsigned int i = 0; i < routerCount; i++) {
      o << "   " << IPAddress(lsa.getAttachedRouters(i)) << endl;
   }
   // TODO: options?
}
void PrintRouterLsa ( const OspfRouterLsa6 lsa,
std::ostream &  o 
) [inline]

Definition at line 336 of file ansaLsa6.h.

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

                                                                     {
   o << "bits=" << ((lsa.getV_VirtualLinkEndpoint()) ? "V " : "_ ")
                << ((lsa.getE_AsBoundaryRouter()) ? "E " : "_ ")
                << ((lsa.getB_AreaBorderRouter()) ? "B" : "_") << endl;

   o << "links:" << endl;
   unsigned int linkCount = lsa.getLinksArraySize();
   for (unsigned int j = 0; j < linkCount; j++){
      const Link6& link = lsa.getLinks(j);
         printLsaLink(link, o);
   }
   // TODO: format + options?
}