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_FRAME_HH_
00023 # define WIFI_FRAME_FRAME_HH_
00024
00025 # include <string>
00026
00027 extern "C"
00028 {
00029 # include <stdint.h>
00030 }
00031
00032 # include <wipal/wifi/addr.hh>
00033
00034 namespace wifi
00035 {
00036
00038 namespace frame
00039 {
00040
00042 namespace type
00043 {
00044
00046 enum frame_type
00047 {
00048 management = 0,
00049 control = 1,
00050 data = 2,
00051 reserved = 3
00052 };
00053
00055 extern const std::string names[4];
00056
00057 }
00058
00059
00061 namespace subtype
00062 {
00063
00065 extern const std::string* const names[4];
00066
00067 }
00068
00069
00070
00071
00072
00074 unsigned
00075 protocol_version_of(const void*);
00076
00078 type::frame_type
00079 type_of(const void*);
00080
00082 unsigned
00083 subtype_of(const void*);
00084
00086 uint8_t
00087 control_flags_of(const void*);
00088
00089
00090
00091
00092
00094 bool
00095 control_flag(const unsigned flag, const void* frame);
00096
00098 bool
00099 to_ds(const void*);
00100
00102 bool
00103 from_ds(const void*);
00104
00105
00106
00107
00108
00110 unsigned
00111 duration_of(const void*);
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00137 const addr*
00138 transmitter_address(const void* frame);
00139
00150 const addr*
00151 bssid_address(const void*, size_t caplen = 30);
00152
00153 }
00154
00155 }
00156
00157 # include "frame.hxx"
00158
00159 #endif // ! WIFI_FRAME_FRAME_HH_