14 #ifndef HH_SENF_Ext_NetEmu_WLAN_WifiStatistics_ 15 #define HH_SENF_Ext_NetEmu_WLAN_WifiStatistics_ 1 19 # include <sys/stat.h> 21 #include <boost/unordered/unordered_map.hpp> 22 #include <boost/property_tree/ptree.hpp> 36 mmapFile (std::string
const & fname);
39 void *
open(std::string
const & fname);
48 if ((next_ +
sizeof(T)) >
end())
49 throw std::exception();
50 T* t ((T*) ((
void*)next_));
52 return (T
const &) *t;
55 std::uint8_t *
next(
size_t const & len) {
56 if ((next_ + len) >
end())
57 throw std::exception();
58 std::uint8_t *t ((std::uint8_t*)next_);
64 T
const &
at(off_t
const & pos) {
65 if ((begin_ + pos +
sizeof(T)) >
end())
66 throw std::exception();
67 T* t ((T*) ((
void*)(begin_ + pos)));
68 return (T
const &) *t;
74 std::uint8_t *begin_, *end_, *next_, *buffer_;
79 struct StatsDataCollectorKernel {
129 total = totalBytes = badFCS = badFCSBytes = rTx = rTxBytes = airTime = 0;
141 WifiStatistics (std::string ifName, std::string debugFS =
"/sys/kernel/debug");
144 bool enable(
bool on =
true);
148 WifiStatisticsMap
const & map()
const;
150 std::uint32_t tag()
const;
151 std::uint32_t invalidEntries()
const;
152 std::uint32_t ioErrors()
const;
157 std::string debugFsPath_;
158 WifiStatisticsMap map_;
161 std::uint32_t invalidEntries_;
162 std::uint32_t ioErrors_;
config::time_type clock_type
std::uint8_t * next(size_t const &len)
senf::StatisticsData bitrate
mmapFile(std::string const &fname)
senf::StatisticsData signal
StatsDataCollectorKernel bitrateNonData
senf::StatisticsData signalNonData
std::uint32_t rTx_packets
struct senf::emu::StatsDataCollectorKernel __attribute__((packed))
boost::unordered_map< senf::MACAddress, WifiStatisticsData > WifiStatisticsMap
StatsDataCollectorKernel signalNonData
std::uint32_t bad_fcs_bytes
T const & at(off_t const &pos)
void * open(std::string const &fname)
senf::ClockService::clock_type lastSeen
std::uint32_t badFCSBytes
StatsDataPktCountsKernel pktCounts
senf::StatisticsData bitrateNonData
StatsDataCollectorKernel bitrate
StatsDataCollectorKernel signal
std::uint32_t bad_fcs_packets