A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
udp-echo-server.h
Go to the documentation of this file.
1
/*
2
* Copyright 2007 University of Washington
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
18
#ifndef UDP_ECHO_SERVER_H
19
#define UDP_ECHO_SERVER_H
20
21
#include "ns3/address.h"
22
#include "ns3/application.h"
23
#include "ns3/event-id.h"
24
#include "ns3/ptr.h"
25
#include "ns3/traced-callback.h"
26
27
namespace
ns3
28
{
29
30
class
Socket;
31
class
Packet;
32
44
class
UdpEchoServer
:
public
Application
45
{
46
public
:
51
static
TypeId
GetTypeId
();
52
UdpEchoServer
();
53
~UdpEchoServer
()
override
;
54
55
protected
:
56
void
DoDispose
()
override
;
57
58
private
:
59
void
StartApplication
()
override
;
60
void
StopApplication
()
override
;
61
69
void
HandleRead
(
Ptr<Socket>
socket);
70
71
uint16_t
m_port
;
72
Ptr<Socket>
m_socket
;
73
Ptr<Socket>
m_socket6
;
74
Address
m_local
;
75
77
TracedCallback<Ptr<const Packet>
>
m_rxTrace
;
78
80
TracedCallback<Ptr<const Packet>
,
const
Address
&,
const
Address
&>
m_rxTraceWithAddresses
;
81
};
82
83
}
// namespace ns3
84
85
#endif
/* UDP_ECHO_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::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::UdpEchoServer
A Udp Echo server.
Definition:
udp-echo-server.h:45
ns3::UdpEchoServer::StartApplication
void StartApplication() override
Application specific startup code.
Definition:
udp-echo-server.cc:85
ns3::UdpEchoServer::m_port
uint16_t m_port
Port on which we listen for incoming packets.
Definition:
udp-echo-server.h:71
ns3::UdpEchoServer::m_local
Address m_local
local multicast address
Definition:
udp-echo-server.h:74
ns3::UdpEchoServer::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-echo-server.h:80
ns3::UdpEchoServer::DoDispose
void DoDispose() override
Destructor implementation.
Definition:
udp-echo-server.cc:78
ns3::UdpEchoServer::m_socket6
Ptr< Socket > m_socket6
IPv6 Socket.
Definition:
udp-echo-server.h:73
ns3::UdpEchoServer::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
udp-echo-server.cc:42
ns3::UdpEchoServer::StopApplication
void StopApplication() override
Application specific shutdown code.
Definition:
udp-echo-server.cc:142
ns3::UdpEchoServer::m_rxTrace
TracedCallback< Ptr< const Packet > > m_rxTrace
Callbacks for tracing the packet Rx events.
Definition:
udp-echo-server.h:77
ns3::UdpEchoServer::~UdpEchoServer
~UdpEchoServer() override
Definition:
udp-echo-server.cc:70
ns3::UdpEchoServer::m_socket
Ptr< Socket > m_socket
IPv4 Socket.
Definition:
udp-echo-server.h:72
ns3::UdpEchoServer::UdpEchoServer
UdpEchoServer()
Definition:
udp-echo-server.cc:65
ns3::UdpEchoServer::HandleRead
void HandleRead(Ptr< Socket > socket)
Handle a packet reception.
Definition:
udp-echo-server.cc:159
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
applications
model
udp-echo-server.h
Generated on Sun Mar 3 2024 17:10:54 for ns-3 by
1.9.1