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