A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
packet-socket-helper.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2008 INRIA
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
7
*/
8
9
#include "
packet-socket-helper.h
"
10
11
#include "ns3/names.h"
12
#include "ns3/packet-socket-factory.h"
13
14
namespace
ns3
15
{
16
17
void
18
PacketSocketHelper::Install
(
NodeContainer
c
)
const
19
{
20
for
(
auto
i
=
c
.Begin();
i
!=
c
.End(); ++
i
)
21
{
22
Install
(*
i
);
23
}
24
}
25
26
void
27
PacketSocketHelper::Install
(
Ptr<Node>
node)
const
28
{
29
Ptr<PacketSocketFactory>
factory
=
CreateObject<PacketSocketFactory>
();
30
node->AggregateObject(
factory
);
31
}
32
33
void
34
PacketSocketHelper::Install
(std::string
nodeName
)
const
35
{
36
Ptr<Node>
node = Names::Find<Node>(
nodeName
);
37
Install
(node);
38
}
39
40
}
// namespace ns3
ns3::NodeContainer
keep track of a set of node pointers.
Definition
node-container.h:29
ns3::PacketSocketHelper::Install
void Install(std::string nodeName) const
Aggregate an instance of a ns3::PacketSocketFactory onto the provided node.
Definition
packet-socket-helper.cc:34
ns3::PacketSocketHelper::Install
void Install(Ptr< Node > node) const
Aggregate an instance of a ns3::PacketSocketFactory onto the provided node.
Definition
packet-socket-helper.cc:27
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
ptr.h:66
ns3::Create
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition
ptr.h:436
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
packet-socket-helper.h
src
network
helper
packet-socket-helper.cc
Generated on Mon Dec 15 2025 15:22:01 for ns-3 by
1.9.8