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_MODULE_HH_
00023 # define WIFI_STATS_MODULE_HH_
00024
00025 # include <string>
00026 # include <cstddef>
00027 extern "C"
00028 {
00029 # include <sys/time.h>
00030 }
00031 # include <boost/optional.hpp>
00032
00033 # include <wipal/wifi/stats/abstract_stats.hh>
00034 # include <wipal/wifi/addr.hh>
00035 # include <wipal/tool/microseconds.hh>
00036 # include <wipal/wifi/frame.hh>
00037
00038 namespace wpl
00039 {
00040
00041 namespace wifi
00042 {
00043
00044 namespace stats
00045 {
00046
00047 # define WP_module_methods_declaration \
00048 typedef boost::optional<std::string> optional_string; \
00049 \
00050 void account_addr(unsigned i, const addr& a); \
00051 \
00052 template <class Frame> \
00053 void \
00054 account_beacon(const Frame& frame, \
00055 const addr* const& ap, \
00056 const addr* const& bss, \
00057 const optional_string& ssid, \
00058 const bool& ibss); \
00059 \
00060 void account_duplicate(); \
00061 void account_expired(); \
00062 \
00063 template <class Frame> \
00064 void \
00065 account_frame(const Frame& frame, \
00066 const size_t& len80211, \
00067 const type::frame_type& type, \
00068 const unsigned& subtype, \
00069 const bool& retx, \
00070 const addr* const& receiver, \
00071 const addr* const& transmitter, \
00072 const bool& from_ap); \
00073 \
00074 void account_gap(const unsigned& gaplen); \
00075 void account_miss(); \
00076 void account_out_of_order(); \
00077 void account_seq_anomaly(); \
00078 \
00079 void restart()
00080
00081 struct module: public abstract_stats
00082 {
00083 WP_module_methods_declaration;
00084 };
00085
00086 template <class Head, class Tail>
00087 struct module_list: public Head, public Tail
00088 {
00089 module_list();
00090
00091 template <class ML>
00092 module_list(const ML* other_modules);
00093
00094 WP_module_methods_declaration;
00095
00096 std::ostream& print(std::ostream& os) const;
00097
00098 template <class T> T& get();
00099 template <class T> const T& get() const;
00100 };
00101
00102 # undef WP_module_methods_declaration
00103
00104 template <class Head, class Tail>
00105 std::ostream&
00106 operator << (std::ostream& os, const module_list<Head, Tail>& ml);
00107
00108 }
00109
00110 }
00111
00112 }
00113
00114 # include "module.hxx"
00115
00116 #endif // ! WIFI_STATS_MODULE_HH_