A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ns3::PlanetLabFdNetDeviceHelper Class Reference

build a set of FdNetDevice objects attached to a virtual TAP network interface More...

#include <planetlab-fd-net-device-helper.h>

+ Inheritance diagram for ns3::PlanetLabFdNetDeviceHelper:

Public Member Functions

 PlanetLabFdNetDeviceHelper ()
 
void SetTapIpAddress (Ipv4Address address)
 
void SetTapMask (Ipv4Mask mask)
 
- Public Member Functions inherited from ns3::EmuFdNetDeviceHelper
 EmuFdNetDeviceHelper ()
 
std::string GetDeviceName (void)
 
void SetDeviceName (std::string deviceName)
 
- Public Member Functions inherited from ns3::FdNetDeviceHelper
 FdNetDeviceHelper ()
 
virtual NetDeviceContainer Install (Ptr< Node > node) const
 
virtual NetDeviceContainer Install (std::string name) const
 
virtual NetDeviceContainer Install (const NodeContainer &c) const
 
void SetAttribute (std::string n1, const AttributeValue &v1)
 
- Public Member Functions inherited from ns3::PcapHelperForDevice
 PcapHelperForDevice ()
 Construct a PcapHelperForDevice.
 
virtual ~PcapHelperForDevice ()
 Destroy a PcapHelperForDevice.
 
void EnablePcap (std::string prefix, Ptr< NetDevice > nd, bool promiscuous=false, bool explicitFilename=false)
 Enable pcap output the indicated net device. More...
 
void EnablePcap (std::string prefix, std::string ndName, bool promiscuous=false, bool explicitFilename=false)
 Enable pcap output the indicated net device using a device previously named using the ns-3 object name service. More...
 
void EnablePcap (std::string prefix, NetDeviceContainer d, bool promiscuous=false)
 Enable pcap output on each device in the container which is of the appropriate type. More...
 
void EnablePcap (std::string prefix, NodeContainer n, bool promiscuous=false)
 Enable pcap output on each device (which is of the appropriate type) in the nodes provided in the container. More...
 
void EnablePcap (std::string prefix, uint32_t nodeid, uint32_t deviceid, bool promiscuous=false)
 Enable pcap output on the device specified by a global node-id (of a previously created node) and associated device-id. More...
 
void EnablePcapAll (std::string prefix, bool promiscuous=false)
 Enable pcap output on each device (which is of the appropriate type) in the set of all nodes created in the simulation. More...
 
- Public Member Functions inherited from ns3::AsciiTraceHelperForDevice
 AsciiTraceHelperForDevice ()
 Construct an AsciiTraceHelperForDevice.
 
virtual ~AsciiTraceHelperForDevice ()
 Destroy an AsciiTraceHelperForDevice.
 
void EnableAscii (std::string prefix, Ptr< NetDevice > nd, bool explicitFilename=false)
 Enable ascii trace output on the indicated net device. More...
 
void EnableAscii (Ptr< OutputStreamWrapper > stream, Ptr< NetDevice > nd)
 Enable ascii trace output on the indicated net device. More...
 
void EnableAscii (std::string prefix, std::string ndName, bool explicitFilename=false)
 Enable ascii trace output the indicated net device using a device previously named using the ns-3 object name service. More...
 
void EnableAscii (Ptr< OutputStreamWrapper > stream, std::string ndName)
 Enable ascii trace output the indicated net device using a device previously named using the ns-3 object name service. More...
 
void EnableAscii (std::string prefix, NetDeviceContainer d)
 Enable ascii trace output on each device in the container which is of the appropriate type. More...
 
void EnableAscii (Ptr< OutputStreamWrapper > stream, NetDeviceContainer d)
 Enable ascii trace output on each device in the container which is of the appropriate type. More...
 
void EnableAscii (std::string prefix, NodeContainer n)
 Enable ascii trace output on each device (which is of the appropriate type) in the nodes provided in the container. More...
 
void EnableAscii (Ptr< OutputStreamWrapper > stream, NodeContainer n)
 Enable ascii trace output on each device (which is of the appropriate type) in the nodes provided in the container. More...
 
