wit::importer Struct Reference

Functor to create WIT data files from PCAP traces. More...

#include </tmp/wipal-release/src/wit-import/wit_importer.hh>

List of all members.

Classes

struct  hooks
 Parse a 802.11 frame and retrieve some fields that wit::importer needs. More...

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)
template<class T >
void operator() (const wpl::pkt::packet< T > &d)

Protected Types

enum  { channels_max = 14 }

Protected Member Functions

std::string handle_time_data (const wpl::pkt::metadata &)
void handle_malformed_prism ()
const wpl::prism::headerhandle_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< wpl::tool::datafileframes_data_
std::vector
< wpl::wifi::addr_mapping
mappings_

Static Protected Attributes

static const std::string db_null = "\\N"

Detailed Description

Functor to create WIT data files from PCAP traces.

The created data files are designed to be loaded into databases using LOAD DATA INFILE SQL commands.


Member Enumeration Documentation

anonymous enum [protected]
Enumerator:
channels_max 

Maximum number of Wi-Fi channels.


Constructor & Destructor Documentation

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).


Member Function Documentation

const wpl::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.

Returns:
A pointer to the Prism header, or NULL if the header is truncated. In this case, the data files have been fully updated and processing may stop safely for this frame.
template<class T >
void wit::importer::operator() ( const wpl::pkt::packet< T > &  d  )  [inline]

Import a frame in the data files.

Parameters:
[in] h Pointer to the frame's PCAP header.
[in] p Pointer to the frame.

The documentation for this struct was generated from the following files:

Generated by  doxygen 1.6.2