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 | */ |
---|
26 | #ifndef DAG_LEGACY_H |
---|
27 | #define DAG_LEGACY_H |
---|
28 | |
---|
29 | /** @file |
---|
30 | * |
---|
31 | * @brief Header file describing the framing formats used by old legacy DAG |
---|
32 | * implementations. |
---|
33 | * |
---|
34 | * @author Daniel Lawson |
---|
35 | * @author Perry Lorier |
---|
36 | * @author Shane Alcock |
---|
37 | * |
---|
38 | * @version $Id$ |
---|
39 | * |
---|
40 | */ |
---|
41 | |
---|
42 | |
---|
43 | /** Legacy ATM cell header */ |
---|
44 | typedef struct legacy_cell { |
---|
45 | uint64_t ts; /**< 64-bit timestamp in the ERF format */ |
---|
46 | uint32_t crc; /**< CRC checksum */ |
---|
47 | } PACKED legacy_cell_t; |
---|
48 | |
---|
49 | /** Legacy Ethernet header */ |
---|
50 | typedef struct legacy_ether { |
---|
51 | uint64_t ts; /**< 64-bit timestamp in the ERF format */ |
---|
52 | uint16_t wlen; /**< Wire length */ |
---|
53 | } PACKED legacy_ether_t; |
---|
54 | |
---|
55 | /** Legacy Packet-over-SONET header */ |
---|
56 | typedef struct legacy_pos { |
---|
57 | uint64_t ts; /**< 64-bit timestamp in the ERF format */ |
---|
58 | uint32_t slen; /**< Capture length */ |
---|
59 | uint32_t wlen; /**< Wire length */ |
---|
60 | } PACKED legacy_pos_t; |
---|
61 | |
---|
62 | /** ATM cell header capture, a la Auckland VII */ |
---|
63 | typedef struct atmhdr { |
---|
64 | uint32_t ts_fraction; /**< Partial seconds portion of the timestamp */ |
---|
65 | uint32_t ts_sec; /**< Seconds portion of the timestamp */ |
---|
66 | } PACKED atmhdr_t; |
---|
67 | |
---|
68 | /** Legacy header format used for capturing the NZIX-I trace set */ |
---|
69 | typedef struct legacy_nzix { |
---|
70 | uint32_t ts; /**< Time elapsed since the last packet in |
---|
71 | microseconds */ |
---|
72 | uint32_t crc; /**< CRC checksum */ |
---|
73 | uint32_t len; /**< Wire length */ |
---|
74 | |
---|
75 | /* The padding has actually been placed in the middle of the IP |
---|
76 | * header - when we read in the packet, we will move various bits |
---|
77 | * of the packet around until the padding ends up here and the |
---|
78 | * IP header is undivided */ |
---|
79 | uint8_t pad[2]; /**< Padding */ |
---|
80 | } PACKED legacy_nzix_t; |
---|
81 | #endif |
---|