void EnableAscii (std::string prefix, uint32_t nodeid, uint32_t deviceid, bool explicitFilename)
 Enable ascii trace output on the device specified by a global node-id (of a previously created node) and associated device-id. More...
 
void EnableAscii (Ptr< OutputStreamWrapper > stream, uint32_t nodeid, uint32_t deviceid)
 Enable ascii trace output on the device specified by a global node-id (of a previously created node) and associated device-id. More...
 
void EnableAsciiAll (std::string prefix)
 Enable ascii trace output on each device (which is of the appropriate type) in the set of all nodes created in the simulation. More...
 
void EnableAsciiAll (Ptr< OutputStreamWrapper > stream)
 Enable ascii trace output on each device (which is of the appropriate type) in the set of all nodes created in the simulation. More...
 

Protected Member Functions

virtual int CreateFileDescriptor (void) const
 
Ptr< NetDeviceInstallPriv (Ptr< Node > node) const
 
virtual void SetFileDescriptor (Ptr< FdNetDevice > device) const
 

Protected Attributes

Ipv4Address m_tapIp
 
Ipv4Mask m_tapMask
 
- Protected Attributes inherited from ns3::EmuFdNetDeviceHelper
std::string m_deviceName
 

Detailed Description

build a set of FdNetDevice objects attached to a virtual TAP network interface

Definition at line 43 of file planetlab-fd-net-device-helper.h.

Constructor & Destructor Documentation

ns3::PlanetLabFdNetDeviceHelper::PlanetLabFdNetDeviceHelper ( )

Construct a PlanetLabFdNetDeviceHelper.

Definition at line 67 of file planetlab-fd-net-device-helper.cc.

References m_tapIp, and m_tapMask.

Member Function Documentation

int ns3::PlanetLabFdNetDeviceHelper::CreateFileDescriptor ( void  ) const
protectedvirtual

Call out to a separate process running as suid root in order to create a TAP device and obtain the file descriptor associated to it.

Reimplemented from ns3::EmuFdNetDeviceHelper.

Definition at line 120 of file planetlab-fd-net-device-helper.cc.

References ns3::BufferToString(), ns3::Ipv4Mask::GetPrefixLength(), m_tapIp, m_tapMask, NS_ABORT_MSG_IF, NS_ASSERT_MSG, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, and NS_LOG_INFO.

Referenced by SetFileDescriptor().

void ns3::PlanetLabFdNetDeviceHelper::SetFileDescriptor ( Ptr< FdNetDevice device) const
protectedvirtual

Sets a file descriptor on the FileDescriptorNetDevice.

Reimplemented from ns3::EmuFdNetDeviceHelper.

Definition at line 107 of file planetlab-fd-net-device-helper.cc.

References CreateFileDescriptor(), and NS_LOG_LOGIC.

void ns3::PlanetLabFdNetDeviceHelper::SetTapIpAddress ( Ipv4Address  address)

Set the device IPv4 address.

Parameters
addressThe IPv4 address for the TAP device.

Definition at line 74 of file planetlab-fd-net-device-helper.cc.

References m_tapIp.

void ns3::PlanetLabFdNetDeviceHelper::SetTapMask ( Ipv4Mask  mask)

Set the network mask for the TAP device.

Parameters
maskThe network mask for the TAP device.

Definition at line 80 of file planetlab-fd-net-device-helper.cc.

References m_tapMask.

Member Data Documentation

Ipv4Address ns3::PlanetLabFdNetDeviceHelper::m_tapIp
protected

The IP address for the TAP device.

Definition at line 90 of file planetlab-fd-net-device-helper.h.

Referenced by CreateFileDescriptor(), PlanetLabFdNetDeviceHelper(), and SetTapIpAddress().

Ipv4Mask ns3::PlanetLabFdNetDeviceHelper::m_tapMask
protected

The network mask for the TAP device.

Definition at line 97 of file planetlab-fd-net-device-helper.h.

Referenced by CreateFileDescriptor(), PlanetLabFdNetDeviceHelper(), and SetTapMask().


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