A Discrete-Event Network Simulator
API
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"

+ Collaboration diagram for ns3::PacketSinkHelper:

Public Member Functions

 PacketSinkHelper (std::string protocol, Address address)
 Create a PacketSinkHelper to make it easier to work with PacketSinkApplications. More...
 
ApplicationContainer Install (NodeContainer c) const
 Install an ns3::PacketSinkApplication on each node of the input container configured with all the attributes set with SetAttribute. More...
 
ApplicationContainer Install (Ptr< Node > node) const
 Install an ns3::PacketSinkApplication on each node of the input container configured with all the attributes set with SetAttribute. More...
 
ApplicationContainer Install (std::string nodeName) const
 Install an ns3::PacketSinkApplication on each node of the input container configured with all the attributes set with SetAttribute. More...
 
void SetAttribute (std::string name, const AttributeValue &value)
 Helper function used to set the underlying application attributes. More...
 

Private Member Functions

Ptr< ApplicationInstallPriv (Ptr< Node > node) const
 Install an ns3::PacketSink on the node configured with all the attributes set with SetAttribute. More...
 

Private Attributes

ObjectFactory m_factory
 Object factory. More...
 

Detailed Description

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

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

Constructor & Destructor Documentation

◆ PacketSinkHelper()

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 first::address, m_factory, ns3::ObjectFactory::Set(), and ns3::ObjectFactory::SetTypeId().

+ Here is the call graph for this function:

Member Function Documentation

◆ Install() [1/3]

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

◆ Install() [2/3]

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.
Returns
Container of Ptr to the applications installed.

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

References InstallPriv().

+ Here is the call graph for this function:

◆ Install() [3/3]

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.
Returns
Container of Ptr to the applications installed.

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

References InstallPriv().

+ Here is the call graph for this function:

◆ InstallPriv()

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

Install an ns3::PacketSink on the node configured with all the attributes set with SetAttribute.

Parameters
nodeThe node on which an PacketSink will be installed.
Returns
Ptr to the application installed.

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

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

Referenced by Install().

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

◆ SetAttribute()

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 m_factory, and ns3::ObjectFactory::Set().

Referenced by BulkSendSeqTsSizeTestCase::DoRun(), and experiment().

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

Member Data Documentation

◆ m_factory

ObjectFactory ns3::PacketSinkHelper::m_factory
private

Object factory.

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

Referenced by PacketSinkHelper(), InstallPriv(), and SetAttribute().


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