include/trace-tools/wifi/frame/data.hh

00001 /*
00002  * trace-tools - 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_DATA_HH_
00023 # define WIFI_FRAME_DATA_HH_
00024 
00025 # include <trace-tools/wifi/addr.hh>
00026 
00027 namespace wifi
00028 {
00029 
00030   namespace frame
00031   {
00032 
00034     namespace data
00035     {
00036 
00038       namespace subtype
00039       {
00040 
00042         enum frame_subtype
00043           {
00044             data                = 0, 
00045             data_cf_ack         = 1, 
00046             data_cf_poll        = 2, 
00047             data_cf_ack_cf_poll = 3, 
00048             null                = 4, 
00049             cf_ack              = 5, 
00050             cf_poll             = 6, 
00051             cf_ack_cf_poll      = 7  
00052           };
00053 
00054       } // End of namespace wifi::frame::data::subtype.
00055 
00057       struct header_3addr
00058       {
00059         uint16_t        frame_ctl;      
00060         uint16_t        duration;       
00061         addr            addrs[3];       
00062         uint16_t        seq_ctl;        
00063         uint8_t body[];                 
00064       };
00065 
00067       struct header_4addr
00068       {
00069         uint16_t        frame_ctl;      
00070         uint16_t        duration;       
00071         addr            addrs[3];       
00072         uint16_t        seq_ctl;        
00073         addr            addrs_4;        
00074         uint8_t body[];                 
00075       };
00076 
00078       namespace within_ibss
00079       {
00080 
00082         struct header : public header_3addr
00083         {
00085           enum addr_index
00086             {
00087               da        = 0,    
00088               sa        = 1,    
00089               bssid     = 2     
00090             };
00091         };
00092       } // End of namespace wifi::frame::data::within_ibss.
00093 
00095       namespace to_ds
00096       {
00097 
00099         struct header : public header_3addr
00100         {
00102           enum addr_index
00103             {
00104               bssid     = 0,    
00105               sa        = 1,    
00106               da        = 2     
00107             };
00108         };
00109       } // End of namespace wifi::frame::data::to_ds.
00110 
00112       namespace from_ds
00113       {
00114 
00116         struct header : public header_3addr
00117         {
00119           enum addr_index
00120             {
00121               da        = 0,    
00122               bssid     = 1,    
00123               sa        = 2     
00124             };
00125         };
00126       } // End of namespace wifi::frame::data::from_ds.
00127 
00129       namespace ap_to_ap
00130       {
00131 
00133         struct header
00134         {
00136           enum addr_index
00137             {
00138               ra        = 0,    
00139               ta        = 1,    
00140               da        = 2,    
00141             };
00142 
00143           uint16_t      frame_ctl;      
00144           uint16_t      duration;       
00145           addr          addrs[3];       
00146           uint16_t      seq_ctl;        
00147           addr          addrs_sa;       
00148           uint8_t       body[];         
00149         };
00150 
00151       } // End of namespace wifi::frame::data::ap_to_ap.
00152 
00153     } // End of namespace wifi::frame::data.
00154 
00155   } // End of namespace wifi::frame.
00156 
00157 } // End of namespace wifi.
00158 
00159 #endif // ! WIFI_FRAME_DATA_HH_

Generated on Wed Sep 12 16:02:47 2007 for trace-tools by  doxygen 1.5.3