OSPFRoutingTableEntry.h File Reference

#include "IRoutingTable.h"
#include "InterfaceTableAccess.h"
#include "OSPFcommon.h"
#include <memory.h>

Namespaces

namespace  OSPF

Classes

class  OSPF::RoutingTableEntry

Functions

std::ostream & operator<< (std::ostream &out, const OSPF::RoutingTableEntry &entry)


Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const OSPF::RoutingTableEntry entry 
) [inline]

00196 {
00197     out << "Destination: "
00198         << entry.GetDestinationID().str()
00199         << "/"
00200         << entry.GetAddressMask().str()
00201         << " (";
00202     if (entry.GetDestinationType() == OSPF::RoutingTableEntry::NetworkDestination) {
00203         out << "Network";
00204     } else {
00205         if ((entry.GetDestinationType() & OSPF::RoutingTableEntry::AreaBorderRouterDestination) != 0) {
00206             out << "AreaBorderRouter";
00207         }
00208         if ((entry.GetDestinationType() & (OSPF::RoutingTableEntry::ASBoundaryRouterDestination | OSPF::RoutingTableEntry::AreaBorderRouterDestination)) != 0) {
00209             out << "+";
00210         }
00211         if ((entry.GetDestinationType() & OSPF::RoutingTableEntry::ASBoundaryRouterDestination) != 0) {
00212             out << "ASBoundaryRouter";
00213         }
00214     }
00215     out << "), Area: "
00216         << entry.GetArea()
00217         << ", PathType: ";
00218     switch (entry.GetPathType()) {
00219         case OSPF::RoutingTableEntry::IntraArea:     out << "IntraArea";     break;
00220         case OSPF::RoutingTableEntry::InterArea:     out << "InterArea";     break;
00221         case OSPF::RoutingTableEntry::Type1External: out << "Type1External"; break;
00222         case OSPF::RoutingTableEntry::Type2External: out << "Type2External"; break;
00223         default:            out << "Unknown";       break;
00224     }
00225     out << ", Cost: "
00226         << entry.GetCost()
00227         << ", Type2Cost: "
00228         << entry.GetType2Cost()
00229         << ", Origin: [";
00230     PrintLSAHeader(entry.GetLinkStateOrigin()->getHeader(), out);
00231     out << "], NextHops: ";
00232 
00233     unsigned int hopCount = entry.GetNextHopCount();
00234     for (unsigned int i = 0; i < hopCount; i++) {
00235         char addressString[16];
00236         out << AddressStringFromIPv4Address(addressString, sizeof(addressString), entry.GetNextHop(i).hopAddress)
00237             << " ";
00238     }
00239 
00240     return out;
00241 }


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