|
|
| 18 |
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
18 |
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
| 19 |
*/ |
19 |
*/ |
| 20 |
#include "ipv4-routing-helper.h" |
20 |
#include "ipv4-routing-helper.h" |
|
|
21 |
#include "ns3/node.h" |
| 22 |
#include "ns3/node-list.h" |
| 23 |
#include "ns3/simulator.h" |
| 24 |
#include "ns3/ipv4-routing-protocol.h" |
| 21 |
|
25 |
|
| 22 |
namespace ns3 { |
26 |
namespace ns3 { |
| 23 |
|
27 |
|
| 24 |
Ipv4RoutingHelper::~Ipv4RoutingHelper () |
28 |
Ipv4RoutingHelper::~Ipv4RoutingHelper () |
| 25 |
{} |
29 |
{} |
| 26 |
|
30 |
|
|
|
31 |
void |
| 32 |
Ipv4RoutingHelper::PrintRoutingTableAllAt (Time printTime, Ptr<OutputStreamWrapper> stream) |
| 33 |
{ |
| 34 |
for (uint32_t i = 0; i < NodeList::GetNNodes (); i++) |
| 35 |
{ |
| 36 |
Ptr<Node> node = NodeList::GetNode (i); |
| 37 |
Ptr<Ipv4RoutingProtocol> rp = node->GetObject<Ipv4RoutingProtocol> (); |
| 38 |
Simulator::Schedule(printTime,&Ipv4RoutingProtocol::PrintRoutingTable,rp,stream); |
| 39 |
} |
| 40 |
} |
| 41 |
|
| 42 |
void |
| 43 |
Ipv4RoutingHelper::PrintRoutingTableAllEvery (Time printTime, Ptr<OutputStreamWrapper> stream) |
| 44 |
{ |
| 45 |
for (uint32_t i = 0; i < NodeList::GetNNodes (); i++) |
| 46 |
{ |
| 47 |
Ptr<Node> node = NodeList::GetNode (i); |
| 48 |
Ptr<Ipv4RoutingProtocol> rp = node->GetObject<Ipv4RoutingProtocol> (); |
| 49 |
Simulator::Schedule(printTime,&Ipv4RoutingProtocol::PrintRoutingTable,rp,stream); |
| 50 |
} |
| 51 |
Simulator::Schedule(printTime,&Ipv4RoutingHelper::PrintRoutingTableAllEvery,this,printTime,stream); |
| 52 |
} |
| 53 |
|
| 54 |
void |
| 55 |
Ipv4RoutingHelper::PrintRoutingTableAt (Time printTime, Ptr<Node> node, Ptr<OutputStreamWrapper> stream) |
| 56 |
{ |
| 57 |
Ptr<Ipv4RoutingProtocol> rp = node->GetObject<Ipv4RoutingProtocol> (); |
| 58 |
Simulator::Schedule (printTime, &Ipv4RoutingProtocol::PrintRoutingTable, rp, stream); |
| 59 |
} |
| 60 |
|
| 61 |
void |
| 62 |
Ipv4RoutingHelper::PrintRoutingTableEvery (Time printTime,Ptr<Node> node, Ptr<OutputStreamWrapper> stream) |
| 63 |
{ |
| 64 |
Ptr<Ipv4RoutingProtocol> rp = node->GetObject<Ipv4RoutingProtocol> (); |
| 65 |
Simulator::Schedule (printTime, &Ipv4RoutingProtocol::PrintRoutingTable, rp, stream); |
| 66 |
Simulator::Schedule(printTime,&Ipv4RoutingHelper::PrintRoutingTableEvery,this, printTime, node, stream); |
| 67 |
} |
| 68 |
|
| 69 |
|
| 27 |
} // namespace ns3 |
70 |
} // namespace ns3 |