Changeset 1fbd938 for lib/wag.h


Ignore:
Timestamp:
02/16/06 11:56:02 (16 years ago)
Author:
Perry Lorier <perry@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
880aa58
Parents:
ee5e4c7
Message:

More -pedantic cleanups
Changed the format structure (again) for pause and seek support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/wag.h

    r49babe0 r1fbd938  
    3232#define _WAG_H
    3333
    34 // This is the WAG magic number - used to delimit frames
     34/* This is the WAG magic number - used to delimit frames */
    3535#define WAG_MAGIC               (0xdaa1)
    3636
    37 // Define frame types
     37/* Define frame types */
    3838#define FRAME_TYPE_DATA         (0x0000)
    3939#define FRAME_TYPE_UNDEFINED    (0xffff)
    4040
    41 // Define frame subtypes
     41/* Define frame subtypes */
    4242#define FRAME_SUBTYPE_DATA_RX   (0x0000)
    4343#define FRAME_SUBTYPE_DATA_TX   (0x0001)
    4444
    45 // This is the common part of the frame header.
    46 // We synchronise by scanning a stream to look for the magic number (WAG_MAGIC).
    47 // We can then tell the size and type of this frame, and pass over it if necessary.
     45/* This is the common part of the frame header.
     46 * We synchronise by scanning a stream to look for the magic number (WAG_MAGIC).
     47 * We can then tell the size and type of this frame, and pass over it if necessary.
     48 */
    4849struct frame_t {
    49   uint16_t magic;                                   // magic number (0xdaa1)
    50   uint16_t size;                                    // total frame size in bytes
    51   uint16_t type;                                    // frame type
    52   uint16_t subtype;                                 // frame subtype
     50  uint16_t magic;                                   /* magic number (0xdaa1) */
     51  uint16_t size;                                    /* total frame size in bytes */
     52  uint16_t type;                                    /* frame type */
     53  uint16_t subtype;                                 /* frame subtype */
    5354};
    5455
    55 ///////////////////////////////////////////////////////////////////////////////////
     56/*/////////////////////////////////////////////////////////////////////////////////
    5657//
    5758// Frames that the radio part of the WAG framework understands
     
    5960///////////////////////////////////////////////////////////////////////////////////
    6061// Common subfields...
     62*/
    6163
    62 // timestamp
     64/* timestamp */
    6365struct timestamp_t {
    64   uint32_t           secs;                          // seconds since start of 01-01-1970
    65   uint32_t           subsecs;                       // (1/(2^32))ths of a second
     66  uint32_t           secs;                          /* seconds since start of 01-01-1970 */
     67  uint32_t           subsecs;                       /* (1/(2^32))ths of a second */
    6668};
    6769
    68 // frame stream information
     70/* frame stream information */
    6971struct strinfo_t {
    7072  uint16_t unused_1;
     
    7476};
    7577
    76 // Type: DATA, Subtype: RX
     78/* Type: DATA, Subtype: RX */
    7779struct frame_data_rx_t {
    78   struct frame_t                 hdr;               // common frame header
    79   struct strinfo_t               strinfo;           // stream status
    80   struct timestamp_t             ts;                // timestamp of reception of this frame
     80  struct frame_t                 hdr;               /* common frame header */
     81  struct strinfo_t               strinfo;           /* stream status */
     82  struct timestamp_t             ts;                /* timestamp of reception of this frame */
    8183  struct {
    82     uint8_t              rssi;                      // receive signal strength of this frame
    83     uint8_t              rxstatus;                  // rx status bits from the modem
    84     uint16_t             length;                    // length in bytes of the frame payload
     84    uint8_t              rssi;                      /* receive signal strength of this frame */
     85    uint8_t              rxstatus;                  /* rx status bits from the modem */
     86    uint16_t             length;                    /* length in bytes of the frame payload */
    8587    struct {
    86       uint8_t  signal;                              // 802.11PLCP signal field
    87       uint8_t  service;                             // 802.11PLCP service field
    88       uint16_t length; } plcp; } rxinfo;            // 802.11PLCP length field (uS)
    89   char                           data[0];           // placeholder to allow payload access
     88      uint8_t  signal;                              /* 802.11PLCP signal field */
     89      uint8_t  service;                             /* 802.11PLCP service field */
     90      uint16_t length; } plcp; } rxinfo;            /* 802.11PLCP length field (uS) */
     91  char                           data[0];           /* placeholder to allow payload access */
    9092};
    9193
    92 // Type: DATA, Subtype: TX
     94/* Type: DATA, Subtype: TX */
    9395struct frame_data_tx_t {
    94   struct frame_t                 hdr;               // common frame header
    95   uint64_t                       unused_1;          //
    96   uint64_t                       unused_2;          //
     96  struct frame_t                 hdr;               /* common frame header */
     97  uint64_t                       unused_1;         
     98  uint64_t                       unused_2;         
    9799  struct {
    98     uint8_t  gain;                                  // tx gain with which to send this packet
    99     uint8_t  mode;                                  // tx mode with which to send this packet
    100     uint16_t length;                                // length in bytes of the frame payload
    101     uint32_t unused_1; }         txinfo;            //
    102   char                           data[0];           // placeholder to allow payload access
     100    uint8_t  gain;                                  /* tx gain with which to send this packet */
     101    uint8_t  mode;                                  /* tx mode with which to send this packet */
     102    uint16_t length;                                /* length in bytes of the frame payload */
     103    uint32_t unused_1; }         txinfo;           
     104  char                           data[0];           /* placeholder to allow payload access */
    103105};
    104106
    105107struct ieee_802_11_header {
    106         uint8_t      protocol:2;
    107         uint8_t      type:2;
    108         uint8_t      subtype:4;
    109         uint8_t      to_ds:1;
    110         uint8_t      from_ds:1;
    111         uint8_t      more_frag:1;
    112         uint8_t      retry:1;
    113         uint8_t      power:1;
    114         uint8_t      more_data:1;
    115         uint8_t      wep:1;
    116         uint8_t      order:1;
    117         uint16_t     duration;
     108        unsigned int      protocol:2;
     109        unsigned int      type:2;
     110        unsigned int      subtype:4;
     111        unsigned int      to_ds:1;
     112        unsigned int      from_ds:1;
     113        unsigned int      more_frag:1;
     114        unsigned int      retry:1;
     115        unsigned int      power:1;
     116        unsigned int      more_data:1;
     117        unsigned int      wep:1;
     118        unsigned int      order:1;
     119        unsigned int     duration;
    118120        uint8_t      mac1[6];
    119121        uint8_t      mac2[6];
Note: See TracChangeset for help on using the changeset viewer.