#include <wipal/wifi/mactime_tracker.hh>
Public Types | |
typedef HIDDEN | exact_type |
Public Member Functions | |
mactime_tracker (bool force_pcap) | |
template<class UIntType > | |
void | tick_uint (UIntType ts) |
void | tick_tv (const struct timeval &tv) |
template<class HeaderType , class D > | |
void | tick (const pcapxx::frame_descriptor< D > &frame, tool::endian::endianness phy_end) |
tool::microseconds | microseconds () const |
Downcast methods | |
const exact_type & | exact () const |
exact_type & | exact () |
const exact_type * | exact_ptr () const |
exact_type * | exact_ptr () |
PHY headers have various fields that holds frames' arrival time on the medium. Some of them are only 32 bits long, thus wrapping every one hour and a half (roughly). This class tracks the evolution of such fields and maintains a microsecond count that does not wrap.
Just call the tick() method for every frames you get in your trace.
typedef HIDDEN tool::static_base< Bottom >::exact_type [inherited] |
Exact type for this template instanciation.
Reimplemented in pcapxx::descriptor< Bottom >, phy::empty_time< Bottom >, phy::empty_header< Bottom >, phy::time< Bottom >, phy::uint64_time< Bottom >, phy::header< 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 >, wifi::time_converter< PhyHeaderType, Bottom >, phy::time< Bottom >, phy::header< Bottom >, tool::iterable< Bottom >, tool::iterator< Bottom >, and tool::valued_iterator< Bottom >.
wifi::mactime_tracker< Bottom >::mactime_tracker | ( | bool | force_pcap | ) | [inline] |
Default constructor - initialize the microsecond count to zero.
[in] | force_pcap | If true, force the use of PCAP timestamps instead of PHY timestamps. |
exact_type& tool::static_base< Bottom >::exact | ( | ) | [inherited] |
Safely downcast to the exact type as a non-const reference.
const exact_type& tool::static_base< Bottom >::exact | ( | ) | const [inherited] |
Safely downcast to the exact type as a const reference.
exact_type* tool::static_base< Bottom >::exact_ptr | ( | ) | [inherited] |
Safely downcast to the exact type as a non-const pointer.
const exact_type* tool::static_base< Bottom >::exact_ptr | ( | ) | const [inherited] |
Safely downcast to the exact type as a const pointer.
tool::microseconds wifi::mactime_tracker< Bottom >::microseconds | ( | ) | const [inline] |
Retrieve the current microsecond count without wraps.
void wifi::mactime_tracker< Bottom >::tick | ( | const pcapxx::frame_descriptor< D > & | frame, | |
tool::endian::endianness | phy_end | |||
) | [inline] |
Update the tracker according to the given frame.
void wifi::mactime_tracker< Bottom >::tick_tv | ( | const struct timeval & | tv | ) | [inline] |
Update the tracker with the given timeval
structure.
This method assumes timeval
structures never wrap around. A negative structure (tv_sec
< 0) will yield valid but negative microsecond counts).
void wifi::mactime_tracker< Bottom >::tick_uint | ( | UIntType | ts | ) | [inline] |
Update the tracker with the given unsigned integer timestamp.
This method tracks wraparounds and maintains a consistent microsecond count.