A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
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
:
50
static
TypeId
GetTypeId
(
void
);
51
52
UdpClient
();
53
54
virtual
~UdpClient
();
55
61
void
SetRemote
(
Address
ip, uint16_t
port
);
66
void
SetRemote
(
Address
addr);
67
71
uint64_t
GetTotalTx
()
const
;
72
73
protected
:
74
virtual
void
DoDispose
(
void
);
75
76
private
:
77
78
virtual
void
StartApplication
(
void
);
79
virtual
void
StopApplication
(
void
);
80
84
void
Send
(
void
);
85
86
uint32_t
m_count
;
87
Time
m_interval
;
88
uint32_t
m_size
;
89
90
uint32_t
m_sent
;
91
uint64_t
m_totalTx
;
92
Ptr<Socket>
m_socket
;
93
Address
m_peerAddress
;
94
uint16_t
m_peerPort
;
95
EventId
m_sendEvent
;
96
#ifdef NS3_LOG_ENABLE
97
std::string
m_peerAddressString
;
98
#endif
// NS3_LOG_ENABLE
99
};
100
101
}
// namespace ns3
102
103
#endif
/* UDP_CLIENT_H */
ns3::Address
a polymophic address class
Definition:
address.h:91
ns3::Application
The base class for all ns3 applications.
Definition:
application.h:61
ns3::EventId
An identifier for simulation events.
Definition:
event-id.h:54
ns3::Ptr< Socket >
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition:
nstime.h:103
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3::UdpClient
A Udp client.
Definition:
udp-client.h:44
ns3::UdpClient::m_interval
Time m_interval
Packet inter-send time.
Definition:
udp-client.h:87
ns3::UdpClient::StartApplication
virtual void StartApplication(void)
Application specific startup code.
Definition:
udp-client.cc:113
ns3::UdpClient::GetTotalTx
uint64_t GetTotalTx() const
Definition:
udp-client.cc:229
ns3::UdpClient::m_totalTx
uint64_t m_totalTx
Total bytes sent.
Definition:
udp-client.h:91
ns3::UdpClient::Send
void Send(void)
Send a packet.
Definition:
udp-client.cc:193
ns3::UdpClient::m_sent
uint32_t m_sent
Counter for sent packets.
Definition:
udp-client.h:90
ns3::UdpClient::m_socket
Ptr< Socket > m_socket
Socket.
Definition:
udp-client.h:92
ns3::UdpClient::DoDispose
virtual void DoDispose(void)
Destructor implementation.
Definition:
udp-client.cc:106
ns3::UdpClient::m_peerPort
uint16_t m_peerPort
Remote peer port.
Definition:
udp-client.h:94
ns3::UdpClient::m_sendEvent
EventId m_sendEvent
Event to send the next packet.
Definition:
udp-client.h:95
ns3::UdpClient::UdpClient
UdpClient()
Definition:
udp-client.cc:76
ns3::UdpClient::m_size
uint32_t m_size
Size of the sent packet (including the SeqTsHeader)
Definition:
udp-client.h:88
ns3::UdpClient::m_count
uint32_t m_count
Maximum number of packets the application will send.
Definition:
udp-client.h:86
ns3::UdpClient::SetRemote
void SetRemote(Address ip, uint16_t port)
set the remote address and port
Definition:
udp-client.cc:91
ns3::UdpClient::m_peerAddress
Address m_peerAddress
Remote peer address.
Definition:
udp-client.h:93
ns3::UdpClient::~UdpClient
virtual ~UdpClient()
Definition:
udp-client.cc:85
ns3::UdpClient::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
udp-client.cc:43
ns3::UdpClient::m_peerAddressString
std::string m_peerAddressString
Remote peer address string.
Definition:
udp-client.h:97
ns3::UdpClient::StopApplication
virtual void StopApplication(void)
Application specific shutdown code.
Definition:
udp-client.cc:186
port
uint16_t port
Definition:
dsdv-manet.cc:45
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
applications
model
udp-client.h
Generated on Tue Feb 6 2024 19:21:15 for ns-3 by
1.9.1