A Discrete-Event Network Simulator
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
24namespace ns3 {
25
26class Application;
27
32{
33public:
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
53private:
54 virtual void StartApplication (void);
55 virtual void StopApplication (void);
56
58 void ScheduleTx (void);
60 void SendPacket (void);
61
68 bool m_running;
70};
71
72} // namespace ns3
73
74#endif /* TUTORIAL_APP_H */
a polymophic address class
Definition: address.h:91
The base class for all ns3 applications.
Definition: application.h:61
Class for representing data rates.
Definition: data-rate.h:89
An identifier for simulation events.
Definition: event-id.h:54
Tutorial - a simple Application sending packets.
Definition: tutorial-app.h:32
virtual ~TutorialApp()
Definition: tutorial-app.cc:34
static TypeId GetTypeId(void)
Register this type.
Definition: tutorial-app.cc:40
virtual void StopApplication(void)
Application specific shutdown code.
Definition: tutorial-app.cc:71
EventId m_sendEvent
Send event.
Definition: tutorial-app.h:67
Ptr< Socket > m_socket
The tranmission socket.
Definition: tutorial-app.h:62
uint32_t m_packetsSent
The number of pacts sent.
Definition: tutorial-app.h:69
void ScheduleTx(void)
Schedule a new transmission.
Definition: tutorial-app.cc:99
void SendPacket(void)
Send a packet.
Definition: tutorial-app.cc:87
Address m_peer
The destination address.
Definition: tutorial-app.h:63
uint32_t m_packetSize
The packet size.
Definition: tutorial-app.h:64
void Setup(Ptr< Socket > socket, Address address, uint32_t packetSize, uint32_t nPackets, DataRate dataRate)
Setup the socket.
Definition: tutorial-app.cc:51
DataRate m_dataRate
The datarate to use.
Definition: tutorial-app.h:66
uint32_t m_nPackets
The number of pacts to send.
Definition: tutorial-app.h:65
virtual void StartApplication(void)
Application specific startup code.
Definition: tutorial-app.cc:61
bool m_running
True if the application is running.
Definition: tutorial-app.h:68
a unique identifier for an interface.
Definition: type-id.h:59
address
Definition: first.py:44
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static const uint32_t packetSize
Pcket size generated at the AP.