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