A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 {
38 {
39 public:
45  UdpServerHelper ();
46 
53  UdpServerHelper (uint16_t port);
54 
61  void SetAttribute (std::string name, const AttributeValue &value);
62 
73 
82 private:
85 };
86 
94 {
95 
96 public:
102  UdpClientHelper ();
103 
112  UdpClientHelper (Ipv4Address ip, uint16_t port);
121  UdpClientHelper (Ipv6Address ip, uint16_t port);
130  UdpClientHelper (Address ip, uint16_t port);
131 
138  void SetAttribute (std::string name, const AttributeValue &value);
139 
148 
149 private:
151 };
165 {
166 public:
173 
182  UdpTraceClientHelper (Address ip, uint16_t port, std::string filename);
191  UdpTraceClientHelper (Ipv4Address ip, uint16_t port, std::string filename);
200  UdpTraceClientHelper (Ipv6Address ip, uint16_t port, std::string filename);
201 
208  void SetAttribute (std::string name, const AttributeValue &value);
209 
218 
219 private:
221 };
222 
223 } // namespace ns3
224 
225 #endif /* UDP_CLIENT_SERVER_H */
holds a vector of ns3::Application pointers.
Ptr< UdpServer > m_server
The last created server application.
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:60
Hold a value for an Attribute.
Definition: attribute.h:56
void SetAttribute(std::string name, const AttributeValue &value)
Record an attribute to be set in each Application after it is is created.
UdpClientHelper()
Create UdpClientHelper which will make life easier for people trying to set up simulations with udp-c...
ObjectFactory m_factory
Object factory.
ApplicationContainer Install(NodeContainer c)
ApplicationContainer Install(NodeContainer c)
uint16_t port
Definition: dsdv-manet.cc:44
a polymophic address class
Definition: address.h:86
UdpServerHelper()
Create UdpServerHelper which will make life easier for people trying to set up simulations with udp-c...
UdpTraceClientHelper()
Create UdpTraceClientHelper which will make life easier for people trying to set up simulations with ...
Create a client application which sends UDP packets carrying a 32bit sequence number and a 64 bit tim...
Create UdpTraceClient application which sends UDP packets based on a trace file of an MPEG4 stream...
ObjectFactory m_factory
Object factory.
Ptr< UdpServer > GetServer(void)
Return the last created server.
Create a server application which waits for input UDP packets and uses the information carried into t...
void SetAttribute(std::string name, const AttributeValue &value)
Record an attribute to be set in each Application after it is is created.
keep track of a set of node pointers.
ObjectFactory m_factory
Object factory.
Describes an IPv6 address.
Definition: ipv6-address.h:46
instantiate subclasses of ns3::Object.
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:38
ApplicationContainer Install(NodeContainer c)
Create one UDP server application on each of the Nodes in the NodeContainer.
void SetAttribute(std::string name, const AttributeValue &value)
Record an attribute to be set in each Application after it is is created.