source: lib/wag.h @ 114b8d6

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since 114b8d6 was 67a14d4, checked in by Perry Lorier <perry@…>, 15 years ago

Move more types to the libtrace standard (typedef'd libtrace_*_t)
Add casts where appropriate
Remove default:'s from enum'd switch()'s

  • Property mode set to 100644
File size: 3.8 KB
RevLine 
[a79ddbe]1/*
2 * This file is part of libtrace
3 *
4 * Copyright (c) 2004 The University of Waikato, Hamilton, New Zealand.
[49babe0]5 * Authors: Daniel Lawson
6 *          Perry Lorier
7 *
[a79ddbe]8 * All rights reserved.
9 *
[49babe0]10 * This code has been developed by the University of Waikato WAND
[a79ddbe]11 * research group. For further information please see http://www.wand.net.nz/
12 *
13 * libtrace is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * libtrace is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with libtrace; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26 *
27 * $Id$
28 *
29 */
[2c060e3]30
[49babe0]31#ifndef _WAG_H
32#define _WAG_H
33
[1fbd938]34/* This is the WAG magic number - used to delimit frames */
[49babe0]35#define WAG_MAGIC               (0xdaa1)
36
[1fbd938]37/* Define frame types */
[49babe0]38#define FRAME_TYPE_DATA         (0x0000)
39#define FRAME_TYPE_UNDEFINED    (0xffff)
40
[1fbd938]41/* Define frame subtypes */
[49babe0]42#define FRAME_SUBTYPE_DATA_RX   (0x0000)
43#define FRAME_SUBTYPE_DATA_TX   (0x0001)
44
[0d768c8]45/** This is the common part of the frame header.
46 * We synchronise by scanning a stream to look for the magic number
47 * (WAG_MAGIC).  We can then tell the size and type of this frame, and pass
48 * over it if necessary.
[1fbd938]49 */
[49babe0]50struct frame_t {
[0d768c8]51  uint16_t magic;                           /**< magic number (0xdaa1) */
52  uint16_t size;                            /**< total frame size in bytes */
53  uint16_t type;                            /**< frame type */
54  uint16_t subtype;                         /**< frame subtype */
[2c060e3]55};
56
[1fbd938]57/*/////////////////////////////////////////////////////////////////////////////////
[49babe0]58//
59// Frames that the radio part of the WAG framework understands
60//
61///////////////////////////////////////////////////////////////////////////////////
62// Common subfields...
[1fbd938]63*/
[49babe0]64
[0d768c8]65/** timestamp */
[49babe0]66struct timestamp_t {
[0d768c8]67  uint32_t           secs;           /**< seconds since start of 01-01-1970 */
68  uint32_t           subsecs;        /**< (1/(2^32))ths of a second */
[9a36e6d]69};
70
[0d768c8]71/** frame stream information */
[49babe0]72struct strinfo_t {
[9a36e6d]73  uint16_t unused_1;
74  uint16_t unused_2;
75  uint16_t unused_3;
[0d768c8]76  uint16_t packets_lost;        /**< Number of packets lost */
[9a36e6d]77};
78
[0d768c8]79/** Type: DATA, Subtype: RX */
[49babe0]80struct frame_data_rx_t {
[0d768c8]81  struct frame_t     hdr;     /**< common frame header */
82  struct strinfo_t   strinfo; /**< stream status */
83  struct timestamp_t ts;      /**< timestamp of reception of this frame */
[49babe0]84  struct {
[0d768c8]85    uint8_t          rssi;    /**< receive signal strength of this frame */
86    uint8_t          rxstatus; /**< rx status bits from the modem */
87    uint16_t         length;  /**< length in bytes of the frame payload */
[49babe0]88    struct {
[0d768c8]89      uint8_t  signal;        /**< 802.11PLCP signal field */
90      uint8_t  service;       /**< 802.11PLCP service field */
91      uint16_t length;        /**< 802.11PLCP length field (uS) */
92    } plcp; 
93  } rxinfo;
[9a36e6d]94};
95
[0d768c8]96/** Type: DATA, Subtype: TX */
[49babe0]97struct frame_data_tx_t {
[0d768c8]98  struct frame_t      hdr;       /**< common frame header */
99  uint64_t            unused_1;         
100  uint64_t            unused_2;         
[49babe0]101  struct {
[0d768c8]102    uint8_t  gain;        /**< tx gain with which to send this packet */
103    uint8_t  mode;        /**< tx mode with which to send this packet */
104    uint16_t length;      /**< length in bytes of the frame payload */
105    uint32_t unused_1; 
106  } txinfo;           
[2c060e3]107};
108
[0d768c8]109/** 802.11 payload */
[67a14d4]110typedef struct ieee_802_11_payload {
[0d768c8]111        uint16_t     type; /**< ether type of this packet */
[67a14d4]112} libtrace_802_11_payload_t;
[2c060e3]113
[49babe0]114
[2c060e3]115#endif
Note: See TracBrowser for help on using the repository browser.