aboutsummaryrefslogtreecommitdiffstats
path: root/epan/packet.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2003-09-09 18:09:42 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2003-09-09 18:09:42 +0000
commita5455c795b499c3f24f75a2c768ffdceecd32209 (patch)
tree861c2c4a7eb17bc3314d5776136325a57faba1b2 /epan/packet.c
parentb42fbaa71f0ffa06f97ae3e99475a8ef96fdb819 (diff)
Add "dissector_get_string_handle()" for string dissector tables, similar
to "dissector_get_port_handle()" for uint dissector tables. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8434 f5534014-38df-0310-8fa8-9805f1628bb7
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)
{