#include "RoutingTable.h"
#include "InterfaceTableAccess.h"
#include "OSPFcommon.h"
#include <memory.h>
Namespaces | |
namespace | OSPF |
Functions | |
std::ostream & | operator<< (std::ostream &out, const OSPF::RoutingTableEntry &entry) |
|
00181 { 00182 out << "Destination: " 00183 << entry.GetDestinationID ().str () 00184 << "/" 00185 << entry.GetAddressMask ().str () 00186 << " ("; 00187 if (entry.GetDestinationType () == OSPF::RoutingTableEntry::NetworkDestination) { 00188 out << "Network"; 00189 } else { 00190 if ((entry.GetDestinationType () & OSPF::RoutingTableEntry::AreaBorderRouterDestination) != 0) { 00191 out << "AreaBorderRouter"; 00192 } 00193 if ((entry.GetDestinationType () & (OSPF::RoutingTableEntry::ASBoundaryRouterDestination | OSPF::RoutingTableEntry::AreaBorderRouterDestination)) != 0) { 00194 out << "+"; 00195 } 00196 if ((entry.GetDestinationType () & OSPF::RoutingTableEntry::ASBoundaryRouterDestination) != 0) { 00197 out << "ASBoundaryRouter"; 00198 } 00199 } 00200 out << "), Area: " 00201 << entry.GetArea () 00202 << ", PathType: "; 00203 switch (entry.GetPathType ()) { 00204 case OSPF::RoutingTableEntry::IntraArea: out << "IntraArea"; break; 00205 case OSPF::RoutingTableEntry::InterArea: out << "InterArea"; break; 00206 case OSPF::RoutingTableEntry::Type1External: out << "Type1External"; break; 00207 case OSPF::RoutingTableEntry::Type2External: out << "Type2External"; break; 00208 default: out << "Unknown"; break; 00209 } 00210 out << ", Cost: " 00211 << entry.GetCost () 00212 << ", Type2Cost: " 00213 << entry.GetType2Cost () 00214 << ", Origin: ["; 00215 PrintLSAHeader (entry.GetLinkStateOrigin ()->getHeader (), &out); 00216 out << "], NextHops: "; 00217 00218 unsigned int hopCount = entry.GetNextHopCount (); 00219 for (unsigned int i = 0; i < hopCount; i++) { 00220 char addressString[16]; 00221 out << AddressStringFromIPv4Address (addressString, sizeof (addressString), entry.GetNextHop (i).hopAddress) 00222 << " "; 00223 } 00224 00225 return out; 00226 }
|