#include <wipal/wifi/mactime_tracker.hh>
Public Types | |
typedef uint32_t | mactime_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 |
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.
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).