A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
packet-socket-server.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2014 Universita' di Firenze
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Author: Tommaso Pecorella <tommaso.pecorella@unifi.it>
18
*/
19
20
#ifndef PACKET_SOCKET_SERVER_H
21
#define PACKET_SOCKET_SERVER_H
22
23
#include "ns3/application.h"
24
#include "ns3/event-id.h"
25
#include "ns3/packet-socket-address.h"
26
#include "ns3/ptr.h"
27
#include "ns3/traced-callback.h"
28
29
namespace
ns3
30
{
31
32
class
Socket;
33
class
Packet;
34
47
class
PacketSocketServer
:
public
Application
48
{
49
public
:
54
static
TypeId
GetTypeId
();
55
56
PacketSocketServer
();
57
58
~PacketSocketServer
()
override
;
59
64
void
SetLocal
(
PacketSocketAddress
addr);
65
66
protected
:
67
void
DoDispose
()
override
;
68
69
private
:
70
void
StartApplication
()
override
;
71
void
StopApplication
()
override
;
72
77
void
HandleRead
(
Ptr<Socket>
socket);
78
79
uint32_t
m_pktRx
;
80
uint32_t
m_bytesRx
;
81
82
Ptr<Socket>
m_socket
;
83
PacketSocketAddress
m_localAddress
;
84
bool
m_localAddressSet
;
85
87
TracedCallback<Ptr<const Packet>
,
const
Address
&>
m_rxTrace
;
88
};
89
90
}
// namespace ns3
91
92
#endif
/* PACKET_SOCKET_SERVER_H */
ns3::Address
a polymophic address class
Definition:
address.h:100
ns3::Application
The base class for all ns3 applications.
Definition:
application.h:61
ns3::PacketSocketAddress
an address for a packet socket
Definition:
packet-socket-address.h:40
ns3::PacketSocketServer
A server using PacketSocket.
Definition:
packet-socket-server.h:48
ns3::PacketSocketServer::m_bytesRx
uint32_t m_bytesRx
Total bytes received.
Definition:
packet-socket-server.h:80
ns3::PacketSocketServer::m_rxTrace
TracedCallback< Ptr< const Packet >, const Address & > m_rxTrace
Traced Callback: received packets, source address.
Definition:
packet-socket-server.h:87
ns3::PacketSocketServer::HandleRead
void HandleRead(Ptr< Socket > socket)
Handle a packet received by the application.
Definition:
packet-socket-server.cc:112
ns3::PacketSocketServer::m_socket
Ptr< Socket > m_socket
Socket.
Definition:
packet-socket-server.h:82
ns3::PacketSocketServer::StopApplication
void StopApplication() override
Application specific shutdown code.
Definition:
packet-socket-server.cc:96
ns3::PacketSocketServer::m_localAddressSet
bool m_localAddressSet
Sanity check.
Definition:
packet-socket-server.h:84
ns3::PacketSocketServer::m_pktRx
uint32_t m_pktRx
The number of received packets.
Definition:
packet-socket-server.h:79
ns3::PacketSocketServer::~PacketSocketServer
~PacketSocketServer() override
Definition:
packet-socket-server.cc:67
ns3::PacketSocketServer::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
packet-socket-server.cc:45
ns3::PacketSocketServer::StartApplication
void StartApplication() override
Application specific startup code.
Definition:
packet-socket-server.cc:80
ns3::PacketSocketServer::SetLocal
void SetLocal(PacketSocketAddress addr)
set the local address and protocol to be used
Definition:
packet-socket-server.cc:104
ns3::PacketSocketServer::DoDispose
void DoDispose() override
Destructor implementation.
Definition:
packet-socket-server.cc:73
ns3::PacketSocketServer::PacketSocketServer
PacketSocketServer()
Definition:
packet-socket-server.cc:58
ns3::PacketSocketServer::m_localAddress
PacketSocketAddress m_localAddress
Local address.
Definition:
packet-socket-server.h:83
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:78
ns3::TracedCallback
Forward calls to a chain of Callback.
Definition:
traced-callback.h:54
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
network
utils
packet-socket-server.h
Generated on Sun Jul 2 2023 18:21:59 for ns-3 by
1.9.6