typedef void (*DATFunc_table) (const gchar *table_name, const gchar *ui_name,
gpointer user_data);
+typedef void (*DATFunc_heur_table) (const gchar *table_name,gpointer table,
+ gpointer user_data);
+
/* Opaque structure - provides type checking but no access to components */
typedef struct dtbl_entry dtbl_entry_t;
by another dissector. */
typedef GSList *heur_dissector_list_t;
+
+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.
* Call this in the parent dissectors proto_register function.
*
extern void register_heur_dissector_list(const char *name,
heur_dissector_list_t *list);
+extern void dissector_all_heur_tables_foreach_table (DATFunc_heur_table func,
+ gpointer user_data);
+
/** Try all the dissectors in a given heuristic dissector list. This is done,
* until we find one that recognizes the protocol.
* Call this while the parent dissector running.
*/
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);
extern void new_register_dissector(const char *name, new_dissector_t dissector,
const int proto);
+/* Get the long name of the protocol for a dissector handle. */
+extern const char *dissector_handle_get_long_name(const dissector_handle_t handle);
+
/* Get the short name of the protocol for a dissector handle. */
extern const char *dissector_handle_get_short_name(const dissector_handle_t handle);
*/
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.