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_ACTIVITY_HH_
00023 # define WIFI_FRAME_STATS_ACTIVITY_HH_
00024
00025 # include <wipal/wifi/frame/stats/abstract_stats.hh>
00026 # include <wipal/wifi/frame/stats/epoch_tracker.hh>
00027
00028 namespace wifi
00029 {
00030
00031 namespace frame
00032 {
00033
00034 namespace stats
00035 {
00036
00037 struct activity: public abstract_stats
00038 {
00039 void account_frame(const tool::microseconds& timestamp,
00040 unsigned len,
00041 unsigned type,
00042 unsigned subtype,
00043 bool from_ap);
00044
00045 void restart();
00046 std::ostream& print(std::ostream& o) const;
00047
00048 private:
00049 enum { epoch_length = 60 * 1000000 };
00050
00051 struct epoch
00052 {
00053 epoch();
00054
00055 unsigned count;
00056 unsigned ap_count;
00057 unsigned type_count[4];
00058 unsigned subtype_count[4][16];
00059 unsigned size;
00060 unsigned ap_size;
00061 unsigned type_size[4];
00062 unsigned subtype_size[4][16];
00063 };
00064
00065 private:
00066 epoch_tracker<epoch, epoch_length> tracker_;
00067 };
00068
00069 }
00070
00071 }
00072
00073 }
00074
00075 # include "activity.hxx"
00076
00077 #endif // ! WIFI_FRAME_STATS_ACTIVITY_HH_