Changeset 143eaba


Ignore:
Timestamp:
02/03/10 14:00:32 (11 years ago)
Author:
Shane Alcock <salcock@…>
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:
e56be6d
Parents:
cce868c
Message:
  • Updated the documentation and licensing on dagformat.h
  • Most notably, removed the duck_inf structure as we do not really support DUCK reading and anyone wanting to write DUCK will already have the real DAG headers available defining the DUCK structure
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/dagformat.h

    r15e9390 r143eaba  
     1/*
     2 * This file is part of libtrace
     3 *
     4 * Copyright (c) 2007,2008,2009,2010 The University of Waikato, Hamilton,
     5 * New Zealand.
     6 *
     7 * Authors: Daniel Lawson
     8 *          Perry Lorier
     9 *          Shane Alcock
     10 *         
     11 * All rights reserved.
     12 *
     13 * This code has been developed by the University of Waikato WAND
     14 * research group. For further information please see http://www.wand.net.nz/
     15 *
     16 * libtrace is free software; you can redistribute it and/or modify
     17 * it under the terms of the GNU General Public License as published by
     18 * the Free Software Foundation; either version 2 of the License, or
     19 * (at your option) any later version.
     20 *
     21 * libtrace is distributed in the hope that it will be useful,
     22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     24 * GNU General Public License for more details.
     25 *
     26 * You should have received a copy of the GNU General Public License
     27 * along with libtrace; if not, write to the Free Software
     28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
     29 *
     30 * $Id$
     31 *
     32 */
     33
     34/** @file
     35 *
     36 * @brief Header file containing definitions required to process DAG / ERF
     37 * traces
     38 *
     39 * @author Daniel Lawson
     40 * @author Perry Lorier
     41 * @author Shane Alcock
     42 *
     43 * @version $Id$
     44 *
     45 * Most of the structures defined in here are already defined in the Endace DAG
     46 * libraries, but we need to re-define them ourselves here so that we can
     47 * process ERF traces without requiring the user to buy a DAG card :)
     48 */
    149#ifndef _DAGFORMAT_H_
    250#define _DAGFORMAT_H_
     
    452#include "libtrace.h"
    553#include "erftypes.h"
    6 
    7 
    854
    955#ifdef WIN32
     
    1460/** GPP Type 1 */
    1561typedef struct pos_rec {
    16         uint32_t  hdlc;
    17         uint8_t   pload[1];             /**< payload */
     62        uint32_t  hdlc;                 /**< The HDLC header */
     63        uint8_t   pload[1];             /**< First byte of payload */
    1864}  PACKED pos_rec_t;
    1965
    2066/** GPP Type 2 */
    2167typedef struct eth_rec {
    22         uint8_t   offset;
    23         uint8_t   pad;
    24         uint8_t   dst[6];
    25         uint8_t   src[6];
    26         uint16_t  etype;                /**< ether type (?) */
    27         uint8_t   pload[1];             /**< payload */
     68        uint8_t   offset;               /**< Ethernet record offset */
     69        uint8_t   pad;                  /**< Padding */
     70        uint8_t   dst[6];               /**< Destination MAC address */
     71        uint8_t   src[6];               /**< Source MAC address */
     72        uint16_t  etype;                /**< Ethertype */
     73        uint8_t   pload[1];             /**< First byte of payload */
    2874}  PACKED eth_rec_t;
    2975
    3076/** GPP Type 3 */
    3177typedef struct atm_rec {
    32         uint32_t  header;
    33         uint8_t   pload[1];             /**< payload */
     78        uint32_t  header;               /**< The ATM header */
     79        uint8_t   pload[1];             /**< First byte of payload */
    3480}  PACKED atm_rec_t;
    3581
    3682/** GPP Type 4 */
    3783typedef struct aal5_rec {
    38         uint32_t  header;
    39         uint8_t   pload[1];             /**< payload */
     84        uint32_t  header;               /**< The AAL5 header */
     85        uint8_t   pload[1];             /**< First byte of payload */
    4086}  PACKED aal5_rec_t;
    4187
     
    4389typedef struct flags {
    4490        LT_BITFIELD8  iface:2;          /**< Interface (direction) */
    45         LT_BITFIELD8  vlen:1;   
    46         LT_BITFIELD8  trunc:1;          /**< Trunacted */
    47         LT_BITFIELD8  rxerror:1;        /**< RX Error in this packet/before
    48                                           * this packet
    49                                           */
     91        LT_BITFIELD8  vlen:1;           /**< Varying Record Lengths Present */
     92        LT_BITFIELD8  trunc:1;          /**< Truncated Record */
     93        LT_BITFIELD8  rxerror:1;        /**< RX Error detected */
    5094        LT_BITFIELD8  dserror:1;        /**< Data stream error */
    5195        LT_BITFIELD8  pad:2;            /**< Unused */
     
    5498/** GPP Global type */
    5599typedef struct dag_record {
    56         uint64_t  ts;           /**< erf timestamp */
     100        uint64_t  ts;           /**< ERF timestamp */
    57101        uint8_t   type;         /**< GPP record type */
    58         flags_t   flags;        /**< flags */
    59         uint16_t  rlen;         /**< record len (capture+framing) */
    60         uint16_t  lctr;         /**< loss counter */
    61         uint16_t  wlen;         /**< wire length */
     102        flags_t   flags;        /**< Flags */
     103        uint16_t  rlen;         /**< Record len (capture+framing) */
     104        uint16_t  lctr;         /**< Loss counter */
     105        uint16_t  wlen;         /**< Wire length */
    62106        union {
    63                 pos_rec_t       pos;   
     107                pos_rec_t       pos;           
    64108                eth_rec_t       eth;
    65109                atm_rec_t       atm;
    66110                aal5_rec_t      aal5;
    67         } rec;
     111        } rec;                  /**< The captured record itself */
    68112} PACKED dag_record_t;
    69 
    70 /** Dynamic(?) Universal Clock Kit Information packet */
    71 typedef struct duck_inf_pkt {
    72         uint32_t  command;
    73         uint32_t  config;
    74         uint32_t  clock_inc;
    75         uint32_t  clock_wrap;
    76         uint32_t  DDS_rate;
    77         uint32_t  crystal_freq;
    78         uint32_t  synth_freq;
    79         uint32_t  sync_rate;
    80         uint64_t  last_ticks;
    81         uint32_t  resyncs;
    82         uint32_t  bad_diffs, bad_offs, bad_pulses;
    83         uint32_t  worst_error, worst_off;
    84         uint32_t  off_limit, off_damp;
    85         uint32_t  pulses, single_pulses_missing, longest_pulse_missing;
    86         uint32_t  health;
    87         uint32_t  sickness;
    88         int32_t   error;
    89         int32_t   offset;
    90         int32_t   stat_start, stat_end; 
    91         uint32_t  set_duck_field;
    92 } duck_inf;
    93113
    94114#ifdef WIN32
     
    96116#endif
    97117
    98 /** sizeof(dag_record_t) without the payload helpers */
     118/** The size of the ERF record header, without the rec field */
    99119#define dag_record_size         16U
    100120
Note: See TracChangeset for help on using the changeset viewer.