A Discrete-Event Network Simulator
API
ns3::EmuFdNetDeviceHelper Class Reference

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

#include "emu-fd-net-device-helper.h"

+ Inheritance diagram for ns3::EmuFdNetDeviceHelper:
+ Collaboration diagram for ns3::EmuFdNetDeviceHelper:

Public Member Functions

 EmuFdNetDeviceHelper ()
 Construct a EmuFdNetDeviceHelper. More...
 
virtual ~EmuFdNetDeviceHelper ()
 
std::string GetDeviceName (void)
 Get the device name of this device. More...
 
void HostQdiscBypass (bool hostQdiscBypass)
 Request host qdisc bypass. More...
 
void SetDeviceName (std::string deviceName)
 Set the device name of this device. More...
 
void SetDpdkMode (int argc, char **argv)
 Set the device in DPDK mode. More...
 
- Public Member Functions inherited from ns3::FdNetDeviceHelper
 FdNetDeviceHelper ()
 Construct a FdNetDeviceHelper. More...
 
virtual ~FdNetDeviceHelper ()
 
virtual NetDeviceContainer Install (Ptr< Node > node) const
 This method creates a FdNetDevice and associates it to a node. More...
 
virtual NetDeviceContainer Install (std::string name) const
 This method creates a FdNetDevice and associates it to a node. More...
 
virtual NetDeviceContainer Install (const NodeContainer &c) const
 This method creates a FdNetDevice and associates it to a node. More...
 
void SetAttribute (std::string n1, const AttributeValue &v1)
 
void SetTypeId (std::string type)
 Set the TypeId of the Objects to be created by this helper. More...
 
- Public Member Functions inherited from ns3::PcapHelperForDevice
 PcapHelperForDevice ()
 Construct a PcapHelperForDevice. More...
 
virtual ~PcapHelperForDevice ()
 Destroy a PcapHelperForDevice. More...
 
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. More...
 
virtual ~AsciiTraceHelperForDevice ()
 Destroy an AsciiTraceHelperForDevice. More...
 
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
 Call out to a separate process running as suid root in order to get a raw socket. More...
 
Ptr< NetDeviceInstallPriv (Ptr< Node > node) const
 This method creates an ns3::FdNetDevice attached to a physical network interface. More...
 
virtual void SetFileDescriptor (Ptr< FdNetDevice > device) const
 Sets a file descriptor on the FileDescriptorNetDevice. More...
 

Protected Attributes

std::string m_deviceName
 The Unix/Linux name of the underlying device (e.g., eth0) More...
 
bool m_dpdkMode
 The DPDK mode of the device. More...
 
int m_ealArgc
 DPDK EAL arguments count. More...
 
char ** m_ealArgv
 DPDK EAL arguments list. More...
 
bool m_hostQdiscBypass
 

Detailed Description

build a set of FdNetDevice objects attached to a physical network interface

Definition at line 40 of file emu-fd-net-device-helper.h.

Constructor & Destructor Documentation

◆ EmuFdNetDeviceHelper()

ns3::EmuFdNetDeviceHelper::EmuFdNetDeviceHelper ( )

Construct a EmuFdNetDeviceHelper.

Definition at line 66 of file emu-fd-net-device-helper.cc.

References m_deviceName, m_dpdkMode, and m_hostQdiscBypass.

◆ ~EmuFdNetDeviceHelper()

virtual ns3::EmuFdNetDeviceHelper::~EmuFdNetDeviceHelper ( )
inlinevirtual

Definition at line 47 of file emu-fd-net-device-helper.h.

Member Function Documentation

◆ CreateFileDescriptor()

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

Call out to a separate process running as suid root in order to get a raw socket.

We do this to avoid having the entire simulation running as root.

Returns
the rawSocket number

Reimplemented in ns3::TapFdNetDeviceHelper, and ns3::PlanetLabFdNetDeviceHelper.

Definition at line 248 of file emu-fd-net-device-helper.cc.

