Wireshark 2.9.0-477-g68ec514b The Wireshark network protocol analyzer

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

epan.h
1 /* epan.h
2 *
3 * Wireshark Protocol Analyzer Library
4 *
5 * Copyright (c) 2001 by Gerald Combs <gerald@wireshark.org>
6 *
7 * SPDX-License-Identifier: GPL-2.0-or-later
8 */
9
10 #ifndef __EPAN_H__
11 #define __EPAN_H__
12
13 #ifdef __cplusplus
14 extern "C" {
15 #endif /* __cplusplus */
16
17 #include <glib.h>
18 #include <epan/tvbuff.h>
19 #include <epan/prefs.h>
20 #include <epan/frame_data.h>
21 #include <wsutil/plugins.h>
22 #include "register.h"
23 #include "ws_symbol_export.h"
24
25 typedef struct epan_dissect epan_dissect_t;
26
27 struct epan_dfilter;
28 struct epan_column_info;
29
30 /*
31 * Opaque structure provided when an epan_t is created; it contains
32 * information needed to allow the user of libwireshark to provide
33 * time stamps, comments, and other information outside the packet
34 * data itself.
35 */
36 struct packet_provider_data;
37
38 /*
39 * Structure containing pointers to functions supplied by the user
40 * of libwireshark.
41 */
42 struct packet_provider_funcs {
43 const nstime_t *(*get_frame_ts)(struct packet_provider_data *prov, guint32 frame_num);
44 const char *(*get_interface_name)(struct packet_provider_data *prov, guint32 interface_id);
45 const char *(*get_interface_description)(struct packet_provider_data *prov, guint32 interface_id);
46 const char *(*get_user_comment)(struct packet_provider_data *prov, const frame_data *fd);
47 };
48
49 #ifdef HAVE_PLUGINS
50 extern plugins_t *libwireshark_plugins;
51 #endif
52
60 /*
61 Ref 1
62 Epan
63 Enhanced Packet ANalyzer, aka the packet analyzing engine. Source code can be found in the epan directory.
64
65 Protocol-Tree - Keep data of the capture file protocol information.
66
67 Dissectors - The various protocol dissectors in epan/dissectors.
68
69 Plugins - Some of the protocol dissectors are implemented as plugins. Source code can be found at plugins.
70
71 Display-Filters - the display filter engine at epan/dfilter
72
73
74
75 Ref2 for further edits - delete when done
76 \section Introduction
77
78 This document describes the data structures and the functions exported by the CACE Technologies AirPcap library.
79 The AirPcap library provides low-level access to the AirPcap driver including advanced capabilities such as channel setting,
80 link type control and WEP configuration.<br>
81 This manual includes the following sections:
82
83 \note throughout this documentation, \e device refers to a physical USB AirPcap device, while \e adapter is an open API
84 instance. Most of the AirPcap API operations are adapter-specific but some of them, like setting the channel, are
85 per-device and will be reflected on all the open adapters. These functions will have "Device" in their name, e.g.
86 AirpcapSetDeviceChannel().
87
88 \b Sections:
89
90 - \ref airpcapfuncs
91 - \ref airpcapdefs
92 - \ref radiotap
93 */
94
102 WS_DLL_PUBLIC
103 gboolean epan_init(void (*register_all_protocols_func)(register_cb cb, gpointer client_data),
104 void (*register_all_handoffs_func)(register_cb cb, gpointer client_data),
105 register_cb cb, void *client_data);
106
110 WS_DLL_PUBLIC
111 e_prefs *epan_load_settings(void);
112
114 WS_DLL_PUBLIC
115 void epan_cleanup(void);
116
117 #ifdef HAVE_PLUGINS
118 typedef struct {
119 void (*init)(void);
120 void (*dissect_init)(epan_dissect_t *);
121 void (*dissect_cleanup)(epan_dissect_t *);
122 void (*cleanup)(void);
123 void (*register_all_protocols)(register_cb, gpointer);
124 void (*register_all_handoffs)(register_cb, gpointer);
125 } epan_plugin;
126
127 WS_DLL_PUBLIC void epan_register_plugin(const epan_plugin *plugin);
128 #endif
129
135 void epan_conversation_init(void);
136
144 typedef struct epan_session epan_t;
145
146 WS_DLL_PUBLIC epan_t *epan_new(struct packet_provider_data *prov,
147 const struct packet_provider_funcs *funcs);
148
149 WS_DLL_PUBLIC const char *epan_get_user_comment(const epan_t *session, const frame_data *fd);
150
151 WS_DLL_PUBLIC const char *epan_get_interface_name(const epan_t *session, guint32 interface_id);
152
153 WS_DLL_PUBLIC const char *epan_get_interface_description(const epan_t *session, guint32 interface_id);
154
155 const nstime_t *epan_get_frame_ts(const epan_t *session, guint32 frame_num);
156
157 WS_DLL_PUBLIC void epan_free(epan_t *session);
158
159 WS_DLL_PUBLIC const gchar*
160 epan_get_version(void);
161
162 WS_DLL_PUBLIC void epan_get_version_number(int *major, int *minor, int *micro);
163
174 void epan_set_always_visible(gboolean force);
175
177 WS_DLL_PUBLIC
178 void
179 epan_dissect_init(epan_dissect_t *edt, epan_t *session, const gboolean create_proto_tree, const gboolean proto_tree_visible);
180
184 WS_DLL_PUBLIC
185 epan_dissect_t*
186 epan_dissect_new(epan_t *session, const gboolean create_proto_tree, const gboolean proto_tree_visible);
187
188 WS_DLL_PUBLIC
189 void
190 epan_dissect_reset(epan_dissect_t *edt);
191
193 WS_DLL_PUBLIC
194 void
195 epan_dissect_fake_protocols(epan_dissect_t *edt, const gboolean fake_protocols);
196
198 WS_DLL_PUBLIC
199 void
200 epan_dissect_run(epan_dissect_t *edt, int file_type_subtype,
201 wtap_rec *rec, tvbuff_t *tvb, frame_data *fd,
202 struct epan_column_info *cinfo);
203
204 WS_DLL_PUBLIC
205 void
206 epan_dissect_run_with_taps(epan_dissect_t *edt, int file_type_subtype,
207 wtap_rec *rec, tvbuff_t *tvb, frame_data *fd,
208 struct epan_column_info *cinfo);
209
211 WS_DLL_PUBLIC
212 void
213 epan_dissect_file_run(epan_dissect_t *edt, wtap_rec *rec,
214 tvbuff_t *tvb, frame_data *fd, struct epan_column_info *cinfo);
215
216 WS_DLL_PUBLIC
217 void
218 epan_dissect_file_run_with_taps(epan_dissect_t *edt, wtap_rec *rec,
219 tvbuff_t *tvb, frame_data *fd, struct epan_column_info *cinfo);
220
222 WS_DLL_PUBLIC
223 void
224 epan_dissect_prime_with_dfilter(epan_dissect_t *edt, const struct epan_dfilter *dfcode);
225
227 WS_DLL_PUBLIC
228 void
229 epan_dissect_prime_with_hfid(epan_dissect_t *edt, int hfid);
230
232 WS_DLL_PUBLIC
233 void
234 epan_dissect_prime_with_hfid_array(epan_dissect_t *edt, GArray *hfids);
235
237 WS_DLL_PUBLIC
238 void
239 epan_dissect_fill_in_columns(epan_dissect_t *edt, const gboolean fill_col_exprs, const gboolean fill_fd_colums);
240
242 WS_DLL_PUBLIC
243 gboolean
244 epan_dissect_packet_contains_field(epan_dissect_t* edt,
245 const char *field_name);
246
248 WS_DLL_PUBLIC
249 void
250 epan_dissect_cleanup(epan_dissect_t* edt);
251
253 WS_DLL_PUBLIC
254 void
255 epan_dissect_free(epan_dissect_t* edt);
256
258 const gchar *
259 epan_custom_set(epan_dissect_t *edt, GSList *ids, gint occurrence,
260 gchar *result, gchar *expr, const int size);
261
265 WS_DLL_PUBLIC
266 void
267 epan_get_compiled_version_info(GString *str);
268
272 WS_DLL_PUBLIC
273 void
274 epan_get_runtime_version_info(GString *str);
275
276 #ifdef __cplusplus
277 }
278 #endif /* __cplusplus */
279
280 #endif /* __EPAN_H__ */
frame_data.h
epan_column_info
Definition: column-info.h:51
tvbuff
Definition: tvbuff-int.h:35
packet_provider_data
Definition: cfile.h:49
nstime_t
Definition: nstime.h:27
_plugin
Definition: plugins.c:31
packet_provider_funcs
Definition: epan.h:42
epan_dfilter
Definition: dfilter-int.h:19
_frame_data
Definition: frame_data.h:53
_e_prefs
Definition: prefs.h:132
epan_dissect
Definition: epan_dissect.h:28
wtap_rec
Definition: wtap.h:1274
epan_session
Definition: epan.c:348