A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::FdNetDeviceHelper Class Reference

build a set of FdNetDevice objects Normally we eschew multiple inheritance, however, the classes PcapUserHelperForDevice and AsciiTraceUserHelperForDevice are treated as "mixins". More...

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

+ Inheritance diagram for ns3::FdNetDeviceHelper:
+ Collaboration diagram for ns3::FdNetDeviceHelper:

Public Member Functions

 FdNetDeviceHelper ()
 Construct a FdNetDeviceHelper.
 
 ~FdNetDeviceHelper () override
 
virtual NetDeviceContainer Install (const NodeContainer &c) const
 This method creates a FdNetDevice and associates it to a node.
 
virtual NetDeviceContainer Install (Ptr< Node > node) const
 This method creates a FdNetDevice and associates it to a node.
 
virtual NetDeviceContainer Install (std::string name) const
 This method creates a FdNetDevice and associates it to a node.
 
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.
 
- Public Member Functions inherited from ns3::PcapHelperForDevice
 PcapHelperForDevice ()
 Construct a PcapHelperForDevice.
 
virtual ~PcapHelperForDevice ()
 Destroy a PcapHelperForDevice.
 
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.
 
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.
 
void EnablePcap (std::string prefix, Ptr< NetDevice > nd, bool promiscuous=false, bool explicitFilename=false)
 Enable pcap output the indicated net device.
 
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.
 
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.
 
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.
 
virtual void EnablePcapInternal (std::string prefix, Ptr< NetDevice > nd, bool promiscuous, bool explicitFilename)=0
 Enable pcap output the indicated net device.
 
- Public Member Functions inherited from ns3::AsciiTraceHelperForDevice
 AsciiTraceHelperForDevice ()
 Construct an AsciiTraceHelperForDevice.
 
virtual ~AsciiTraceHelperForDevice ()
 Destroy an AsciiTraceHelperForDevice.
 
void EnableAscii (Ptr< OutputStreamWrapper > stream, NetDeviceContainer d)
 Enable ascii trace output on each device in the container which is of the appropriate type.
 
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.
 
void EnableAscii (Ptr< OutputStreamWrapper > stream, Ptr< NetDevice > nd)
 Enable ascii trace output on the indicated net device.
 
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.
 
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.
 
void EnableAscii (std::string prefix, NetDeviceContainer d)
 Enable ascii trace output on each device in the container which is of the appropriate type.
 
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.
 
void EnableAscii (std::string prefix, Ptr< NetDevice > nd, bool explicitFilename=false)
 Enable ascii trace output on the indicated net device.
 
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.
 
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.
 
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.
 
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.
 
virtual void EnableAsciiInternal (Ptr< OutputStreamWrapper > stream, std::string prefix, Ptr< NetDevice > nd, bool explicitFilename)=0
 Enable ascii trace output on the indicated net device.
 

Protected Member Functions

virtual Ptr< NetDeviceInstallPriv (Ptr< Node > node) const
 This method creates an ns3::FdNetDevice and associates it to a node.
 

Private Member Functions

void EnableAsciiInternal (Ptr< OutputStreamWrapper > stream, std::string prefix, Ptr< NetDevice > nd, bool explicitFilename) override
 Enable ascii trace output on the indicated net device.
 
void EnablePcapInternal (std::string prefix, Ptr< NetDevice > nd, bool promiscuous, bool explicitFilename) override
 Enable pcap output on the indicated net device.
 

Private Attributes

ObjectFactory m_deviceFactory
 factory for the NetDevices
 

Detailed Description

build a set of FdNetDevice objects Normally we eschew multiple inheritance, however, the classes PcapUserHelperForDevice and AsciiTraceUserHelperForDevice are treated as "mixins".

A mixin is a self-contained class that encapsulates a general attribute or a set of functionality that may be of interest to many other classes.

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

Constructor & Destructor Documentation

◆ FdNetDeviceHelper()

ns3::FdNetDeviceHelper::FdNetDeviceHelper ( )

Construct a FdNetDeviceHelper.

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

References m_deviceFactory, and ns3::ObjectFactory::SetTypeId().

+ Here is the call graph for this function:

◆ ~FdNetDeviceHelper()

ns3::FdNetDeviceHelper::~FdNetDeviceHelper ( )
inlineoverride

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

Member Function Documentation

◆ EnableAsciiInternal()

void ns3::FdNetDeviceHelper::EnableAsciiInternal ( Ptr< OutputStreamWrapper stream,
std::string  prefix,
Ptr< NetDevice nd,
bool  explicitFilename 
)
overrideprivatevirtual

Enable ascii trace output on the indicated net device.

NetDevice-specific implementation mechanism for hooking the trace and writing to the trace file.