References ns3::BufferToString(), EMU_MAGIC, NS_ASSERT_MSG, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, and NS_LOG_INFO.

Referenced by SetFileDescriptor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetDeviceName()

std::string ns3::EmuFdNetDeviceHelper::GetDeviceName ( void  )

Get the device name of this device.

Returns
The device name of this device.

Definition at line 102 of file emu-fd-net-device-helper.cc.

References m_deviceName.

◆ HostQdiscBypass()

void ns3::EmuFdNetDeviceHelper::HostQdiscBypass ( bool  hostQdiscBypass)

Request host qdisc bypass.

Parameters
hostQdiscBypassto enable host qdisc bypass

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

References m_hostQdiscBypass.

◆ InstallPriv()

Ptr< NetDevice > ns3::EmuFdNetDeviceHelper::InstallPriv ( Ptr< Node node) const
protectedvirtual

This method creates an ns3::FdNetDevice attached to a physical network interface.

Parameters
nodeThe node to install the device in
Returns
A container holding the added net device.

Reimplemented from ns3::FdNetDeviceHelper.

Reimplemented in ns3::TapFdNetDeviceHelper, and ns3::PlanetLabFdNetDeviceHelper.

Definition at line 108 of file emu-fd-net-device-helper.cc.

References ns3::FdNetDeviceHelper::InstallPriv(), and SetFileDescriptor().

+ Here is the call graph for this function:

◆ SetDeviceName()

void ns3::EmuFdNetDeviceHelper::SetDeviceName ( std::string  deviceName)

Set the device name of this device.

Parameters
deviceNameThe device name of this device.

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

References m_deviceName.

Referenced by ns3::EmuEpcHelper::AddEnb(), and ns3::EmuEpcHelper::EmuEpcHelper().

+ Here is the caller graph for this function:

◆ SetDpdkMode()

void ns3::EmuFdNetDeviceHelper::SetDpdkMode ( int  argc,
char **  argv 
)

Set the device in DPDK mode.

Parameters
argcDpdk EAL args count.
argvDpdk EAL args list.

Definition at line 85 of file emu-fd-net-device-helper.cc.

References m_dpdkMode, m_ealArgc, m_ealArgv, NS_FATAL_ERROR, NS_LOG_FUNCTION, NS_LOG_LOGIC, and ns3::FdNetDeviceHelper::SetTypeId().

+ Here is the call graph for this function:

◆ SetFileDescriptor()

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

Sets a file descriptor on the FileDescriptorNetDevice.

Reimplemented in ns3::TapFdNetDeviceHelper, and ns3::PlanetLabFdNetDeviceHelper.

Definition at line 117 of file emu-fd-net-device-helper.cc.

References CreateFileDescriptor(), m_deviceName, m_dpdkMode, m_ealArgc, m_ealArgv, m_hostQdiscBypass, NS_FATAL_ERROR, NS_LOG_ERROR, and NS_LOG_LOGIC.

Referenced by InstallPriv().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_deviceName

std::string ns3::EmuFdNetDeviceHelper::m_deviceName
protected

◆ m_dpdkMode

bool ns3::EmuFdNetDeviceHelper::m_dpdkMode
protected

The DPDK mode of the device.

Definition at line 111 of file emu-fd-net-device-helper.h.

Referenced by EmuFdNetDeviceHelper(), SetDpdkMode(), and SetFileDescriptor().

◆ m_ealArgc

int ns3::EmuFdNetDeviceHelper::m_ealArgc
protected

DPDK EAL arguments count.

Definition at line 116 of file emu-fd-net-device-helper.h.

Referenced by SetDpdkMode(), and SetFileDescriptor().

◆ m_ealArgv

char** ns3::EmuFdNetDeviceHelper::m_ealArgv
protected

DPDK EAL arguments list.

Definition at line 121 of file emu-fd-net-device-helper.h.

Referenced by SetDpdkMode(), and SetFileDescriptor().

◆ m_hostQdiscBypass

bool ns3::EmuFdNetDeviceHelper::m_hostQdiscBypass
protected

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