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
v4ping.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* This program is free software; you can redistribute it and/or modify
4
* it under the terms of the GNU General Public License version 2 as
5
* published by the Free Software Foundation;
6
*
7
* This program is distributed in the hope that it will be useful,
8
* but WITHOUT ANY WARRANTY; without even the implied warranty of
9
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
* GNU General Public License for more details.
11
*
12
* You should have received a copy of the GNU General Public License
13
* along with this program; if not, write to the Free Software
14
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15
*/
16
#ifndef V4PING_H
17
#define V4PING_H
18
19
#include "ns3/application.h"
20
#include "ns3/traced-callback.h"
21
#include "ns3/nstime.h"
22
#include "ns3/average.h"
23
#include "ns3/simulator.h"
24
#include <map>
25
26
namespace
ns3 {
27
28
class
Socket;
29
36
class
V4Ping
:
public
Application
37
{
38
public
:
39
static
TypeId
GetTypeId
(
void
);
40
44
V4Ping
();
45
virtual
~V4Ping
();
46
47
private
:
48
void
Write32
(uint8_t *buffer,
const
uint32_t
data
);
49
void
Read32
(
const
uint8_t *buffer, uint32_t &data);
50
51
// inherited from Application base class.
52
virtual
void
StartApplication
(
void
);
53
virtual
void
StopApplication
(
void
);
54
virtual
void
DoDispose
(
void
);
55
uint32_t
GetApplicationId
(
void
)
const
;
56
void
Receive
(
Ptr<Socket>
socket);
57
void
Send
();
58
60
Ipv4Address
m_remote
;
62
Time
m_interval
;
67
uint32_t
m_size
;
68
Ptr<Socket>
m_socket
;
69
uint16_t
m_seq
;
70
TracedCallback<Time>
m_traceRtt
;
72
bool
m_verbose
;
74
uint32_t
m_recv
;
76
Time
m_started
;
78
Average<double>
m_avgRtt
;
80
EventId
m_next
;
82
std::map<uint16_t, Time>
m_sent
;
83
};
84
85
}
// namespace ns3
86
87
#endif
/* V4PING_H */
ns3::V4Ping::StartApplication
virtual void StartApplication(void)
Application specific startup code.
Definition:
v4ping.cc:232
ns3::V4Ping::Write32
void Write32(uint8_t *buffer, const uint32_t data)
Definition:
v4ping.cc:169
ns3::Time
keep track of time values and allow control of global simulation resolution
Definition:
nstime.h:81
ns3::Ptr< Socket >
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::V4Ping::m_traceRtt
TracedCallback< Time > m_traceRtt
Definition:
v4ping.h:70
ns3::V4Ping::GetApplicationId
uint32_t GetApplicationId(void) const
Definition:
v4ping.cc:88
ns3::V4Ping::V4Ping
V4Ping()
Definition:
v4ping.cc:64
ns3::V4Ping::DoDispose
virtual void DoDispose(void)
Definition:
v4ping.cc:80
ns3::V4Ping::Read32
void Read32(const uint8_t *buffer, uint32_t &data)
Definition:
v4ping.cc:180
ns3::V4Ping::m_started
Time m_started
Start time to report total ping time.
Definition:
v4ping.h:76
ns3::V4Ping::GetTypeId
static TypeId GetTypeId(void)
Definition:
v4ping.cc:34
ns3::Application
The base class for all ns3 applications.
Definition:
application.h:61
ns3::V4Ping::Receive
void Receive(Ptr< Socket > socket)
Definition:
v4ping.cc:104
data
uint8_t data[writeSize]
Definition:
socket-bound-tcp-static-routing.cc:53
ns3::V4Ping::m_sent
std::map< uint16_t, Time > m_sent
All sent but not answered packets. Map icmp seqno -> when sent.
Definition:
v4ping.h:82
ns3::V4Ping::m_verbose
bool m_verbose
produce ping-style output if true
Definition:
v4ping.h:72
ns3::V4Ping::m_seq
uint16_t m_seq
Definition:
v4ping.h:69
ns3::V4Ping::m_next
EventId m_next
Next packet will be sent.
Definition:
v4ping.h:80
ns3::Average< double >
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition:
ipv4-address.h:38
ns3::V4Ping::StopApplication
virtual void StopApplication(void)
Application specific shutdown code.
Definition:
v4ping.cc:257
ns3::EventId
an identifier for simulation events.
Definition:
event-id.h:46
ns3::V4Ping::Send
void Send()
Definition:
v4ping.cc:187
ns3::V4Ping
an application which sends one ICMP ECHO request, waits for a REPLYs and reports the calculated RTT...
Definition:
v4ping.h:36
ns3::V4Ping::m_interval
Time m_interval
Wait interval seconds between sending each packet.
Definition:
v4ping.h:62
ns3::V4Ping::m_recv
uint32_t m_recv
received packets counter
Definition:
v4ping.h:74
ns3::V4Ping::~V4Ping
virtual ~V4Ping()
Definition:
v4ping.cc:74
ns3::V4Ping::m_remote
Ipv4Address m_remote
Remote address.
Definition:
v4ping.h:60
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:49
ns3::V4Ping::m_size
uint32_t m_size
Definition:
v4ping.h:67
ns3::V4Ping::m_avgRtt
Average< double > m_avgRtt
Average rtt is ms.
Definition:
v4ping.h:78
ns3::V4Ping::m_socket
Ptr< Socket > m_socket
Definition:
v4ping.h:68
src
applications
model
v4ping.h
Generated on Sun Apr 20 2014 11:14:45 for ns-3 by
1.8.6