summaryrefslogtreecommitdiff
path: root/epan/packet.h
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-03-12 22:11:03 -0500
committerMichael Mann <mmann78@netscape.net>2016-03-20 12:48:31 +0000
commit6da50e2fde7b678cfbee922e3b12d588d75b6eef (patch)
tree6a77a67af9ec3cc9c3ec16937751406ae35ebe66 /epan/packet.h
parentbb74293fa7b018123e34f1f8ca2c7779c0085293 (diff)
downloadwireshark-6da50e2fde7b678cfbee922e3b12d588d75b6eef.tar.gz
Start work on API to generate protocol dependency tree.
Dissector and heuristic tables now setup protocol dependencies. "Manual" dependencies in separate patch. Ping-Bug: 1402 Change-Id: I8da1239306de8676dcb05f8807914376816fc44f Reviewed-on: https://code.wireshark.org/review/14447 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/packet.h')
-rw-r--r--epan/packet.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/epan/packet.h b/epan/packet.h
index 1fb6453217..b36ffd43b9 100644
--- a/epan/packet.h
+++ b/epan/packet.h
@@ -515,6 +515,9 @@ WS_DLL_PUBLIC GList* get_dissector_names(void);
/** Find a dissector by name. */
WS_DLL_PUBLIC dissector_handle_t find_dissector(const char *name);
+/** Find a dissector by name and add parent protocol as a depedency*/
+WS_DLL_PUBLIC dissector_handle_t find_dissector_add_dependency(const char *name, const int parent_proto);
+
/** Get a dissector name from handle. */
WS_DLL_PUBLIC const char *dissector_handle_get_dissector_name(const dissector_handle_t handle);
@@ -569,6 +572,41 @@ WS_DLL_PUBLIC int call_dissector_only(dissector_handle_t handle, tvbuff_t *tvb,
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);
+/* This is opaque outside of "packet.c". */
+struct depend_dissector_list;
+typedef struct depend_dissector_list *depend_dissector_list_t;
+
+/** Register a protocol dependency
+ * This is done automatically when registering with a dissector or
+ * heuristic table. This is for "manual" registration when a dissector
+ * ends up calling another through call_dissector (or similar) so
+ * dependencies can be determined
+ *
+ * @param parent "Parent" protocol short name
+ * @param dependent "Dependent" protocol short name
+ * @return return TRUE if dependency was successfully registered
+ */
+WS_DLL_PUBLIC gboolean register_depend_dissector(const char* parent, const char* dependent);
+
+/** Unregister a protocol dependency
+ * This is done automatically when removing from a dissector or
+ * heuristic table. This is for "manual" deregistration for things
+ * like Lua
+ *
+ * @param parent "Parent" protocol short name
+ * @param dependent "Dependent" protocol short name
+ * @return return TRUE if dependency was successfully unregistered
+ */
+WS_DLL_PUBLIC gboolean deregister_depend_dissector(const char* parent, const char* dependent);
+
+/** Find the list of protocol dependencies
+ *
+ * @param name Protocol short name to search for
+ * @return return list of dependent was successfully registered
+ */
+WS_DLL_PUBLIC depend_dissector_list_t find_depend_dissector_list(const char* name);
+
+
/* Do all one-time initialization. */
extern void dissect_init(void);