source: lib/format_helper.h @ 733c8b4

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivelibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since 733c8b4 was d8b05b7, checked in by Shane Alcock <salcock@…>, 6 years ago

Make sure our copyright covers recent years

Consistency across all of our source files is also nice.

  • Property mode set to 100644
File size: 3.1 KB
Line 
1/*
2 * This file is part of libtrace
3 *
4 * Copyright (c) 2007-2015 The University of Waikato, Hamilton,
5 * New Zealand.
6 *
7 * Authors: Daniel Lawson
8 *          Perry Lorier
9 *          Shane Alcock
10 *         
11 * All rights reserved.
12 *
13 * This code has been developed by the University of Waikato WAND
14 * research group. For further information please see http://www.wand.net.nz/
15 *
16 * libtrace is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2 of the License, or
19 * (at your option) any later version.
20 *
21 * libtrace is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with libtrace; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
29 *
30 * $Id$
31 *
32 */
33
34#ifndef FORMAT_HELPER_H
35#define FORMAT_HELPER_H
36#include "common.h"
37#include "wandio.h"
38
39/** @file
40 *
41 * @brief Header file containing prototypes for functions that are useful for
42 * multiple format modules
43 *
44 * @author Daniel Lawson
45 * @author Perry Lorier
46 * @author Shane Alcock
47 *
48 * @version $Id$
49 */
50
51/** Generic event function for a live capture device
52 *
53 * @param trace         The input trace for the live capture device
54 * @param packet        A libtrace packet to read the next available packet
55 *                      into
56 * @return A libtrace event describing the next event of interest
57 *
58 * Any live capture format that does not require a custom event handler
59 * should use this function.
60 */
61struct libtrace_eventobj_t trace_event_device(libtrace_t *trace, libtrace_packet_t *packet);
62
63/** Generic event function for a offline trace file
64 *
65 * @param trace         The input trace for the trace file
66 * @param packet        A libtrace packet to read the next available packet
67 *                      into
68 * @return A libtrace event describing the next event of interest
69 *
70 * Any trace file format that does not require a custom event handler should
71 * use this function
72 */
73struct libtrace_eventobj_t trace_event_trace(libtrace_t *trace, libtrace_packet_t *packet);
74
75/** Opens an input trace file for reading
76 *
77 * @param libtrace      The input trace to be opened
78 * @return A libtrace IO reader for the newly opened file or NULL if the file
79 * was unable to be opened
80 */
81io_t *trace_open_file(libtrace_t *libtrace);
82
83/** Opens an output trace file for writing
84 *
85 * @param libtrace      The output trace to be opened
86 * @param compress_type The compression type to use when writing
87 * @param level         The compression level to use when writing, ranging from
88 *                      0 to 9
89 * @param filemode      The file status flags for the file, bitwise-ORed.
90 * @return A libtrace IO writer for the newly opened file or NULL if the file
91 * was unable to be opened
92 */
93iow_t *trace_open_file_out(libtrace_out_t *libtrace,
94                int compress_type,
95                int level,
96                int filemode);
97#endif /* FORMAT_HELPER_H */
Note: See TracBrowser for help on using the repository browser.