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
udp-echo-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 "
udp-echo-helper.h
"
10
11
#include "ns3/udp-echo-client.h"
12
#include "ns3/udp-echo-server.h"
13
#include "ns3/uinteger.h"
14
15
namespace
ns3
16
{
17
18
UdpEchoServerHelper::UdpEchoServerHelper
(uint16_t
port
)
19
:
ApplicationHelper
(
UdpEchoServer
::GetTypeId())
20
{
21
SetAttribute
(
"Port"
,
UintegerValue
(
port
));
22
}
23
24
UdpEchoClientHelper::UdpEchoClientHelper
(
const
Address
& address, uint16_t
port
)
25
:
ApplicationHelper
(
UdpEchoClient
::GetTypeId())
26
{
27
SetAttribute
(
"RemoteAddress"
,
AddressValue
(address));
28
SetAttribute
(
"RemotePort"
,
UintegerValue
(
port
));
29
}
30
31
UdpEchoClientHelper::UdpEchoClientHelper
(
const
Address
& address)
32
:
ApplicationHelper
(
UdpEchoClient
::GetTypeId())
33
{
34
SetAttribute
(
"RemoteAddress"
,
AddressValue
(address));
35
}
36
37
void
38
UdpEchoClientHelper::SetFill
(
Ptr<Application>
app,
const
std::string& fill)
39
{
40
app->GetObject<
UdpEchoClient
>()->
SetFill
(fill);
41
}
42
43
void
44
UdpEchoClientHelper::SetFill
(
Ptr<Application>
app, uint8_t fill,
uint32_t
dataLength)
45
{
46
app->GetObject<
UdpEchoClient
>()->
SetFill
(fill, dataLength);
47
}
48
49
void
50
UdpEchoClientHelper::SetFill
(
Ptr<Application>
app,
51
uint8_t* fill,
52
uint32_t
fillLength,
53
uint32_t
dataLength)
54
{
55
app->GetObject<
UdpEchoClient
>()->
SetFill
(fill, fillLength, dataLength);
56
}
57
58
}
// namespace ns3
ns3::Address
a polymophic address class
Definition
address.h:90
ns3::AddressValue
Definition
address.h:275
ns3::ApplicationHelper
A helper to make it easier to instantiate an application on a set of nodes.
Definition
application-helper.h:28
ns3::ApplicationHelper::SetAttribute
void SetAttribute(const std::string &name, const AttributeValue &value)
Helper function used to set the underlying application attributes.
Definition
application-helper.cc:41
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::UdpEchoClientHelper::UdpEchoClientHelper
UdpEchoClientHelper(const Address &ip, uint16_t port)
Create UdpEchoClientHelper which will make life easier for people trying to set up simulations with e...
Definition
udp-echo-helper.cc:24
ns3::UdpEchoClientHelper::SetFill
void SetFill(Ptr< Application > app, const std::string &fill)
Given a pointer to a UdpEchoClient application, set the data fill of the packet (what is sent as data...
Definition
udp-echo-helper.cc:38
ns3::UdpEchoClient
A Udp Echo client.
Definition
udp-echo-client.h:29
ns3::UdpEchoServerHelper::UdpEchoServerHelper
UdpEchoServerHelper(uint16_t port)
Create UdpEchoServerHelper which will make life easier for people trying to set up simulations with e...
Definition
udp-echo-helper.cc:18
ns3::UdpEchoServer
A Udp Echo server.
Definition
udp-echo-server.h:34
ns3::UintegerValue
Hold an unsigned integer type.
Definition
uinteger.h:34
uint32_t
port
uint16_t port
Definition
dsdv-manet.cc:33
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
udp-echo-helper.h
src
applications
helper
udp-echo-helper.cc
Generated on Fri Nov 8 2024 13:58:59 for ns-3 by
1.11.0