#include </tmp/wscout/trace-tools-0.1/src/wit_import/wit_importer.hh>
Public Types | |
enum | error { success = 0, malformed_frame = 1, malformed_prism = 2, malformed_802 = 3, malformed_other = 4, driver_reported = 5, unexpected_section = 6, bad_length = 7, bad_type_subtype = 8 } |
Public Member Functions | |
importer (const std::string &prefix) | |
void | got_frame (const pcapxx::pkthdr *h, const void *p) |
Protected Types | |
enum | { channels_max = 14 } |
Protected Member Functions | |
std::string | handle_time_data (const pcapxx::pkthdr *) |
void | handle_malformed_prism () |
const prism::header * | handle_prism_header (const std::string &time_string, const void *, size_t caplen) |
Static Protected Member Functions | |
static std::string | frames_data_filename (const std::string &, unsigned) |
static std::string | mapping_filename (const std::string &, unsigned) |
Protected Attributes | |
unsigned | last_channel_ |
boost::posix_time::ptime | last_frame_ |
unsigned | last_id_ [channels_max] |
std::vector < tool::datafile > | frames_data_ |
std::vector < wifi::addr_mapping > | mappings_ |
Static Protected Attributes | |
static const std::string | db_null = "\\N" |
Classes | |
struct | hooks |
Parse a 802.11 frame and retrieve some fields that wit::importer needs. More... |
The created data files are designed to be loaded into databases using LOAD DATA INFILE SQL commands.
enum wit::importer::error |
WIT's createRawDataDatabase.pl error codes.
wit::importer::importer | ( | const std::string & | prefix | ) |
Contruct a wit::importer given a prefix to use for data files.
The created data files will have the name <prefix>_c<channel> (for raw frames) and
<prefix>_c<channel>_MACIndex (for address to integer mappings).
void wit::importer::got_frame | ( | const pcapxx::pkthdr * | h, | |
const void * | p | |||
) | [inline] |
Import a frame in the data files.
[in] | h | Pointer to the frame's PCAP header. |
[in] | p | Pointer to the frame. |
std::string wit::importer::frames_data_filename | ( | const std::string & | prefix, | |
unsigned | channel | |||
) | [inline, static, protected] |
Get the name of a frames data file given a prefix and a channel.
std::string wit::importer::mapping_filename | ( | const std::string & | prefix, | |
unsigned | channel | |||
) | [inline, static, protected] |
Get the name of a mapping data file given a prefix and a channel.
std::string wit::importer::handle_time_data | ( | const pcapxx::pkthdr * | h | ) | [inline, protected] |
Update the object's time information and return a time string for a given frame's PCAP header.
void wit::importer::handle_malformed_prism | ( | ) | [inline, protected] |
Update data files when a Prism header was trucated.
const prism::header * wit::importer::handle_prism_header | ( | const std::string & | time_string, | |
const void * | p, | |||
size_t | caplen | |||
) | [inline, protected] |
Parse a frame's Prism header and update data files accordingly.
const std::string wit::importer::db_null = "\\N" [static, protected] |
NULL field representation.
unsigned wit::importer::last_channel_ [protected] |
Channel of last received frame.
boost::posix_time::ptime wit::importer::last_frame_ [protected] |
Time of arrival of last received frame.
unsigned wit::importer::last_id_[channels_max] [protected] |
ID of last receveid frame (per channel).
std::vector<tool::datafile> wit::importer::frames_data_ [protected] |
Frames data for each channel.
std::vector<wifi::addr_mapping> wit::importer::mappings_ [protected] |
Address to index mapping for each channel.