source: lib/erftypes.h @ a857389

cachetimestampsdevelopetsiliverc-4.0.3rc-4.0.4ringdecrementfixringperformance
Last change on this file since a857389 was a857389, checked in by Shane Alcock <salcock@…>, 3 years ago

Initial support for ERF provenance records

Update erftypes.h with TYPE_META (27).
Check for ERF_TYPE_MAX rather than some arbitrary type in ERF sanity checks. In Wireshark we recently completely removed these checks as there are only a few types before TYPE_PAD/ERF_TYPE_MAX, but leave them in for now.
Add TRACE_TYPE_ERF_META for provenance record payload.
Continue to use TRACE_RT_DATA_ERF as provenance is a valid ERF record. Note: this means that LIBTRACE_IS_META_PACKET() will currently return FALSE which may confuse some tools. Other places in the code also tend to check for TRACE_TYPE_NONDATA which isn't true here either.
Return zero for wire length of provenance records.
Don't allow snapping them (just return the same value).
Skip provenance records in l2 parsers and trace_get_payload_from_meta().
Return provenance payload for trace_get_packet_meta().

Also add support for a couple of missing ERF_TYPE_ETH_COLOR variants.

  • Property mode set to 100644
File size: 4.4 KB
RevLine 
[2c743a7]1/*
2 *
[ee6e802]3 * Copyright (c) 2007-2016 The University of Waikato, Hamilton, New Zealand.
[2c743a7]4 * All rights reserved.
5 *
[ee6e802]6 * This file is part of libtrace.
7 *
8 * This code has been developed by the University of Waikato WAND
[2c743a7]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
[ee6e802]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
[2c743a7]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
[ee6e802]19 * GNU Lesser General Public License for more details.
[2c743a7]20 *
[ee6e802]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/>.
[2c743a7]23 *
24 *
25 */
[2faa57e]26#ifndef _ERFTYPES_H_
27#define _ERFTYPES_H_
28
[2c743a7]29/** @file
30 *
31 * @brief Header file containing all the possible GPP record types
32 *
33 * @author Daniel Lawson
34 * @author Perry Lorier
35 * @author Shane Alcock
36 *
37 * @version $Id$
38 */
39
40/* GPP record type defines - these can indicate the header that immediately
41 * follows the ERF header and/or an adjustment to the layout of the ERF header
42 * itself, e.g. due to the use of Coloring.
43 *
44 * NOTE: "Color" refers to the concept of marking packets based on matching
45 * a particular filter or classification */
46
[204872da]47#ifndef TYPE_LEGACY
[2c743a7]48#define TYPE_LEGACY             0       /**< Legacy */
[204872da]49#endif
50
51#ifndef TYPE_HDLC_POS
[2c743a7]52#define TYPE_HDLC_POS           1       /**< PoS with HDLC framing */
[204872da]53#endif
54
55#ifndef TYPE_ETH
[2c743a7]56#define TYPE_ETH                2       /**< Ethernet */
[204872da]57#endif
58
59#ifndef TYPE_ATM
[2c743a7]60#define TYPE_ATM                3       /**< ATM Cell */
[204872da]61#endif
62
63#ifndef TYPE_AAL5
[2c743a7]64#define TYPE_AAL5               4       /**< AAL5 Frame */
[204872da]65#endif
66
67#ifndef TYPE_MC_HDLC
[2c743a7]68#define TYPE_MC_HDLC            5       /**< Multi-channel HDLC */
[204872da]69#endif
70
71#ifndef TYPE_MC_RAW
[2c743a7]72#define TYPE_MC_RAW             6       /**< Multi-channel Raw link record */
[204872da]73#endif
74
75#ifndef TYPE_MC_ATM
[2c743a7]76#define TYPE_MC_ATM             7       /**< Multi-channel ATM Cell */
[204872da]77#endif
78
79#ifndef TYPE_MC_RAW_CHANNEL
[2c743a7]80#define TYPE_MC_RAW_CHANNEL     8       /**< Multi-channel Raw link data */
[204872da]81#endif
82
83#ifndef TYPE_MC_AAL5
[2c743a7]84#define TYPE_MC_AAL5            9       /**< Multi-channel AAL5 */
[204872da]85#endif
[2c743a7]86
87/** PoS with HDLC framing and classification information in the loss counter
88 *  field */
[204872da]89#ifndef TYPE_COLOR_HDLC_POS
[2c743a7]90#define TYPE_COLOR_HDLC_POS     10     
[204872da]91#endif
[2c743a7]92
93/** Ethernet with classification information in the loss counter field */
[204872da]94#ifndef TYPE_COLOR_ETH
[2faa57e]95#define TYPE_COLOR_ETH          11
[204872da]96#endif
[2c743a7]97
98/** Multi-channel AAL2 */
[204872da]99#ifndef TYPE_MC_AAL2
[2faa57e]100#define TYPE_MC_AAL2            12
[204872da]101#endif
[2c743a7]102
103/** IP counter ERF record */
[204872da]104#ifndef TYPE_IP_COUNTER
[2faa57e]105#define TYPE_IP_COUNTER         13
[204872da]106#endif
[2c743a7]107
108/** TCP flow counter ERF record */
[204872da]109#ifndef TYPE_TCP_FLOW_COUNTER
[2faa57e]110#define TYPE_TCP_FLOW_COUNTER   14
[204872da]111#endif
[2c743a7]112
113/** PoS with HDLC framing with DSM color information in the loss counter field*/
[204872da]114#ifndef TYPE_DSM_COLOR_HDLC_POS
[2faa57e]115#define TYPE_DSM_COLOR_HDLC_POS 15
[204872da]116#endif
[2c743a7]117
118/** Ethernet with DSM color information in the loss counter field */
[204872da]119#ifndef TYPE_DSM_COLOR_ETH
[2faa57e]120#define TYPE_DSM_COLOR_ETH      16
[204872da]121#endif
[2c743a7]122
123/** Multi-channel HDLC with classification information in the loss counter
124 *  field */
[204872da]125#ifndef TYPE_COLOR_MC_HDLC_POS
[2faa57e]126#define TYPE_COLOR_MC_HDLC_POS  17
[204872da]127#endif
[2c743a7]128
129/** AAL2 Frame */
[204872da]130#ifndef TYPE_AAL2
[2faa57e]131#define TYPE_AAL2               18
[204872da]132#endif
[2faa57e]133
[2c743a7]134/** Colored PoS HDLC record with Hash load balancing */
[204872da]135#ifndef TYPE_COLOR_HASH_POS
[2c743a7]136#define TYPE_COLOR_HASH_POS     19
[204872da]137#endif
[2c743a7]138
139/** Colored Ethernet with Hash load balancing */
[204872da]140#ifndef TYPE_COLOR_HASH_ETH
[2c743a7]141#define TYPE_COLOR_HASH_ETH     20
[204872da]142#endif
[2c743a7]143
144/** Infiniband */
[204872da]145#ifndef TYPE_INFINIBAND
[2c743a7]146#define TYPE_INFINIBAND         21
[204872da]147#endif
[2c743a7]148
149/** IPv4 */
[204872da]150#ifndef TYPE_IPV4
[2c743a7]151#define TYPE_IPV4               22
[204872da]152#endif
[2c743a7]153
154/** IPv6 */
[204872da]155#ifndef TYPE_IPV6
[2c743a7]156#define TYPE_IPV6               23
[204872da]157#endif
[2c743a7]158
159/** Raw link data, usually SONET or SDH */
[204872da]160#ifndef TYPE_RAW_LINK
[2c743a7]161#define TYPE_RAW_LINK           24
[204872da]162#endif
[2c743a7]163
[a857389]164/** Provenance Metadata Record */
165#ifndef ERF_TYPE_META
166#define ERF_TYPE_META   27
167#endif
168/* TODO: Endace has deprecated TYPE_* in favour of ERF_TYPE_*. New types do not have TYPE_* aliases. */
169#ifndef TYPE_META
170#define TYPE_META       ERF_TYPE_META
171#endif
172
[2c743a7]173/** Padding record */
[204872da]174#ifndef TYPE_PAD
[2c743a7]175#define TYPE_PAD                48
[2faa57e]176#endif
[204872da]177
[a857389]178#ifndef ERF_TYPE_MAX
179#define ERF_TYPE_MAX    TYPE_PAD
180#endif
[204872da]181
182#endif /* _ERFTYPES_H_ */
Note: See TracBrowser for help on using the repository browser.