aggregate IP/TCP/UDP functionality to existing Nodes. More...
#include <internet-stack-helper.h>
Classes | |
struct | Trace |
Public Member Functions | |
InternetStackHelper (void) | |
void | Install (Ptr< Node > node) const |
void | Install (NodeContainer c) const |
void | SetNscStack (std::string soname) |
Enable or disable use of the Network Simulation Cradle stack. | |
Static Public Member Functions | |
static void | EnableAscii (std::ostream &os, NodeContainer n) |
static void | EnableAsciiAll (std::ostream &os) |
static void | EnablePcapAll (std::string filename) |
Static Private Member Functions | |
static void | Cleanup (void) |
static void | LogRxIp (std::string context, Ptr< const Packet > packet, uint32_t deviceId) |
static void | LogTxIp (std::string context, Ptr< const Packet > packet, uint32_t deviceId) |
static Ptr< PcapWriter > | GetStream (uint32_t nodeId, uint32_t interfaceId) |
static void | AsciiDropEvent (std::ostream *os, std::string path, Ptr< const Packet > packet) |
static uint32_t | GetNodeIndex (std::string context) |
Private Attributes | |
std::string | m_nscLibrary |
Static Private Attributes | |
static std::string | m_pcapBaseFilename |
static std::vector< Trace > | m_traces |
aggregate IP/TCP/UDP functionality to existing Nodes.
Definition at line 34 of file internet-stack-helper.h.
ns3::InternetStackHelper::InternetStackHelper | ( | void | ) |
Definition at line 31 of file internet-stack-helper.cc.
References m_pcapBaseFilename, and m_traces.
void ns3::InternetStackHelper::AsciiDropEvent | ( | std::ostream * | os, | |
std::string | path, | |||
Ptr< const Packet > | packet | |||
) | [static, private] |
Definition at line 178 of file internet-stack-helper.cc.
void ns3::InternetStackHelper::Cleanup | ( | void | ) | [static, private] |
Definition at line 36 of file internet-stack-helper.cc.
void ns3::InternetStackHelper::EnableAscii | ( | std::ostream & | os, | |
NodeContainer | n | |||
) | [static] |
os | output stream | |
n | node container |
Enable ascii output on these drop traces, for each node in the NodeContainer.. /NodeList/[i]/$ns3ArpL3Protocol/Drop /NodeList/[i]/$ns3Ipv4L3Protocol/Drop
Definition at line 89 of file internet-stack-helper.cc.
Referenced by EnablePcapAll().
void ns3::InternetStackHelper::EnableAsciiAll | ( | std::ostream & | os | ) | [static] |
os | output stream |
Enable ascii output on these drop traces, for all nodes. /NodeList/[i]/$ns3ArpL3Protocol/Drop /NodeList/[i]/$ns3Ipv4L3Protocol/Drop
Definition at line 106 of file internet-stack-helper.cc.
void ns3::InternetStackHelper::EnablePcapAll | ( | std::string | filename | ) | [static] |
Enable pcap output on each protocol instance which is of the ns3::Ipv4L3Protocol type. Both Tx and Rx events will be logged.
filename | filename prefix to use for pcap files. |
Definition at line 112 of file internet-stack-helper.cc.
References EnableAscii(), and ns3::NodeContainer::GetGlobal().
uint32_t ns3::InternetStackHelper::GetNodeIndex | ( | std::string | context | ) | [static, private] |
Definition at line 124 of file internet-stack-helper.cc.
Referenced by GetStream(), and LogRxIp().
Ptr< PcapWriter > ns3::InternetStackHelper::GetStream | ( | uint32_t | nodeId, | |
uint32_t | interfaceId | |||
) | [static, private] |
Definition at line 154 of file internet-stack-helper.cc.
References GetNodeIndex().
Referenced by LogRxIp().
void ns3::InternetStackHelper::Install | ( | NodeContainer | c | ) | const |
For each node in the input container, aggregate implementations of the ns3::Ipv4, ns3::Udp, and, ns3::Tcp classes. The program will assert if this method is called on a container with a node that already has an Ipv4 object aggregated to it.
c | NodeContainer that holds the set of nodes on which to install the new stacks. |
Definition at line 57 of file internet-stack-helper.cc.
References m_nscLibrary.
Aggregate implementations of the ns3::Ipv4, ns3::Udp, and ns3::Tcp classes onto the provided node. This method will assert if called on a node that already has an Ipv4 object aggregated to it.
node | The node on which to install the stack. |
Definition at line 66 of file internet-stack-helper.cc.
void ns3::InternetStackHelper::LogRxIp | ( | std::string | context, | |
Ptr< const Packet > | packet, | |||
uint32_t | deviceId | |||
) | [static, private] |
Definition at line 147 of file internet-stack-helper.cc.
References GetNodeIndex(), and GetStream().
void ns3::InternetStackHelper::LogTxIp | ( | std::string | context, | |
Ptr< const Packet > | packet, | |||
uint32_t | deviceId | |||
) | [static, private] |
Definition at line 140 of file internet-stack-helper.cc.
void ns3::InternetStackHelper::SetNscStack | ( | std::string | soname | ) |
Enable or disable use of the Network Simulation Cradle stack.
Give the NSC stack a shared library file name to use when creating the statck implementation. By providing a non-empty string as a parameter, you select the NSC version of the stack. By providing an empty string, you select the ns-3 default version.
soname | name of the shared library with the nsc tcp stack to use, e.g. 'liblinux2.6.26.so'. |
Definition at line 51 of file internet-stack-helper.cc.
std::string ns3::InternetStackHelper::m_nscLibrary [private] |
Definition at line 107 of file internet-stack-helper.h.
Referenced by Install().
std::string ns3::InternetStackHelper::m_pcapBaseFilename [static, private] |
Definition at line 118 of file internet-stack-helper.h.
Referenced by InternetStackHelper().
std::vector< InternetStackHelper::Trace > ns3::InternetStackHelper::m_traces [static, private] |
Definition at line 120 of file internet-stack-helper.h.
Referenced by InternetStackHelper().