Main Page | Data Structures | Directories | File List | Data Fields | Globals

wag.h

00001 /*
00002  * This file is part of libtrace
00003  *
00004  * Copyright (c) 2007 The University of Waikato, Hamilton, New Zealand.
00005  * Authors: Daniel Lawson
00006  *          Perry Lorier
00007  *
00008  * All rights reserved.
00009  *
00010  * This code has been developed by the University of Waikato WAND
00011  * research group. For further information please see http://www.wand.net.nz/
00012  *
00013  * libtrace is free software; you can redistribute it and/or modify
00014  * it under the terms of the GNU General Public License as published by
00015  * the Free Software Foundation; either version 2 of the License, or
00016  * (at your option) any later version.
00017  *
00018  * libtrace is distributed in the hope that it will be useful,
00019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  * GNU General Public License for more details.
00022  *
00023  * You should have received a copy of the GNU General Public License
00024  * along with libtrace; if not, write to the Free Software
00025  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00026  *
00027  * $Id: wag.h 1131 2007-01-26 02:31:48Z perry $
00028  *
00029  */
00030 
00031 #ifndef _WAG_H
00032 #define _WAG_H
00033 
00034 /* Once a proper wag api is released, most of this file will become irrelevant
00035  * but for now, we need to define a lot of this stuff ourselves
00036  */
00037 
00038 /* IOCTL's that we use */
00039 #define CAPTURE_RADIOON         101
00040 #define CAPTURE_RADIOOFF        102
00041 #define CAPTURE_SETCHANNEL      103
00042 
00043 /* This is the WAG magic number - used to delimit frames */
00044 #define WAG_MAGIC               (0xdaa1)
00045 
00046 /* Define frame types */
00047 #define FRAME_TYPE_DATA         (0x0000)
00048 #define FRAME_TYPE_UNDEFINED    (0xffff)
00049 
00050 /* Define frame subtypes */
00051 #define FRAME_SUBTYPE_DATA_RX   (0x0000)
00052 #define FRAME_SUBTYPE_DATA_TX   (0x0001)
00053 
00059 struct frame_t {
00060   uint16_t magic;                           
00061   uint16_t size;                            
00062   uint16_t type;                            
00063   uint16_t subtype;                         
00064 };
00065 
00066 /*/////////////////////////////////////////////////////////////////////////////////
00067 //
00068 // Frames that the radio part of the WAG framework understands
00069 //
00071 // Common subfields...
00072 */
00073 
00075 struct timestamp_t {
00076   uint32_t           secs;           
00077   uint32_t           subsecs;        
00078 };
00079 
00081 struct strinfo_t {
00082   uint16_t unused_1;
00083   uint16_t unused_2;
00084   uint16_t unused_3;
00085   uint16_t packets_lost;        
00086 };
00087 
00089 struct frame_data_rx_t {
00090   struct frame_t     hdr;     
00091   struct strinfo_t   strinfo; 
00092   struct timestamp_t ts;      
00093   struct {
00094     uint8_t          rssi;    
00095     uint8_t          rxstatus; 
00096     uint16_t         length;  
00097     struct {
00098       uint8_t  signal;        
00099       uint8_t  service;       
00100       uint16_t length;        
00101     } plcp; 
00102   } rxinfo;
00103 };
00104 
00106 struct frame_data_tx_t {
00107   struct frame_t      hdr;       
00108   uint64_t            unused_1;         
00109   uint64_t            unused_2;          
00110   struct {
00111     uint8_t  gain;        
00112     uint8_t  mode;        
00113     uint16_t length;      
00114     uint32_t unused_1; 
00115   } txinfo;            
00116 };
00117 
00119 typedef struct ieee_802_11_payload {
00120         uint16_t     type; 
00121 } libtrace_802_11_payload_t;
00122 
00123 
00124 #endif

Generated on Wed Sep 5 15:28:31 2007 for WAND Trace processing by  doxygen 1.4.2