aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2003-05-23 22:09:36 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2003-05-23 22:09:36 +0000
commit9ccafb2aaea9b34c5ec0cd6dce6221e6e8d33bab (patch)
tree368c5a88751ed8dc8db15e6667acc57fe5b988f2 /epan
parent1b8610512096890145f77b21ece83cbb03dbcd1d (diff)
Add an API to get the dissector name from a dissector handle.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7726 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan')
-rw-r--r--epan/packet.c11
-rw-r--r--epan/packet.h5
2 files changed, 13 insertions, 3 deletions
diff --git a/epan/packet.c b/epan/packet.c
index 29e3cabe69..fed1526da4 100644
--- a/epan/packet.c
+++ b/epan/packet.c
@@ -1,7 +1,7 @@
/* packet.c
* Routines for packet disassembly
*
- * $Id: packet.c,v 1.91 2003/04/23 10:20:27 sahlberg Exp $
+ * $Id: packet.c,v 1.92 2003/05/23 22:09:36 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -1116,11 +1116,18 @@ dissector_handle_get_short_name(dissector_handle_t handle)
return proto_get_protocol_short_name(handle->proto_index);
}
+/* Get the dissector name for a dissector handle. */
+const char *
+dissector_handle_get_dissector_name(dissector_handle_t handle)
+{
+ return handle->name;
+}
+
/* Get the index of the protocol for a dissector handle. */
int
dissector_handle_get_protocol_index(dissector_handle_t handle)
{
- return handle->proto_index;
+ return handle->proto_index;
}
/* Find a registered dissector by name. */
diff --git a/epan/packet.h b/epan/packet.h
index 4e0b7de7b7..fef53c75b4 100644
--- a/epan/packet.h
+++ b/epan/packet.h
@@ -1,7 +1,7 @@
/* packet.h
* Definitions for packet disassembly structures and routines
*
- * $Id: packet.h,v 1.65 2002/11/15 03:10:36 guy Exp $
+ * $Id: packet.h,v 1.66 2003/05/23 22:09:36 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -213,6 +213,9 @@ extern void new_register_dissector(const char *name, new_dissector_t dissector,
/* Get the short name of the protocol for a dissector handle. */
extern char *dissector_handle_get_short_name(dissector_handle_t handle);
+/* Get the dissector name for a dissector handle. */
+extern const char *dissector_handle_get_dissector_name(dissector_handle_t handle);
+
/* Get the index of the protocol for a dissector handle. */
extern int dissector_handle_get_protocol_index(dissector_handle_t handle);