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 static bool eq_time(const pcapxx::frame_descriptor& lhs,
00062 const pcapxx::frame_descriptor& rhs,
00063 tool::endian::endianness phy_end,
00064 unsigned prec);
00066
00074 const void*
00075 first_field(size_t caplen) const;
00076
00084 void*
00085 first_field(size_t caplen);
00086
00088 uint64_t
00089 tsft_get(size_t caplen) const;
00090
00091
00092 enum field
00093 {
00094 tsft = 0x00000001,
00095 flags = 0x00000002,
00096 rate = 0x00000004,
00097 channel = 0x00000008,
00098 fhss = 0x00000010,
00099 dbm_antsignal = 0x00000020,
00100 dbm_antnoise = 0x00000040,
00101 lock_quality = 0x00000080,
00102 tx_attenuation = 0x00000100,
00103 db_tx_attenuation = 0x00000200,
00104 dbm_tx_power = 0x00000400,
00105 antenna = 0x00000800,
00106 db_antsignal = 0x00001000,
00107 db_antnoise = 0x00002000,
00108 ext = 0x10000000,
00109 };
00110
00111 uint8_t it_version;
00112 uint8_t it_pad;
00113 uint16_t it_len;
00114 uint32_t it_present;
00115 } __attribute__((__packed__));
00116
00117
00118 }
00119
00120 # include "rtap_header.hxx"
00121
00122 #endif // ! RTAP_HEADER_HH_