Wireshark 4.5.0
The Wireshark network protocol analyzer
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
epan.h
Go to the documentation of this file.
1
10#ifndef __EPAN_H__
11#define __EPAN_H__
12
13#include <wsutil/feature_list.h>
14#include <epan/tvbuff.h>
15#include <epan/prefs.h>
16#include <epan/frame_data.h>
17#include <epan/register.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif /* __cplusplus */
23
28extern bool wireshark_abort_on_too_many_items;
29
33WS_DLL_PUBLIC void ws_dissector_bug(const char *format, ...)
34 G_GNUC_PRINTF(1,2);
35
39#define ws_dissector_oops(_fmt, ...) ws_dissector_bug("OOPS: " _fmt, __VA_ARGS__)
40
41typedef struct epan_dissect epan_dissect_t;
42
43struct epan_dfilter;
44struct epan_column_info;
45
53
59 const nstime_t *(*get_frame_ts)(struct packet_provider_data *prov, uint32_t frame_num);
60 const char *(*get_interface_name)(struct packet_provider_data *prov, uint32_t interface_id, unsigned section_number);
61 const char *(*get_interface_description)(struct packet_provider_data *prov, uint32_t interface_id, unsigned section_number);
62 wtap_block_t (*get_modified_block)(struct packet_provider_data *prov, const frame_data *fd);
63};
64
72/*
73Ref 1
74Epan
75Enhanced Packet ANalyzer, aka the packet analyzing engine. Source code can be found in the epan directory.
76
77Protocol-Tree - Keep data of the capture file protocol information.
78
79Dissectors - The various protocol dissectors in epan/dissectors.
80
81Plugins - Some of the protocol dissectors are implemented as plugins. Source code can be found at plugins.
82
83Display-Filters - the display filter engine at epan/dfilter
84
85*/
86
94WS_DLL_PUBLIC
95bool epan_init(register_cb cb, void *client_data, bool load_plugins);
96
100WS_DLL_PUBLIC
102
104WS_DLL_PUBLIC
105void epan_cleanup(void);
106
107typedef struct {
108 void (*init)(void); /* Called before proto_init() */
109 void (*post_init)(void); /* Called at the end of epan_init() */
110 void (*dissect_init)(epan_dissect_t *);
111 void (*dissect_cleanup)(epan_dissect_t *);
112 void (*cleanup)(void);
113 void (*register_all_protocols)(register_cb, void *);
114 void (*register_all_handoffs)(register_cb, void *);
115 void (*register_all_tap_listeners)(void);
117
118WS_DLL_PUBLIC void epan_register_plugin(const epan_plugin *plugin);
119
125WS_DLL_PUBLIC int epan_plugins_supported(void);
126
133void epan_conversation_init(void);
134
142typedef struct epan_session epan_t;
143
144WS_DLL_PUBLIC epan_t *epan_new(struct packet_provider_data *prov,
145 const struct packet_provider_funcs *funcs);
146
147WS_DLL_PUBLIC wtap_block_t epan_get_modified_block(const epan_t *session, const frame_data *fd);
148
149WS_DLL_PUBLIC const char *epan_get_interface_name(const epan_t *session, uint32_t interface_id, unsigned section_number);
150
151WS_DLL_PUBLIC const char *epan_get_interface_description(const epan_t *session, uint32_t interface_id, unsigned section_number);
152
153const nstime_t *epan_get_frame_ts(const epan_t *session, uint32_t frame_num);
154
155WS_DLL_PUBLIC void epan_free(epan_t *session);
156
157WS_DLL_PUBLIC const char*
158epan_get_version(void);
159
160WS_DLL_PUBLIC void epan_get_version_number(int *major, int *minor, int *micro);
161
172WS_DLL_PUBLIC
173void epan_set_always_visible(bool force);
174
176WS_DLL_PUBLIC
177void
178epan_dissect_init(epan_dissect_t *edt, epan_t *session, const bool create_proto_tree, const bool proto_tree_visible);
179
183WS_DLL_PUBLIC
185epan_dissect_new(epan_t *session, const bool create_proto_tree, const bool proto_tree_visible);
186
187WS_DLL_PUBLIC
188void
189epan_dissect_reset(epan_dissect_t *edt);
190
192WS_DLL_PUBLIC
193void
194epan_dissect_fake_protocols(epan_dissect_t *edt, const bool fake_protocols);
195
197WS_DLL_PUBLIC
198void
199epan_dissect_run(epan_dissect_t *edt, int file_type_subtype,
200 wtap_rec *rec, frame_data *fd, struct epan_column_info *cinfo);
201
202WS_DLL_PUBLIC
203void
204epan_dissect_run_with_taps(epan_dissect_t *edt, int file_type_subtype,
205 wtap_rec *rec, frame_data *fd, struct epan_column_info *cinfo);
206
208WS_DLL_PUBLIC
209void
211 frame_data *fd, struct epan_column_info *cinfo);
212
213WS_DLL_PUBLIC
214void
215epan_dissect_file_run_with_taps(epan_dissect_t *edt, wtap_rec *rec,
216 frame_data *fd, struct epan_column_info *cinfo);
217
219WS_DLL_PUBLIC
220void
222
224WS_DLL_PUBLIC
225void
227
229WS_DLL_PUBLIC
230void
232
234WS_DLL_PUBLIC
235void
237
239WS_DLL_PUBLIC
240void
241epan_dissect_fill_in_columns(epan_dissect_t *edt, const bool fill_col_exprs, const bool fill_fd_colums);
242
244WS_DLL_PUBLIC
245bool
247 const char *field_name);
248
250WS_DLL_PUBLIC
251void
253
255WS_DLL_PUBLIC
256void
258
260const char *
261epan_custom_set(epan_dissect_t *edt, GSList *ids, int occurrence, bool display_details,
262 char *result, char *expr, const int size);
263
267WS_DLL_PUBLIC
268void
269epan_gather_compile_info(feature_list l);
270
274WS_DLL_PUBLIC
275void
276epan_gather_runtime_info(feature_list l);
277
278#ifdef __cplusplus
279}
280#endif /* __cplusplus */
281
282#endif /* __EPAN_H__ */
WS_DLL_PUBLIC void epan_dissect_init(epan_dissect_t *edt, epan_t *session, const bool create_proto_tree, const bool proto_tree_visible)
Definition epan.c:578
WS_DLL_PUBLIC void epan_dissect_fake_protocols(epan_dissect_t *edt, const bool fake_protocols)
Definition epan.c:649
void epan_conversation_init(void)
Definition epan.c:557
WS_DLL_PUBLIC void epan_dissect_file_run(epan_dissect_t *edt, wtap_rec *rec, frame_data *fd, struct epan_column_info *cinfo)
Definition epan.c:690
bool wireshark_abort_on_dissector_bug
Definition epan.c:120
WS_DLL_PUBLIC void epan_gather_compile_info(feature_list l)
Definition epan.c:827
WS_DLL_PUBLIC void epan_dissect_cleanup(epan_dissect_t *edt)
Definition epan.c:721
WS_DLL_PUBLIC e_prefs * epan_load_settings(void)
Definition epan.c:389
WS_DLL_PUBLIC void epan_dissect_prime_with_hfid(epan_dissect_t *edt, int hfid)
Definition epan.c:770
WS_DLL_PUBLIC bool epan_init(register_cb cb, void *client_data, bool load_plugins)
Definition epan.c:258
WS_DLL_PUBLIC int epan_plugins_supported(void)
Definition epan.c:241
WS_DLL_PUBLIC void epan_cleanup(void)
Definition epan.c:408
WS_DLL_PUBLIC void epan_dissect_free(epan_dissect_t *edt)
Definition epan.c:751
WS_DLL_PUBLIC void epan_dissect_fill_in_columns(epan_dissect_t *edt, const bool fill_col_exprs, const bool fill_fd_colums)
Definition epan.c:798
WS_DLL_PUBLIC void ws_dissector_bug(const char *format,...) G_GNUC_PRINTF(1
WS_DLL_PUBLIC bool epan_dissect_packet_contains_field(epan_dissect_t *edt, const char *field_name)
Definition epan.c:805
WS_DLL_PUBLIC void epan_dissect_prime_with_dfilter(epan_dissect_t *edt, const struct epan_dfilter *dfcode)
WS_DLL_PUBLIC void epan_dissect_run(epan_dissect_t *edt, int file_type_subtype, wtap_rec *rec, frame_data *fd, struct epan_column_info *cinfo)
Definition epan.c:656
WS_DLL_PUBLIC void epan_gather_runtime_info(feature_list l)
Definition epan.c:939
WS_DLL_PUBLIC void epan_dissect_prime_with_hfid_array(epan_dissect_t *edt, GArray *hfids)
Definition epan.c:776
WS_DLL_PUBLIC epan_dissect_t * epan_dissect_new(epan_t *session, const bool create_proto_tree, const bool proto_tree_visible)
Definition epan.c:638
WS_DLL_PUBLIC void epan_dissect_prime_with_dfilter_print(epan_dissect_t *edt, const struct epan_dfilter *dfcode)
WS_DLL_PUBLIC void epan_set_always_visible(bool force)
Definition epan.c:569
const char * epan_custom_set(epan_dissect_t *edt, GSList *ids, int occurrence, bool display_details, char *result, char *expr, const int size)
Definition epan.c:788
void register_all_protocols(register_cb cb, void *client_data)
Definition register.c:65
Definition prefs.h:165
Definition plugins.c:29
Definition column-info.h:62
Definition dfilter-int.h:35
Definition epan_dissect.h:28
Definition epan.h:107
Definition epan.c:482
Definition nstime.h:26
Definition cfile.h:58
Definition epan.h:58
Definition wtap_opttypes.c:85
Definition wtap.h:1433