00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef WIFI_TIME_CONVERTER_HH_
00023 # define WIFI_TIME_CONVERTER_HH_
00024
00025 extern "C"
00026 {
00027 # include <inttypes.h>
00028 }
00029
00030 # include <wipal/tool/static_base.hh>
00031 # include <wipal/tool/microseconds.hh>
00032
00033 namespace wifi
00034 {
00035
00051 template <class PhyHeaderType, class Bottom = tool::bottom>
00052 struct time_converter: WP_INHERIT(public tool::static_base,
00053 time_converter<PhyHeaderType, Bottom>)
00054 {
00056
00057 typedef WP_GET_EXACT(Bottom, time_converter<PhyHeaderType, Bottom>)
00058 exact_type;
00059 typedef tool::static_base<exact_type> super_type;
00061
00063 typedef struct timeval pcap_time_type;
00064
00066 typedef typename PhyHeaderType::time_type phy_time_type;
00067
00069 time_converter(const pcap_time_type& local_pcap_time,
00070 const phy_time_type& local_phy_time,
00071 const tool::microseconds& global_time);
00072
00074 struct time_values
00075 {
00077 time_values();
00078
00080 time_values(const pcap_time_type& pcap_time,
00081 const phy_time_type& phy_time);
00082
00084 pcap_time_type pcap_time;
00085
00087 phy_time_type phy_time;
00088 };
00089
00091 time_values operator () (const tool::microseconds& global_time) const;
00092
00093 private:
00094 time_values local_reference_;
00095 tool::microseconds global_reference_;
00096 };
00097
00098 }
00099
00100 # include "time_converter.hxx"
00101
00102 #endif // ! WIFI_TIME_CONVERTER_HH_