source: lib/dagformat.h @ 121b7e2

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since 121b7e2 was 121b7e2, checked in by Shane Alcock <salcock@…>, 14 years ago
  • Updated format_dag25 to support multiple streams - the new uri format for dag is "dag:/dev/dagX,<stream number>"
  • As each dag card can only be opened by a single process, thread-safety is now incorporated to allow separate threads to read from each dag stream
  • format_dag24 also supports the new uri format, although the stream number is ignored because old dags only have the one stream
  • Updated dagformat.h to include a whole bunch of new erf types
  • Added explicit support for the DSM Coloured Ethernet record type which will be required to deal with streamed packets
  • Fixed erf_get_padding() code that was comparing the return value of trace_get_link_type against an erf type rather than a libtrace link type
  • Property mode set to 100644
File size: 2.9 KB
Line 
1#ifndef _DAGFORMAT_H_
2#define _DAGFORMAT_H_
3
4#include "libtrace.h"
5
6/* GPP record type defines */
7#define TYPE_LEGACY             0
8#define TYPE_HDLC_POS           1
9#define TYPE_ETH                2
10#define TYPE_ATM                3
11#define TYPE_AAL5               4
12#define TYPE_MC_HDLC            5
13#define TYPE_MC_RAW             6
14#define TYPE_MC_ATM             7
15#define TYPE_MC_RAW_CHANNEL     8
16#define TYPE_MC_AAL5            9
17#define TYPE_COLOR_HDLC_POS     10
18#define TYPE_COLOR_ETH          11
19#define TYPE_MC_AAL2            12
20#define TYPE_IP_COUNTER         13
21#define TYPE_TCP_FLOW_COUNTER   14
22#define TYPE_DSM_COLOR_HDLC_POS 15
23#define TYPE_DSM_COLOR_ETH      16
24#define TYPE_COLOR_MC_HDLC_POS  17
25#define TYPE_AAL2               18
26
27
28
29#ifdef WIN32
30#pragma pack(push)
31#pragma pack(1)
32#endif
33
34/** GPP Type 1 */
35typedef struct pos_rec {
36        uint32_t  hdlc;
37        uint8_t   pload[1];             /**< payload */
38}  pos_rec_t;
39
40/** GPP Type 2 */
41typedef struct eth_rec {
42        uint8_t   offset;
43        uint8_t   pad;
44        uint8_t   dst[6];
45        uint8_t   src[6];
46        uint16_t  etype;                /**< ether type (?) */
47        uint8_t   pload[1];             /**< payload */
48}  eth_rec_t;
49
50/** GPP Type 3 */
51typedef struct atm_rec {
52        uint32_t  header; 
53        uint8_t   pload[1];             /**< payload */
54}  atm_rec_t;
55
56/** GPP Type 4 */
57typedef struct aal5_rec {
58        uint32_t  header; 
59        uint8_t   pload[1];             /**< payload */
60}  aal5_rec_t;
61
62/** Flags */
63typedef struct flags {
64        LT_BITFIELD8  iface:2;          /**< Interface (direction) */
65        LT_BITFIELD8  vlen:1;   
66        LT_BITFIELD8  trunc:1;          /**< Trunacted */
67        LT_BITFIELD8  rxerror:1;        /**< RX Error in this packet/before
68                                          * this packet
69                                          */
70        LT_BITFIELD8  dserror:1;        /**< Data stream error */
71        LT_BITFIELD8  pad:2;            /**< Unused */
72} PACKED flags_t;
73
74/** GPP Global type */
75typedef struct dag_record {
76        uint64_t  ts;           /**< erf timestamp */
77        uint8_t   type;         /**< GPP record type */
78        flags_t   flags;        /**< flags */
79        uint16_t  rlen;         /**< record len (capture+framing) */
80        uint16_t  lctr;         /**< loss counter */
81        uint16_t  wlen;         /**< wire length */
82        union {
83                pos_rec_t       pos;   
84                eth_rec_t       eth;
85                atm_rec_t       atm;
86                aal5_rec_t      aal5;
87        } rec;
88} PACKED dag_record_t;
89
90/** Dynamic(?) Universal Clock Kit Information packet */
91typedef struct duck_inf_pkt {
92        uint32_t  command;
93        uint32_t  config;
94        uint32_t  clock_inc;
95        uint32_t  clock_wrap;
96        uint32_t  DDS_rate;
97        uint32_t  crystal_freq;
98        uint32_t  synth_freq;
99        uint32_t  sync_rate;
100        uint64_t  last_ticks;
101        uint32_t  resyncs;
102        uint32_t  bad_diffs, bad_offs, bad_pulses;
103        uint32_t  worst_error, worst_off;
104        uint32_t  off_limit, off_damp;
105        uint32_t  pulses, single_pulses_missing, longest_pulse_missing;
106        uint32_t  health; 
107        uint32_t  sickness;
108        int32_t   error;
109        int32_t   offset;
110        int32_t   stat_start, stat_end; 
111        uint32_t  set_duck_field;
112} duck_inf;
113
114#ifdef WIN32
115#pragma pack(pop)
116#endif
117
118/** sizeof(dag_record_t) without the payload helpers */
119#define dag_record_size         16U
120
121#endif /* _DAGFORMAT_H_ */
Note: See TracBrowser for help on using the repository browser.