A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
udp-client-server-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: Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
18 */
19
21
22#include <ns3/string.h>
23#include <ns3/uinteger.h>
24
25namespace ns3
26{
27
29 : ApplicationHelper(UdpServer::GetTypeId())
30{
31}
32
35{
37}
38
40 : ApplicationHelper(UdpClient::GetTypeId())
41{
42}
43
46{
47 SetAttribute("RemoteAddress", AddressValue(address));
48}
49
51 : UdpClientHelper(address)
52{
53 SetAttribute("RemotePort", UintegerValue(port));
54}
55
57 : ApplicationHelper(UdpTraceClient::GetTypeId())
58{
59}
60
61UdpTraceClientHelper::UdpTraceClientHelper(const Address& address, const std::string& filename)
63{
64 SetAttribute("RemoteAddress", AddressValue(address));
65 SetAttribute("TraceFilename", StringValue(filename));
66}
67
69 uint16_t port,
70 const std::string& filename)
71 : UdpTraceClientHelper(address, filename)
72{
73 SetAttribute("RemotePort", UintegerValue(port));
74}
75
76} // 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.
Hold variables of type string.
Definition: string.h:56
Create a client application which sends UDP packets carrying a 32bit sequence number and a 64 bit tim...
UdpClientHelper()
Create UdpClientHelper which will make life easier for people trying to set up simulations with udp-c...
A Udp client.
Definition: udp-client.h:45
Create a server application which waits for input UDP packets and uses the information carried into t...
UdpServerHelper()
Create UdpServerHelper which will make life easier for people trying to set up simulations with udp-c...
A UDP server, receives UDP packets from a remote host.
Definition: udp-server.h:50
Create UdpTraceClient application which sends UDP packets based on a trace file of an MPEG4 stream.
UdpTraceClientHelper()
Create UdpTraceClientHelper which will make life easier for people trying to set up simulations with ...
A trace based streamer.
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.