Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
packet.h
Go to the documentation of this file.
1
11#ifndef __PACKET_H__
12#define __PACKET_H__
13
14#include <wsutil/array.h>
16#include "proto.h"
17#include "tvbuff.h"
18#include "epan.h"
19#include "frame_data.h"
20#include "packet_info.h"
21#include "column-utils.h"
22#include "guid-utils.h"
23
24#ifdef __cplusplus
25extern "C" {
26#endif /* __cplusplus */
27
28struct epan_range;
29
35#define hi_nibble(b) (((b) & 0xf0) >> 4)
36#define lo_nibble(b) ((b) & 0x0f)
37
38/* Check whether the "len" bytes of data starting at "offset" is
39 * entirely inside the captured data for this packet. */
40#define BYTES_ARE_IN_FRAME(offset, captured_len, len) \
41 ((unsigned)(offset) + (unsigned)(len) > (unsigned)(offset) && \
42 (unsigned)(offset) + (unsigned)(len) <= (unsigned)(captured_len))
43
44/* 0 is case insensitive for backwards compatibility with tables that
45 * used false or BASE_NONE for case sensitive, which was the default.
46 */
47#define STRING_CASE_SENSITIVE 0
48#define STRING_CASE_INSENSITIVE 1
49
50extern void packet_init(void);
51extern void packet_cache_proto_handles(void);
52extern void packet_all_tables_sort_handles(void);
53extern void packet_cleanup(void);
54
55/* Handle for dissectors you call directly or register with "dissector_add_uint()".
56 This handle is opaque outside of "packet.c". */
57struct dissector_handle;
59
60/* Hash table for matching unsigned integers, or strings, and dissectors;
61 this is opaque outside of "packet.c". */
62struct dissector_table;
64
65/*
66 * Dissector that returns:
67 *
68 * The amount of data in the protocol's PDU, if it was able to
69 * dissect all the data;
70 *
71 * 0, if the tvbuff doesn't contain a PDU for that protocol;
72 *
73 * The negative of the amount of additional data needed, if
74 * we need more data (e.g., from subsequent TCP segments) to
75 * dissect the entire PDU.
76 */
77typedef int (*dissector_t)(tvbuff_t *, packet_info *, proto_tree *, void *);
78
79/* Same as dissector_t with an extra parameter for callback pointer */
80typedef int (*dissector_cb_t)(tvbuff_t *, packet_info *, proto_tree *, void *, void *);
81
89typedef bool (*heur_dissector_t)(tvbuff_t *tvb, packet_info *pinfo,
90 proto_tree *tree, void *);
91
92typedef enum {
93 HEURISTIC_DISABLE,
94 HEURISTIC_ENABLE
95} heuristic_enable_e;
96
97typedef void (*DATFunc) (const char *table_name, ftenum_t selector_type,
98 void *key, void *value, void *user_data);
99typedef void (*DATFunc_handle) (const char *table_name, void *value,
100 void *user_data);
101typedef void (*DATFunc_table) (const char *table_name, const char *ui_name,
102 void *user_data);
103
104/* Opaque structure - provides type checking but no access to components */
105typedef struct dtbl_entry dtbl_entry_t;
106
107WS_DLL_PUBLIC dissector_handle_t dtbl_entry_get_handle (dtbl_entry_t *dtbl_entry);
108WS_DLL_PUBLIC dissector_handle_t dtbl_entry_get_initial_handle (dtbl_entry_t * entry);
109
119void dissector_table_foreach_changed (const char *table_name, DATFunc func,
120 void *user_data);
121
131WS_DLL_PUBLIC void dissector_table_foreach (const char *table_name, DATFunc func,
132 void *user_data);
133
142WS_DLL_PUBLIC void dissector_all_tables_foreach_changed (DATFunc func,
143 void *user_data);
144
154WS_DLL_PUBLIC void dissector_table_foreach_handle(const char *table_name, DATFunc_handle func,
155 void *user_data);
156
165WS_DLL_PUBLIC void dissector_all_tables_foreach_table (DATFunc_table func,
166 void *user_data, GCompareFunc compare_key_func);
167
168/* a protocol uses the function to register a sub-dissector table
169 *
170 * 'param' is the display base for integer tables, STRING_CASE_SENSITIVE
171 * or STRING_CASE_INSENSITIVE for string tables, and ignored for other
172 * table types.
173 */
174WS_DLL_PUBLIC dissector_table_t register_dissector_table(const char *name,
175 const char *ui_name, const int proto, const ftenum_t type, const int param);
176
177/*
178 * Similar to register_dissector_table, but with a "custom" hash function
179 * to store subdissectors.
180 */
181WS_DLL_PUBLIC dissector_table_t register_custom_dissector_table(const char *name,
182 const char *ui_name, const int proto, GHashFunc hash_func, GEqualFunc key_equal_func,
183 GDestroyNotify key_destroy_func);
184
191 const char *alias_name);
192
194void deregister_dissector_table(const char *name);
195
196/* Find a dissector table by table name. */
197WS_DLL_PUBLIC dissector_table_t find_dissector_table(const char *name);
198
199/* Get the UI name for a sub-dissector table, given its internal name */
200WS_DLL_PUBLIC const char *get_dissector_table_ui_name(const char *name);
201
202/* Get the field type for values of the selector for a dissector table,
203 given the table's internal name */
204WS_DLL_PUBLIC ftenum_t get_dissector_table_selector_type(const char *name);
205
206/* Get the param set for the sub-dissector table,
207 given the table's internal name */
208WS_DLL_PUBLIC int get_dissector_table_param(const char *name);
209
210/* Dump all dissector tables to the standard output (not the entries,
211 just the information about the tables) */
212WS_DLL_PUBLIC void dissector_dump_dissector_tables(void);
213
214/* Add an entry to a uint dissector table. */
215WS_DLL_PUBLIC void dissector_add_uint(const char *name, const uint32_t pattern,
216 dissector_handle_t handle);
217
218/* Add an entry to a uint dissector table with "preference" automatically added. */
219WS_DLL_PUBLIC void dissector_add_uint_with_preference(const char *name, const uint32_t pattern,
220 dissector_handle_t handle);
221
222/* Add an range of entries to a uint dissector table. */
223WS_DLL_PUBLIC void dissector_add_uint_range(const char *abbrev, struct epan_range *range,
224 dissector_handle_t handle);
225
226/* Add an range of entries to a uint dissector table with "preference" automatically added. */
227WS_DLL_PUBLIC void dissector_add_uint_range_with_preference(const char *abbrev, const char* range_str,
228 dissector_handle_t handle);
229
230/* Delete the entry for a dissector in a uint dissector table
231 with a particular pattern. */
232WS_DLL_PUBLIC void dissector_delete_uint(const char *name, const uint32_t pattern,
233 dissector_handle_t handle);
234
235/* Delete an range of entries from a uint dissector table. */
236WS_DLL_PUBLIC void dissector_delete_uint_range(const char *abbrev, struct epan_range *range,
237 dissector_handle_t handle);
238
239/* Delete all entries from a dissector table. */
240WS_DLL_PUBLIC void dissector_delete_all(const char *name, dissector_handle_t handle);
241
242/* Change the entry for a dissector in a uint dissector table
243 with a particular pattern to use a new dissector handle. */
244WS_DLL_PUBLIC void dissector_change_uint(const char *abbrev, const uint32_t pattern,
245 dissector_handle_t handle);
246
247/* Reset an entry in a uint dissector table to its initial value. */
248WS_DLL_PUBLIC void dissector_reset_uint(const char *name, const uint32_t pattern);
249
250/* Return true if an entry in a uint dissector table is found and has been
251 * changed (i.e. dissector_change_uint() has been called, such as from
252 * Decode As, prefs registered via dissector_add_uint_[range_]with_preference),
253 * etc.), otherwise return false.
254 */
255WS_DLL_PUBLIC bool dissector_is_uint_changed(dissector_table_t const sub_dissectors, const uint32_t uint_val);
256
257/* Look for a given value in a given uint dissector table and, if found,
258 call the dissector with the arguments supplied, and return the number
259 of bytes consumed, otherwise return 0. */
260WS_DLL_PUBLIC int dissector_try_uint(dissector_table_t sub_dissectors,
261 const uint32_t uint_val, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
262
263/* Look for a given value in a given uint dissector table and, if found,
264 call the dissector with the arguments supplied, and return the number
265 of bytes consumed, otherwise return 0. */
266WS_DLL_PUBLIC int dissector_try_uint_new(dissector_table_t sub_dissectors,
267 const uint32_t uint_val, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, const bool add_proto_name, void *data);
268
277 dissector_table_t const sub_dissectors, const uint32_t uint_val);
278
287 const char *name, const uint32_t uint_val);
288
289/* Add an entry to a string dissector table. */
290WS_DLL_PUBLIC void dissector_add_string(const char *name, const char *pattern,
291 dissector_handle_t handle);
292
293/* Delete the entry for a dissector in a string dissector table
294 with a particular pattern. */
295WS_DLL_PUBLIC void dissector_delete_string(const char *name, const char *pattern,
296 dissector_handle_t handle);
297
298/* Change the entry for a dissector in a string dissector table
299 with a particular pattern to use a new dissector handle. */
300WS_DLL_PUBLIC void dissector_change_string(const char *name, const char *pattern,
301 dissector_handle_t handle);
302
303/* Reset an entry in a string sub-dissector table to its initial value. */
304WS_DLL_PUBLIC void dissector_reset_string(const char *name, const char *pattern);
305
306/* Return true if an entry in a string dissector table is found and has been
307 * changed (i.e. dissector_change_string() has been called, such as from
308 * Decode As), otherwise return false.
309 */
310WS_DLL_PUBLIC bool dissector_is_string_changed(dissector_table_t const subdissectors, const char *string);
311
312/* Look for a given string in a given dissector table and, if found, call
313 the dissector with the arguments supplied, and return the number of
314 bytes consumed, otherwise return 0. */
315WS_DLL_PUBLIC int dissector_try_string(dissector_table_t sub_dissectors,
316 const char *string, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data);
317
318/* Look for a given string in a given dissector table and, if found, call
319 the dissector with the arguments supplied, and return the number of
320 bytes consumed, otherwise return 0. */
321WS_DLL_PUBLIC int dissector_try_string_new(dissector_table_t sub_dissectors,
322 const char *string, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, const bool add_proto_name,void *data);
323
332 dissector_table_t sub_dissectors, const char *string);
333
342 const char *name, const char *string);
343
344/* Add an entry to a "custom" dissector table. */
345WS_DLL_PUBLIC void dissector_add_custom_table_handle(const char *name, void *pattern,
346 dissector_handle_t handle);
347
356 dissector_table_t sub_dissectors, void *key);
357/* Key for GUID dissector tables. This is based off of DCE/RPC needs
358 so some dissector tables may not need the ver portion of the hash
359 */
360typedef struct _guid_key {
361 e_guid_t guid;
362 uint16_t ver;
363} guid_key;
364
365/* Add an entry to a guid dissector table. */
366WS_DLL_PUBLIC void dissector_add_guid(const char *name, guid_key* guid_val,
367 dissector_handle_t handle);
368
369/* Look for a given value in a given guid dissector table and, if found,
370 call the dissector with the arguments supplied, and return true,
371 otherwise return false. */
372WS_DLL_PUBLIC int dissector_try_guid(dissector_table_t sub_dissectors,
373 guid_key* guid_val, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
374
375/* Look for a given value in a given guid dissector table and, if found,
376 call the dissector with the arguments supplied, and return true,
377 otherwise return false. */
378WS_DLL_PUBLIC int dissector_try_guid_new(dissector_table_t sub_dissectors,
379 guid_key* guid_val, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, const bool add_proto_name, void *data);
380
381/* Delete a GUID from a dissector table. */
382WS_DLL_PUBLIC void dissector_delete_guid(const char *name, guid_key* guid_val,
383 dissector_handle_t handle);
384
393 dissector_table_t const sub_dissectors, guid_key* guid_val);
394
395/* Use the currently assigned payload dissector for the dissector table and,
396 if any, call the dissector with the arguments supplied, and return the
397 number of bytes consumed, otherwise return 0. */
398WS_DLL_PUBLIC int dissector_try_payload(dissector_table_t sub_dissectors,
399 tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
400
401/* Use the currently assigned payload dissector for the dissector table and,
402 if any, call the dissector with the arguments supplied, and return the
403 number of bytes consumed, otherwise return 0. */
404WS_DLL_PUBLIC int dissector_try_payload_new(dissector_table_t sub_dissectors,
405 tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, const bool add_proto_name, void *data);
406
407/* Change the entry for a dissector in a payload (FT_NONE) dissector table
408 with a particular pattern to use a new dissector handle. */
409WS_DLL_PUBLIC void dissector_change_payload(const char *abbrev, dissector_handle_t handle);
410
411/* Reset payload (FT_NONE) dissector table to its initial value. */
412WS_DLL_PUBLIC void dissector_reset_payload(const char *name);
413
414/* Given a payload dissector table (type FT_NONE), return the handle of
415 the dissector that is currently active, i.e. that was selected via
416 Decode As. */
417WS_DLL_PUBLIC dissector_handle_t dissector_get_payload_handle(
419
420/* Add a handle to the list of handles that *could* be used with this
421 table. That list is used by the "Decode As"/"-d" code in the UI. */
422WS_DLL_PUBLIC void dissector_add_for_decode_as(const char *name,
423 dissector_handle_t handle);
424
425/* Same as dissector_add_for_decode_as, but adds preference for dissector table value */
426WS_DLL_PUBLIC void dissector_add_for_decode_as_with_preference(const char *name,
427 dissector_handle_t handle);
428
432
437
441
445
449
450/* List of "heuristic" dissectors (which get handed a packet, look at it,
451 and either recognize it as being for their protocol, dissect it, and
452 return true, or don't recognize it and return false) to be called
453 by another dissector.
454
455 This is opaque outside of "packet.c". */
458
459
460typedef struct heur_dtbl_entry {
461 heur_dissector_t dissector;
462 protocol_t *protocol; /* this entry's protocol */
463 char *list_name; /* the list name this entry is in the list of */
464 const char *display_name; /* the string used to present heuristic to user */
465 char *short_name; /* string used for "internal" use to uniquely identify heuristic */
466 bool enabled;
467 bool enabled_by_default;
469
477WS_DLL_PUBLIC heur_dissector_list_t register_heur_dissector_list_with_description(const char *name, const char *ui_name, const int proto);
478
483WS_DLL_PUBLIC const char *heur_dissector_list_get_description(heur_dissector_list_t list);
484
491WS_DLL_PUBLIC heur_dissector_list_t register_heur_dissector_list(const char *name, const int proto);
492
494void deregister_heur_dissector_list(const char *name);
495
496typedef void (*DATFunc_heur) (const char *table_name,
497 struct heur_dtbl_entry *entry, void *user_data);
498typedef void (*DATFunc_heur_table) (const char *table_name,
499 struct heur_dissector_list *table, void *user_data);
500
510WS_DLL_PUBLIC void heur_dissector_table_foreach(const char *table_name,
511 DATFunc_heur func, void *user_data);
512
521WS_DLL_PUBLIC void dissector_all_heur_tables_foreach_table (DATFunc_heur_table func,
522 void *user_data, GCompareFunc compare_key_func);
523
524/* true if a heur_dissector list of that name exists to be registered into */
525WS_DLL_PUBLIC bool has_heur_dissector_list(const char *name);
526
539WS_DLL_PUBLIC bool dissector_try_heuristic(heur_dissector_list_t sub_dissectors,
540 tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, heur_dtbl_entry_t **hdtbl_entry, void *data);
541
547WS_DLL_PUBLIC heur_dissector_list_t find_heur_dissector_list(const char *name);
548
554WS_DLL_PUBLIC heur_dtbl_entry_t* find_heur_dissector_by_unique_short_name(const char *short_name);
555
566WS_DLL_PUBLIC void heur_dissector_add(const char *name, heur_dissector_t dissector,
567 const char *display_name, const char *internal_name, const int proto, heuristic_enable_e enable);
568
576WS_DLL_PUBLIC void heur_dissector_delete(const char *name, heur_dissector_t dissector, const int proto);
577
579WS_DLL_PUBLIC dissector_handle_t register_dissector(const char *name, dissector_t dissector, const int proto);
580
582WS_DLL_PUBLIC dissector_handle_t register_dissector_with_description(const char *name, const char *description, dissector_t dissector, const int proto);
583
585WS_DLL_PUBLIC dissector_handle_t register_dissector_with_data(const char *name, dissector_cb_t dissector, const int proto, void *cb_data);
586
588void deregister_dissector(const char *name);
589
591WS_DLL_PUBLIC const char *dissector_handle_get_protocol_long_name(const dissector_handle_t handle);
592
594WS_DLL_PUBLIC const char *dissector_handle_get_protocol_short_name(const dissector_handle_t handle);
595
596/* For backwards source and binary compatibility */
598WS_DLL_PUBLIC const char *dissector_handle_get_short_name(const dissector_handle_t handle);
599
601WS_DLL_PUBLIC const char *dissector_handle_get_description(const dissector_handle_t handle);
602
604WS_DLL_PUBLIC int dissector_handle_get_protocol_index(const dissector_handle_t handle);
605
607WS_DLL_PUBLIC GList* get_dissector_names(void);
608
610WS_DLL_PUBLIC dissector_handle_t find_dissector(const char *name);
611
613WS_DLL_PUBLIC dissector_handle_t find_dissector_add_dependency(const char *name, const int parent_proto);
614
616WS_DLL_PUBLIC const char *dissector_handle_get_dissector_name(const dissector_handle_t handle);
617
618WS_DLL_PUBLIC const char *dissector_handle_get_pref_suffix(const dissector_handle_t handle);
619
630WS_DLL_PUBLIC dissector_handle_t create_dissector_handle(dissector_t dissector,
631 const int proto);
632
644WS_DLL_PUBLIC dissector_handle_t create_dissector_handle_with_name(dissector_t dissector,
645 const int proto, const char* name);
646
662 const int proto, const char* name, const char* description);
663WS_DLL_PUBLIC dissector_handle_t create_dissector_handle_with_data(dissector_cb_t dissector,
664 const int proto, void* cb_data);
665
666/* Dump all registered dissectors to the standard output */
667WS_DLL_PUBLIC void dissector_dump_dissectors(void);
668
682WS_DLL_PUBLIC int call_dissector_with_data(dissector_handle_t handle, tvbuff_t *tvb,
683 packet_info *pinfo, proto_tree *tree, void *data);
684WS_DLL_PUBLIC int call_dissector(dissector_handle_t handle, tvbuff_t *tvb,
685 packet_info *pinfo, proto_tree *tree);
686
687WS_DLL_PUBLIC int call_data_dissector(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
688
702WS_DLL_PUBLIC int call_dissector_only(dissector_handle_t handle, tvbuff_t *tvb,
703 packet_info *pinfo, proto_tree *tree, void *data);
704
714 packet_info *pinfo, proto_tree *tree, void *data);
715
716/* This is opaque outside of "packet.c". */
719
730WS_DLL_PUBLIC bool register_depend_dissector(const char* parent, const char* dependent);
731
741WS_DLL_PUBLIC bool deregister_depend_dissector(const char* parent, const char* dependent);
742
748WS_DLL_PUBLIC depend_dissector_list_t find_depend_dissector_list(const char* name);
749
750
751/* Do all one-time initialization. */
752extern void dissect_init(void);
753
754extern void dissect_cleanup(void);
755
756/*
757 * Given a tvbuff, and a length from a packet header, adjust the length
758 * of the tvbuff to reflect the specified length.
759 */
760WS_DLL_PUBLIC void set_actual_length(tvbuff_t *tvb, const unsigned specified_len);
761
769WS_DLL_PUBLIC void register_init_routine(void (*func)(void));
770
778WS_DLL_PUBLIC void register_cleanup_routine(void (*func)(void));
779
780/*
781 * Allows protocols to register "shutdown" routines, which are called
782 * once, just before program exit
783 */
784WS_DLL_PUBLIC void register_shutdown_routine(void (*func)(void));
785
786/* Initialize all data structures used for dissection. */
787void init_dissection(void);
788
789/* Free data structures allocated for dissection. */
790void cleanup_dissection(void);
791
792/* Allow protocols to register a "cleanup" routine to be
793 * run after the initial sequential run through the packets.
794 * Note that the file can still be open after this; this is not
795 * the final cleanup. */
796WS_DLL_PUBLIC void register_postseq_cleanup_routine(void (*func)(void));
797
798/* Call all the registered "postseq_cleanup" routines. */
799WS_DLL_PUBLIC void postseq_cleanup_all_protocols(void);
800
801/* Allow dissectors to register a "final_registration" routine
802 * that is run like the proto_register_XXX() routine, but the end
803 * end of the epan_init() function; that is, *after* all other
804 * subsystems, liked dfilters, have finished initializing. This is
805 * useful for dissector registration routines which need to compile
806 * display filters. dfilters can't initialize itself until all protocols
807 * have registered themselves. */
808WS_DLL_PUBLIC void
809register_final_registration_routine(void (*func)(void));
810
811/* Call all the registered "final_registration" routines. */
812extern void
813final_registration_all_protocols(void);
814
815/*
816 * Add a new data source to the list of data sources for a frame, given
817 * the tvbuff for the data source and its name.
818 */
819WS_DLL_PUBLIC void add_new_data_source(packet_info *pinfo, tvbuff_t *tvb,
820 const char *name);
821/* Removes the last-added data source, if it turns out it wasn't needed */
822WS_DLL_PUBLIC void remove_last_data_source(packet_info *pinfo);
823
824/*
825 * Return the data source name, tvb.
826 */
827struct data_source;
828WS_DLL_PUBLIC char *get_data_source_name(const struct data_source *src);
829WS_DLL_PUBLIC tvbuff_t *get_data_source_tvb(const struct data_source *src);
830WS_DLL_PUBLIC tvbuff_t *get_data_source_tvb_by_name(packet_info *pinfo, const char *name);
831
832/*
833 * Free up a frame's list of data sources.
834 */
835extern void free_data_sources(packet_info *pinfo);
836
837/* Mark another frame as depended upon by the current frame.
838 *
839 * This information is used to ensure that the depended-upon frame is saved
840 * if the user does a File->Save-As of only the Displayed packets and the
841 * current frame passed the display filter.
842 */
843WS_DLL_PUBLIC void mark_frame_as_depended_upon(frame_data *fd, uint32_t frame_num);
844
845/* Structure passed to the frame dissector */
846typedef struct frame_data_s
847{
848 int file_type_subtype;
850 struct epan_dissect *color_edt;
853
854/* Structure passed to the file dissector */
855typedef struct file_data_s
856{
858 struct epan_dissect *color_edt;
861
862/*
863 * Dissectors should never modify the record data.
864 */
865extern void dissect_record(struct epan_dissect *edt, int file_type_subtype,
866 wtap_rec *rec, tvbuff_t *tvb, frame_data *fd, column_info *cinfo);
867
868/*
869 * Dissectors should never modify the packet data.
870 */
871extern void dissect_file(struct epan_dissect *edt,
872 wtap_rec *rec, tvbuff_t *tvb, frame_data *fd, column_info *cinfo);
873
874/* Structure passed to the ethertype dissector */
875typedef struct ethertype_data_s
876{
877 uint16_t etype;
878 int payload_offset;
879 proto_tree *fh_tree;
880 int trailer_id;
881 int fcs_len;
883
884/*
885 * Dump layer/selector/dissector records in a fashion similar to the
886 * proto_registrar_dump_* routines.
887 */
888WS_DLL_PUBLIC void dissector_dump_decodes(void);
889
890/*
891 * For each heuristic dissector table, dump list of dissectors (filter_names) for that table
892 */
893WS_DLL_PUBLIC void dissector_dump_heur_decodes(void);
894
895/*
896 * postdissectors are to be called by packet-frame.c after every other
897 * dissector has been called.
898 */
899
900/*
901 * Register a postdissector; the argument is the dissector handle for it.
902 */
903WS_DLL_PUBLIC void register_postdissector(dissector_handle_t handle);
904
905/*
906 * Specify a set of hfids that the postdissector will need.
907 * The GArray is an array of hfids (type int) and should be NULL to clear the
908 * list. This function will take ownership of the memory.
909 */
910WS_DLL_PUBLIC void set_postdissector_wanted_hfids(dissector_handle_t handle,
911 GArray *wanted_hfids);
912
913/*
914 * Deregister a postdissector. Not for use in (post)dissectors or
915 * applications; only to be used by libwireshark itself.
916 */
917void deregister_postdissector(dissector_handle_t handle);
918
919/*
920 * Return true if we have at least one postdissector, false if not.
921 * Not for use in (post)dissectors or applications; only to be used
922 * by libwireshark itself.
923 */
924extern bool have_postdissector(void);
925
926/*
927 * Call all postdissectors, handing them the supplied arguments.
928 * Not for use in (post)dissectors or applications; only to be used
929 * by libwireshark itself.
930 */
931extern void call_all_postdissectors(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
932
933/*
934 * Return true if at least one postdissector needs at least one hfid,
935 * false otherwise.
936 */
937WS_DLL_PUBLIC bool postdissectors_want_hfids(void);
938
939/*
940 * Prime an epan_dissect_t with all the hfids wanted by postdissectors.
941 */
942WS_DLL_PUBLIC void
943prime_epan_dissect_with_postdissector_wanted_hfids(epan_dissect_t *edt);
944
951WS_DLL_PUBLIC void increment_dissection_depth(packet_info *pinfo);
952
957WS_DLL_PUBLIC void decrement_dissection_depth(packet_info *pinfo);
958
961#ifdef __cplusplus
962}
963#endif /* __cplusplus */
964
965#endif /* packet.h */
WS_DLL_PUBLIC void dissector_table_foreach(const char *table_name, DATFunc func, void *user_data)
Definition packet.c:2591
WS_DLL_PUBLIC int call_dissector_only(dissector_handle_t handle, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
Definition packet.c:3678
WS_DLL_PUBLIC const char * dissector_handle_get_protocol_long_name(const dissector_handle_t handle)
Definition packet.c:3359
void deregister_dissector(const char *name)
Definition packet.c:3662
WS_DLL_PUBLIC dissector_handle_t dissector_get_default_string_handle(const char *name, const char *string)
Definition packet.c:1998
WS_DLL_PUBLIC heur_dtbl_entry_t * find_heur_dissector_by_unique_short_name(const char *short_name)
Definition packet.c:2933
void dissector_table_foreach_changed(const char *table_name, DATFunc func, void *user_data)
Definition packet.c:2668
WS_DLL_PUBLIC dissector_handle_t dissector_get_default_uint_handle(const char *name, const uint32_t uint_val)
Definition packet.c:1668
WS_DLL_PUBLIC dissector_handle_t find_dissector_add_dependency(const char *name, const int parent_proto)
Definition packet.c:3434
WS_DLL_PUBLIC dissector_handle_t register_dissector(const char *name, dissector_t dissector, const int proto)
Definition packet.c:3605
void deregister_dissector_table(const char *name)
Definition packet.c:2867
WS_DLL_PUBLIC dissector_handle_t dissector_get_guid_handle(dissector_table_t const sub_dissectors, guid_key *guid_val)
Definition packet.c:2179
WS_DLL_PUBLIC dissector_handle_t register_dissector_with_data(const char *name, dissector_cb_t dissector, const int proto, void *cb_data)
Definition packet.c:3625
WS_DLL_PUBLIC heur_dissector_list_t find_heur_dissector_list(const char *name)
Definition packet.c:2923
WS_DLL_PUBLIC ftenum_t dissector_table_get_type(dissector_table_t dissector_table)
Definition packet.c:2471
WS_DLL_PUBLIC const char * dissector_handle_get_dissector_name(const dissector_handle_t handle)
Definition packet.c:3447
void deregister_heur_dissector_list(const char *name)
Definition packet.c:3333
WS_DLL_PUBLIC dissector_handle_t dissector_get_custom_table_handle(dissector_table_t sub_dissectors, void *key)
Definition packet.c:2058
WS_DLL_PUBLIC GList * get_dissector_names(void)
Definition packet.c:3417
WS_DLL_PUBLIC const char * dissector_handle_get_description(const dissector_handle_t handle)
Definition packet.c:3388
WS_DLL_PUBLIC bool dissector_table_supports_decode_as(dissector_table_t dissector_table)
Definition packet.c:2483
WS_DLL_PUBLIC void decrement_dissection_depth(packet_info *pinfo)
Definition packet.c:4278
WS_DLL_PUBLIC void register_init_routine(void(*func)(void))
Definition packet.c:323
WS_DLL_PUBLIC dissector_handle_t dissector_get_uint_handle(dissector_table_t const sub_dissectors, const uint32_t uint_val)
Definition packet.c:1656
WS_DLL_PUBLIC void heur_dissector_delete(const char *name, heur_dissector_t dissector, const int proto)
Definition packet.c:3029
WS_DLL_PUBLIC bool register_depend_dissector(const char *parent, const char *dependent)
Definition packet.c:3805
WS_DLL_PUBLIC void register_cleanup_routine(void(*func)(void))
Definition packet.c:329
WS_DLL_PUBLIC dissector_handle_t create_dissector_handle(dissector_t dissector, const int proto)
Definition packet.c:3545
WS_DLL_PUBLIC const char * dissector_handle_get_protocol_short_name(const dissector_handle_t handle)
Definition packet.c:3370
WS_DLL_PUBLIC void heur_dissector_table_foreach(const char *table_name, DATFunc_heur func, void *user_data)
Definition packet.c:3196
WS_DLL_PUBLIC void dissector_table_allow_decode_as(dissector_table_t dissector_table)
Definition packet.c:2477
WS_DLL_PUBLIC dissector_handle_t find_dissector(const char *name)
Definition packet.c:3428
WS_DLL_PUBLIC void increment_dissection_depth(packet_info *pinfo)
Definition packet.c:4272
WS_DLL_PUBLIC void dissector_all_tables_foreach_table(DATFunc_table func, void *user_data, GCompareFunc compare_key_func)
Definition packet.c:2723
WS_DLL_PUBLIC void dissector_all_heur_tables_foreach_table(DATFunc_heur_table func, void *user_data, GCompareFunc compare_key_func)
Definition packet.c:3252
WS_DLL_PUBLIC GSList * dissector_table_get_dissector_handles(dissector_table_t dissector_table)
Definition packet.c:2429
WS_DLL_PUBLIC void dissector_all_tables_foreach_changed(DATFunc func, void *user_data)
Definition packet.c:2652
WS_DLL_PUBLIC dissector_handle_t create_dissector_handle_with_name_and_description(dissector_t dissector, const int proto, const char *name, const char *description)
Definition packet.c:3522
WS_DLL_PUBLIC int dissector_handle_get_protocol_index(const dissector_handle_t handle)
Definition packet.c:3399
WS_DLL_PUBLIC depend_dissector_list_t find_depend_dissector_list(const char *name)
Definition packet.c:3843
WS_DLL_PUBLIC const char * heur_dissector_list_get_description(heur_dissector_list_t list)
Definition packet.c:3344
WS_DLL_PUBLIC void register_dissector_table_alias(dissector_table_t dissector_table, const char *alias_name)
Definition packet.c:2849
WS_DLL_PUBLIC bool deregister_depend_dissector(const char *parent, const char *dependent)
Definition packet.c:3833
WS_DLL_PUBLIC int call_dissector_with_data(dissector_handle_t handle, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
Definition packet.c:3692
WS_DLL_PUBLIC void call_heur_dissector_direct(heur_dtbl_entry_t *heur_dtbl_entry, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
Definition packet.c:3726
WS_DLL_PUBLIC void heur_dissector_add(const char *name, heur_dissector_t dissector, const char *display_name, const char *internal_name, const int proto, heuristic_enable_e enable)
Definition packet.c:2939
WS_DLL_PUBLIC dissector_handle_t register_dissector_with_description(const char *name, const char *description, dissector_t dissector, const int proto)
Definition packet.c:3615
WS_DLL_PUBLIC dissector_handle_t create_dissector_handle_with_name(dissector_t dissector, const int proto, const char *name)
Definition packet.c:3537
bool(* heur_dissector_t)(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *)
Definition packet.h:89
WS_DLL_PUBLIC dissector_handle_t dissector_table_get_dissector_handle(dissector_table_t dissector_table, const char *description)
Definition packet.c:2459
WS_DLL_PUBLIC heur_dissector_list_t register_heur_dissector_list(const char *name, const int proto)
Definition packet.c:3327
WS_DLL_PUBLIC void dissector_table_foreach_handle(const char *table_name, DATFunc_handle func, void *user_data)
Definition packet.c:2610
WS_DLL_PUBLIC bool dissector_try_heuristic(heur_dissector_list_t sub_dissectors, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, heur_dtbl_entry_t **hdtbl_entry, void *data)
Definition packet.c:3055
WS_DLL_PUBLIC dissector_handle_t dissector_get_string_handle(dissector_table_t sub_dissectors, const char *string)
Definition packet.c:1983
WS_DLL_PUBLIC heur_dissector_list_t register_heur_dissector_list_with_description(const char *name, const char *ui_name, const int proto)
Definition packet.c:3306
Definition guid-utils.h:23
Definition packet.h:360
Definition packet_info.h:43
Definition proto.h:899
Definition proto.c:375
Definition packet.c:56
Definition packet.c:116
Definition packet.c:765
Definition packet.c:86
Definition packet.c:1113
Definition column-info.h:62
Definition epan_dissect.h:28
Definition range.h:41
Definition packet.h:876
Definition packet.h:856
wtap_block_t pkt_block
Definition packet.h:857
Definition packet.h:847
wtap_block_t pkt_block
Definition packet.h:849
Definition packet.c:161
Definition packet.h:460
Definition tvbuff-int.h:35
Definition wtap_opttypes.c:85
Definition wtap.h:1432