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"
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< NetDevice > | InstallPriv (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 | |
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.
ns3::FdNetDeviceHelper::FdNetDeviceHelper | ( | ) |
Construct a FdNetDeviceHelper.
Definition at line 40 of file fd-net-device-helper.cc.
References m_deviceFactory, and ns3::ObjectFactory::SetTypeId().
|
inlineoverride |
Definition at line 53 of file fd-net-device-helper.h.
|
overrideprivatevirtual |
Enable ascii trace output on the indicated net device.
NetDevice-specific implementation mechanism for hooking the trace and writing to the trace file.
stream | The output stream object to use when logging ascii traces. |
prefix | Filename prefix to use for ascii trace files. |
nd | Net device for which you want to enable tracing. |
explicitFilename | Treat 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.
|
overrideprivatevirtual |
Enable pcap output on the indicated net device.
NetDevice-specific implementation mechanism for hooking the trace and writing to the trace file.
prefix | Filename prefix to use for pcap files. |
nd | Net device for which you want to enable tracing. |
promiscuous | If true capture all possible packets available at the device. |
explicitFilename | Treat 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.
|
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.
c | The NodeContainer holding the nodes to be changed. |
Definition at line 198 of file fd-net-device-helper.cc.
References ns3::NetDeviceContainer::Add(), ns3::NodeContainer::Begin(), ns3::NodeContainer::End(), and InstallPriv().
|
virtual |
This method creates a FdNetDevice and associates it to a node.
node | The node to install the device in |
Definition at line 185 of file fd-net-device-helper.cc.
References InstallPriv().
Referenced by ns3::EmuEpcHelper::EmuEpcHelper(), and ns3::EmuEpcHelper::AddEnb().
|
virtual |
This method creates a FdNetDevice and associates it to a node.
name | The name of the node to install the device in |
Definition at line 191 of file fd-net-device-helper.cc.
References InstallPriv().
This method creates an ns3::FdNetDevice and associates it to a node.
node | The node to install the device in |
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().
void ns3::FdNetDeviceHelper::SetAttribute | ( | std::string | n1, |
const AttributeValue & | v1 | ||
) |
n1 | the name of the attribute to set |
v1 | the 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().
void ns3::FdNetDeviceHelper::SetTypeId | ( | std::string | type | ) |
Set the TypeId of the Objects to be created by this helper.
[in] | type | The 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().
|
private |
factory for the NetDevices
Definition at line 142 of file fd-net-device-helper.h.
Referenced by FdNetDeviceHelper(), InstallPriv(), SetAttribute(), and SetTypeId().