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