source: lib/format_erf.h @ 254c926

develop
Last change on this file since 254c926 was 254c926, checked in by Jacob Van Walraven <jcv9@…>, 21 months ago

Cleanup some duplicate code, Added datatype/option_name for libtrace_meta_t structure

  • Property mode set to 100644
File size: 4.2 KB
Line 
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 FORMAT_ERF_H
27#define FORMAT_ERF_H
28
29#include "libtrace.h"
30
31/* ERF Section codes */
32#define ERF_PROV_SECTION_CAPTURE 0xFF00
33#define ERF_PROV_SECTION_HOST 0xFF01
34#define ERF_PROV_SECTION_MODULE 0xFF02
35#define ERF_PROV_SECTION_INTERFACE 0xFF03
36
37/* ERF Provenance record tag type codes */
38#define ERF_PROV_COMMENT 1
39#define ERF_PROV_FCS_LEN 8
40#define ERF_PROV_MASK_CIDR 10
41#define ERF_PROV_NAME 12
42#define ERF_PROV_DESCR 13
43#define ERF_PROV_APP_NAME 16
44#define ERF_PROV_HOSTNAME 18
45#define ERF_PROV_OS 17
46#define ERF_PROV_MODEL 20
47#define ERF_PROV_FW_VERSION 21
48#define ERF_PROV_SERIAL_NO 22
49#define ERF_PROV_ORG_NAME 11
50#define ERF_PROV_SNAPLEN 29
51#define ERF_PROV_CARD_NUM 30
52#define ERF_PROV_MODULE_NUM 31
53#define ERF_PROV_LOC_NAME 34
54#define ERF_PROV_FLOW_HASH_MODE 37
55#define ERF_PROV_TUNNELING_MODE 38
56#define ERF_PROV_LOC_DESCR 46
57#define ERF_PROV_APP_VERSION 47
58#define ERF_PROV_MEM 40
59#define ERF_PROV_DEV_NAME 44
60#define ERF_PROV_DEV_PATH 45
61#define ERF_PROV_CPU 49
62#define ERF_PROV_CPU_PHYS_CORES 50
63#define ERF_PROV_CPU_NUMA_NODES 51
64#define ERF_PROV_DAG_VERSION 53
65#define ERF_PROV_IF_NUM 64
66#define ERF_PROV_IF_SPEED 66
67#define ERF_PROV_IF_IPV4 67
68#define ERF_PROV_IF_IPV6 68
69#define ERF_PROV_IF_MAC 69
70#define ERF_PROV_IF_SFP_TYPE 78
71#define ERF_PROV_IF_LINK_STATUS 81
72#define ERF_PROV_IF_PHY_MODE 82
73#define ERF_PROV_IF_PORT_TYPE 83
74#define ERF_PROV_IF_RX_LATENCY 84
75#define ERF_PROV_IF_RX_POWER 79
76#define ERF_PROV_IF_TX_POWER 80
77#define ERF_PROV_CLK_SOURCE 384
78#define ERF_PROV_CLK_STATE 385
79#define ERF_PROV_CLK_THRESHOLD 386
80#define ERF_PROV_CLK_CORRECTION 387
81#define ERF_PROV_CLK_FAILURES 388
82#define ERF_PROV_CLK_RESYNCS 389
83#define ERF_PROV_CLK_PHASE_ERROR 390
84#define ERF_PROV_CLK_INPUT_PULSES 391
85#define ERF_PROV_CLK_REJECTED_PULSES 392
86#define ERF_PROV_CLK_PHC_INDEX 393
87#define ERF_PROV_CLK_PHC_OFFSET 394
88#define ERF_PROV_CLK_TIMEBASE 395
89#define ERF_PROV_CLK_DESCR 396
90#define ERF_PROV_CLK_OUT_SOURCE 397
91#define ERF_PROV_CLK_LINK_MODE 398
92#define ERF_PROV_PTP_DOMAIN_NUM 399
93#define ERF_PROV_PTP_STEPS_REMOVED 400
94#define ERF_PROV_CLK_PORT_PROTO 414
95
96/** @file
97 *
98 * @brief Header file defining functions that apply to all libtrace formats
99 * that use the ERF record format, e.g. ERF, DAG 2.4, DAG 2.5
100 *
101 * @author Daniel Lawson
102 * @author Perry Lorier
103 * @author Shane Alcock
104 *
105 * @version $Id$
106 *
107 * Not too much detail required with these functions - this header file exists
108 * solely to ensure that we don't have to duplicate the same code across
109 * multiple format modules.
110 */
111
112int erf_get_framing_length(const libtrace_packet_t *packet);
113libtrace_linktype_t erf_get_link_type(const libtrace_packet_t *packet);
114libtrace_direction_t erf_get_direction(const libtrace_packet_t *packet);
115libtrace_direction_t erf_set_direction(libtrace_packet_t *packet, libtrace_direction_t direction);
116uint64_t erf_get_erf_timestamp(const libtrace_packet_t *packet);
117int erf_get_capture_length(const libtrace_packet_t *packet);
118int erf_get_wire_length(const libtrace_packet_t *packet);
119size_t erf_set_capture_length(libtrace_packet_t *packet, size_t size);
120int erf_is_color_type(uint8_t erf_type);
121
122void *erf_get_meta_section(libtrace_packet_t *packet, uint32_t section);
123void *erf_get_meta_section_option(libtrace_packet_t *packet, uint32_t section,
124        uint16_t option);
125
126#endif
Note: See TracBrowser for help on using the repository browser.