A Discrete-Event Network Simulator
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
15namespace ns3
16{
17
23
25 : ApplicationHelper(UdpEchoClient::GetTypeId())
26{
27 SetAttribute("RemoteAddress", AddressValue(address));
28 SetAttribute("RemotePort", UintegerValue(port));
29}
30
32 : ApplicationHelper(UdpEchoClient::GetTypeId())
33{
34 SetAttribute("RemoteAddress", AddressValue(address));
35}
36
37void
39{
40 app->GetObject<UdpEchoClient>()->SetFill(fill);
41}
42
43void
45{
46 app->GetObject<UdpEchoClient>()->SetFill(fill, dataLength);
47}
48
49void
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
a polymophic address class
Definition address.h:90
A helper to make it easier to instantiate an application on a set of nodes.
void SetAttribute(const std::string &name, const AttributeValue &value)
Helper function used to set the underlying application attributes.
Smart pointer class similar to boost::intrusive_ptr.
UdpEchoClientHelper(const Address &ip, uint16_t port)
Create UdpEchoClientHelper which will make life easier for people trying to set up simulations with e...
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...
A Udp Echo client.
UdpEchoServerHelper(uint16_t port)
Create UdpEchoServerHelper which will make life easier for people trying to set up simulations with e...
A Udp Echo server.
Hold an unsigned integer type.
Definition uinteger.h:34
uint16_t port
Definition dsdv-manet.cc:33
Every class exported by the ns3 library is enclosed in the ns3 namespace.