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 {
00057 mactime_tracker();
00058
00065 void tick_32(uint32_t ts);
00066
00072 void tick_64(uint64_t ts);
00073
00075 void tick_tv(const struct timeval& tv);
00076
00077
00079 template <class HeaderType>
00080 void
00081 tick(const pcapxx::frame_descriptor& frame,
00082 tool::endian::endianness phy_end);
00083
00085 tool::microseconds microseconds() const;
00086
00087 private:
00088 uint32_t low_bits_;
00089 unsigned wrap_count_;
00090 };
00091
00092 }
00093
00094 # include "mactime_tracker.hxx"
00095
00096 #endif // ! WIFI_MACTIME_TRACKER_HH_