trace sink for wifi device that mimics madwifi's athstats tool. More...
#include <athstats-helper.h>
Public Member Functions | |
AthstatsWifiTraceSink () | |
virtual | ~AthstatsWifiTraceSink () |
void | DevRxTrace (std::string context, Ptr< const Packet > p) |
function to be called when the net device receives a packet More... | |
void | DevTxTrace (std::string context, Ptr< const Packet > p) |
function to be called when the net device transmits a packet More... | |
void | Open (std::string const &name) |
Open a file for output. More... | |
void | PhyRxErrorTrace (std::string context, Ptr< const Packet > packet, double snr) |
Function to be called when a frame reception by the PHY layer of the considered device resulted in an error due to a failure in the CRC check of the frame. More... | |
void | PhyRxOkTrace (std::string context, Ptr< const Packet > packet, double snr, WifiMode mode, enum WifiPreamble preamble) |
Function to be called when the PHY layer of the considered device receives a frame. More... | |
void | PhyStateTrace (std::string context, Time start, Time duration, enum WifiPhy::State state) |
Function to be called when the PHY layer of the considered device changes state. More... | |
void | PhyTxTrace (std::string context, Ptr< const Packet > packet, WifiMode mode, WifiPreamble preamble, uint8_t txPower) |
Function to be called when a frame is being transmitted by the PHY layer of the considered device. More... | |
void | TxDataFailedTrace (std::string context, Mac48Address address) |
Function to be called when a data frame transmission by the considered device has failed. More... | |
void | TxFinalDataFailedTrace (std::string context, Mac48Address address) |
Function to be called when the transmission of a data frame has exceeded the retry limit. More... | |
void | TxFinalRtsFailedTrace (std::string context, Mac48Address address) |
Function to be called when the transmission of a RTS frame has exceeded the retry limit. More... | |
void | TxRtsFailedTrace (std::string context, Mac48Address address) |
Function to be called when a RTS frame transmission by the considered device has failed. More... | |
![]() | |
Object () | |
Constructor. More... | |
virtual | ~Object () |
Destructor. More... | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. More... | |
void | Dispose (void) |
Dispose of this Object. More... | |
AggregateIterator | GetAggregateIterator (void) const |
Get an iterator to the Objects aggregated to this one. More... | |
virtual TypeId | GetInstanceTypeId (void) const |
Implement the GetInstanceTypeId method defined in ObjectBase. More... | |
template<typename T > | |
Ptr< T > | GetObject (void) const |
Get a pointer to the requested aggregated Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object. More... | |
void | Initialize (void) |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
![]() | |
SimpleRefCount () | |
Constructor. More... | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
![]() | |
virtual | ~ObjectBase () |
Virtual destructor. More... | |
void | GetAttribute (std::string name, AttributeValue &value) const |
Get the value of an attribute, raising fatal errors if unsuccessful. More... | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising erros. More... | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. More... | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. More... | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. More... | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. More... | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. More... | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. More... | |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
![]() | |
static TypeId | GetTypeId (void) |
Register this type. More... | |
![]() | |
static void | Cleanup (void) |
Noop. More... | |
![]() | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Private Member Functions | |
void | ResetCounters () |
void | WriteStats () |
Private Attributes | |
uint32_t | m_exceededRetryCount |
Time | m_interval |
uint32_t | m_longRetryCount |
uint32_t | m_phyRxErrorCount |
uint32_t | m_phyRxOkCount |
uint32_t | m_phyTxCount |
uint32_t | m_rxCount |
uint32_t | m_shortRetryCount |
uint32_t | m_txCount |
std::ofstream * | m_writer |
Additional Inherited Members | |
![]() | |
Object (const Object &o) | |
Copy an Object. More... | |
virtual void | DoDispose (void) |
Destructor implementation. More... | |
virtual void | DoInitialize (void) |
Initialize() implementation. More... | |
virtual void | NotifyNewAggregate (void) |
Notify all Objects aggregated to this one of a new Object being aggregated. More... | |
![]() | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. More... | |
virtual void | NotifyConstructionCompleted (void) |
Notifier called once the ObjectBase is fully constructed. More... | |
![]() | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
trace sink for wifi device that mimics madwifi's athstats tool.
Introspection did not find any typical Config paths.
The AthstatsWifiTraceSink class is a trace sink to be connected to several of the traces available within a wifi device. The purpose of AthstatsWifiTraceSink is to mimic the behavior of the athstats tool distributed wih the madwifi driver. In particular, the reproduced behavior is that obtained when executing athstats without parameters: a report written in text format is produced every fixed interval, based on the events observed by the wifi device.
Differences with the "real" athstats:
No TraceSources are defined for this type.
Size of this type is 80 bytes (on a 64-bit architecture).
Definition at line 82 of file athstats-helper.h.
ns3::AthstatsWifiTraceSink::AthstatsWifiTraceSink | ( | ) |
Definition at line 124 of file athstats-helper.cc.
References ns3::Simulator::ScheduleNow(), and WriteStats().
|
virtual |
Definition at line 138 of file athstats-helper.cc.
References m_writer, NS_LOG_FUNCTION, and NS_LOG_LOGIC.
function to be called when the net device receives a packet
context | |
p | the packet being received |
Definition at line 184 of file athstats-helper.cc.
References m_rxCount, and NS_LOG_FUNCTION.
Referenced by ns3::AthstatsHelper::EnableAthstats().
function to be called when the net device transmits a packet
context | |
p | the packet being transmitted |
Definition at line 177 of file athstats-helper.cc.
References m_txCount, and NS_LOG_FUNCTION.
Referenced by ns3::AthstatsHelper::EnableAthstats().
|
static |
Definition at line 110 of file athstats-helper.cc.
References m_interval, ns3::MakeTimeAccessor(), ns3::MakeTimeChecker(), ns3::Seconds(), and ns3::TypeId::SetParent().
void ns3::AthstatsWifiTraceSink::Open | ( | std::string const & | name | ) |
Open a file for output.
name | the name of the file to be opened. |
Definition at line 253 of file athstats-helper.cc.
References m_writer, NS_ABORT_MSG_IF, NS_ABORT_MSG_UNLESS, NS_ASSERT_MSG, NS_LOG_FUNCTION, and NS_LOG_LOGIC.
void ns3::AthstatsWifiTraceSink::PhyRxErrorTrace | ( | std::string | context, |
Ptr< const Packet > | packet, | ||
double | snr | ||
) |
Function to be called when a frame reception by the PHY layer of the considered device resulted in an error due to a failure in the CRC check of the frame.
context | |
packet | |
snr |
Definition at line 229 of file athstats-helper.cc.
References m_phyRxErrorCount, and NS_LOG_FUNCTION.
Referenced by ns3::AthstatsHelper::EnableAthstats().
void ns3::AthstatsWifiTraceSink::PhyRxOkTrace | ( | std::string | context, |
Ptr< const Packet > | packet, | ||
double | snr, | ||
WifiMode | mode, | ||
enum WifiPreamble | preamble | ||
) |
Function to be called when the PHY layer of the considered device receives a frame.
context | |
packet | |
snr | |
mode | |
preamble |
Definition at line 222 of file athstats-helper.cc.
References m_phyRxOkCount, and NS_LOG_FUNCTION.
Referenced by ns3::AthstatsHelper::EnableAthstats().
void ns3::AthstatsWifiTraceSink::PhyStateTrace | ( | std::string | context, |
Time | start, | ||
Time | duration, | ||
enum WifiPhy::State | state | ||
) |
Function to be called when the PHY layer of the considered device changes state.
context | |
start | |
duration | |
state |
Definition at line 244 of file athstats-helper.cc.
References NS_LOG_FUNCTION.
Referenced by ns3::AthstatsHelper::EnableAthstats().
void ns3::AthstatsWifiTraceSink::PhyTxTrace | ( | std::string | context, |
Ptr< const Packet > | packet, | ||
WifiMode | mode, | ||
WifiPreamble | preamble, | ||
uint8_t | txPower | ||
) |
Function to be called when a frame is being transmitted by the PHY layer of the considered device.
context | |
packet | |
mode | |
preamble | |
txPower |
Definition at line 236 of file athstats-helper.cc.
References m_phyTxCount, and NS_LOG_FUNCTION.
Referenced by ns3::AthstatsHelper::EnableAthstats().
|
private |
Definition at line 164 of file athstats-helper.cc.
References m_exceededRetryCount, m_longRetryCount, m_phyRxErrorCount, m_phyRxOkCount, m_phyTxCount, m_rxCount, m_shortRetryCount, and m_txCount.
Referenced by WriteStats().
void ns3::AthstatsWifiTraceSink::TxDataFailedTrace | ( | std::string | context, |
Mac48Address | address | ||
) |
Function to be called when a data frame transmission by the considered device has failed.
context | |
address | the MAC address of the remote station |
Definition at line 199 of file athstats-helper.cc.
References m_longRetryCount, and NS_LOG_FUNCTION.
Referenced by ns3::AthstatsHelper::EnableAthstats().
void ns3::AthstatsWifiTraceSink::TxFinalDataFailedTrace | ( | std::string | context, |
Mac48Address | address | ||
) |
Function to be called when the transmission of a data frame has exceeded the retry limit.
context | |
address | the MAC address of the remote station |
Definition at line 213 of file athstats-helper.cc.
References m_exceededRetryCount, and NS_LOG_FUNCTION.
Referenced by ns3::AthstatsHelper::EnableAthstats().
void ns3::AthstatsWifiTraceSink::TxFinalRtsFailedTrace | ( | std::string | context, |
Mac48Address | address | ||
) |
Function to be called when the transmission of a RTS frame has exceeded the retry limit.
context | |
address | the MAC address of the remote station |
Definition at line 206 of file athstats-helper.cc.
References m_exceededRetryCount, and NS_LOG_FUNCTION.
Referenced by ns3::AthstatsHelper::EnableAthstats().
void ns3::AthstatsWifiTraceSink::TxRtsFailedTrace | ( | std::string | context, |
Mac48Address | address | ||
) |
Function to be called when a RTS frame transmission by the considered device has failed.
context | |
address | the MAC address of the remote station |
Definition at line 192 of file athstats-helper.cc.
References m_shortRetryCount, and NS_LOG_FUNCTION.
Referenced by ns3::AthstatsHelper::EnableAthstats().
|
private |
Definition at line 273 of file athstats-helper.cc.
References m_exceededRetryCount, m_interval, m_longRetryCount, m_phyRxErrorCount, m_rxCount, m_shortRetryCount, m_txCount, m_writer, ns3::Now(), NS_ABORT_MSG_UNLESS, ResetCounters(), and ns3::Simulator::Schedule().
Referenced by AthstatsWifiTraceSink().
|
private |
Definition at line 204 of file athstats-helper.h.
Referenced by ResetCounters(), TxFinalDataFailedTrace(), TxFinalRtsFailedTrace(), and WriteStats().
|
private |
Definition at line 211 of file athstats-helper.h.
Referenced by GetTypeId(), and WriteStats().
|
private |
Definition at line 203 of file athstats-helper.h.
Referenced by ResetCounters(), TxDataFailedTrace(), and WriteStats().
|
private |
Definition at line 206 of file athstats-helper.h.
Referenced by PhyRxErrorTrace(), ResetCounters(), and WriteStats().
|
private |
Definition at line 205 of file athstats-helper.h.
Referenced by PhyRxOkTrace(), and ResetCounters().
|
private |
Definition at line 207 of file athstats-helper.h.
Referenced by PhyTxTrace(), and ResetCounters().
|
private |
Definition at line 201 of file athstats-helper.h.
Referenced by DevRxTrace(), ResetCounters(), and WriteStats().
|
private |
Definition at line 202 of file athstats-helper.h.
Referenced by ResetCounters(), TxRtsFailedTrace(), and WriteStats().
|
private |
Definition at line 200 of file athstats-helper.h.
Referenced by DevTxTrace(), ResetCounters(), and WriteStats().
|
private |
Definition at line 209 of file athstats-helper.h.
Referenced by Open(), WriteStats(), and ~AthstatsWifiTraceSink().