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

A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes. More...

#include <packet-sink-helper.h>

Public Member Functions

 PacketSinkHelper (std::string protocol, Address address)
 
ApplicationContainer Install (NodeContainer c) const
 
ApplicationContainer Install (Ptr< Node > node) const
 
ApplicationContainer Install (std::string nodeName) const
 
void SetAttribute (std::string name, const AttributeValue &value)
 

Private Member Functions

Ptr< ApplicationInstallPriv (Ptr< Node > node) const
 

Private Attributes

ObjectFactory m_factory
 

Detailed Description

A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes.

Definition at line 34 of file packet-sink-helper.h.

Constructor & Destructor Documentation

ns3::PacketSinkHelper::PacketSinkHelper ( std::string  protocol,
Address  address 
)

Create a PacketSinkHelper to make it easier to work with PacketSinkApplications

Parameters
protocolthe name of the protocol to use to receive traffic This string identifies the socket factory type used to create sockets for the applications. A typical value would be ns3::TcpSocketFactory.
addressthe address of the sink,

Definition at line 28 of file packet-sink-helper.cc.

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

Member Function Documentation

ApplicationContainer ns3::PacketSinkHelper::Install ( NodeContainer  c) const

Install an ns3::PacketSinkApplication on each node of the input container configured with all the attributes set with SetAttribute.

Parameters
cNodeContainer of the set of nodes on which a PacketSinkApplication will be installed.

Definition at line 55 of file packet-sink-helper.cc.

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

Referenced by ns3::aodv::Bug772ChainTest::CreateDevices(), ns3::LenaFdTbfqFfMacSchedulerTestCase1::DoRun(), ns3::LenaTdTbfqFfMacSchedulerTestCase1::DoRun(), WifiMsduAggregatorThroughputTest::DoRun(), ns3::LenaPssFfMacSchedulerTestCase1::DoRun(), StaticRoutingSlash32TestCase::DoRun(), Ns3TcpNoDelayTestCase::DoRun(), Ns3TcpSocketTestCase1::DoRun(), NscTcpLossTestCase1::DoRun(), CsmaBridgeTestCase::DoRun(), ns3::LteX2HandoverTestCase::DoRun(), Ns3TcpLossTestCase::DoRun(), Ns3TcpStateTestCase::DoRun(), ns3::LenaPssFfMacSchedulerTestCase2::DoRun(), ns3::LenaTdTbfqFfMacSchedulerTestCase2::DoRun(), ns3::LenaFdTbfqFfMacSchedulerTestCase2::DoRun(), ns3::EpcS1uDlTestCase::DoRun(), Ns3TcpInteroperabilityTestCase::DoRun(), ns3::LteEpcE2eDataTestCase::DoRun(), ns3::BriteTopologyFunctionTestCase::DoRun(), Ns3TcpSocketTestCase2::DoRun(), NscTcpLossTestCase2::DoRun(), CsmaBroadcastTestCase::DoRun(), Ns3TcpCwndTestCase1::DoRun(), ns3::EpcS1uUlTestCase::DoRun(), CsmaMulticastTestCase::DoRun(), GlobalRoutingSlash32TestCase::DoRun(), Ns3TcpCwndTestCase2::DoRun(), CsmaOneSubnetTestCase::DoRun(), CsmaPacketSocketTestCase::DoRun(), CsmaPingTestCase::DoRun(), CsmaRawIpSocketTestCase::DoRun(), and CsmaStarTestCase::DoRun().

ApplicationContainer ns3::PacketSinkHelper::Install ( Ptr< Node node) const

Install an ns3::PacketSinkApplication on each node of the input container configured with all the attributes set with SetAttribute.

Parameters
nodeThe node on which a PacketSinkApplication will be installed.

Definition at line 42 of file packet-sink-helper.cc.

References InstallPriv().

ApplicationContainer ns3::PacketSinkHelper::Install ( std::string  nodeName) const

Install an ns3::PacketSinkApplication on each node of the input container configured with all the attributes set with SetAttribute.

Parameters
nodeNameThe name of the node on which a PacketSinkApplication will be installed.

Definition at line 48 of file packet-sink-helper.cc.

References InstallPriv().

Ptr< Application > ns3::PacketSinkHelper::InstallPriv ( Ptr< Node node) const
private

Definition at line 67 of file packet-sink-helper.cc.

References ns3::Node::AddApplication(), and ns3::ObjectFactory::Create().

Referenced by Install().

void ns3::PacketSinkHelper::SetAttribute ( std::string  name,
const AttributeValue value 
)

Helper function used to set the underlying application attributes.

Parameters
namethe name of the application attribute to set
valuethe value of the application attribute to set

Definition at line 36 of file packet-sink-helper.cc.

References ns3::ObjectFactory::Set().


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