00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef WIFI_STATS_SIMPLE_COUNTERS_HH_
00023 # define WIFI_STATS_SIMPLE_COUNTERS_HH_
00024
00025 extern "C"
00026 {
00027 # include <stdint.h>
00028 }
00029
00030 # include <wipal/wifi/stats/module.hh>
00031
00032 namespace wpl
00033 {
00034
00035 namespace wifi
00036 {
00037
00038 namespace stats
00039 {
00040
00041 struct simple_counters: public module
00042 {
00043 simple_counters(const void* other_modules = 0);
00044
00045 void account_duplicate();
00046 void account_expired();
00047
00048 template <class Frame>
00049 void
00050 account_frame(const Frame& frame,
00051 const size_t& len80211,
00052 const type::frame_type& type,
00053 const unsigned& subtype,
00054 const bool& retx,
00055 const addr* const& receiver,
00056 const addr* const& transmitter,
00057 const bool& from_ap);
00058
00059 void account_gap(const unsigned& gaplen);
00060 void account_out_of_order();
00061 void account_seq_anomaly();
00062
00063 std::ostream& print(std::ostream& o) const;
00064
00065 unsigned total() const;
00066 unsigned type_count(unsigned type) const ;
00067 unsigned subtype_count(unsigned type, unsigned subtype) const;
00068
00069 private:
00070 unsigned total_;
00071 uint64_t size_;
00072 unsigned ap_total_;
00073 uint64_t ap_size_;
00074 unsigned retransmitted_;
00075 unsigned expired_;
00076 unsigned out_of_order_;
00077 unsigned duplicate_;
00078 unsigned gap_;
00079 unsigned seq_anomaly_;
00080 unsigned type_count_[4];
00081 uint64_t type_size_[4];
00082 unsigned subtype_count_[4][16];
00083 uint64_t subtype_size_[4][16];
00084 };
00085
00086 }
00087
00088 }
00089
00090 }
00091
00092 # include "simple_counters.hxx"
00093
00094 #endif // ! WIFI_STATS_SIMPLE_COUNTERS_HH_