column-utils: add space to improve readability.
[metze/wireshark/wip.git] / epan / capture_dissectors.h
1 /* capture_dissectors.h
2  * Routines for handling capture dissectors
3  *
4  * Wireshark - Network traffic analyzer
5  * By Gerald Combs <gerald@wireshark.org>
6  * Copyright 1998 Gerald Combs
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  */
22
23 #ifndef __CAPTURE_DISSECTORS_H__
24 #define __CAPTURE_DISSECTORS_H__
25
26 #include "ws_symbol_export.h"
27 #include <wiretap/wtap.h>
28 #include <capture_info.h>
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif /* __cplusplus */
33
34 /** @file
35  */
36
37 /** callback function definition for capture dissectors */
38 typedef gboolean (*capture_dissector_t)(const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header);
39
40 /* a protocol uses the function to register a capture sub-dissector table
41  */
42 WS_DLL_PUBLIC void register_capture_dissector_table(const char *name, const char *ui_name);
43
44
45 /** Register a new capture dissector. */
46 WS_DLL_PUBLIC void register_capture_dissector(const char* name, const guint32 pattern, capture_dissector_t dissector, const int proto);
47
48 WS_DLL_PUBLIC gboolean try_capture_dissector(const char* name, const guint32 pattern, const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header);
49
50 WS_DLL_PUBLIC guint32 capture_dissector_get_count(packet_counts* counts, const int proto);
51 WS_DLL_PUBLIC void capture_dissector_increment_count(capture_packet_info_t *cpinfo, const int proto);
52
53 extern void capture_dissector_init(void);
54 extern void capture_dissector_cleanup(void);
55
56 #ifdef __cplusplus
57 }
58 #endif /* __cplusplus */
59
60 #endif /* capture_dissectors.h */