source: lib/format_erf.h @ 977e0db

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

Add meta api for erf and pcapng meta packets

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