ns-3 Direct Code Execution
API
ns3::LinuxStackHelper Class Reference

aggregate Ipv4Linux to nodes More...

#include <linux-stack-helper.h>

Public Member Functions

 LinuxStackHelper ()
 
 ~LinuxStackHelper ()
 
void Install (std::string nodeName)
 
void Install (Ptr< Node > node)
 
void Install (NodeContainer c)
 
void InstallAll (void)
 
void SetRoutingHelper (const Ipv4RoutingHelper &routing)
 
void SysctlSet (NodeContainer c, std::string path, std::string value)
 

Static Public Member Functions

static void PopulateRoutingTables ()
 
static void RunIp (Ptr< Node > node, Time at, std::string str)
 
static void SysctlGet (Ptr< Node > node, Time at, std::string path, void(*callback)(std::string, std::string))
 

Private Member Functions

void Initialize ()
 

Static Private Member Functions

static void SysctlGetCallback (Ptr< Node > node, std::string path, void(*callback)(std::string, std::string))
 

Private Attributes

const Ipv4RoutingHelper * m_routing
 

Detailed Description

aggregate Ipv4Linux to nodes

Today the first goal of the Ipv4Linux is to be able to use the standards NS-3 Helpers for two tasks: 1 - assign address to devices using Ipv4AddressHelper, 2 - create the static routes using Ipv4GlobalRoutingHelper

Definition at line 41 of file linux-stack-helper.h.

Constructor & Destructor Documentation

ns3::LinuxStackHelper::LinuxStackHelper ( )

Definition at line 33 of file linux-stack-helper.cc.

References Initialize().

+ Here is the call graph for this function:

ns3::LinuxStackHelper::~LinuxStackHelper ( )

Definition at line 51 of file linux-stack-helper.cc.

References m_routing.

Member Function Documentation

void ns3::LinuxStackHelper::Initialize ( )
private

Definition at line 41 of file linux-stack-helper.cc.

References SetRoutingHelper().

Referenced by LinuxStackHelper().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::LinuxStackHelper::Install ( std::string  nodeName)

Aggregate ns3::Ipv4Linux classe onto the provided node. This method will assert if called on a node that already has an Ipv4 object aggregated to it.

Parameters
nodeNameThe name of the node on which to install the stack.

Definition at line 78 of file linux-stack-helper.cc.

Referenced by Install(), and InstallAll().

+ Here is the caller graph for this function:

void ns3::LinuxStackHelper::Install ( Ptr< Node >  node)

Aggregate ns3::Ipv4Linux classe onto the provided node. This method will assert if called on a node that already has an Ipv4 object aggregated to it.

Parameters
nodeThe node on which to install the stack.

Definition at line 64 of file linux-stack-helper.cc.

References ns3::Ipv6Linux::InstallNode(), ns3::Ipv4Linux::InstallNode(), and m_routing.

+ Here is the call graph for this function:

void ns3::LinuxStackHelper::Install ( NodeContainer  c)

Aggregate ns3::Ipv4Linux class onto the provided node. This method will assert if called on a node that already has an Ipv4 object aggregated to it.

Parameters
cNodeContainer that holds the set of nodes on which to install the new stacks.

Definition at line 86 of file linux-stack-helper.cc.

References Install().

+ Here is the call graph for this function:

void ns3::LinuxStackHelper::InstallAll ( void  )

Aggregate ns3::Ipv4Linux to all nodes in the simulation

Definition at line 96 of file linux-stack-helper.cc.

References Install().

+ Here is the call graph for this function:

void ns3::LinuxStackHelper::PopulateRoutingTables ( )
static

Populate routing information to all the nodes in network from GlobalRoutingTable.

Limitation: 1) This method SHOULD call after Ipv4GlobalRoutingHelper::PopulateRoutingTables () so that LinuxStackHelper can obtain the route information. 2) This feature is only available for IPv4 route information. IPv6 is not implemented.

Definition at line 104 of file linux-stack-helper.cc.

References ns3::Ipv4Linux::PopulateRoutingTable().

+ Here is the call graph for this function:

void ns3::LinuxStackHelper::RunIp ( Ptr< Node >  node,
Time  at,
std::string  str 
)
static

Execute "ip" command (of Linux) on a specific node to configure the ip address/route/etc information.

Parameters
nodeThe node pointer Ptr<Node> to configure.
atthe delta from the begining of simulation to execute this command.
stra string for the command line argument of ip command. e.g., "route add 10.0.1.0/24 via 10.0.0.1"

Definition at line 121 of file linux-stack-helper.cc.

References ns3::DceApplicationHelper::Install(), ns3::DceApplicationHelper::ParseArguments(), ns3::DceApplicationHelper::ResetArguments(), ns3::DceApplicationHelper::SetBinary(), and ns3::DceApplicationHelper::SetStackSize().

Referenced by ns3::Ipv6Linux::AddAddress(), ns3::Ipv4Linux::AddAddress(), and ns3::Ipv4Linux::PopulateRoutingTable().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::LinuxStackHelper::SetRoutingHelper ( const Ipv4RoutingHelper &  routing)
Parameters
routinga new routing helper

Set the routing helper to use during Install. The routing helper is really an object factory which is used to create an object of type ns3::Ipv4RoutingProtocol per node. This routing object is then associated to a single ns3::Ipv4 object through its ns3::Ipv4::SetRoutingProtocol.

Definition at line 57 of file linux-stack-helper.cc.

References m_routing.

Referenced by Initialize().

+ Here is the caller graph for this function:

void ns3::LinuxStackHelper::SysctlGet ( Ptr< Node >  node,
Time  at,
std::string  path,
void(*)(std::string, std::string)  callback 
)
static

Obtain Linux kernel state with traditional 'sysctl' interface.

Parameters
nodeThe node pointer Ptr<Node> that will ask the status.
atthe delta from the begining of simulation to ask this query.
patha string value for sysctl parameter. it starts from '.' following the name of parameter. e.g., ".net.ipv4.conf.default.forwarding"
callbacka callback function to parse the result of sysctl query.

Definition at line 156 of file linux-stack-helper.cc.

References ns3::KernelSocketFdFactory::ScheduleTask(), and SysctlGetCallback().

+ Here is the call graph for this function:

void ns3::LinuxStackHelper::SysctlGetCallback ( Ptr< Node >  node,
std::string  path,
void(*)(std::string, std::string)  callback 
)
staticprivate

Definition at line 136 of file linux-stack-helper.cc.

Referenced by SysctlGet().

+ Here is the caller graph for this function:

void ns3::LinuxStackHelper::SysctlSet ( NodeContainer  c,
std::string  path,
std::string  value 
)

Configure Linux kernel parameters with traditional 'sysctl' interface.

Parameters
cNodeContainer that holds the set of nodes to configure this parameter.
patha string value for sysctl parameter. it starts from '.' following the name of parameter. e.g., ".net.ipv4.conf.default.forwarding"
valuea string value to set for sysctl parameter.

Definition at line 176 of file linux-stack-helper.cc.

References ns3::LinuxSocketFdFactory::Set().

+ Here is the call graph for this function:

Member Data Documentation

const Ipv4RoutingHelper* ns3::LinuxStackHelper::m_routing
private

Definition at line 136 of file linux-stack-helper.h.

Referenced by Install(), SetRoutingHelper(), and ~LinuxStackHelper().


The documentation for this class was generated from the following files: