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