#include <RoutingTable.h>
Inheritance diagram for RoutingEntry:

Public Types | |
| 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) |
|
|
|
Route type
|
|
|
|
|
|
00039 {
00040 interfacePtr = NULL;
00041
00042 metric = 0;
00043 type = DIRECT;
00044 source = MANUAL;
00045 }
|
|
|
00100 {}
|
|
|
00070 {
00071 return std::string();
00072 }
|
|
|
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 }
|
|
|
|
|
|
Next hop.
|
|
|
Destination.
|
|
|
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.
|
1.4.1