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_BSS_STATS_HH_
00023 # define WIFI_STATS_BSS_STATS_HH_
00024
00025 # include <map>
00026
00027 # include <wipal/wifi/stats/module.hh>
00028 # include <wipal/wifi/addr.hh>
00029 # include <wipal/wifi/essid.hh>
00030
00031 namespace wpl
00032 {
00033
00034 namespace wifi
00035 {
00036
00037 namespace stats
00038 {
00039
00040 struct bss_stats: public module
00041 {
00042 bss_stats(const void* other_modules = 0);
00043
00044 template <class Frame>
00045 void
00046 account_beacon(const Frame& frame,
00047 const addr* const& ap,
00048 const addr* const& bss,
00049 const optional_string& ssid,
00050 const bool& ibss);
00051
00052 std::ostream& print(std::ostream& o) const;
00053
00054 private:
00055 struct single_sta_stats
00056 {
00057 single_sta_stats();
00058
00059 typedef std::map<essid, unsigned> essid_stats;
00060
00061 unsigned total;
00062 unsigned independent;
00063 essid_stats essids;
00064 };
00065
00066 struct single_bss_stats
00067 {
00068 typedef std::map<addr, single_sta_stats> sta_stats;
00069
00070 single_bss_stats();
00071
00072 bool operator < (const single_bss_stats& rhs) const;
00073 bool operator == (const single_bss_stats& rhs) const;
00074
00075 unsigned total_;
00076 sta_stats sta_stats_;
00077 };
00078
00079 typedef std::map<wifi::addr, single_bss_stats> internal_stats;
00080
00081 unsigned beacon_count_;
00082 unsigned ap_count_;
00083 internal_stats bss_stats_;
00084 };
00085
00086 }
00087
00088 }
00089
00090 }
00091
00092 # include "bss_stats.hxx"
00093
00094 #endif // ! WIFI_STATS_BSS_STATS_HH_