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
source-application.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2024 DERONNE SOFTWARE ENGINEERING
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Sébastien Deronne <sebastien.deronne@gmail.com>
7
*/
8
9
#ifndef SOURCE_APPLICATION_H
10
#define SOURCE_APPLICATION_H
11
12
#include "ns3/address.h"
13
#include "ns3/application.h"
14
15
namespace
ns3
16
{
17
18
/**
19
* @ingroup applications
20
* @brief Base class for source applications.
21
*
22
* This class can be used as a base class for source applications.
23
* A source application is one that primarily sources new data towards a single remote client
24
* address and port, and may also receive data (such as an HTTP server).
25
*
26
* The main purpose of this base class application public API is to provide a uniform way to
27
* configure remote and local addresses.
28
*
29
* Unlike the SinkApplication, the SourceApplication does not expose an individual Port attribute.
30
* Instead, the port values are embedded in the Local and Remote address attributes, which should be
31
* configured to an InetSocketAddress or Inet6SocketAddress value that contains the desired port
32
* number.
33
*/
34
class
SourceApplication
:
public
Application
35
{
36
public
:
37
/**
38
* @brief Get the type ID.
39
* @return the object TypeId
40
*/
41
static
TypeId
GetTypeId
();
42
43
SourceApplication
();
44
~SourceApplication
()
override
;
45
46
/**
47
* @brief set the remote address
48
* @param addr remote address
49
*/
50
virtual
void
SetRemote
(
const
Address
& addr);
51
52
/**
53
* @brief get the remote address
54
* @return the remote address
55
*/
56
Address
GetRemote
()
const
;
57
58
protected
:
59
Address
m_peer
;
//!< Peer address
60
Address
m_local
;
//!< Local address to bind to
61
uint8_t
m_tos
;
//!< The packets Type of Service
62
};
63
64
}
// namespace ns3
65
66
#endif
/* SOURCE_APPLICATION_H */
ns3::Address
a polymophic address class
Definition
address.h:90
ns3::Application
The base class for all ns3 applications.
Definition
application.h:51
ns3::SourceApplication
Base class for source applications.
Definition
source-application.h:35
ns3::SourceApplication::~SourceApplication
~SourceApplication() override
Definition
source-application.cc:56
ns3::SourceApplication::m_local
Address m_local
Local address to bind to.
Definition
source-application.h:60
ns3::SourceApplication::GetRemote
Address GetRemote() const
get the remote address
Definition
source-application.cc:72
ns3::SourceApplication::SetRemote
virtual void SetRemote(const Address &addr)
set the remote address
Definition
source-application.cc:62
ns3::SourceApplication::m_tos
uint8_t m_tos
The packets Type of Service.
Definition
source-application.h:61
ns3::SourceApplication::SourceApplication
SourceApplication()
Definition
source-application.cc:50
ns3::SourceApplication::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
source-application.cc:22
ns3::SourceApplication::m_peer
Address m_peer
Peer address.
Definition
source-application.h:59
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
applications
model
source-application.h
Generated on Thu Dec 12 2024 18:40:35 for ns-3 by
1.11.0