#include <RoutingTable.h>
Inheritance diagram for RoutingEntry:
Public Types | |
DIRECT | |
Directly attached to the router. | |
REMOTE | |
Reached through another router. | |
MANUAL | |
manually added static route | |
IFACENETMASK | |
comes from an interface's netmask | |
RIP | |
managed by the given routing protocol | |
OSPF | |
managed by the given routing protocol | |
BGP | |
managed by the given routing protocol | |
ZEBRA | |
managed by the Quagga/Zebra based model | |
enum | RouteType { DIRECT, REMOTE } |
enum | RouteSource { MANUAL, IFACENETMASK, RIP, OSPF, BGP, ZEBRA } |
Public Member Functions | |
RoutingEntry () | |
virtual | ~RoutingEntry () |
virtual std::string | info () const |
virtual std::string | detailedInfo () const |
Public Attributes | |
IPAddress | host |
Destination. | |
IPAddress | netmask |
Route mask. | |
IPAddress | gateway |
Next hop. | |
opp_string | interfaceName |
Interface name and pointer. | |
InterfaceEntry * | interfacePtr |
RouteType | type |
Route type: Direct or Remote. | |
RouteSource | source |
int | metric |
Metric ("cost" to reach the destination). | |
Private Member Functions | |
RoutingEntry (const RoutingEntry &obj) | |
RoutingEntry & | operator= (const RoutingEntry &obj) |
Specifies where the route comes from
RoutingEntry::RoutingEntry | ( | const RoutingEntry & | obj | ) | [private] |
RoutingEntry::RoutingEntry | ( | ) |
std::string RoutingEntry::detailedInfo | ( | ) | const [virtual] |
std::string RoutingEntry::info | ( | ) | const [virtual] |
00048 { 00049 std::stringstream out; 00050 out << "dest:"; if (host.isUnspecified()) out << "* "; else out << host << " "; 00051 out << "gw:"; if (gateway.isUnspecified()) out << "* "; else out << gateway << " "; 00052 out << "mask:"; if (netmask.isUnspecified()) out << "* "; else out << netmask << " "; 00053 out << "metric:" << metric << " "; 00054 out << "if:"; if (interfaceName.empty()) out << "* "; else out << interfaceName.c_str() << " "; 00055 out << (type==DIRECT ? "DIRECT" : "REMOTE"); 00056 switch (source) 00057 { 00058 case MANUAL: out << " MANUAL"; break; 00059 case IFACENETMASK: out << " IFACENETMASK"; break; 00060 case RIP: out << " RIP"; break; 00061 case OSPF: out << " OSPF"; break; 00062 case BGP: out << " BGP"; break; 00063 case ZEBRA: out << " ZEBRA"; break; 00064 default: out << " ???"; break; 00065 } 00066 return out.str(); 00067 }
RoutingEntry& RoutingEntry::operator= | ( | const RoutingEntry & | obj | ) | [private] |
Next hop.
Destination.
opp_string RoutingEntry::interfaceName |
Interface name and pointer.
Metric ("cost" to reach the destination).
Route mask.
Source of route, MANUAL by reading a file, routing protocol name otherwise
Route type: Direct or Remote.