From Harald Welte:
[obnox/wireshark/wip.git] / epan / packet.h
index 9aa604990fcf8c5ddc2e83c87e5186f4be3325cc..5db30200611654baaa8cc0c6c5267ae493ea9c9d 100644 (file)
@@ -132,6 +132,9 @@ typedef void (*DATFunc_handle) (const gchar *table_name, gpointer value,
 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;
 
@@ -266,6 +269,13 @@ extern void dissector_add_handle(const char *name, dissector_handle_t handle);
    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.
  *
@@ -275,6 +285,9 @@ typedef GSList *heur_dissector_list_t;
 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.
@@ -307,12 +320,25 @@ extern void heur_dissector_add(const char *name, heur_dissector_t 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);
 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);
 
@@ -441,6 +467,11 @@ extern void ethertype(guint16 etype, tvbuff_t *tvb, int offset_after_ethertype,
  */
 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.