00001 #ifndef _DAGFORMAT_H_
00002 #define _DAGFORMAT_H_
00003
00004 #include "libtrace.h"
00005
00006
00007 #define TYPE_LEGACY 0
00008 #define TYPE_HDLC_POS 1
00009 #define TYPE_ETH 2
00010 #define TYPE_ATM 3
00011 #define TYPE_AAL5 4
00012
00013 #ifdef WIN32
00014 #pragma pack(push)
00015 #pragma pack(1)
00016 #endif
00017
00019 typedef struct pos_rec {
00020 uint32_t hdlc;
00021 uint8_t pload[1];
00022 } pos_rec_t;
00023
00025 typedef struct eth_rec {
00026 uint8_t offset;
00027 uint8_t pad;
00028 uint8_t dst[6];
00029 uint8_t src[6];
00030 uint16_t etype;
00031 uint8_t pload[1];
00032 } eth_rec_t;
00033
00035 typedef struct atm_rec {
00036 uint32_t header;
00037 uint8_t pload[1];
00038 } atm_rec_t;
00039
00041 typedef struct aal5_rec {
00042 uint32_t header;
00043 uint8_t pload[1];
00044 } aal5_rec_t;
00045
00047 typedef struct flags {
00048 LT_BITFIELD8 iface:2;
00049 LT_BITFIELD8 vlen:1;
00050 LT_BITFIELD8 trunc:1;
00051 LT_BITFIELD8 rxerror:1;
00054 LT_BITFIELD8 dserror:1;
00055 LT_BITFIELD8 pad:2;
00056 } PACKED flags_t;
00057
00059 typedef struct dag_record {
00060 uint64_t ts;
00061 uint8_t type;
00062 flags_t flags;
00063 uint16_t rlen;
00064 uint16_t lctr;
00065 uint16_t wlen;
00066 union {
00067 pos_rec_t pos;
00068 eth_rec_t eth;
00069 atm_rec_t atm;
00070 aal5_rec_t aal5;
00071 } rec;
00072 } PACKED dag_record_t;
00073
00075 typedef struct duck_inf_pkt {
00076 uint32_t command;
00077 uint32_t config;
00078 uint32_t clock_inc;
00079 uint32_t clock_wrap;
00080 uint32_t DDS_rate;
00081 uint32_t crystal_freq;
00082 uint32_t synth_freq;
00083 uint32_t sync_rate;
00084 uint64_t last_ticks;
00085 uint32_t resyncs;
00086 uint32_t bad_diffs, bad_offs, bad_pulses;
00087 uint32_t worst_error, worst_off;
00088 uint32_t off_limit, off_damp;
00089 uint32_t pulses, single_pulses_missing, longest_pulse_missing;
00090 uint32_t health;
00091 uint32_t sickness;
00092 int32_t error;
00093 int32_t offset;
00094 int32_t stat_start, stat_end;
00095 uint32_t set_duck_field;
00096 } duck_inf;
00097
00098 #ifdef WIN32
00099 #pragma pack(pop)
00100 #endif
00101
00103 #define dag_record_size 16U
00104
00105 #endif