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_DISSECTOR_DISSECTOR_HH_
00023 # define WIFI_FRAME_DISSECTOR_DISSECTOR_HH_
00024
00025 # include <cstdlib>
00026
00027 # include <wipal/wifi/frame/mgt.hh>
00028 # include <wipal/wifi/frame/dissector/status.hh>
00029
00030 namespace wifi
00031 {
00032
00033 namespace frame
00034 {
00035
00036 struct dissector_default_hooks;
00037
00074 template <class Hooks = dissector_default_hooks>
00075 struct dissector: public Hooks
00076 {
00078 dissector(const Hooks& = Hooks ());
00079
00091 dissector(const void* frm, size_t caplen, const Hooks& hooks = Hooks ());
00092
00094 dissector_status::status status() const;
00095
00106 void operator () (const void* frm, size_t caplen);
00107
00109
00110 Hooks& hooks();
00111 const Hooks& hooks() const;
00113
00114 private:
00115
00117 enum length
00118 {
00119 control = 2,
00120 duration = 4,
00121 addr1 = 10,
00122 addr2 = 16,
00123 addr3 = 22,
00124 seqctl = 24,
00125 addr4 = 30
00126 };
00127
00128 void management_frame(const void*, size_t);
00129 void management_frame_dispatch(const mgt::header*,
00130 size_t);
00131
00132 void control_frame(const void*, size_t);
00133
00134 void data_frame(const void*, size_t);
00135 void data_frame_dispatch(const void*, size_t);
00136
00137 dissector_status::status status_;
00138 };
00139
00140 }
00141
00142 }
00143
00144 # include "dissector.hxx"
00145
00146 #endif // ! WIFI_FRAME_DISSECTOR_DISSECTOR_HH_