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-echo-client.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright 2007 University of Washington
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
19
#ifndef UDP_ECHO_CLIENT_H
20
#define UDP_ECHO_CLIENT_H
21
22
#include "ns3/application.h"
23
#include "ns3/event-id.h"
24
#include "ns3/ptr.h"
25
#include "ns3/ipv4-address.h"
26
#include "ns3/traced-callback.h"
27
28
namespace
ns3 {
29
30
class
Socket;
31
class
Packet;
32
39
class
UdpEchoClient
:
public
Application
40
{
41
public
:
42
static
TypeId
GetTypeId
(
void
);
43
44
UdpEchoClient
();
45
46
virtual
~UdpEchoClient
();
47
52
void
SetRemote
(
Address
ip, uint16_t
port
);
53
void
SetRemote
(
Ipv4Address
ip, uint16_t port);
54
void
SetRemote
(
Ipv6Address
ip, uint16_t port);
55
66
void
SetDataSize
(uint32_t dataSize);
67
79
uint32_t
GetDataSize
(
void
)
const
;
80
91
void
SetFill
(std::string fill);
92
105
void
SetFill
(uint8_t fill, uint32_t dataSize);
106
123
void
SetFill
(uint8_t *fill, uint32_t fillSize, uint32_t dataSize);
124
125
protected
:
126
virtual
void
DoDispose
(
void
);
127
128
private
:
129
130
virtual
void
StartApplication
(
void
);
131
virtual
void
StopApplication
(
void
);
132
133
void
ScheduleTransmit
(
Time
dt);
134
void
Send
(
void
);
135
136
void
HandleRead
(
Ptr<Socket>
socket);
137
138
uint32_t
m_count
;
139
Time
m_interval
;
140
uint32_t
m_size
;
141
142
uint32_t
m_dataSize
;
143
uint8_t *
m_data
;
144
145
uint32_t
m_sent
;
146
Ptr<Socket>
m_socket
;
147
Address
m_peerAddress
;
148
uint16_t
m_peerPort
;
149
EventId
m_sendEvent
;
151
TracedCallback<Ptr<const Packet>
>
m_txTrace
;
152
};
153
154
}
// namespace ns3
155
156
#endif
/* UDP_ECHO_CLIENT_H */
ns3::Time
keep track of time values and allow control of global simulation resolution
Definition:
nstime.h:81
ns3::Ptr< Socket >
ns3::UdpEchoClient::m_txTrace
TracedCallback< Ptr< const Packet > > m_txTrace
Callbacks for tracing the packet Tx events.
Definition:
udp-echo-client.h:151
ns3::UdpEchoClient::m_dataSize
uint32_t m_dataSize
Definition:
udp-echo-client.h:142
ns3::UdpEchoClient::~UdpEchoClient
virtual ~UdpEchoClient()
Definition:
udp-echo-client.cc:84
ns3::UdpEchoClient::m_socket
Ptr< Socket > m_socket
Definition:
udp-echo-client.h:146
ns3::UdpEchoClient::DoDispose
virtual void DoDispose(void)
Definition:
udp-echo-client.cc:119
ns3::TracedCallback
forward calls to a chain of CallbackAn ns3::TracedCallback has almost exactly the same API as a norma...
Definition:
traced-callback.h:43
ns3::UdpEchoClient::HandleRead
void HandleRead(Ptr< Socket > socket)
Definition:
udp-echo-client.cc:332
ns3::UdpEchoClient::SetRemote
void SetRemote(Address ip, uint16_t port)
Definition:
udp-echo-client.cc:95
ns3::UdpEchoClient::StopApplication
virtual void StopApplication(void)
Application specific shutdown code.
Definition:
udp-echo-client.cc:152
port
uint16_t port
Definition:
dsdv-manet.cc:44
ns3::Address
a polymophic address class
Definition:
address.h:86
ns3::UdpEchoClient::ScheduleTransmit
void ScheduleTransmit(Time dt)
Definition:
udp-echo-client.cc:270
ns3::UdpEchoClient::UdpEchoClient
UdpEchoClient()
Definition:
udp-echo-client.cc:74
ns3::Application
The base class for all ns3 applications.
Definition:
application.h:61
ns3::UdpEchoClient::m_data
uint8_t * m_data
Definition:
udp-echo-client.h:143
ns3::UdpEchoClient
A Udp Echo client.
Definition:
udp-echo-client.h:39
ns3::UdpEchoClient::StartApplication
virtual void StartApplication(void)
Application specific startup code.
Definition:
udp-echo-client.cc:126
ns3::UdpEchoClient::m_count
uint32_t m_count
Definition:
udp-echo-client.h:138
ns3::UdpEchoClient::GetTypeId
static TypeId GetTypeId(void)
Definition:
udp-echo-client.cc:38
ns3::UdpEchoClient::m_interval
Time m_interval
Definition:
udp-echo-client.h:139
ns3::UdpEchoClient::SetDataSize
void SetDataSize(uint32_t dataSize)
Definition:
udp-echo-client.cc:167
ns3::UdpEchoClient::Send
void Send(void)
Definition:
udp-echo-client.cc:277
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::UdpEchoClient::m_sendEvent
EventId m_sendEvent
Definition:
udp-echo-client.h:149
ns3::EventId
an identifier for simulation events.
Definition:
event-id.h:46
ns3::UdpEchoClient::GetDataSize
uint32_t GetDataSize(void) const
Definition:
udp-echo-client.cc:183
ns3::UdpEchoClient::m_peerAddress
Address m_peerAddress
Definition:
udp-echo-client.h:147
ns3::UdpEchoClient::m_sent
uint32_t m_sent
Definition:
udp-echo-client.h:145
ns3::UdpEchoClient::m_size
uint32_t m_size
Definition:
udp-echo-client.h:140
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:49
ns3::UdpEchoClient::m_peerPort
uint16_t m_peerPort
Definition:
udp-echo-client.h:148
ns3::UdpEchoClient::SetFill
void SetFill(std::string fill)
Definition:
udp-echo-client.cc:190
src
applications
model
udp-echo-client.h
Generated on Sat Nov 16 2013 16:17:35 for ns-3 by
1.8.5