Parameters
streamThe output stream object to use when logging ascii traces.
prefixFilename prefix to use for ascii trace files.
ndNet device for which you want to enable tracing.
explicitFilenameTreat the prefix as an explicit filename if true

Implements ns3::AsciiTraceHelperForDevice.

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

References ns3::Config::Connect(), ns3::AsciiTraceHelper::CreateFileStream(), ns3::AsciiTraceHelper::DefaultReceiveSinkWithContext(), ns3::Packet::EnablePrinting(), ns3::AsciiTraceHelper::GetFilenameFromDevice(), ns3::AsciiTraceHelper::HookDefaultReceiveSinkWithoutContext(), ns3::MakeBoundCallback(), and NS_LOG_INFO.

+ Here is the call graph for this function:

◆ EnablePcapInternal()

void ns3::FdNetDeviceHelper::EnablePcapInternal ( std::string  prefix,
Ptr< NetDevice nd,
bool  promiscuous,
bool  explicitFilename 
)
overrideprivatevirtual

Enable pcap output on the indicated net device.

NetDevice-specific implementation mechanism for hooking the trace and writing to the trace file.

Parameters
prefixFilename prefix to use for pcap files.
ndNet device for which you want to enable tracing.
promiscuousIf true capture all possible packets available at the device.
explicitFilenameTreat the prefix as an explicit filename if true

Implements ns3::PcapHelperForDevice.

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

References ns3::PcapHelper::CreateFile(), ns3::PcapHelper::DLT_EN10MB, ns3::PcapHelper::GetFilenameFromDevice(), ns3::PcapHelper::HookDefaultSink(), and NS_LOG_INFO.

+ Here is the call graph for this function:

◆ Install() [1/3]

NetDeviceContainer ns3::FdNetDeviceHelper::Install ( const NodeContainer c) const
virtual

This method creates a FdNetDevice and associates it to a node.

For each Ptr<node> in the provided container: it creates an ns3::FdNetDevice (with the attributes configured by FdNetDeviceHelper::SetDeviceAttribute); adds the device to the node; and attaches the channel to the device.

Parameters
cThe NodeContainer holding the nodes to be changed.
Returns
A container holding the added net devices.

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

References ns3::NetDeviceContainer::Add(), ns3::NodeContainer::Begin(), ns3::NodeContainer::End(), and InstallPriv().

+ Here is the call graph for this function:

◆ Install() [2/3]

NetDeviceContainer ns3::FdNetDeviceHelper::Install ( Ptr< Node node) const
virtual

This method creates a FdNetDevice and associates it to a node.

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

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

References InstallPriv().

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

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

◆ Install() [3/3]

NetDeviceContainer ns3::FdNetDeviceHelper::Install ( std::string  name) const
virtual

This method creates a FdNetDevice and associates it to a node.

Parameters
nameThe name of the node to install the device in
Returns
A container holding the added net device.

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

References InstallPriv().

+ Here is the call graph for this function:

◆ InstallPriv()

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

This method creates an ns3::FdNetDevice and associates it to a node.

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

Reimplemented in ns3::NetmapNetDeviceHelper, ns3::DpdkNetDeviceHelper, ns3::EmuFdNetDeviceHelper, and ns3::TapFdNetDeviceHelper.

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

References ns3::Mac48Address::Allocate(), ns3::ObjectFactory::Create(), and m_deviceFactory.

Referenced by Install(), ns3::NetmapNetDeviceHelper::InstallPriv(), ns3::DpdkNetDeviceHelper::InstallPriv(), ns3::EmuFdNetDeviceHelper::InstallPriv(), and ns3::TapFdNetDeviceHelper::InstallPriv().

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

◆ SetAttribute()

void ns3::FdNetDeviceHelper::SetAttribute ( std::string  n1,
const AttributeValue v1 
)
Parameters
n1the name of the attribute to set
v1the value of the attribute to set

Set these attributes on each ns3::FdNetDevice created by FdNetDeviceHelper::Install

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

References m_deviceFactory, NS_LOG_FUNCTION, and ns3::ObjectFactory::Set().

+ Here is the call graph for this function:

◆ SetTypeId()

void ns3::FdNetDeviceHelper::SetTypeId ( std::string  type)

Set the TypeId of the Objects to be created by this helper.

Parameters
[in]typeThe TypeId of the object to instantiate.

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

References m_deviceFactory, and ns3::ObjectFactory::SetTypeId().

Referenced by ns3::DpdkNetDeviceHelper::DpdkNetDeviceHelper(), and ns3::NetmapNetDeviceHelper::NetmapNetDeviceHelper().

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

Member Data Documentation

◆ m_deviceFactory

ObjectFactory ns3::FdNetDeviceHelper::m_deviceFactory
private

factory for the NetDevices

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

Referenced by FdNetDeviceHelper(), InstallPriv(), SetAttribute(), and SetTypeId().


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