wpl::wifi::dissector< Hooks > Struct Template Reference

IEEE 802.11 frame parser. More...

#include <wipal/wifi/dissector/dissector.hh>

List of all members.

Public Member Functions

 dissector (const Hooks &=Hooks())
 dissector (const void *frm, size_t caplen, const Hooks &hooks=Hooks())
dissector_status::status status () const
void operator() (const void *frm, size_t caplen)
Hooks accessors

Hooks & hooks ()
const Hooks & hooks () const

Detailed Description

template<class Hooks = dissector_default_hooks>
struct wpl::wifi::dissector< Hooks >

IEEE 802.11 frame parser.

This class template provides mechanisms to parse IEEE 802.11 frames. Its template parameter should be a class that defines several hooks to be called at different parsing stages.

There is basically two modes of operation : triggering the parsing implicitly at object creation, or explicitly by calling operator()().

 const void*     frame = // ...
 const unsigned  caplen = // ...

 my_hooks  hooks1 = // ...
 my_hooks  hooks2 = // ...

 dissector<my_hooks>  d1 (hooks1);                // No parsing done yet.
 dissector<my_hooks>  d2 (frame, caplen, hooks2); // Implicitely parse
                                                  // frame.

 d1(frame, caplen); // Do parse frame explicitely.

There is many different hooks. Look dissector_default_hooks's documentation for a list. Although subclassing dissector_default_hooks is a good idea in order to implement your set of hooks, this is not mandatory.

The status() method allows you to get the parser's status after the parsing. When this is relevant, this state is provided to hook functions as argument.

See also:
dissector_default_hooks, dissector_status::status

Constructor & Destructor Documentation

template<class Hooks >
wpl::wifi::dissector< Hooks >::dissector ( const void *  frm,
size_t  caplen,
const Hooks &  hooks = Hooks () 
) [inline]

Construct a dissector and parse a frame.

Parameters:
[in] frm Pointer to the frame.
[in] caplen Available bytes in the frame. The frame may be truncated. In such case, the parsing ends with the parsing in an intermediary state.
[in] hooks The hooks to use.
See also:
status()

Member Function Documentation

template<class Hooks >
void wpl::wifi::dissector< Hooks >::operator() ( const void *  frm,
size_t  caplen 
) [inline]

Do parse a frame.

Parameters:
[in] frm Pointer to the frame.
[in] caplen Available bytes in the frame. The frame may be truncated. In such case, the parsing ends with the parsing in an intermediary state.
See also:
status()
template<class Hooks >
dissector_status::status wpl::wifi::dissector< Hooks >::status (  )  const [inline]

Get the current parser state.

See also:
dissector_status::status

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

Generated by  doxygen 1.6.2