source: lib/format_erf.h @ ef5ba20

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

add abilty to get custom option from meta packets, add abilty to get entire section from meta packet, meta api now returns libtrace_meta_t structure

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