aboutsummaryrefslogtreecommitdiffstats
path: root/epan/packet.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-12-03 05:07:18 +0000
committerGuy Harris <guy@alum.mit.edu>2001-12-03 05:07:18 +0000
commit21b9a88b2942558536c9b0f5191261a874b8034a (patch)
tree9f1b2b33fa6322b2481df30e43dc0405a2d34242 /epan/packet.c
parentd304535254ee7b9b21c5c26e9ae40afca29d1fe5 (diff)
Add a routine tro look for a given port in a given dissector table and,
if found, return the dissector handle for that port. Use that routine in the X.25 dissector; revert to attaching a dissector handle to an X.25 virtual circuit. svn path=/trunk/; revision=4310
Diffstat (limited to 'epan/packet.c')
-rw-r--r--epan/packet.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/epan/packet.c b/epan/packet.c
index 1b04a0db03..bee5f2a43e 100644
--- a/epan/packet.c
+++ b/epan/packet.c
@@ -1,7 +1,7 @@
/* packet.c
* Routines for packet disassembly
*
- * $Id: packet.c,v 1.48 2001/12/03 04:00:14 guy Exp $
+ * $Id: packet.c,v 1.49 2001/12/03 05:07:17 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -348,10 +348,7 @@ dissector_reset(const char *name, guint32 pattern)
/* Look for a given port in a given dissector table and, if found, call
the dissector with the arguments supplied, and return TRUE, otherwise
- return FALSE.
-
- If the arguments supplied don't match the arguments to the dissector,
- do the appropriate translation. */
+ return FALSE. */
gboolean
dissector_try_port(dissector_table_t sub_dissectors, guint32 port,
tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
@@ -419,6 +416,21 @@ dissector_try_port(dissector_table_t sub_dissectors, guint32 port,
return FALSE;
}
+/* Look for a given port in a given dissector table and, if found, return
+ the dissector handle for that port. */
+dissector_handle_t
+dissector_get_port_handle(dissector_table_t sub_dissectors, guint32 port)
+{
+ dtbl_entry_t *dtbl_entry;
+
+ dtbl_entry = g_hash_table_lookup(sub_dissectors,
+ GUINT_TO_POINTER(port));
+ if (dtbl_entry != NULL)
+ return dtbl_entry->current;
+ else
+ return NULL;
+}
+
dissector_handle_t
dtbl_entry_get_handle (dtbl_entry_t *dtbl_entry)
{