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

Generated on Tue Nov 13 13:48:01 2007 for trace-tools by  doxygen 1.5.3-20071008