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
udp-trace-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: Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
19
* <amine.ismail@udcast.com>
20
*/
21
22
#ifndef UDP_TRACE_CLIENT_H
23
#define UDP_TRACE_CLIENT_H
24
25
#include "ns3/application.h"
26
#include "ns3/event-id.h"
27
#include "ns3/ptr.h"
28
#include "ns3/ipv4-address.h"
29
#include <vector>
30
31
namespace
ns3
{
32
33
class
Socket;
34
class
Packet;
35
54
class
UdpTraceClient :
public
Application
55
{
56
public
:
61
static
TypeId
GetTypeId
(
void
);
62
63
UdpTraceClient
();
64
76
UdpTraceClient
(Ipv4Address ip, uint16_t
port
,
char
*traceFile);
77
~UdpTraceClient
();
78
84
void
SetRemote
(Address ip, uint16_t
port
);
89
void
SetRemote
(Address addr);
90
98
void
SetTraceFile
(std::string filename);
99
104
uint16_t
GetMaxPacketSize
(
void
);
105
110
void
SetMaxPacketSize
(uint16_t maxPacketSize);
111
112
protected
:
113
virtual
void
DoDispose
(
void
);
114
115
private
:
120
void
LoadTrace
(std::string filename);
124
void
LoadDefaultTrace
(
void
);
125
virtual
void
StartApplication
(
void
);
126
virtual
void
StopApplication
(
void
);
127
131
void
Send
(
void
);
136
void
SendPacket
(uint32_t size);
137
143
struct
TraceEntry
144
{
145
uint32_t
timeToSend
;
146
uint32_t
packetSize
;
147
char
frameType
;
148
};
149
150
uint32_t
m_sent
;
151
Ptr<Socket>
m_socket
;
152
Address
m_peerAddress
;
153
uint16_t
m_peerPort
;
154
EventId
m_sendEvent
;
155
156
std::vector<struct TraceEntry>
m_entries
;
157
uint32_t
m_currentEntry
;
158
static
struct
TraceEntry
g_defaultEntries
[];
159
uint16_t
m_maxPacketSize
;
160
};
161
162
}
// namespace ns3
163
164
#endif
/* UDP_TRACE_CLIENT_H */
ns3::UdpTraceClient::LoadDefaultTrace
void LoadDefaultTrace(void)
Load the default trace.
Definition:
udp-trace-client.cc:212
ns3::Ptr< Socket >
ns3::UdpTraceClient::TraceEntry::packetSize
uint32_t packetSize
Size of the frame.
Definition:
udp-trace-client.h:146
ns3::UdpTraceClient::StartApplication
virtual void StartApplication(void)
Application specific startup code.
Definition:
udp-trace-client.cc:235
ns3::UdpTraceClient::m_peerAddress
Address m_peerAddress
Remote peer address.
Definition:
udp-trace-client.h:152
ns3::UdpTraceClient::~UdpTraceClient
~UdpTraceClient()
Definition:
udp-trace-client.cc:118
ns3::UdpTraceClient::StopApplication
virtual void StopApplication(void)
Application specific shutdown code.
Definition:
udp-trace-client.cc:274
ns3::UdpTraceClient::UdpTraceClient
UdpTraceClient()
Definition:
udp-trace-client.cc:92
ns3::UdpTraceClient::SetTraceFile
void SetTraceFile(std::string filename)
Set the trace file to be used by the application.
Definition:
udp-trace-client.cc:142
ns3::UdpTraceClient::m_sendEvent
EventId m_sendEvent
Event to send the next packet.
Definition:
udp-trace-client.h:154
port
uint16_t port
Definition:
dsdv-manet.cc:44
ns3::Address
a polymophic address class
Definition:
address.h:90
ns3::UdpTraceClient::TraceEntry::timeToSend
uint32_t timeToSend
Time to send the frame.
Definition:
udp-trace-client.h:145
ns3::UdpTraceClient::GetMaxPacketSize
uint16_t GetMaxPacketSize(void)
Return the maximum packet size.
Definition:
udp-trace-client.cc:163
ns3::UdpTraceClient::g_defaultEntries
static struct TraceEntry g_defaultEntries[]
Default trace to send.
Definition:
udp-trace-client.h:158
ns3::UdpTraceClient::TraceEntry::frameType
char frameType
Frame type (I, P or B)
Definition:
udp-trace-client.h:147
ns3::UdpTraceClient::m_entries
std::vector< struct TraceEntry > m_entries
Entries in the trace to send.
Definition:
udp-trace-client.h:156
ns3::UdpTraceClient::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
udp-trace-client.cc:61
ns3::UdpTraceClient::LoadTrace
void LoadTrace(std::string filename)
Load a trace file.
Definition:
udp-trace-client.cc:178
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::UdpTraceClient::m_sent
uint32_t m_sent
Counter for sent packets.
Definition:
udp-trace-client.h:150
ns3::UdpTraceClient::m_socket
Ptr< Socket > m_socket
Socket.
Definition:
udp-trace-client.h:151
ns3::UdpTraceClient::SetMaxPacketSize
void SetMaxPacketSize(uint16_t maxPacketSize)
Set the maximum packet size.
Definition:
udp-trace-client.cc:156
ns3::UdpTraceClient::Send
void Send(void)
Send a packet.
Definition:
udp-trace-client.cc:327
ns3::UdpTraceClient::TraceEntry
Entry to send.
Definition:
udp-trace-client.h:143
ns3::UdpTraceClient::m_maxPacketSize
uint16_t m_maxPacketSize
Maximum packet size to send (including the SeqTsHeader)
Definition:
udp-trace-client.h:159
ns3::EventId
An identifier for simulation events.
Definition:
event-id.h:53
ns3::UdpTraceClient::m_peerPort
uint16_t m_peerPort
Remote peer port.
Definition:
udp-trace-client.h:153
ns3::UdpTraceClient::SetRemote
void SetRemote(Address ip, uint16_t port)
set the remote address and port
Definition:
udp-trace-client.cc:125
ns3::UdpTraceClient::m_currentEntry
uint32_t m_currentEntry
Current entry index.
Definition:
udp-trace-client.h:157
ns3::UdpTraceClient::DoDispose
virtual void DoDispose(void)
Destructor implementation.
Definition:
udp-trace-client.cc:171
ns3::UdpTraceClient::SendPacket
void SendPacket(uint32_t size)
Send a packet of a given size.
Definition:
udp-trace-client.cc:281
src
applications
model
udp-trace-client.h
Generated on Mon Oct 3 2016 23:03:53 for ns-3 by
1.8.9.1