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
00029 namespace rtap
00030 {
00031
00033 struct header
00034 {
00035
00036 enum field
00037 {
00038 tsft = 0x00000001,
00039 flags = 0x00000002,
00040 rate = 0x00000004,
00041 channel = 0x00000008,
00042 fhss = 0x00000010,
00043 dbm_antsignal = 0x00000020,
00044 dbm_antnoise = 0x00000040,
00045 lock_quality = 0x00000080,
00046 tx_attenuation = 0x00000100,
00047 db_tx_attenuation = 0x00000200,
00048 dbm_tx_power = 0x00000400,
00049 antenna = 0x00000800,
00050 db_antsignal = 0x00001000,
00051 db_antnoise = 0x00002000,
00052 ext = 0x10000000,
00053 };
00054
00055 uint8_t it_version;
00056 uint8_t it_pad;
00057 uint16_t it_len;
00058 uint32_t it_present;
00059 } __attribute__((__packed__));
00060
00070 void
00071 check(const header* h, size_t caplen);
00072
00079 const void*
00080 first_field(const header*, size_t caplen);
00081
00088 const void*
00089 get_80211(const header*, size_t caplen);
00090
00098 tool::microseconds
00099 get_tsft(const header*, size_t caplen, const void* first_field);
00100
00113 bool
00114 eq_80211(const header* lhs, size_t lhs_caplen,
00115 const header* rhs, size_t rhs_caplen);
00116
00131 bool
00132 eq_time_and_80211(const header* lhs, size_t lhs_caplen,
00133 const header* rhs, size_t rhs_caplen,
00134 unsigned precision = phy::eq_time_default_precision);
00135
00136 }
00137
00138 # include "rtap_header.hxx"
00139
00140 #endif // ! RTAP_HEADER_HH_