A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
udp-server.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2007,2008,2009 INRIA, UDCAST
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: Amine Ismail <amine.ismail@sophia.inria.fr>
18
* <amine.ismail@udcast.com>
19
*
20
*/
21
22
#ifndef UDP_SERVER_H
23
#define UDP_SERVER_H
24
25
#include "
packet-loss-counter.h
"
26
27
#include "ns3/address.h"
28
#include "ns3/application.h"
29
#include "ns3/event-id.h"
30
#include "ns3/ptr.h"
31
#include "ns3/traced-callback.h"
32
33
namespace
ns3
34
{
49
class
UdpServer
:
public
Application
50
{
51
public
:
56
static
TypeId
GetTypeId
();
57
UdpServer
();
58
~UdpServer
()
override
;
63
uint32_t
GetLost
()
const
;
64
69
uint64_t
GetReceived
()
const
;
70
75
uint16_t
GetPacketWindowSize
()
const
;
76
83
void
SetPacketWindowSize
(uint16_t size);
84
85
protected
:
86
void
DoDispose
()
override
;
87
88
private
:
89
void
StartApplication
()
override
;
90
void
StopApplication
()
override
;
91
99
void
HandleRead
(
Ptr<Socket>
socket);
100
101
uint16_t
m_port
;
102
Ptr<Socket>
m_socket
;
103
Ptr<Socket>
m_socket6
;
104
uint64_t
m_received
;
105
PacketLossCounter
m_lossCounter
;
106
108
TracedCallback<Ptr<const Packet>
>
m_rxTrace
;
109
111
TracedCallback<Ptr<const Packet>
,
const
Address
&,
const
Address
&>
m_rxTraceWithAddresses
;
112
};
113
114
}
// namespace ns3
115
116
#endif
/* UDP_SERVER_H */
ns3::Address
a polymophic address class
Definition:
address.h:101
ns3::Application
The base class for all ns3 applications.
Definition:
application.h:62
ns3::PacketLossCounter
A class to count the number of lost packets.
Definition:
packet-loss-counter.h:46
ns3::Ptr< Socket >
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
ns3::UdpServer
A UDP server, receives UDP packets from a remote host.
Definition:
udp-server.h:50
ns3::UdpServer::m_socket6
Ptr< Socket > m_socket6
IPv6 Socket.
Definition:
udp-server.h:103
ns3::UdpServer::m_rxTrace
TracedCallback< Ptr< const Packet > > m_rxTrace
Callbacks for tracing the packet Rx events.
Definition:
udp-server.h:108
ns3::UdpServer::~UdpServer
~UdpServer() override
Definition:
udp-server.cc:82
ns3::UdpServer::m_port
uint16_t m_port
Port on which we listen for incoming packets.
Definition:
udp-server.h:101
ns3::UdpServer::GetReceived
uint64_t GetReceived() const
Returns the number of received packets.
Definition:
udp-server.cc:109
ns3::UdpServer::StartApplication
void StartApplication() override
Application specific startup code.
Definition:
udp-server.cc:123
ns3::UdpServer::m_socket
Ptr< Socket > m_socket
IPv4 Socket.
Definition:
udp-server.h:102
ns3::UdpServer::HandleRead
void HandleRead(Ptr< Socket > socket)
Handle a packet reception.
Definition:
udp-server.cc:166
ns3::UdpServer::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
udp-server.cc:45
ns3::UdpServer::m_lossCounter
PacketLossCounter m_lossCounter
Lost packet counter.
Definition:
udp-server.h:105
ns3::UdpServer::SetPacketWindowSize
void SetPacketWindowSize(uint16_t size)
Set the size of the window used for checking loss.
Definition:
udp-server.cc:95
ns3::UdpServer::UdpServer
UdpServer()
Definition:
udp-server.cc:75
ns3::UdpServer::m_rxTraceWithAddresses
TracedCallback< Ptr< const Packet >, const Address &, const Address & > m_rxTraceWithAddresses
Callbacks for tracing the packet Rx events, includes source and destination addresses.
Definition:
udp-server.h:111
ns3::UdpServer::GetLost
uint32_t GetLost() const
Returns the number of lost packets.
Definition:
udp-server.cc:102
ns3::UdpServer::m_received
uint64_t m_received
Number of received packets.
Definition:
udp-server.h:104
ns3::UdpServer::DoDispose
void DoDispose() override
Destructor implementation.
Definition:
udp-server.cc:116
ns3::UdpServer::GetPacketWindowSize
uint16_t GetPacketWindowSize() const
Returns the size of the window used for checking loss.
Definition:
udp-server.cc:88
ns3::UdpServer::StopApplication
void StopApplication() override
Application specific shutdown code.
Definition:
udp-server.cc:155
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
packet-loss-counter.h
src
applications
model
udp-server.h
Generated on Sun Mar 3 2024 17:10:54 for ns-3 by
1.9.1