A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
athstats-helper.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2009 CTTC
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Nicola Baldo <nbaldo@cttc.es>
19
*/
20
21
#ifndef ATHSTATS_HELPER_H
22
#define ATHSTATS_HELPER_H
23
24
#include <string>
25
#include "ns3/object.h"
26
#include "ns3/attribute.h"
27
#include "ns3/object-factory.h"
28
#include "ns3/node-container.h"
29
#include "ns3/net-device-container.h"
30
#include "ns3/nstime.h"
31
#include "ns3/wifi-phy.h"
32
#include "ns3/double.h"
33
#include "ns3/mac48-address.h"
34
35
namespace
ns3 {
36
37
38
class
NetDevice;
39
45
class
AthstatsHelper
46
{
47
public
:
48
AthstatsHelper
();
49
void
EnableAthstats
(std::string filename, uint32_t nodeid, uint32_t deviceid);
50
void
EnableAthstats
(std::string filename,
Ptr<NetDevice>
nd);
51
void
EnableAthstats
(std::string filename,
NetDeviceContainer
d);
52
void
EnableAthstats
(std::string filename,
NodeContainer
n);
53
54
private
:
55
Time
m_interval
;
56
};
57
58
59
60
82
class
AthstatsWifiTraceSink
:
public
Object
83
{
84
public
:
85
static
TypeId
GetTypeId
(
void
);
86
AthstatsWifiTraceSink
();
87
virtual
~AthstatsWifiTraceSink
();
88
89
96
void
DevTxTrace
(std::string context,
Ptr<const Packet>
p);
97
104
void
DevRxTrace
(std::string context,
Ptr<const Packet>
p);
105
113
void
TxRtsFailedTrace
(std::string context,
Mac48Address
address);
114
122
void
TxDataFailedTrace
(std::string context,
Mac48Address
address);
123
131
void
TxFinalRtsFailedTrace
(std::string context,
Mac48Address
address);
132
140
void
TxFinalDataFailedTrace
(std::string context,
Mac48Address
address);
141
152
void
PhyRxOkTrace
(std::string context,
Ptr<const Packet>
packet,
double
snr,
WifiMode
mode,
enum
WifiPreamble
preamble);
153
163
void
PhyRxErrorTrace
(std::string context,
Ptr<const Packet>
packet,
double
snr);
164
175
void
PhyTxTrace
(std::string context,
Ptr<const Packet>
packet,
WifiMode
mode,
WifiPreamble
preamble, uint8_t txPower);
176
186
void
PhyStateTrace
(std::string context,
Time
start
,
Time
duration,
enum
WifiPhy::State
state);
187
193
void
Open
(std::string
const
& name);
194
195
private
:
199
void
WriteStats
();
200
204
void
ResetCounters
();
205
206
uint32_t
m_txCount
;
207
uint32_t
m_rxCount
;
208
uint32_t
m_shortRetryCount
;
209
uint32_t
m_longRetryCount
;
210
uint32_t
m_exceededRetryCount
;
211
uint32_t
m_phyRxOkCount
;
212
uint32_t
m_phyRxErrorCount
;
213
uint32_t
m_phyTxCount
;
214
215
std::ofstream *
m_writer
;
216
217
Time
m_interval
;
218
219
};
// class AthstatsWifiTraceSink
220
221
222
223
224
}
// namespace ns3
225
226
227
228
229
#endif
/* ATHSTATS_HELPER_H */
src
wifi
helper
athstats-helper.h
Generated on Tue Nov 13 2012 10:32:24 for ns-3 by
1.8.1.2