38 * |
39 * |
39 */ |
40 */ |
40 class LinuxStackHelper |
41 class LinuxStackHelper |
41 { |
42 { |
42 public: |
43 public: |
|
44 |
|
45 LinuxStackHelper (); |
|
46 ~LinuxStackHelper (); |
|
47 |
43 /** |
48 /** |
44 * Aggregate ns3::Ipv4Linux classe onto the provided node. |
49 * Aggregate ns3::Ipv4Linux classe onto the provided node. |
45 * This method will assert if called on a node that |
50 * This method will assert if called on a node that |
46 * already has an Ipv4 object aggregated to it. |
51 * already has an Ipv4 object aggregated to it. |
47 * |
52 * |
48 * \param nodeName The name of the node on which to install the stack. |
53 * \param nodeName The name of the node on which to install the stack. |
49 */ |
54 */ |
50 static void Install (std::string nodeName); |
55 void Install (std::string nodeName); |
51 |
56 |
52 /** |
57 /** |
53 * Aggregate ns3::Ipv4Linux classe onto the provided node. |
58 * Aggregate ns3::Ipv4Linux classe onto the provided node. |
54 * This method will assert if called on a node that |
59 * This method will assert if called on a node that |
55 * already has an Ipv4 object aggregated to it. |
60 * already has an Ipv4 object aggregated to it. |
56 * |
61 * |
57 * \param node The node on which to install the stack. |
62 * \param node The node on which to install the stack. |
58 */ |
63 */ |
59 static void Install (Ptr<Node> node); |
64 void Install (Ptr<Node> node); |
60 |
65 |
61 /** |
66 /** |
62 * Aggregate ns3::Ipv4Linux class onto the provided node. |
67 * Aggregate ns3::Ipv4Linux class onto the provided node. |
63 * This method will assert if called on a node that |
68 * This method will assert if called on a node that |
64 * already has an Ipv4 object aggregated to it. |
69 * already has an Ipv4 object aggregated to it. |
65 * |
70 * |
66 * \param c NodeContainer that holds the set of nodes on which to install the |
71 * \param c NodeContainer that holds the set of nodes on which to install the |
67 * new stacks. |
72 * new stacks. |
68 */ |
73 */ |
69 static void Install (NodeContainer c); |
74 void Install (NodeContainer c); |
70 |
75 |
71 /** |
76 /** |
72 * Aggregate ns3::Ipv4Linux to all nodes in the simulation |
77 * Aggregate ns3::Ipv4Linux to all nodes in the simulation |
73 */ |
78 */ |
74 static void InstallAll (void); |
79 void InstallAll (void); |
|
80 |
|
81 /** |
|
82 * \param routing a new routing helper |
|
83 * |
|
84 * Set the routing helper to use during Install. The routing |
|
85 * helper is really an object factory which is used to create |
|
86 * an object of type ns3::Ipv4RoutingProtocol per node. This routing |
|
87 * object is then associated to a single ns3::Ipv4 object through its |
|
88 * ns3::Ipv4::SetRoutingProtocol. |
|
89 */ |
|
90 void SetRoutingHelper (const Ipv4RoutingHelper &routing); |
75 |
91 |
76 /** |
92 /** |
77 * Configure Linux kernel parameters with traditional 'sysctl' interface. |
93 * Configure Linux kernel parameters with traditional 'sysctl' interface. |
78 * |
94 * |
79 * \param c NodeContainer that holds the set of nodes to configure this parameter. |
95 * \param c NodeContainer that holds the set of nodes to configure this parameter. |
114 * \param str a string for the command line argument of ip command. e.g., "route add 10.0.1.0/24 via 10.0.0.1" |
130 * \param str a string for the command line argument of ip command. e.g., "route add 10.0.1.0/24 via 10.0.0.1" |
115 */ |
131 */ |
116 static void RunIp (Ptr<Node> node, Time at, std::string str); |
132 static void RunIp (Ptr<Node> node, Time at, std::string str); |
117 |
133 |
118 private: |
134 private: |
|
135 void Initialize (); |
|
136 const Ipv4RoutingHelper *m_routing; |
119 static void SysctlGetCallback (Ptr<Node> node, std::string path, |
137 static void SysctlGetCallback (Ptr<Node> node, std::string path, |
120 void (*callback)(std::string, std::string)); |
138 void (*callback)(std::string, std::string)); |
121 |
139 |
122 |
140 |
123 }; |
141 }; |