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
packet-socket-client.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2014 Universita' di Firenze
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: Tommaso Pecorella <tommaso.pecorella@unifi.it>
19
*/
20
21
#ifndef PACKET_SOCKET_CLIENT_H
22
#define PACKET_SOCKET_CLIENT_H
23
24
#include "ns3/application.h"
25
#include "ns3/event-id.h"
26
#include "ns3/ptr.h"
27
#include "ns3/packet-socket-address.h"
28
29
namespace
ns3
{
30
31
class
Socket;
32
class
Packet;
33
52
class
PacketSocketClient
:
public
Application
53
{
54
public
:
59
static
TypeId
GetTypeId
(
void
);
60
61
PacketSocketClient
();
62
63
virtual
~PacketSocketClient
();
64
69
void
SetRemote
(
PacketSocketAddress
addr);
70
71
protected
:
72
virtual
void
DoDispose
(
void
);
73
74
private
:
75
76
virtual
void
StartApplication
(
void
);
77
virtual
void
StopApplication
(
void
);
78
82
void
Send
(
void
);
83
84
uint32_t
m_maxPackets
;
85
Time
m_interval
;
86
uint32_t
m_size
;
87
88
uint32_t
m_sent
;
89
Ptr<Socket>
m_socket
;
90
PacketSocketAddress
m_peerAddress
;
91
bool
m_peerAddressSet
;
92
EventId
m_sendEvent
;
93
95
TracedCallback<Ptr<const Packet>
,
const
Address
&>
m_txTrace
;
96
};
97
98
}
// namespace ns3
99
100
#endif
/* PACKET_SOCKET_CLIENT_H */
ns3::PacketSocketClient::m_maxPackets
uint32_t m_maxPackets
Maximum number of packets the application will send.
Definition:
packet-socket-client.h:84
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition:
nstime.h:102
ns3::Ptr< Socket >
ns3::PacketSocketClient::StopApplication
virtual void StopApplication(void)
Application specific shutdown code.
Definition:
packet-socket-client.cc:119
ns3::TracedCallback
Forward calls to a chain of Callback.
Definition:
traced-callback.h:62
ns3::PacketSocketAddress
an address for a packet socket
Definition:
packet-socket-address.h:38
ns3::PacketSocketClient::m_peerAddressSet
bool m_peerAddressSet
Sanity check.
Definition:
packet-socket-client.h:91
ns3::PacketSocketClient::~PacketSocketClient
virtual ~PacketSocketClient()
Definition:
packet-socket-client.cc:79
ns3::Address
a polymophic address class
Definition:
address.h:90
ns3::PacketSocketClient::m_sent
uint32_t m_sent
Counter for sent packets.
Definition:
packet-socket-client.h:88
ns3::PacketSocketClient::m_interval
Time m_interval
Packet inter-send time.
Definition:
packet-socket-client.h:85
ns3::PacketSocketClient::StartApplication
virtual void StartApplication(void)
Application specific startup code.
Definition:
packet-socket-client.cc:100
ns3::Application
The base class for all ns3 applications.
Definition:
application.h:60
ns3::PacketSocketClient::m_sendEvent
EventId m_sendEvent
Event to send the next packet.
Definition:
packet-socket-client.h:92
ns3::PacketSocketClient::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
packet-socket-client.cc:43
ns3::PacketSocketClient::m_socket
Ptr< Socket > m_socket
Socket.
Definition:
packet-socket-client.h:89
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::PacketSocketClient::DoDispose
virtual void DoDispose(void)
Destructor implementation.
Definition:
packet-socket-client.cc:93
ns3::PacketSocketClient::m_txTrace
TracedCallback< Ptr< const Packet >, const Address & > m_txTrace
Traced Callback: sent packets, source address.
Definition:
packet-socket-client.h:95
ns3::PacketSocketClient
A simple client.
Definition:
packet-socket-client.h:52
ns3::EventId
An identifier for simulation events.
Definition:
event-id.h:53
ns3::PacketSocketClient::SetRemote
void SetRemote(PacketSocketAddress addr)
set the remote address and protocol to be used
Definition:
packet-socket-client.cc:85
ns3::PacketSocketClient::Send
void Send(void)
Send a packet.
Definition:
packet-socket-client.cc:127
ns3::PacketSocketClient::m_peerAddress
PacketSocketAddress m_peerAddress
Remote peer address.
Definition:
packet-socket-client.h:90
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:58
ns3::PacketSocketClient::m_size
uint32_t m_size
Size of the sent packet.
Definition:
packet-socket-client.h:86
ns3::PacketSocketClient::PacketSocketClient
PacketSocketClient()
Definition:
packet-socket-client.cc:70
src
network
utils
packet-socket-client.h
Generated on Wed Sep 30 2015 15:55:46 for ns-3 by
1.8.9.1