00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef RTAP_HEADER_HH_
00023 # define RTAP_HEADER_HH_
00024
00025 # include <wipal/phy/phy.hh>
00026 # include <wipal/tool/microseconds.hh>
00027
00028
00029 namespace rtap
00030 {
00031 struct header;
00032 }
00033
00034
00035 namespace tool
00036 {
00037
00038 template <>
00039 struct types<rtap::header>
00040 {
00041 typedef phy::uint64_time<> time_type;
00042 };
00043
00044 }
00045
00047 namespace rtap
00048 {
00049
00051 struct header: public phy::header<rtap::header>
00052 {
00054
00055 typedef rtap::header exact_type;
00056 typedef WP_TYPE_(time_type, exact_type) time_type;
00057
00058 size_t len_impl(size_t, bool) const;
00059 time_type time_get_impl(bool) const;
00060 void time_set_impl(const time_type&, bool);
00061
00062 template <class D1, class D2>
00063 static bool eq_time(const pcapxx::frame_descriptor<D1>& lhs,
00064 const pcapxx::frame_descriptor<D2>& rhs,
00065 const unsigned prec,
00066 const tool::endian::endianness phy_end);
00068
00076 const void*
00077 first_field(size_t caplen) const;
00078
00086 void*
00087 first_field(size_t caplen);
00088
00090 uint64_t
00091 tsft_get(size_t caplen) const;
00092
00093
00094 enum field
00095 {
00096 tsft = 0x00000001,
00097 flags = 0x00000002,
00098 rate = 0x00000004,
00099 channel = 0x00000008,
00100 fhss = 0x00000010,
00101 dbm_antsignal = 0x00000020,
00102 dbm_antnoise = 0x00000040,
00103 lock_quality = 0x00000080,
00104 tx_attenuation = 0x00000100,
00105 db_tx_attenuation = 0x00000200,
00106 dbm_tx_power = 0x00000400,
00107 antenna = 0x00000800,
00108 db_antsignal = 0x00001000,
00109 db_antnoise = 0x00002000,
00110 ext = 0x10000000,
00111 };
00112
00113 uint8_t it_version;
00114 uint8_t it_pad;
00115 uint16_t it_len;
00116 uint32_t it_present;
00117 } __attribute__((__packed__));
00118
00119
00120 }
00121
00122 # include "rtap_header.hxx"
00123
00124 #endif // ! RTAP_HEADER_HH_