Changeset b53d019
- Timestamp:
- 09/17/15 13:24:51 (5 years ago)
- Branches:
- 4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
- Children:
- 9a0e118
- Parents:
- 76c86fb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/libtrace.h.in
r5478d3d rb53d019 2 2 * This file is part of libtrace 3 3 * 4 * Copyright (c) 2007 ,2008,2009,2010 The University of Waikato, Hamilton,4 * Copyright (c) 2007-2015 The University of Waikato, Hamilton, 5 5 * New Zealand. 6 6 * 7 * Authors: Daniel Lawson 7 * Authors: Daniel Lawson 8 8 * Perry Lorier 9 * Shane Alcock 10 * 9 * Shane Alcock 10 * Richard Sanger 11 * 11 12 * All rights reserved. 12 13 * 13 * This code has been developed by the University of Waikato WAND 14 * This code has been developed by the University of Waikato WAND 14 15 * research group. For further information please see http://www.wand.net.nz/ 15 16 * … … 42 43 * @author Perry Lorier 43 44 * @author Shane Alcock 45 * @author Richard Sanger 44 46 * 45 47 * @version $Id$ 46 48 * 47 * This library provides a per packet interface into a trace file, or a live 49 * This library provides a per packet interface into a trace file, or a live 48 50 * captures. It supports ERF, DAG cards, PCAP, Linux and BSD native sockets, 49 51 * legacy ERF formats etc. 50 52 * 51 53 * @par Usage 52 * See the example/ directory in the source distribution for some simple 54 * See the example/ directory in the source distribution for some simple 53 55 * examples 54 56 * 55 57 * @par Linking 56 58 * To use this library you need to link against libtrace by passing -ltrace 57 * to your linker. You may also need to link against a version of libpcap58 * and of zlib which are compiled for largefile support (if you wish to access59 * traces larger than 2 GB). This is left as an exercise for the reader. Debian60 * Woody, at least, does not support large file offsets.59 * to your linker. 60 * 61 * See libtrace_parallel.h for a description of the parallel API that allows 62 * programmers to spread packet processing across multiple threads. 61 63 * 62 64 */ … … 240 242 #endif 241 243 242 244 243 245 /** Opaque structure holding information about an output trace */ 244 246 typedef struct libtrace_out_t libtrace_out_t; 245 247 246 248 /** Opaque structure holding information about a trace */ 247 249 typedef struct libtrace_t libtrace_t; 248 250 249 251 /** Opaque structure holding information about a bpf filter */ 250 252 typedef struct libtrace_filter_t libtrace_filter_t; … … 312 314 * DLT */ 313 315 TRACE_DLT_ERROR = -1, 314 315 /** pcap documents this as having the Address Family value in host byte order as the316 *framing. Ugly? Yes.316 317 /** pcap documents this as having the Address Family value in host 318 * byte order as the framing. Ugly? Yes. 317 319 */ 318 320 TRACE_DLT_NULL = 0, … … 320 322 TRACE_DLT_PPP = 9, 321 323 TRACE_DLT_ATM_RFC1483 = 11, 322 323 /** Ok, so OpenBSD has a different value for DLT_RAW as the rest of the planet, so detect 324 * this. When reading to/from files we should be using TRACE_DLT_LINKTYPE_RAW instead. 325 * When talking about DLT's inside libtrace tho, we should be using /these/ DLT's. 326 */ 324 325 /** Ok, so OpenBSD has a different value for DLT_RAW as the rest of 326 * the planet, so detect this. When reading to/from files we should 327 * be using TRACE_DLT_LINKTYPE_RAW instead. When talking about DLT's 328 * inside libtrace tho, we should be using /these/ DLT's. 329 */ 327 330 #ifdef __OpenBSD__ 328 331 TRACE_DLT_OPENBSD_LOOP=12, 329 TRACE_DLT_RAW = 14 ,332 TRACE_DLT_RAW = 14 330 333 #else 331 334 TRACE_DLT_RAW = 12, … … 625 628 } PACKED libtrace_ip6_ext_t; 626 629 630 /** IPv6 fragmentation header */ 627 631 typedef struct libtrace_ip6_frag 628 632 { … … 717 721 } PACKED libtrace_icmp_t; 718 722 723 /** Generic ICMPv6 header structure */ 719 724 typedef struct libtrace_icmp6 { 720 725 uint8_t type; /**< Message Type */ … … 1091 1096 } PACKED libtrace_ospf_router_lsa_v2_t; 1092 1097 1098 /** OSPF message types */ 1093 1099 typedef enum { 1094 1100 TRACE_OSPF_HELLO = 1, /**< OSPF Hello */ … … 1099 1105 } libtrace_ospf_types_t; 1100 1106 1107 /** OSPF link state acknowledgement types */ 1101 1108 typedef enum { 1102 1109 TRACE_OSPF_LS_ROUTER = 1, /**< OSPF Router LSA */ … … 1191 1198 * - erf:/path/to/erf/file 1192 1199 * - erf:- (stdin) 1193 * - dag:/dev/dagcard 1200 * - dag:/dev/dagcard 1194 1201 * - pcapint:pcapinterface (eg: pcap:eth0) 1195 1202 * - pcap:/path/to/pcap/file … … 1383 1390 * Statistic counters are cumulative from the time the trace is started. 1384 1391 * Trace pause will reset the counters, to zero. 1385 * Always check \a{field}_valid is set before attempting to read the stored value. 1392 * Always check \a{field}_valid is set before attempting to read the stored 1393 * value. 1386 1394 * 1387 1395 * @note Always allocate this structure using trace_create_statistics(). … … 1401 1409 1402 1410 /* These must all be uint64_t's, match this order with the X macro */ 1403 uint64_t accepted; 1404 /**< The number of packets that have been read from the input trace 1411 /** The number of packets that have been read from the input trace 1405 1412 * using trace_read_packet(). In the parallel framework this may include 1406 1413 * some packets waiting in a batch yet to be seen by the user's … … 1412 1419 * @note This field replaces trace_get_accepted_packets() 1413 1420 */ 1414 uint64_t filtered; 1415 /**< The number of packets that were captured, but discarded for not 1421 uint64_t accepted; 1422 1423 /** The number of packets that were captured, but discarded for not 1416 1424 * matching a provided filter. 1417 1425 * 1418 1426 * @note This field replaces trace_get_filtered_packets() 1419 1427 */ 1420 uint64_t received; 1421 /**< The total number of good packets which have been recevied. Including 1428 uint64_t filtered; 1429 1430 /** The total number of good packets which have been recevied. Including 1422 1431 * those which are dropped and filtered. This does not include errors. 1423 1432 * … … 1427 1436 * @note This field replaces trace_get_received_packets() 1428 1437 */ 1429 uint64_t dropped; 1430 /**< The number of packets that have been dropped on an input trace 1438 uint64_t received; 1439 1440 /** The number of packets that have been dropped on an input trace 1431 1441 * due to lack of buffer space on the capturing device. This does not 1432 1442 * included errored packets which are dropped directly by the card. … … 1434 1444 * @note This field replaces trace_get_dropped_packets() 1435 1445 */ 1436 uint64_t captured; 1437 /**< The number of received packets that have not been dropped. This 1446 uint64_t dropped; 1447 1448 /** The number of received packets that have not been dropped. This 1438 1449 * includes filtered packets. 1439 1450 * … … 1443 1454 * not yet included in accepted. 1444 1455 */ 1445 uint64_t errors; 1446 /**< The number of packets that have been discarded by the network card 1456 uint64_t captured; 1457 1458 /** The number of packets that have been discarded by the network card 1447 1459 * because they are invalid. That includes FCS mismatches, incorrect 1448 1460 * packet lengths etc. 1449 1461 */ 1462 uint64_t errors; 1450 1463 } libtrace_stat_t; 1451 1464
Note: See TracChangeset
for help on using the changeset viewer.