A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
tutorial-app.h
Go to the documentation of this file.
1
/*
2
* This program is free software; you can redistribute it and/or modify
3
* it under the terms of the GNU General Public License version 2 as
4
* published by the Free Software Foundation;
5
*
6
* This program is distributed in the hope that it will be useful,
7
* but WITHOUT ANY WARRANTY; without even the implied warranty of
8
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9
* GNU General Public License for more details.
10
*
11
* You should have received a copy of the GNU General Public License
12
* along with this program; if not, write to the Free Software
13
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
14
*/
15
16
#ifndef TUTORIAL_APP_H
17
#define TUTORIAL_APP_H
18
19
#include "ns3/core-module.h"
20
#include "ns3/internet-module.h"
21
#include "ns3/network-module.h"
22
23
namespace
ns3
24
{
25
26
class
Application;
27
31
class
TutorialApp
:
public
Application
32
{
33
public
:
34
TutorialApp
();
35
~TutorialApp
()
override
;
36
41
static
TypeId
GetTypeId
();
42
51
void
Setup
(
Ptr<Socket>
socket,
52
Address
address
,
53
uint32_t
packetSize
,
54
uint32_t nPackets,
55
DataRate
dataRate);
56
57
private
:
58
void
StartApplication
()
override
;
59
void
StopApplication
()
override
;
60
62
void
ScheduleTx
();
64
void
SendPacket
();
65
66
Ptr<Socket>
m_socket
;
67
Address
m_peer
;
68
uint32_t
m_packetSize
;
69
uint32_t
m_nPackets
;
70
DataRate
m_dataRate
;
71
EventId
m_sendEvent
;
72
bool
m_running
;
73
uint32_t
m_packetsSent
;
74
};
75
76
}
// namespace ns3
77
78
#endif
/* TUTORIAL_APP_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::DataRate
Class for representing data rates.
Definition:
data-rate.h:89
ns3::EventId
An identifier for simulation events.
Definition:
event-id.h:55
ns3::Ptr< Socket >
ns3::TutorialApp
Tutorial - a simple Application sending packets.
Definition:
tutorial-app.h:32
ns3::TutorialApp::StopApplication
void StopApplication() override
Application specific shutdown code.
Definition:
tutorial-app.cc:75
ns3::TutorialApp::ScheduleTx
void ScheduleTx()
Schedule a new transmission.
Definition:
tutorial-app.cc:103
ns3::TutorialApp::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition:
tutorial-app.cc:41
ns3::TutorialApp::TutorialApp
TutorialApp()
Definition:
tutorial-app.cc:22
ns3::TutorialApp::~TutorialApp
~TutorialApp() override
Definition:
tutorial-app.cc:34
ns3::TutorialApp::m_sendEvent
EventId m_sendEvent
Send event.
Definition:
tutorial-app.h:71
ns3::TutorialApp::m_socket
Ptr< Socket > m_socket
The transmission socket.
Definition:
tutorial-app.h:66
ns3::TutorialApp::m_packetsSent
uint32_t m_packetsSent
The number of packets sent.
Definition:
tutorial-app.h:73
ns3::TutorialApp::SendPacket
void SendPacket()
Send a packet.
Definition:
tutorial-app.cc:91
ns3::TutorialApp::m_peer
Address m_peer
The destination address.
Definition:
tutorial-app.h:67
ns3::TutorialApp::m_packetSize
uint32_t m_packetSize
The packet size.
Definition:
tutorial-app.h:68
ns3::TutorialApp::Setup
void Setup(Ptr< Socket > socket, Address address, uint32_t packetSize, uint32_t nPackets, DataRate dataRate)
Setup the socket.
Definition:
tutorial-app.cc:51
ns3::TutorialApp::StartApplication
void StartApplication() override
Application specific startup code.
Definition:
tutorial-app.cc:65
ns3::TutorialApp::m_dataRate
DataRate m_dataRate
The data rate to use.
Definition:
tutorial-app.h:70
ns3::TutorialApp::m_nPackets
uint32_t m_nPackets
The number of packets to send.
Definition:
tutorial-app.h:69
ns3::TutorialApp::m_running
bool m_running
True if the application is running.
Definition:
tutorial-app.h:72
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
first.address
address
Definition:
first.py:47
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
packetSize
static const uint32_t packetSize
Packet size generated at the AP.
Definition:
wifi-power-adaptation-distance.cc:111
examples
tutorial
tutorial-app.h
Generated on Sun Mar 3 2024 17:10:52 for ns-3 by
1.9.1