* we need more data (e.g., from subsequent TCP segments) to
* dissect the entire PDU.
*/
-typedef int (*new_dissector_t)(tvbuff_t *, packet_info *, proto_tree *);
+typedef int (*new_dissector_t)(tvbuff_t *, packet_info *, proto_tree *, void *);
/** Type of a heuristic dissector, used in heur_dissector_add().
*
* @return TRUE if the packet was recognized by the sub-dissector (stop dissection here)
*/
typedef gboolean (*heur_dissector_t)(tvbuff_t *tvb, packet_info *pinfo,
- proto_tree *tree);
+ proto_tree *tree, void *);
typedef void (*DATFunc) (const gchar *table_name, ftenum_t selector_type,
gpointer key, gpointer value, gpointer user_data);
extern void dissector_table_foreach_handle(const char *name, DATFunc_handle func,
gpointer user_data);
extern void dissector_all_tables_foreach_table (DATFunc_table func,
- gpointer user_data);
+ gpointer user_data, GCompareFunc compare_key_func);
/* a protocol uses the function to register a sub-dissector table */
extern dissector_table_t register_dissector_table(const char *name,
call the dissector with the arguments supplied, and return TRUE,
otherwise return FALSE. */
extern gboolean dissector_try_uint_new(dissector_table_t sub_dissectors,
- const guint32 uint_val, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, const gboolean add_proto_name);
+ const guint32 uint_val, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, const gboolean add_proto_name, void *data);
/* For old code that hasn't yet been changed. */
#define dissector_try_port_new(sub_dissectors, uint_val, tvb, pinfo, tree, add_proto_name) \
- dissector_try_uint_new(sub_dissectors, uint_val, tvb, pinfo, tree, add_proto_name)
+ dissector_try_uint_new(sub_dissectors, uint_val, tvb, pinfo, tree, add_proto_name, NULL)
/* Look for a given value in a given uint dissector table and, if found,
return the dissector handle for that value. */
typedef struct {
heur_dissector_t dissector;
protocol_t *protocol;
+ gboolean enabled;
} heur_dtbl_entry_t;
/** A protocol uses this function to register a heuristic sub-dissector list.
* @param tvb the tv_buff with the (remaining) packet data
* @param pinfo the packet info of this packet (additional info)
* @param tree the protocol tree to be build or NULL
+ * @param data parameter to pass to subdissector
* @return TRUE if the packet was recognized by the sub-dissector (stop dissection here)
*/
extern gboolean dissector_try_heuristic(heur_dissector_list_t sub_dissectors,
- tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
+ tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data);
/** Add a sub-dissector to a heuristic dissector list.
* Call this in the proto_handoff function of the sub-dissector.
*/
extern void heur_dissector_delete(const char *name, heur_dissector_t dissector, const int proto);
+/** Enable/Disable a sub-dissector in a heuristic dissector list
+ * Call this in the prefs_reinit function of the sub-dissector.
+ *
+ * @param name the name of the "parent" protocol, e.g. "tcp"
+ * @param dissector the sub-dissector to be disabled/enabled
+ * @param proto the protocol id of the sub-dissector
+ * @param TRUE/FALSE to enable/disable the sub-dissector
+ */
+extern void heur_dissector_set_enabled(const char *name, heur_dissector_t dissector, const int proto, const gboolean enabled);
+
/* Register a dissector. */
extern void register_dissector(const char *name, dissector_t dissector,
const int proto);
const int proto);
/* Call a dissector through a handle and if no dissector was found
- * pass if over to the "data" dissector instead.
+ * pass it over to the "data" dissector instead.
*
* @param handle The dissector to call.
* @param tvb The buffer to dissect.
* @param pinfo Packet Info.
* @param tree The protocol tree.
+ * @param data parameter to pass to dissector
* @return If the protocol for that handle isn't enabled call the data
* dissector. Otherwise, if the handle refers to a new-style
* dissector, call the dissector and return its return value, otherwise call
* it and return the length of the tvbuff pointed to by the argument.
*/
+extern int call_dissector_with_data(dissector_handle_t handle, tvbuff_t *tvb,
+ packet_info *pinfo, proto_tree *tree, void *data);
extern int call_dissector(dissector_handle_t handle, tvbuff_t *tvb,
packet_info *pinfo, proto_tree *tree);
* @param tvb The buffer to dissect.
* @param pinfo Packet Info.
* @param tree The protocol tree.
+ * @param data parameter to pass to dissector
* @return If the protocol for that handle isn't enabled, return 0 without
* calling the dissector. Otherwise, if the handle refers to a new-style
* dissector, call the dissector and return its return value, otherwise call
* it and return the length of the tvbuff pointed to by the argument.
*/
extern int call_dissector_only(dissector_handle_t handle, tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree);
+ packet_info *pinfo, proto_tree *tree, void *data);
/* Do all one-time initialization. */
extern void dissect_init(void);
*/
extern void free_data_sources(packet_info *pinfo);
+/* Mark another frame as depended upon by the current frame.
+ *
+ * This information is used to ensure that the dependend-upon frame is saved
+ * if the user does a File->Save-As of only the Displayed packets and the
+ * current frame passed the display filter.
+ */
+extern void mark_frame_as_depended_upon(packet_info *pinfo, guint32 frame_num);
+
/*
* Dissectors should never modify the packet data.
*/
*/
extern void dissector_dump_decodes(void);
+/*
+ * For each heuristic dissector table, dump list of dissectors (filter_names) for that table
+ */
+extern void dissector_dump_heur_decodes(void);
+
/*
* post dissectors are to be called by packet-frame.c after every other
* dissector has been called.