00001 /* 00002 * WiPal - A library and a set of tools to manipulate wireless traces. 00003 * Copyright (C) 2007, 2008, 2009 Universite Pierre et Marie Curie - Paris 6 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation; either version 2 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 00018 * MA 02110-1301 USA 00019 * 00020 * Author: Thomas Claveirole <thomas.claveirole@lip6.fr> 00021 */ 00022 #ifndef WIFI_FRAME_CTL_HH_ 00023 # define WIFI_FRAME_CTL_HH_ 00024 00025 # include <string> 00026 00027 # include <wipal/wifi/addr.hh> 00028 00029 namespace wpl 00030 { 00031 00032 namespace wifi 00033 { 00034 00036 namespace ctl 00037 { 00038 00040 namespace subtype 00041 { 00042 00044 enum frame_subtype 00045 { 00046 ps_poll = 10, 00047 rts = 11, 00048 cts = 12, 00049 ack = 13, 00050 cf_end = 14, 00051 cf_end_cf_ack = 15 00052 }; 00053 00055 extern const std::string names[16]; 00056 00057 } // End of namespace wpl::wifi::ctl::subtype. 00058 00060 namespace rts 00061 { 00062 00064 struct header 00065 { 00066 00068 enum addr_index 00069 { 00070 ra = 0, 00071 ta = 1 00072 }; 00073 00074 uint16_t frame_ctl; 00075 uint16_t duration; 00076 addr addrs[2]; 00077 } __attribute__((__packed__)); 00078 } // End of namespace wpl::wifi::ctl::rts. 00079 00081 namespace cts 00082 { 00084 struct header 00085 { 00086 uint16_t frame_ctl; 00087 uint16_t duration; 00088 addr ra; 00089 } __attribute__((__packed__)); 00090 } // End of namespace wpl::wifi::ctl::cts. 00091 00096 namespace ack = cts; 00097 00099 namespace ps_poll 00100 { 00102 struct header 00103 { 00104 00106 enum addr_index 00107 { 00108 bssid = 0, 00109 ta = 1 00110 }; 00111 00112 uint16_t frame_ctl; 00113 uint16_t aid; 00114 addr addrs[2]; 00115 } __attribute__((__packed__)); 00116 } // End of namespace wpl::wifi::ctl::ps_poll. 00117 00119 namespace cf_end 00120 { 00122 struct header 00123 { 00124 00126 enum addr_index 00127 { 00128 ra = 0, 00129 bssid = 1 00130 }; 00131 00132 uint16_t frame_ctl; 00133 uint16_t duration; 00134 addr addrs[2]; 00135 } __attribute__((__packed__)); 00136 } // End of namespace wpl::wifi::ctl::cf_end. 00137 00142 namespace cf_end_cf_ack = cf_end; 00143 00144 } // End of namespace wpl::wifi::ctl. 00145 00146 } // End of namespace wpl::wifi. 00147 00148 } // End of namespace wpl. 00149 00150 #endif // ! WIFI_FRAME_CTL_HH_