#include <wipal/wifi/mactime_tracker.hh>
Public Types | |
typedef uint32_t | mactime_type |
typedef HIDDEN | exact_type |
Public Member Functions | |
mactime_tracker () | |
mactime_tracker (const mactime_type &mactime_start) | |
void | tick (const mactime_type &) |
void | tick (const prism::header *header, size_t caplen, bool swapped) |
tool::microseconds | microseconds () const |
const mactime_type & | mactime () const |
Downcast methods | |
const exact_type & | exact () const |
exact_type & | exact () |
const exact_type * | exact_ptr () const |
exact_type * | exact_ptr () |
Prism headers have a mactime
field that holds frames' MAC arrival time. But this field is only 32 bits long, thus wrapping every one hour and a half (roughly). This class tracks the evolution of mactime
fields from Prism headers and maintains a microsecond count that does not wrap.
Just call the tick() method for every mactime
fields you get in your trace.
typedef uint32_t wifi::mactime_tracker< Bottom >::mactime_type |
Type of Prism headers' mactime
fields.
typedef HIDDEN tool::static_base< Bottom >::exact_type [inherited] |
Exact type for this template instanciation.
Reimplemented in pcapxx::descriptor< Bottom >, pcapxx::internals::frame_iterator< Bottom >, tool::iterable< Bottom >, tool::iterator< Bottom >, tool::valued_iterator< Bottom >, tool::window< InputIterator, WSize, Step, Bottom >, wifi::frame::filter::internals::non_noisy_prism_iterator< I, B, Bottom >, wifi::frame::filter::internals::uniquely_identifiable_iterator< U, I, H, B, Bottom >, and wifi::time_converter< Bottom >.
wifi::mactime_tracker< Bottom >::mactime_tracker | ( | ) | [inline] |
Default constructor - initialize the microsecond count to zero.
wifi::mactime_tracker< Bottom >::mactime_tracker | ( | const mactime_type & | mactime_start | ) | [inline] |
Construct a mactime
tracker according to the given starting time.
void wifi::mactime_tracker< Bottom >::tick | ( | const mactime_type & | m | ) | [inline] |
Update the tracker with the giver mactime
.
void wifi::mactime_tracker< Bottom >::tick | ( | const prism::header * | header, | |
size_t | caplen, | |||
bool | swapped | |||
) | [inline] |
Update the tracker with the given Prism header's MAC time.
tool::microseconds wifi::mactime_tracker< Bottom >::microseconds | ( | ) | const [inline] |
Retrieve the current microsecond count without wraps.
const mactime_tracker< Bottom >::mactime_type & wifi::mactime_tracker< Bottom >::mactime | ( | ) | const [inline] |
Retrieve the current mactime (might wrap).
const static_base< Bottom >::exact_type & tool::static_base< Bottom >::exact | ( | ) | const [inline, inherited] |
Safely downcast to the exact type as a const reference.
static_base< Bottom >::exact_type & tool::static_base< Bottom >::exact | ( | ) | [inline, inherited] |
Safely downcast to the exact type as a non-const reference.
const static_base< Bottom >::exact_type * tool::static_base< Bottom >::exact_ptr | ( | ) | const [inline, inherited] |
Safely downcast to the exact type as a const pointer.
static_base< Bottom >::exact_type * tool::static_base< Bottom >::exact_ptr | ( | ) | [inline, inherited] |
Safely downcast to the exact type as a non-const pointer.