build a set of SimpleNetDevice objects More...
#include "simple-net-device-helper.h"
Public Member Functions | |
SimpleNetDeviceHelper () | |
Construct a SimpleNetDeviceHelper. More... | |
virtual | ~SimpleNetDeviceHelper () |
NetDeviceContainer | Install (Ptr< Node > node) const |
This method creates an ns3::SimpleChannel with the attributes configured by SimpleNetDeviceHelper::SetChannelAttribute, an ns3::SimpleNetDevice with the attributes configured by SimpleNetDeviceHelper::SetDeviceAttribute and then adds the device to the node and attaches the channel to the device. More... | |
NetDeviceContainer | Install (Ptr< Node > node, Ptr< SimpleChannel > channel) const |
This method creates an ns3::SimpleNetDevice with the attributes configured by SimpleNetDeviceHelper::SetDeviceAttribute and then adds the device to the node and attaches the provided channel to the device. More... | |
NetDeviceContainer | Install (const NodeContainer &c) const |
This method creates an ns3::SimpleChannel with the attributes configured by SimpleNetDeviceHelper::SetChannelAttribute. More... | |
NetDeviceContainer | Install (const NodeContainer &c, Ptr< SimpleChannel > channel) const |
For each Ptr<node> in the provided container, this method creates an ns3::SimpleNetDevice (with the attributes configured by SimpleNetDeviceHelper::SetDeviceAttribute); adds the device to the node; and attaches the provided channel to the device. More... | |
void | SetChannel (std::string type, std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue()) |
Each net device must have a channel to pass packets through. More... | |
void | SetChannelAttribute (std::string n1, const AttributeValue &v1) |
void | SetDeviceAttribute (std::string n1, const AttributeValue &v1) |
void | SetNetDevicePointToPointMode (bool pointToPointMode) |
SimpleNetDevice is Broadcast capable and ARP needing. More... | |
void | SetQueue (std::string type, std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue()) |
Each net device must have a queue to pass packets through. More... | |
Private Member Functions | |
Ptr< NetDevice > | InstallPriv (Ptr< Node > node, Ptr< SimpleChannel > channel) const |
This method creates an ns3::SimpleNetDevice with the attributes configured by SimpleNetDeviceHelper::SetDeviceAttribute and then adds the device to the node and attaches the provided channel to the device. More... | |
Private Attributes | |
ObjectFactory | m_channelFactory |
Channel factory. More... | |
ObjectFactory | m_deviceFactory |
NetDevice factory. More... | |
bool | m_pointToPointMode |
Install PointToPoint SimpleNetDevice or Broadcast ones. More... | |
ObjectFactory | m_queueFactory |
Queue factory. More... | |
build a set of SimpleNetDevice objects
Definition at line 36 of file simple-net-device-helper.h.
ns3::SimpleNetDeviceHelper::SimpleNetDeviceHelper | ( | ) |
Construct a SimpleNetDeviceHelper.
Definition at line 42 of file simple-net-device-helper.cc.
References m_channelFactory, m_deviceFactory, m_pointToPointMode, m_queueFactory, and ns3::ObjectFactory::SetTypeId().
|
inlinevirtual |
Definition at line 43 of file simple-net-device-helper.h.
NetDeviceContainer ns3::SimpleNetDeviceHelper::Install | ( | Ptr< Node > | node | ) | const |
This method creates an ns3::SimpleChannel with the attributes configured by SimpleNetDeviceHelper::SetChannelAttribute, an ns3::SimpleNetDevice with the attributes configured by SimpleNetDeviceHelper::SetDeviceAttribute and then adds the device to the node and attaches the channel to the device.
node | The node to install the device in |
Definition at line 99 of file simple-net-device-helper.cc.
References third::channel, ns3::ObjectFactory::Create(), and m_channelFactory.
Referenced by ns3::olsr::Bug780Test::CreateNodes(), ns3::olsr::HelloRegressionTest::CreateNodes(), ns3::olsr::TcRegressionTest::CreateNodes(), DhcpTestCase::DoRun(), Ipv6ForwardingTest::DoRun(), Ipv4StaticRoutingSlash32TestCase::DoRun(), Ipv6RawSocketImplTest::DoRun(), Ipv4RawSocketImplTest::DoRun(), Ipv4FragmentationTest::DoRun(), UdpSocketImplTest::DoRun(), ns3::TcpGeneralTest::DoRun(), Udp6SocketImplTest::DoRun(), Ipv4DynamicGlobalRoutingTestCase::DoRun(), Ipv4GlobalRoutingSlash32TestCase::DoRun(), and Install().
NetDeviceContainer ns3::SimpleNetDeviceHelper::Install | ( | Ptr< Node > | node, |
Ptr< SimpleChannel > | channel | ||
) | const |
This method creates an ns3::SimpleNetDevice with the attributes configured by SimpleNetDeviceHelper::SetDeviceAttribute and then adds the device to the node and attaches the provided channel to the device.
node | The node to install the device in |
channel | The channel to attach to the device. |
Definition at line 106 of file simple-net-device-helper.cc.
References third::channel, and InstallPriv().
NetDeviceContainer ns3::SimpleNetDeviceHelper::Install | ( | const NodeContainer & | c | ) | const |
This method creates an ns3::SimpleChannel with the attributes configured by SimpleNetDeviceHelper::SetChannelAttribute.
For each Ptr<node> in the provided container: it creates an ns3::SimpleNetDevice (with the attributes configured by SimpleNetDeviceHelper::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 112 of file simple-net-device-helper.cc.
References third::channel, ns3::ObjectFactory::Create(), Install(), and m_channelFactory.
NetDeviceContainer ns3::SimpleNetDeviceHelper::Install | ( | const NodeContainer & | c, |
Ptr< SimpleChannel > | channel | ||
) | const |
For each Ptr<node> in the provided container, this method creates an ns3::SimpleNetDevice (with the attributes configured by SimpleNetDeviceHelper::SetDeviceAttribute); adds the device to the node; and attaches the provided channel to the device.
c | The NodeContainer holding the nodes to be changed. |
channel | The channel to attach to the devices. |
Definition at line 120 of file simple-net-device-helper.cc.
References ns3::NetDeviceContainer::Add(), ns3::NodeContainer::Begin(), third::channel, ns3::NodeContainer::End(), and InstallPriv().
|
private |
This method creates an ns3::SimpleNetDevice with the attributes configured by SimpleNetDeviceHelper::SetDeviceAttribute and then adds the device to the node and attaches the provided channel to the device.
node | The node to install the device in |
channel | The channel to attach to the device. |
Definition at line 133 of file simple-net-device-helper.cc.
References ns3::Node::AddDevice(), ns3::Mac48Address::Allocate(), third::channel, ns3::ObjectFactory::Create(), m_deviceFactory, m_pointToPointMode, m_queueFactory, and NS_ASSERT_MSG().
Referenced by Install().
void ns3::SimpleNetDeviceHelper::SetChannel | ( | std::string | type, |
std::string | n1 = "" , |
||
const AttributeValue & | v1 = EmptyAttributeValue () , |
||
std::string | n2 = "" , |
||
const AttributeValue & | v2 = EmptyAttributeValue () , |
||
std::string | n3 = "" , |
||
const AttributeValue & | v3 = EmptyAttributeValue () , |
||
std::string | n4 = "" , |
||
const AttributeValue & | v4 = EmptyAttributeValue () |
||
) |
Each net device must have a channel to pass packets through.
This method allows one to set the type of the channel that is automatically created when the device is created and attached to a node.
type | the type of queue |
n1 | the name of the attribute to set on the queue |
v1 | the value of the attribute to set on the queue |
n2 | the name of the attribute to set on the queue |
v2 | the value of the attribute to set on the queue |
n3 | the name of the attribute to set on the queue |
v3 | the value of the attribute to set on the queue |
n4 | the name of the attribute to set on the queue |
v4 | the value of the attribute to set on the queue |
Set the type of channel to create and associated to each SimpleNetDevice created through SimpleNetDeviceHelper::Install.
Definition at line 67 of file simple-net-device-helper.cc.
References m_channelFactory, ns3::ObjectFactory::Set(), and ns3::ObjectFactory::SetTypeId().
void ns3::SimpleNetDeviceHelper::SetChannelAttribute | ( | 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::CsmaChannel created by SimpleNetDeviceHelper::Install
Definition at line 87 of file simple-net-device-helper.cc.
References m_channelFactory, and ns3::ObjectFactory::Set().
Referenced by ns3::olsr::Bug780Test::CreateNodes(), ns3::olsr::HelloRegressionTest::CreateNodes(), ns3::olsr::TcRegressionTest::CreateNodes(), and DhcpTestCase::DoRun().
void ns3::SimpleNetDeviceHelper::SetDeviceAttribute | ( | 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::SimpleNetDevice created by SimpleNetDeviceHelper::Install
Definition at line 81 of file simple-net-device-helper.cc.
References m_deviceFactory, and ns3::ObjectFactory::Set().
Referenced by ns3::olsr::Bug780Test::CreateNodes(), ns3::olsr::HelloRegressionTest::CreateNodes(), ns3::olsr::TcRegressionTest::CreateNodes(), and DhcpTestCase::DoRun().
void ns3::SimpleNetDeviceHelper::SetNetDevicePointToPointMode | ( | bool | pointToPointMode | ) |
SimpleNetDevice is Broadcast capable and ARP needing.
This function limits the number of SimpleNetDevices on one channel to two, disables Broadcast and ARP and enables PointToPoint mode.
pointToPointMode | True for PointToPoint SimpleNetDevice |
Definition at line 93 of file simple-net-device-helper.cc.
References m_pointToPointMode.
Referenced by Ipv6ForwardingTest::DoRun(), Ipv6RawSocketImplTest::DoRun(), Ipv4RawSocketImplTest::DoRun(), Ipv4FragmentationTest::DoRun(), UdpSocketImplTest::DoRun(), ns3::TcpGeneralTest::DoRun(), Udp6SocketImplTest::DoRun(), Ipv4DynamicGlobalRoutingTestCase::DoRun(), LinkTest::DoSetup(), and TwoLinkTest::DoSetup().
void ns3::SimpleNetDeviceHelper::SetQueue | ( | std::string | type, |
std::string | n1 = "" , |
||
const AttributeValue & | v1 = EmptyAttributeValue () , |
||
std::string | n2 = "" , |
||
const AttributeValue & | v2 = EmptyAttributeValue () , |
||
std::string | n3 = "" , |
||
const AttributeValue & | v3 = EmptyAttributeValue () , |
||
std::string | n4 = "" , |
||
const AttributeValue & | v4 = EmptyAttributeValue () |
||
) |
Each net device must have a queue to pass packets through.
This method allows one to set the type of the queue that is automatically created when the device is created and attached to a node.
type | the type of queue |
n1 | the name of the attribute to set on the queue |
v1 | the value of the attribute to set on the queue |
n2 | the name of the attribute to set on the queue |
v2 | the value of the attribute to set on the queue |
n3 | the name of the attribute to set on the queue |
v3 | the value of the attribute to set on the queue |
n4 | the name of the attribute to set on the queue |
v4 | the value of the attribute to set on the queue |
Set the type of queue to create and associated to each SimpleNetDevice created through SimpleNetDeviceHelper::Install.
Definition at line 51 of file simple-net-device-helper.cc.
References ns3::QueueBase::AppendItemTypeIfNotPresent(), m_queueFactory, ns3::ObjectFactory::Set(), and ns3::ObjectFactory::SetTypeId().
|
private |
Channel factory.
Definition at line 183 of file simple-net-device-helper.h.
Referenced by Install(), SetChannel(), SetChannelAttribute(), and SimpleNetDeviceHelper().
|
private |
NetDevice factory.
Definition at line 182 of file simple-net-device-helper.h.
Referenced by InstallPriv(), SetDeviceAttribute(), and SimpleNetDeviceHelper().
|
private |
Install PointToPoint SimpleNetDevice or Broadcast ones.
Definition at line 184 of file simple-net-device-helper.h.
Referenced by InstallPriv(), SetNetDevicePointToPointMode(), and SimpleNetDeviceHelper().
|
private |
Queue factory.
Definition at line 181 of file simple-net-device-helper.h.
Referenced by InstallPriv(), SetQueue(), and SimpleNetDeviceHelper().