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 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18 */
19
20#include "udp-echo-helper.h"
21
22#include "ns3/udp-echo-client.h"
23#include "ns3/udp-echo-server.h"
24#include "ns3/uinteger.h"
25
26namespace ns3
27{
28
30 : ApplicationHelper(UdpEchoServer::GetTypeId())
31{
33}
34
36 : ApplicationHelper(UdpEchoClient::GetTypeId())
37{
38 SetAttribute("RemoteAddress", AddressValue(address));
39 SetAttribute("RemotePort", UintegerValue(port));
40}
41
43 : ApplicationHelper(UdpEchoClient::GetTypeId())
44{
45 SetAttribute("RemoteAddress", AddressValue(address));
46}
47
48void
50{
51 app->GetObject<UdpEchoClient>()->SetFill(fill);
52}
53
54void
56{
57 app->GetObject<UdpEchoClient>()->SetFill(fill, dataLength);
58}
59
60void
62 uint8_t* fill,
63 uint32_t fillLength,
64 uint32_t dataLength)
65{
66 app->GetObject<UdpEchoClient>()->SetFill(fill, fillLength, dataLength);
67}
68
69} // namespace ns3
a polymophic address class
Definition: address.h:101
AttributeValue implementation for Address.
Definition: address.h:286
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.
Definition: ptr.h:77
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:45
uint16_t port
Definition: dsdv-manet.cc:44
Every class exported by the ns3 library is enclosed in the ns3 namespace.