00001 /* 00002 * WiPal - A library and a set of tools to manipulate wireless traces. 00003 * Copyright (C) 2007 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 <wipal/wifi/addr.hh> 00026 00027 namespace wifi 00028 { 00029 00030 namespace frame 00031 { 00032 00034 namespace ctl 00035 { 00036 00038 namespace subtype 00039 { 00040 00042 enum frame_subtype 00043 { 00044 ps_poll = 10, 00045 rts = 11, 00046 cts = 12, 00047 ack = 13, 00048 cf_end = 14, 00049 cf_end_cf_ack = 15 00050 }; 00051 00052 } // End of namespace wifi::frame::ctl::subtype. 00053 00055 namespace rts 00056 { 00057 00059 struct header 00060 { 00061 00063 enum addr_index 00064 { 00065 ra = 0, 00066 ta = 1 00067 }; 00068 00069 uint16_t frame_ctl; 00070 uint16_t duration; 00071 addr addrs[2]; 00072 }; 00073 } // End of namespace wifi::frame::ctl::rts. 00074 00076 namespace cts 00077 { 00079 struct header 00080 { 00081 uint16_t frame_ctl; 00082 uint16_t duration; 00083 addr ra; 00084 }; 00085 } // End of namespace wifi::frame::ctl::cts. 00086 00091 namespace ack = cts; 00092 00094 namespace ps_poll 00095 { 00097 struct header 00098 { 00099 00101 enum addr_index 00102 { 00103 bssid = 0, 00104 ta = 1 00105 }; 00106 00107 uint16_t frame_ctl; 00108 uint16_t aid; 00109 addr addrs[2]; 00110 }; 00111 } // End of namespace wifi::frame::ctl::ps_poll. 00112 00114 namespace cf_end 00115 { 00117 struct header 00118 { 00119 00121 enum addr_index 00122 { 00123 ra = 0, 00124 bssid = 1 00125 }; 00126 00127 uint16_t frame_ctl; 00128 uint16_t duration; 00129 addr addrs[2]; 00130 }; 00131 } // End of namespace wifi::frame::ctl::cf_end. 00132 00137 namespace cf_end_cf_ack = cf_end; 00138 00139 } // End of namespace wifi::frame::ctl. 00140 00141 } // End of namespace wifi::frame. 00142 00143 } // End of namespace wifi. 00144 00145 #endif // ! WIFI_FRAME_CTL_HH_