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 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif /* __cplusplus */
25 
29 extern gboolean wireshark_abort_on_dissector_bug;
30 extern gboolean wireshark_abort_on_too_many_items;
31 
32 typedef struct epan_dissect epan_dissect_t;
33 
34 struct epan_dfilter;
35 struct epan_column_info;
36 
44 
50  const nstime_t *(*get_frame_ts)(struct packet_provider_data *prov, guint32 frame_num);
51  const char *(*get_interface_name)(struct packet_provider_data *prov, guint32 interface_id, unsigned section_number);
52  const char *(*get_interface_description)(struct packet_provider_data *prov, guint32 interface_id, unsigned section_number);
53  wtap_block_t (*get_modified_block)(struct packet_provider_data *prov, const frame_data *fd);
54 };
55 
63 /*
64 Ref 1
65 Epan
66 Enhanced Packet ANalyzer, aka the packet analyzing engine. Source code can be found in the epan directory.
67 
68 Protocol-Tree - Keep data of the capture file protocol information.
69 
70 Dissectors - The various protocol dissectors in epan/dissectors.
71 
72 Plugins - Some of the protocol dissectors are implemented as plugins. Source code can be found at plugins.
73 
74 Display-Filters - the display filter engine at epan/dfilter
75 
76 
77 
78 Ref2 for further edits - delete when done
79  \section Introduction
80 
81  This document describes the data structures and the functions exported by the CACE Technologies AirPcap library.
82  The AirPcap library provides low-level access to the AirPcap driver including advanced capabilities such as channel setting,
83  link type control and WEP configuration.<br>
84  This manual includes the following sections:
85 
86  \note throughout this documentation, \e device refers to a physical USB AirPcap device, while \e adapter is an open API
87  instance. Most of the AirPcap API operations are adapter-specific but some of them, like setting the channel, are
88  per-device and will be reflected on all the open adapters. These functions will have "Device" in their name, e.g.
89  AirpcapSetDeviceChannel().
90 
91  \b Sections:
92 
93  - \ref airpcapfuncs
94  - \ref airpcapdefs
95  - \ref radiotap
96 */
97 
105 WS_DLL_PUBLIC
106 gboolean epan_init(register_cb cb, void *client_data, gboolean load_plugins);
107 
111 WS_DLL_PUBLIC
113 
115 WS_DLL_PUBLIC
116 void epan_cleanup(void);
117 
118 typedef struct {
119  void (*init)(void); /* Called before proto_init() */
120  void (*post_init)(void); /* Called at the end of epan_init() */
121  void (*dissect_init)(epan_dissect_t *);
122  void (*dissect_cleanup)(epan_dissect_t *);
123  void (*cleanup)(void);
124  void (*register_all_protocols)(register_cb, gpointer);
125  void (*register_all_handoffs)(register_cb, gpointer);
126  void (*register_all_tap_listeners)(void);
127 } epan_plugin;
128 
129 WS_DLL_PUBLIC void epan_register_plugin(const epan_plugin *plugin);
130 
136 WS_DLL_PUBLIC int epan_plugins_supported(void);
137 
145 
153 typedef struct epan_session epan_t;
154 
155 WS_DLL_PUBLIC epan_t *epan_new(struct packet_provider_data *prov,
156  const struct packet_provider_funcs *funcs);
157 
158 WS_DLL_PUBLIC wtap_block_t epan_get_modified_block(const epan_t *session, const frame_data *fd);
159 
160 WS_DLL_PUBLIC const char *epan_get_interface_name(const epan_t *session, guint32 interface_id, unsigned section_number);
161 
162 WS_DLL_PUBLIC const char *epan_get_interface_description(const epan_t *session, guint32 interface_id, unsigned section_number);
163 
164 const nstime_t *epan_get_frame_ts(const epan_t *session, guint32 frame_num);
165 
166 WS_DLL_PUBLIC void epan_free(epan_t *session);
167 
168 WS_DLL_PUBLIC const gchar*
169 epan_get_version(void);
170 
171 WS_DLL_PUBLIC void epan_get_version_number(int *major, int *minor, int *micro);
172 
183 WS_DLL_PUBLIC
184 void epan_set_always_visible(gboolean force);
185 
187 WS_DLL_PUBLIC
188 void
189 epan_dissect_init(epan_dissect_t *edt, epan_t *session, const gboolean create_proto_tree, const gboolean proto_tree_visible);
190 
194 WS_DLL_PUBLIC
196 epan_dissect_new(epan_t *session, const gboolean create_proto_tree, const gboolean proto_tree_visible);
197 
198 WS_DLL_PUBLIC
199 void
200 epan_dissect_reset(epan_dissect_t *edt);
201 
203 WS_DLL_PUBLIC
204 void
205 epan_dissect_fake_protocols(epan_dissect_t *edt, const gboolean fake_protocols);
206 
208 WS_DLL_PUBLIC
209 void
210 epan_dissect_run(epan_dissect_t *edt, int file_type_subtype,
211  wtap_rec *rec, tvbuff_t *tvb, frame_data *fd,
212  struct epan_column_info *cinfo);
213 
214 WS_DLL_PUBLIC
215 void
216 epan_dissect_run_with_taps(epan_dissect_t *edt, int file_type_subtype,
217  wtap_rec *rec, tvbuff_t *tvb, frame_data *fd,
218  struct epan_column_info *cinfo);
219 
221 WS_DLL_PUBLIC
222 void
224  tvbuff_t *tvb, frame_data *fd, struct epan_column_info *cinfo);
225 
226 WS_DLL_PUBLIC
227 void
228 epan_dissect_file_run_with_taps(epan_dissect_t *edt, wtap_rec *rec,
229  tvbuff_t *tvb, frame_data *fd, struct epan_column_info *cinfo);
230 
232 WS_DLL_PUBLIC
233 void
235 
237 WS_DLL_PUBLIC
238 void
240 
242 WS_DLL_PUBLIC
243 void
245 
247 WS_DLL_PUBLIC
248 void
249 epan_dissect_fill_in_columns(epan_dissect_t *edt, const gboolean fill_col_exprs, const gboolean fill_fd_colums);
250 
252 WS_DLL_PUBLIC
253 gboolean
255  const char *field_name);
256 
258 WS_DLL_PUBLIC
259 void
261 
263 WS_DLL_PUBLIC
264 void
266 
268 const gchar *
269 epan_custom_set(epan_dissect_t *edt, GSList *ids, gint occurrence,
270  gchar *result, gchar *expr, const int size);
271 
275 WS_DLL_PUBLIC
276 void
277 epan_gather_compile_info(feature_list l);
278 
282 WS_DLL_PUBLIC
283 void
284 epan_gather_runtime_info(feature_list l);
285 
286 #ifdef __cplusplus
287 }
288 #endif /* __cplusplus */
289 
290 #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:759
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:768
void epan_conversation_init(void)
Definition: epan.c:535
gboolean wireshark_abort_on_dissector_bug
Definition: epan.c:117
WS_DLL_PUBLIC void epan_gather_compile_info(feature_list l)
Definition: epan.c:797
WS_DLL_PUBLIC void epan_dissect_cleanup(epan_dissect_t *edt)
Definition: epan.c:698
WS_DLL_PUBLIC void epan_dissect_fake_protocols(epan_dissect_t *edt, const gboolean fake_protocols)
Definition: epan.c:627
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:741
WS_DLL_PUBLIC int epan_plugins_supported(void)
Definition: epan.c:223
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:634
WS_DLL_PUBLIC void epan_cleanup(void)
Definition: epan.c:388
WS_DLL_PUBLIC void epan_dissect_free(epan_dissect_t *edt)
Definition: epan.c:728
WS_DLL_PUBLIC gboolean epan_dissect_packet_contains_field(epan_dissect_t *edt, const char *field_name)
Definition: epan.c:775
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:616
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:369
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:667
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:556
WS_DLL_PUBLIC void epan_gather_runtime_info(feature_list l)
Definition: epan.c:904
WS_DLL_PUBLIC void epan_dissect_prime_with_hfid_array(epan_dissect_t *edt, GArray *hfids)
Definition: epan.c:747
WS_DLL_PUBLIC void epan_set_always_visible(gboolean force)
Definition: epan.c:547
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:118
Definition: epan.c:460
Definition: nstime.h:26
Definition: cfile.h:58
Definition: epan.h:49
Definition: tvbuff-int.h:35
Definition: wtap_opttypes.c:85
Definition: wtap.h:1395