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 namespace wpl
00029 {
00030
00031
00032 namespace rtap
00033 {
00034 struct header;
00035 }
00036
00037
00038 namespace tool
00039 {
00040
00041 template <>
00042 struct types<rtap::header>
00043 {
00044 typedef phy::uint64_time<> time_type;
00045 };
00046
00047 }
00048
00050 namespace rtap
00051 {
00052
00054 struct header: public phy::header<rtap::header>
00055 {
00056 typedef rtap::header exact_type;
00057 typedef WP_TYPE_(time_type, exact_type) time_type;
00058
00059 size_t len_impl(size_t, bool) const;
00060 time_type time_get_impl(bool) const;
00061 void time_set_impl(const time_type&, bool);
00062
00063 template <class S1, class S2>
00064 static bool
00065 eq_time(const pkt::packet<S1>& lhs,
00066 const pkt::packet<S2>& rhs,
00067 const unsigned prec,
00068 const tool::end::endianness phy_end);
00069
00077 const void*
00078 first_field(size_t caplen) const;
00079
00087 void*
00088 first_field(size_t caplen);
00089
00091 uint64_t
00092 tsft_get(size_t caplen) const;
00093
00094
00095 enum field
00096 {
00097 tsft = 0x00000001,
00098 flags = 0x00000002,
00099 rate = 0x00000004,
00100 channel = 0x00000008,
00101 fhss = 0x00000010,
00102 dbm_antsignal = 0x00000020,
00103 dbm_antnoise = 0x00000040,
00104 lock_quality = 0x00000080,
00105 tx_attenuation = 0x00000100,
00106 db_tx_attenuation = 0x00000200,
00107 dbm_tx_power = 0x00000400,
00108 antenna = 0x00000800,
00109 db_antsignal = 0x00001000,
00110 db_antnoise = 0x00002000,
00111 ext = 0x10000000,
00112 };
00113
00114 uint8_t it_version;
00115 uint8_t it_pad;
00116 uint16_t it_len;
00117 uint32_t it_present;
00118 } __attribute__((__packed__));
00119
00120 }
00121
00122 }
00123
00124 # include "rtap_header.hxx"
00125
00126 #endif // ! RTAP_HEADER_HH_