A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
applications
helper
udp-client-server-helper.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2008 INRIA
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
19
*/
20
#ifndef UDP_CLIENT_SERVER_HELPER_H
21
#define UDP_CLIENT_SERVER_HELPER_H
22
23
#include <stdint.h>
24
#include "ns3/application-container.h"
25
#include "ns3/node-container.h"
26
#include "ns3/object-factory.h"
27
#include "ns3/ipv4-address.h"
28
#include "ns3/udp-server.h"
29
#include "ns3/udp-client.h"
30
namespace
ns3
{
37
class
UdpServerHelper
38
{
39
public
:
45
UdpServerHelper
();
46
53
UdpServerHelper
(uint16_t
port
);
54
61
void
SetAttribute
(std::string name,
const
AttributeValue
&value);
62
72
ApplicationContainer
Install
(
NodeContainer
c);
73
81
Ptr<UdpServer>
GetServer
(
void
);
82
private
:
83
ObjectFactory
m_factory
;
84
Ptr<UdpServer>
m_server
;
85
};
86
93
class
UdpClientHelper
94
{
95
96
public
:
102
UdpClientHelper
();
103
114
UdpClientHelper
(
Address
ip, uint16_t
port
);
124
UdpClientHelper
(
Address
addr);
125
132
void
SetAttribute
(std::string name,
const
AttributeValue
&value);
133
141
ApplicationContainer
Install
(
NodeContainer
c);
142
143
private
:
144
ObjectFactory
m_factory
;
145
};
158
class
UdpTraceClientHelper
159
{
160
public
:
166
UdpTraceClientHelper
();
167
178
UdpTraceClientHelper
(
Address
ip, uint16_t
port
, std::string filename);
188
UdpTraceClientHelper
(
Address
addr, std::string filename);
189
196
void
SetAttribute
(std::string name,
const
AttributeValue
&value);
197
205
ApplicationContainer
Install
(
NodeContainer
c);
206
207
private
:
208
ObjectFactory
m_factory
;
209
};
210
211
}
// namespace ns3
212
213
#endif
/* UDP_CLIENT_SERVER_H */
ns3::ApplicationContainer
holds a vector of ns3::Application pointers.
Definition:
application-container.h:42
ns3::UdpServerHelper::m_server
Ptr< UdpServer > m_server
The last created server application.
Definition:
udp-client-server-helper.h:84
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:73
ns3::AttributeValue
Hold a value for an Attribute.
Definition:
attribute.h:68
ns3::UdpTraceClientHelper::SetAttribute
void SetAttribute(std::string name, const AttributeValue &value)
Record an attribute to be set in each Application after it is is created.
Definition:
udp-client-server-helper.cc:127
ns3::UdpClientHelper::UdpClientHelper
UdpClientHelper()
Create UdpClientHelper which will make life easier for people trying to set up simulations with udp-c...
Definition:
udp-client-server-helper.cc:68
ns3::UdpServerHelper::m_factory
ObjectFactory m_factory
Object factory.
Definition:
udp-client-server-helper.h:83
ns3::UdpTraceClientHelper::Install
ApplicationContainer Install(NodeContainer c)
Definition:
udp-client-server-helper.cc:133
ns3::UdpClientHelper::Install
ApplicationContainer Install(NodeContainer c)
Definition:
udp-client-server-helper.cc:93
port
uint16_t port
Definition:
dsdv-manet.cc:45
ns3::Address
a polymophic address class
Definition:
address.h:90
ns3::UdpServerHelper::UdpServerHelper
UdpServerHelper()
Create UdpServerHelper which will make life easier for people trying to set up simulations with udp-c...
Definition:
udp-client-server-helper.cc:29
ns3::UdpTraceClientHelper::UdpTraceClientHelper
UdpTraceClientHelper()
Create UdpTraceClientHelper which will make life easier for people trying to set up simulations with ...
Definition:
udp-client-server-helper.cc:106
ns3::UdpClientHelper
Create a client application which sends UDP packets carrying a 32bit sequence number and a 64 bit tim...
Definition:
udp-client-server-helper.h:93
ns3::UdpTraceClientHelper
Create UdpTraceClient application which sends UDP packets based on a trace file of an MPEG4 stream...
Definition:
udp-client-server-helper.h:158
ns3::UdpTraceClientHelper::m_factory
ObjectFactory m_factory
Object factory.
Definition:
udp-client-server-helper.h:208
ns3::UdpServerHelper::GetServer
Ptr< UdpServer > GetServer(void)
Return the last created server.
Definition:
udp-client-server-helper.cc:63
ns3::UdpServerHelper
Create a server application which waits for input UDP packets and uses the information carried into t...
Definition:
udp-client-server-helper.h:37
ns3::UdpClientHelper::SetAttribute
void SetAttribute(std::string name, const AttributeValue &value)
Record an attribute to be set in each Application after it is is created.
Definition:
udp-client-server-helper.cc:87
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::NodeContainer
keep track of a set of node pointers.
Definition:
node-container.h:38
ns3::UdpClientHelper::m_factory
ObjectFactory m_factory
Object factory.
Definition:
udp-client-server-helper.h:144
ns3::ObjectFactory
Instantiate subclasses of ns3::Object.
Definition:
object-factory.h:47
ns3::UdpServerHelper::Install
ApplicationContainer Install(NodeContainer c)
Create one UDP server application on each of the Nodes in the NodeContainer.
Definition:
udp-client-server-helper.cc:47
ns3::UdpServerHelper::SetAttribute
void SetAttribute(std::string name, const AttributeValue &value)
Record an attribute to be set in each Application after it is is created.
Definition:
udp-client-server-helper.cc:41
Generated on Wed Nov 7 2018 10:01:47 for ns-3 by
1.8.14