|
|
| 254 |
RoutingProtocol::PrintRoutingTable (Ptr<OutputStreamWrapper> stream) const |
254 |
RoutingProtocol::PrintRoutingTable (Ptr<OutputStreamWrapper> stream) const |
| 255 |
{ |
255 |
{ |
| 256 |
std::ostream* os = stream->GetStream (); |
256 |
std::ostream* os = stream->GetStream (); |
|
|
257 |
|
| 258 |
*os << "Node: " << m_ipv4->GetObject<Node> ()->GetId () |
| 259 |
<< " Time: " << Simulator::Now ().GetSeconds () << "s " |
| 260 |
<< "OLSR Routing table" << std::endl; |
| 261 |
|
| 257 |
*os << "Destination\t\tNextHop\t\tInterface\tDistance\n"; |
262 |
*os << "Destination\t\tNextHop\t\tInterface\tDistance\n"; |
| 258 |
|
263 |
|
| 259 |
for (std::map<Ipv4Address, RoutingTableEntry>::const_iterator iter = m_table.begin (); |
264 |
for (std::map<Ipv4Address, RoutingTableEntry>::const_iterator iter = m_table.begin (); |
|
|
| 272 |
*os << iter->second.distance << "\t"; |
277 |
*os << iter->second.distance << "\t"; |
| 273 |
*os << "\n"; |
278 |
*os << "\n"; |
| 274 |
} |
279 |
} |
|
|
280 |
|
| 275 |
// Also print the HNA routing table |
281 |
// Also print the HNA routing table |
| 276 |
*os << " HNA Routing Table:\n"; |
282 |
if (m_hnaRoutingTable->GetNRoutes () > 0) |
| 277 |
m_hnaRoutingTable->PrintRoutingTable (stream); |
283 |
{ |
|
|
284 |
*os << " HNA Routing Table: "; |
| 285 |
m_hnaRoutingTable->PrintRoutingTable (stream); |
| 286 |
} |
| 287 |
else |
| 288 |
{ |
| 289 |
*os << std::endl; |
| 290 |
} |
| 278 |
} |
291 |
} |
| 279 |
|
292 |
|
| 280 |
void RoutingProtocol::DoInitialize () |
293 |
void RoutingProtocol::DoInitialize () |