00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef WIFI_MACTIME_TRACKER_HH_
00023 # define WIFI_MACTIME_TRACKER_HH_
00024
00025 # include <wipal/pcap/frame_descriptor.hh>
00026 # include <wipal/wifi/frame/frame.hh>
00027
00028 extern "C"
00029 {
00030 # include <inttypes.h>
00031 }
00032
00033 # include <wipal/tool/static_base.hh>
00034 # include <wipal/tool/microseconds.hh>
00035 # include <wipal/phy/prism_header.hh>
00036
00037 namespace wifi
00038 {
00039
00052 template <class Bottom = tool::bottom>
00053 struct mactime_tracker: WP_INHERIT(public tool::static_base,
00054 mactime_tracker<Bottom>)
00055 {
00062 mactime_tracker(bool force_pcap);
00063
00070 template <class UIntType>
00071 void
00072 tick_uint(UIntType ts);
00073
00081 void tick_tv(const struct timeval& tv);
00082
00084 template <class HeaderType, class D>
00085 void
00086 tick(const pcapxx::frame_descriptor<D>& frame,
00087 tool::endian::endianness phy_end);
00088
00090 tool::microseconds microseconds() const;
00091
00092 private:
00093 uint64_t last_stamp_;
00094 tool::microseconds ms_count_;
00095 bool force_pcap_;
00096 };
00097
00098 }
00099
00100 # include "mactime_tracker.hxx"
00101
00102 #endif // ! WIFI_MACTIME_TRACKER_HH_