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_TFI_PLOT_HH_
00023 # define WIFI_STATS_TFI_PLOT_HH_
00024
00025 # include <boost/multi_array.hpp>
00026
00027 # include <wipal/wifi/stats/module.hh>
00028 # include <wipal/tool/microseconds.hh>
00029
00030 namespace wpl
00031 {
00032
00033 namespace wifi
00034 {
00035
00036 namespace stats
00037 {
00038
00039 struct tfi_plot: public module
00040 {
00041 tfi_plot(const void* other_modules = 0);
00042
00043 template <class Frame>
00044 void
00045 account_frame(const Frame& frame,
00046 const size_t& len80211,
00047 const type::frame_type& type,
00048 const unsigned& subtype,
00049 const bool& retx,
00050 const addr* const& receiver,
00051 const addr* const& transmitter,
00052 const bool& from_ap);
00053
00054 void account_gap(const unsigned& gap_length);
00055 void account_miss();
00056
00057 std::ostream& print(std::ostream& o) const;
00058 void restart();
00059
00060 private:
00061 void end_epoch(const tool::microseconds& new_epoch_start);
00062
00063 enum
00064 {
00065 epoch_length = 102400,
00066 score_step = 10,
00067 load_step = 1,
00068 load_max = 2048
00069 };
00070
00071 boost::multi_array<unsigned, 2> tfi_;
00072 tool::microseconds epoch_start_;
00073 unsigned total_;
00074 unsigned missed_;
00075 };
00076
00077 }
00078
00079 }
00080
00081 }
00082
00083 # include "tfi_plot.hxx"
00084
00085 #endif // ! WIFI_STATS_TFI_PLOT_HH_