WAND Trace processing  4.0.5
dagformat.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2007-2016 The University of Waikato, Hamilton, New Zealand.
4  * All rights reserved.
5  *
6  * This file is part of libtrace.
7  *
8  * This code has been developed by the University of Waikato WAND
9  * research group. For further information please see http://www.wand.net.nz/
10  *
11  * libtrace is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License as published by
13  * the Free Software Foundation; either version 3 of the License, or
14  * (at your option) any later version.
15  *
16  * libtrace is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * along with this program. If not, see <http://www.gnu.org/licenses/>.
23  *
24  *
25  */
41 #ifndef _DAGFORMAT_H_
42 #define _DAGFORMAT_H_
43 
44 #include "libtrace.h"
45 #include "erftypes.h"
46 
47 #ifdef WIN32
48 #pragma pack(push)
49 #pragma pack(1)
50 #endif
51 
53 typedef struct pos_rec {
54  uint32_t hdlc;
55  uint8_t pload[1];
56 } PACKED pos_rec_t;
57 
59 typedef struct eth_rec {
60  uint8_t offset;
61  uint8_t pad;
62  uint8_t dst[6];
63  uint8_t src[6];
64  uint16_t etype;
65  uint8_t pload[1];
66 } PACKED eth_rec_t;
67 
69 typedef struct atm_rec {
70  uint32_t header;
71  uint8_t pload[1];
72 } PACKED atm_rec_t;
73 
75 typedef struct aal5_rec {
76  uint32_t header;
77  uint8_t pload[1];
78 } PACKED aal5_rec_t;
79 
81 typedef struct flags {
82  LT_BITFIELD8 iface:2;
83  LT_BITFIELD8 vlen:1;
84  LT_BITFIELD8 trunc:1;
85  LT_BITFIELD8 rxerror:1;
86  LT_BITFIELD8 dserror:1;
87  LT_BITFIELD8 pad:2;
88 } PACKED flags_t;
89 
91 typedef struct dag_record {
92  uint64_t ts;
93  uint8_t type;
95  uint16_t rlen;
96  uint16_t lctr;
97  uint16_t wlen;
98  union {
99  pos_rec_t pos;
100  eth_rec_t eth;
101  atm_rec_t atm;
102  aal5_rec_t aal5;
103  } rec;
104 } PACKED dag_record_t;
105 
106 #ifdef WIN32
107 #pragma pack(pop)
108 #endif
109 
111 #define dag_record_size 16U
112 
113 #endif /* _DAGFORMAT_H_ */
uint64_t ts
ERF timestamp.
Definition: dagformat.h:92
uint16_t rlen
Record len (capture+framing)
Definition: dagformat.h:95
struct aal5_rec aal5_rec_t
GPP Type 4.
GPP Global type.
Definition: dagformat.h:91
flags_t flags
Flags.
Definition: dagformat.h:94
uint8_t pad
Padding.
Definition: dagformat.h:61
struct dag_record dag_record_t
GPP Global type.
struct eth_rec eth_rec_t
GPP Type 2.
LT_BITFIELD8 iface
Interface (direction)
Definition: dagformat.h:82
uint8_t pload[1]
First byte of payload.
Definition: dagformat.h:65
LT_BITFIELD8 pad
Unused.
Definition: dagformat.h:87
LT_BITFIELD8 rxerror
RX Error detected.
Definition: dagformat.h:85
Trace file processing library header.
uint8_t pload[1]
First byte of payload.
Definition: dagformat.h:55
uint8_t pload[1]
First byte of payload.
Definition: dagformat.h:77
uint32_t header
The ATM header.
Definition: dagformat.h:70
uint8_t offset
Ethernet record offset.
Definition: dagformat.h:60
LT_BITFIELD8 vlen
Varying Record Lengths Present.
Definition: dagformat.h:83
GPP Type 3.
Definition: dagformat.h:69
Header file containing all the possible GPP record types.
uint8_t dst[6]
Destination MAC address.
Definition: dagformat.h:62
struct pos_rec pos_rec_t
GPP Type 1.
uint16_t wlen
Wire length.
Definition: dagformat.h:97
LT_BITFIELD8 dserror
Data stream error.
Definition: dagformat.h:86
GPP Type 4.
Definition: dagformat.h:75
GPP Type 1.
Definition: dagformat.h:53
struct flags flags_t
Flags.
uint32_t hdlc
The HDLC header.
Definition: dagformat.h:54
uint8_t pload[1]
First byte of payload.
Definition: dagformat.h:71
uint32_t header
The AAL5 header.
Definition: dagformat.h:76
uint8_t type
GPP record type.
Definition: dagformat.h:93
uint8_t src[6]
Source MAC address.
Definition: dagformat.h:63
uint16_t etype
Ethertype.
Definition: dagformat.h:64
Flags.
Definition: dagformat.h:81
uint16_t lctr
Loss counter.
Definition: dagformat.h:96
struct atm_rec atm_rec_t
GPP Type 3.
GPP Type 2.
Definition: dagformat.h:59
union dag_record::@0 rec
The captured record itself.
LT_BITFIELD8 trunc
Truncated Record.
Definition: dagformat.h:84