#include <trace-tools/wifi/mactime_tracker.hh>
Public Types | |
typedef uint32_t | mactime |
Public Member Functions | |
mactime_tracker () | |
void | tick (mactime) |
void | tick (const prism::header *h, size_t caplen) |
operator tool::microseconds () 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::mactime |
Type of Prism headers' mactime
fields.
wifi::mactime_tracker::mactime_tracker | ( | ) | [inline] |
Default constructor - initialize the tracker to zero.
void wifi::mactime_tracker::tick | ( | mactime | m | ) | [inline] |
Update the tracker with the giver mactime
.
void wifi::mactime_tracker::tick | ( | const prism::header * | h, | |
size_t | caplen | |||
) | [inline] |
Update the tracker with the given Prism header's MAC time.
wifi::mactime_tracker::operator tool::microseconds | ( | ) | const [inline] |
Retrieve the current time without wraps.