A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
udp-client.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2007,2008,2009 INRIA, UDCAST
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: Amine Ismail <amine.ismail@sophia.inria.fr>
19
* <amine.ismail@udcast.com>
20
*
21
*/
22
23
#ifndef UDP_CLIENT_H
24
#define UDP_CLIENT_H
25
26
#include "ns3/application.h"
27
#include "ns3/event-id.h"
28
#include "ns3/ptr.h"
29
#include "ns3/ipv4-address.h"
30
31
namespace
ns3 {
32
33
class
Socket;
34
class
Packet;
35
43
class
UdpClient
:
public
Application
44
{
45
public
:
46
static
TypeId
47
GetTypeId
(
void
);
48
49
UdpClient
();
50
51
virtual
~UdpClient
();
52
58
void
SetRemote
(
Ipv4Address
ip, uint16_t
port
);
59
void
SetRemote
(
Ipv6Address
ip, uint16_t port);
60
void
SetRemote
(
Address
ip, uint16_t port);
61
62
protected
:
63
virtual
void
DoDispose
(
void
);
64
65
private
:
66
67
virtual
void
StartApplication
(
void
);
68
virtual
void
StopApplication
(
void
);
69
70
void
ScheduleTransmit
(
Time
dt);
71
void
Send
(
void
);
72
73
uint32_t
m_count
;
74
Time
m_interval
;
75
uint32_t
m_size
;
76
77
uint32_t
m_sent
;
78
Ptr<Socket>
m_socket
;
79
Address
m_peerAddress
;
80
uint16_t
m_peerPort
;
81
EventId
m_sendEvent
;
82
83
};
84
85
}
// namespace ns3
86
87
#endif
/* UDP_CLIENT_H */
ns3::Time
keep track of time values and allow control of global simulation resolution
Definition:
nstime.h:81
ns3::Ptr< Socket >
ns3::UdpClient::m_count
uint32_t m_count
Definition:
udp-client.h:73
ns3::UdpClient::StartApplication
virtual void StartApplication(void)
Application specific startup code.
Definition:
udp-client.cc:120
ns3::UdpClient::UdpClient
UdpClient()
Definition:
udp-client.cc:75
ns3::UdpClient::m_socket
Ptr< Socket > m_socket
Definition:
udp-client.h:78
ns3::UdpClient::StopApplication
virtual void StopApplication(void)
Application specific shutdown code.
Definition:
udp-client.cc:145
port
uint16_t port
Definition:
dsdv-manet.cc:44
ns3::Address
a polymophic address class
Definition:
address.h:86
ns3::UdpClient::m_sent
uint32_t m_sent
Definition:
udp-client.h:77
ns3::UdpClient::m_size
uint32_t m_size
Definition:
udp-client.h:75
ns3::Application
The base class for all ns3 applications.
Definition:
application.h:61
ns3::UdpClient::m_interval
Time m_interval
Definition:
udp-client.h:74
ns3::UdpClient::m_peerPort
uint16_t m_peerPort
Definition:
udp-client.h:80
ns3::UdpClient::GetTypeId
static TypeId GetTypeId(void)
Definition:
udp-client.cc:42
ns3::UdpClient::Send
void Send(void)
Definition:
udp-client.cc:152
ns3::UdpClient::~UdpClient
virtual ~UdpClient()
Definition:
udp-client.cc:83
ns3::UdpClient::m_peerAddress
Address m_peerAddress
Definition:
udp-client.h:79
ns3::UdpClient
A Udp client. Sends UDP packet carrying sequence number and time stamp in their payloads.
Definition:
udp-client.h:43
ns3::Ipv6Address
Describes an IPv6 address.
Definition:
ipv6-address.h:46
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition:
ipv4-address.h:38
ns3::EventId
an identifier for simulation events.
Definition:
event-id.h:46
ns3::UdpClient::ScheduleTransmit
void ScheduleTransmit(Time dt)
ns3::UdpClient::DoDispose
virtual void DoDispose(void)
Definition:
udp-client.cc:113
ns3::UdpClient::SetRemote
void SetRemote(Ipv4Address ip, uint16_t port)
set the remote address and port
Definition:
udp-client.cc:89
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:49
ns3::UdpClient::m_sendEvent
EventId m_sendEvent
Definition:
udp-client.h:81
src
applications
model
udp-client.h
Generated on Sat Nov 16 2013 12:55:22 for ns-3 by
1.8.5