00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef WIFI_FRAME_ID_HELPER_HOOKS_HXX_
00023 # define WIFI_FRAME_ID_HELPER_HOOKS_HXX_
00024
00025 # include "id_helper_hooks.hh"
00026
00027 namespace wifi
00028 {
00029
00030 namespace frame
00031 {
00032
00033 namespace internals
00034 {
00035
00036 inline
00037 id_helper_hooks::id_helper_hooks():
00038 timestamp_ (0),
00039 addrs_ (0)
00040 {
00041 }
00042
00043 inline
00044 const timestamp*
00045 id_helper_hooks::timestamp_ptr() const
00046 {
00047 return timestamp_;
00048 }
00049
00050 inline
00051 const addr*
00052 id_helper_hooks::addr_ptr(unsigned i) const
00053 {
00054 return addrs_ ? addrs_ + i : 0;
00055 }
00056
00057 inline
00058 void
00059 id_helper_hooks::beacon_hook(const mgt::header* h, size_t caplen)
00060 {
00061 if (caplen < sizeof (*h) + sizeof (*timestamp_))
00062 return;
00063
00064 timestamp_ = reinterpret_cast<const timestamp*> (h->body);
00065 addrs_ = h->addrs;
00066 }
00067
00068 }
00069
00070 }
00071
00072 }
00073
00074 #endif // ! WIFI_FRAME_ID_HELPER_HOOKS_HXX_
00075