Wireshark  4.3.0
The Wireshark network protocol analyzer
epan.h
Go to the documentation of this file.
1 
10 #ifndef __EPAN_H__
11 #define __EPAN_H__
12 
13 #include <wireshark.h>
14 
15 #include <wsutil/feature_list.h>
16 #include <epan/tvbuff.h>
17 #include <epan/prefs.h>
18 #include <epan/frame_data.h>
19 #include <epan/register.h>
20 #include <wiretap/wtap_opttypes.h>
21 #include <wsutil/plugins.h>
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif /* __cplusplus */
26 
30 extern gboolean wireshark_abort_on_dissector_bug;
31 extern gboolean wireshark_abort_on_too_many_items;
32 
33 typedef struct epan_dissect epan_dissect_t;
34 
35 struct epan_dfilter;
36 struct epan_column_info;
37 
45 
51  const nstime_t *(*get_frame_ts)(struct packet_provider_data *prov, guint32 frame_num);
52  const char *(*get_interface_name)(struct packet_provider_data *prov, guint32 interface_id, unsigned section_number);
53  const char *(*get_interface_description)(struct packet_provider_data *prov, guint32 interface_id, unsigned section_number);
54  wtap_block_t (*get_modified_block)(struct packet_provider_data *prov, const frame_data *fd);
55 };
56 
64 /*
65 Ref 1
66 Epan
67 Enhanced Packet ANalyzer, aka the packet analyzing engine. Source code can be found in the epan directory.
68 
69 Protocol-Tree - Keep data of the capture file protocol information.
70 
71 Dissectors - The various protocol dissectors in epan/dissectors.
72 
73 Plugins - Some of the protocol dissectors are implemented as plugins. Source code can be found at plugins.
74 
75 Display-Filters - the display filter engine at epan/dfilter
76 
77 
78 
79 Ref2 for further edits - delete when done
80  \section Introduction
81 
82  This document describes the data structures and the functions exported by the CACE Technologies AirPcap library.
83  The AirPcap library provides low-level access to the AirPcap driver including advanced capabilities such as channel setting,
84  link type control and WEP configuration.<br>
85  This manual includes the following sections:
86 
87  \note throughout this documentation, \e device refers to a physical USB AirPcap device, while \e adapter is an open API
88  instance. Most of the AirPcap API operations are adapter-specific but some of them, like setting the channel, are
89  per-device and will be reflected on all the open adapters. These functions will have "Device" in their name, e.g.
90  AirpcapSetDeviceChannel().
91 
92  \b Sections:
93 
94  - \ref airpcapfuncs
95  - \ref airpcapdefs
96  - \ref radiotap
97 */
98 
106 WS_DLL_PUBLIC
107 gboolean epan_init(register_cb cb, void *client_data, gboolean load_plugins);
108 
112 WS_DLL_PUBLIC
114 
116 WS_DLL_PUBLIC
117 void epan_cleanup(void);
118 
119 typedef struct {
120  void (*init)(void); /* Called before proto_init() */
121  void (*post_init)(void); /* Called at the end of epan_init() */
122  void (*dissect_init)(epan_dissect_t *);
123  void (*dissect_cleanup)(epan_dissect_t *);
124  void (*cleanup)(void);
125  void (*register_all_protocols)(register_cb, gpointer);
126  void (*register_all_handoffs)(register_cb, gpointer);
127  void (*get_descriptions)(plugin_description_callback callback, void *user_data);
128 } epan_plugin;
129 
130 WS_DLL_PUBLIC void epan_register_plugin(const epan_plugin *plugin);
131 
132 WS_DLL_PUBLIC void epan_plugins_get_descriptions(plugin_description_callback callback, void *user_data);
133 
134 WS_DLL_PUBLIC void epan_plugins_dump_all(void);
135 
141 WS_DLL_PUBLIC int epan_plugins_supported(void);
142 
150 
158 typedef struct epan_session epan_t;
159 
160 WS_DLL_PUBLIC epan_t *epan_new(struct packet_provider_data *prov,
161  const struct packet_provider_funcs *funcs);
162 
163 WS_DLL_PUBLIC wtap_block_t epan_get_modified_block(const epan_t *session, const frame_data *fd);
164 
165 WS_DLL_PUBLIC const char *epan_get_interface_name(const epan_t *session, guint32 interface_id, unsigned section_number);
166 
167 WS_DLL_PUBLIC const char *epan_get_interface_description(const epan_t *session, guint32 interface_id, unsigned section_number);
168 
169 const nstime_t *epan_get_frame_ts(const epan_t *session, guint32 frame_num);
170 
171 WS_DLL_PUBLIC void epan_free(epan_t *session);
172 
173 WS_DLL_PUBLIC const gchar*
174 epan_get_version(void);
175 
176 WS_DLL_PUBLIC void epan_get_version_number(int *major, int *minor, int *micro);
177 
188 WS_DLL_PUBLIC
189 void epan_set_always_visible(gboolean force);
190 
192 WS_DLL_PUBLIC
193 void
194 epan_dissect_init(epan_dissect_t *edt, epan_t *session, const gboolean create_proto_tree, const gboolean proto_tree_visible);
195 
199 WS_DLL_PUBLIC
201 epan_dissect_new(epan_t *session, const gboolean create_proto_tree, const gboolean proto_tree_visible);
202 
203 WS_DLL_PUBLIC
204 void
205 epan_dissect_reset(epan_dissect_t *edt);
206 
208 WS_DLL_PUBLIC
209 void
210 epan_dissect_fake_protocols(epan_dissect_t *edt, const gboolean fake_protocols);
211 
213 WS_DLL_PUBLIC
214 void
215 epan_dissect_run(epan_dissect_t *edt, int file_type_subtype,
216  wtap_rec *rec, tvbuff_t *tvb, frame_data *fd,
217  struct epan_column_info *cinfo);
218 
219 WS_DLL_PUBLIC
220 void
221 epan_dissect_run_with_taps(epan_dissect_t *edt, int file_type_subtype,
222  wtap_rec *rec, tvbuff_t *tvb, frame_data *fd,
223  struct epan_column_info *cinfo);
224 
226 WS_DLL_PUBLIC
227 void
229  tvbuff_t *tvb, frame_data *fd, struct epan_column_info *cinfo);
230 
231 WS_DLL_PUBLIC
232 void
233 epan_dissect_file_run_with_taps(epan_dissect_t *edt, wtap_rec *rec,
234  tvbuff_t *tvb, frame_data *fd, struct epan_column_info *cinfo);
235 
237 WS_DLL_PUBLIC
238 void
240 
242 WS_DLL_PUBLIC
243 void
245 
247 WS_DLL_PUBLIC
248 void
250 
252 WS_DLL_PUBLIC
253 void
254 epan_dissect_fill_in_columns(epan_dissect_t *edt, const gboolean fill_col_exprs, const gboolean fill_fd_colums);
255 
257 WS_DLL_PUBLIC
258 gboolean
260  const char *field_name);
261 
263 WS_DLL_PUBLIC
264 void
266 
268 WS_DLL_PUBLIC
269 void
271 
273 const gchar *
274 epan_custom_set(epan_dissect_t *edt, GSList *ids, gint occurrence,
275  gchar *result, gchar *expr, const int size);
276 
280 WS_DLL_PUBLIC
281 void
282 epan_gather_compile_info(feature_list l);
283 
287 WS_DLL_PUBLIC
288 void
289 epan_gather_runtime_info(feature_list l);
290 
291 #ifdef __cplusplus
292 }
293 #endif /* __cplusplus */
294 
295 #endif /* __EPAN_H__ */
const gchar * epan_custom_set(epan_dissect_t *edt, GSList *ids, gint occurrence, gchar *result, gchar *expr, const int size)
Definition: epan.c:752
WS_DLL_PUBLIC void epan_dissect_fill_in_columns(epan_dissect_t *edt, const gboolean fill_col_exprs, const gboolean fill_fd_colums)
Definition: epan.c:761
void epan_conversation_init(void)
Definition: epan.c:528
gboolean wireshark_abort_on_dissector_bug
Definition: epan.c:113
WS_DLL_PUBLIC void epan_gather_compile_info(feature_list l)
Definition: epan.c:790
WS_DLL_PUBLIC void epan_dissect_cleanup(epan_dissect_t *edt)
Definition: epan.c:691
WS_DLL_PUBLIC void epan_dissect_fake_protocols(epan_dissect_t *edt, const gboolean fake_protocols)
Definition: epan.c:620
WS_DLL_PUBLIC gboolean epan_init(register_cb cb, void *client_data, gboolean load_plugins)
WS_DLL_PUBLIC void epan_dissect_prime_with_hfid(epan_dissect_t *edt, int hfid)
Definition: epan.c:734
WS_DLL_PUBLIC int epan_plugins_supported(void)
Definition: epan.c:228
WS_DLL_PUBLIC void epan_dissect_run(epan_dissect_t *edt, int file_type_subtype, wtap_rec *rec, tvbuff_t *tvb, frame_data *fd, struct epan_column_info *cinfo)
Definition: epan.c:627
WS_DLL_PUBLIC void epan_cleanup(void)
Definition: epan.c:383
WS_DLL_PUBLIC void epan_dissect_free(epan_dissect_t *edt)
Definition: epan.c:721
WS_DLL_PUBLIC gboolean epan_dissect_packet_contains_field(epan_dissect_t *edt, const char *field_name)
Definition: epan.c:768
WS_DLL_PUBLIC epan_dissect_t * epan_dissect_new(epan_t *session, const gboolean create_proto_tree, const gboolean proto_tree_visible)
Definition: epan.c:609
WS_DLL_PUBLIC void epan_dissect_prime_with_dfilter(epan_dissect_t *edt, const struct epan_dfilter *dfcode)
WS_DLL_PUBLIC e_prefs * epan_load_settings(void)
Definition: epan.c:364
WS_DLL_PUBLIC void epan_dissect_file_run(epan_dissect_t *edt, wtap_rec *rec, tvbuff_t *tvb, frame_data *fd, struct epan_column_info *cinfo)
Definition: epan.c:660
WS_DLL_PUBLIC void epan_dissect_init(epan_dissect_t *edt, epan_t *session, const gboolean create_proto_tree, const gboolean proto_tree_visible)
Definition: epan.c:549
WS_DLL_PUBLIC void epan_gather_runtime_info(feature_list l)
Definition: epan.c:897
WS_DLL_PUBLIC void epan_dissect_prime_with_hfid_array(epan_dissect_t *edt, GArray *hfids)
Definition: epan.c:740
WS_DLL_PUBLIC void epan_set_always_visible(gboolean force)
Definition: epan.c:540
void register_all_protocols(register_cb cb, gpointer client_data)
Definition: register.c:65
Definition: prefs.h:147
Definition: plugins.c:29
Definition: column-info.h:63
Definition: dfilter-int.h:35
Definition: epan_dissect.h:28
Definition: epan.h:119
Definition: epan.c:453
Definition: nstime.h:26
Definition: cfile.h:58
Definition: epan.h:50
Definition: tvbuff-int.h:35
Definition: wtap_opttypes.c:85
Definition: wtap.h:1395