A Discrete-Event Network Simulator
QKDNetSim v2.0 (NS-3 v3.41) @ (+)
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
w
Enumerator
a
b
c
d
e
f
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
Related Functions
:
a
b
c
d
e
g
h
i
j
l
m
n
o
p
q
r
s
t
u
w
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
Enumerations
Enumerator
c
e
i
l
o
r
s
t
v
Macros
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
ping-helper.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2022 Universita' di Firenze, Italy
3
* Copyright (c) 2008-2009 Strasbourg University (original Ping6 helper)
4
* Copyright (c) 2008 INRIA (original v4Ping helper)
5
*
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License version 2 as
8
* published by the Free Software Foundation;
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
*
19
* Author: Tommaso Pecorella <tommaso.pecorella@unifi.it>
20
*
21
* Derived from original v4Ping helper (author: Mathieu Lacage)
22
* Derived from original ping6 helper (author: Sebastien Vincent)
23
*/
24
25
#include "
ping-helper.h
"
26
27
#include "ns3/names.h"
28
#include "ns3/ping.h"
29
30
namespace
ns3
31
{
32
33
PingHelper::PingHelper
()
34
{
35
m_factory
.
SetTypeId
(
"ns3::Ping"
);
36
}
37
38
PingHelper::PingHelper
(
Address
remote,
Address
local)
39
{
40
m_factory
.
SetTypeId
(
"ns3::Ping"
);
41
m_factory
.
Set
(
"Destination"
, AddressValue(remote));
42
m_factory
.
Set
(
"InterfaceAddress"
, AddressValue(local));
43
}
44
45
void
46
PingHelper::SetAttribute
(std::string name,
const
AttributeValue
& value)
47
{
48
m_factory
.
Set
(name, value);
49
}
50
51
ApplicationContainer
52
PingHelper::Install
(
Ptr<Node>
node)
const
53
{
54
return
ApplicationContainer
(
InstallPriv
(node));
55
}
56
57
ApplicationContainer
58
PingHelper::Install
(std::string nodeName)
const
59
{
60
Ptr<Node>
node = Names::Find<Node>(nodeName);
61
return
ApplicationContainer
(
InstallPriv
(node));
62
}
63
64
ApplicationContainer
65
PingHelper::Install
(
NodeContainer
c)
const
66
{
67
ApplicationContainer
apps;
68
for
(
auto
i = c.
Begin
(); i != c.
End
(); ++i)
69
{
70
apps.
Add
(
InstallPriv
(*i));
71
}
72
73
return
apps;
74
}
75
76
Ptr<Application>
77
PingHelper::InstallPriv
(
Ptr<Node>
node)
const
78
{
79
Ptr<Ping>
app
=
m_factory
.
Create
<
Ping
>();
80
node->
AddApplication
(
app
);
81
82
return
app
;
83
}
84
85
}
// namespace ns3
ns3::Address
a polymophic address class
Definition:
address.h:101
ns3::ApplicationContainer
holds a vector of ns3::Application pointers.
Definition:
application-container.h:44
ns3::ApplicationContainer::Add
void Add(ApplicationContainer other)
Append the contents of another ApplicationContainer to the end of this container.
Definition:
application-container.cc:70
ns3::AttributeValue
Hold a value for an Attribute.
Definition:
attribute.h:70
ns3::NodeContainer
keep track of a set of node pointers.
Definition:
node-container.h:40
ns3::NodeContainer::End
Iterator End() const
Get an iterator which indicates past-the-last Node in the container.
Definition:
node-container.cc:66
ns3::NodeContainer::Begin
Iterator Begin() const
Get an iterator which refers to the first Node in the container.
Definition:
node-container.cc:60
ns3::Node::AddApplication
uint32_t AddApplication(Ptr< Application > application)
Associate an Application to this Node.
Definition:
node.cc:169
ns3::ObjectFactory::Create
Ptr< Object > Create() const
Create an Object instance of the configured TypeId.
Definition:
object-factory.cc:93
ns3::ObjectFactory::Set
void Set(const std::string &name, const AttributeValue &value, Args &&... args)
Set an attribute to be set during construction.
Definition:
object-factory.h:220
ns3::ObjectFactory::SetTypeId
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
Definition:
object-factory.cc:42
ns3::PingHelper::SetAttribute
void SetAttribute(std::string name, const AttributeValue &value)
Configure ping applications attribute.
Definition:
ping-helper.cc:46
ns3::PingHelper::m_factory
ObjectFactory m_factory
Object factory.
Definition:
ping-helper.h:111
ns3::PingHelper::Install
ApplicationContainer Install(NodeContainer nodes) const
Install a Ping application on each Node in the provided NodeContainer.
Definition:
ping-helper.cc:65
ns3::PingHelper::InstallPriv
Ptr< Application > InstallPriv(Ptr< Node > node) const
Do the actual application installation in the node.
Definition:
ping-helper.cc:77
ns3::PingHelper::PingHelper
PingHelper()
Create a PingHelper which is used to make life easier for people wanting to use ping Applications.
Definition:
ping-helper.cc:33
ns3::Ping
This application behaves similarly to the Unix ping application, although with fewer options supporte...
Definition:
ping.h:56
ns3::Ptr< Node >
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
openflow-switch.app
app
Definition:
openflow-switch.py:75
ping-helper.h
src
internet-apps
helper
ping-helper.cc
Generated on Sun Mar 3 2024 17:10:57 for ns-3 by
1.9.1