- Timestamp:
- 02/03/10 14:00:32 (12 years ago)
- 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
- 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 */ 1 49 #ifndef _DAGFORMAT_H_ 2 50 #define _DAGFORMAT_H_ … … 4 52 #include "libtrace.h" 5 53 #include "erftypes.h" 6 7 8 54 9 55 #ifdef WIN32 … … 14 60 /** GPP Type 1 */ 15 61 typedef 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 */ 18 64 } PACKED pos_rec_t; 19 65 20 66 /** GPP Type 2 */ 21 67 typedef 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 */ 28 74 } PACKED eth_rec_t; 29 75 30 76 /** GPP Type 3 */ 31 77 typedef 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 */ 34 80 } PACKED atm_rec_t; 35 81 36 82 /** GPP Type 4 */ 37 83 typedef 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 */ 40 86 } PACKED aal5_rec_t; 41 87 … … 43 89 typedef struct flags { 44 90 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 */ 50 94 LT_BITFIELD8 dserror:1; /**< Data stream error */ 51 95 LT_BITFIELD8 pad:2; /**< Unused */ … … 54 98 /** GPP Global type */ 55 99 typedef struct dag_record { 56 uint64_t ts; /**< erftimestamp */100 uint64_t ts; /**< ERF timestamp */ 57 101 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 */ 62 106 union { 63 pos_rec_t pos; 107 pos_rec_t pos; 64 108 eth_rec_t eth; 65 109 atm_rec_t atm; 66 110 aal5_rec_t aal5; 67 } rec; 111 } rec; /**< The captured record itself */ 68 112 } 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;93 113 94 114 #ifdef WIN32 … … 96 116 #endif 97 117 98 /** sizeof(dag_record_t) without the payload helpers*/118 /** The size of the ERF record header, without the rec field */ 99 119 #define dag_record_size 16U 100 120
Note: See TracChangeset
for help on using the changeset viewer.