summaryrefslogtreecommitdiff
path: root/epan/packet.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-09-09 18:09:42 +0000
committerGuy Harris <guy@alum.mit.edu>2003-09-09 18:09:42 +0000
commit92fbca527d7fcad9b4631c3aacd5ba114ba3132a (patch)
tree861c2c4a7eb17bc3314d5776136325a57faba1b2 /epan/packet.c
parent24bf25d65277e0196079be4464ef435bedce9ebf (diff)
downloadwireshark-92fbca527d7fcad9b4631c3aacd5ba114ba3132a.tar.gz
Add "dissector_get_string_handle()" for string dissector tables, similar
to "dissector_get_port_handle()" for uint dissector tables. svn path=/trunk/; revision=8434
Diffstat (limited to 'epan/packet.c')
-rw-r--r--epan/packet.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/epan/packet.c b/epan/packet.c
index 56577bf6de..bc15ec865f 100644
--- a/epan/packet.c
+++ b/epan/packet.c
@@ -1,7 +1,7 @@
/* packet.c
* Routines for packet disassembly
*
- * $Id: packet.c,v 1.96 2003/09/07 00:47:56 guy Exp $
+ * $Id: packet.c,v 1.97 2003/09/09 18:09:42 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -1023,6 +1023,21 @@ dissector_try_string(dissector_table_t sub_dissectors, const gchar *string,
return FALSE;
}
+/* Look for a given value in a given string dissector table and, if found,
+ return the dissector handle for that value. */
+dissector_handle_t
+dissector_get_string_handle(dissector_table_t sub_dissectors,
+ const gchar *string)
+{
+ dtbl_entry_t *dtbl_entry;
+
+ dtbl_entry = find_string_dtbl_entry(sub_dissectors, string);
+ if (dtbl_entry != NULL)
+ return dtbl_entry->current;
+ else
+ return NULL;
+}
+
dissector_handle_t
dtbl_entry_get_handle (dtbl_entry_t *dtbl_entry)
{