include/wipal/phy/prism_header.hh

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 PRISM_HEADER_HH_
00023 # define PRISM_HEADER_HH_
00024 
00025 # include <wipal/phy/phy.hh>
00026 
00028 namespace prism
00029 {
00035   struct item
00036   {
00038     uint32_t    get(bool swapped) const;
00039 
00041     item&       set(uint32_t value, bool swapped);
00042 
00043   protected:
00044     uint32_t did;       
00045     uint16_t status;    
00046     uint16_t len;       
00047     uint32_t data;      
00048   };
00049 
00051   struct header
00052   {
00053     enum
00054       {
00056         devnamelen_max = 16
00057       };
00058 
00059     uint32_t    msgcode;                        
00060     uint32_t    msglen;                         
00061     uint8_t     devname[devnamelen_max];        
00062     item        hosttime;                       
00063     item        mactime;                        
00064     item        channel;                        
00065     item        rssi;                           
00066     item        sq;                             
00067     item        signal;                         
00068     item        noise;                          
00069     item        rate;                           
00070     item        istx;                           
00071     item        frmlen;                         
00072   };
00073 
00086   bool
00087   eq_80211(const header* lhs, size_t lhs_caplen,
00088            const header* rhs, size_t rhs_caplen);
00089 
00105   bool
00106   eq_time_and_80211(const header* lhs, size_t lhs_caplen, bool lhs_swapped,
00107                     const header* rhs, size_t rhs_caplen, bool rhs_swapped,
00108                     unsigned    precision = phy::eq_time_default_precision,
00109                     bool        check_hosttime = false);
00110 
00111 } // End of namespace prism.
00112 
00113 # include "prism_header.hxx"
00114 
00115 #endif // ! PRISM_HEADER_HH_

Generated on Wed Jan 16 16:15:14 2008 for wipal by  doxygen 1.5.4