aboutsummaryrefslogtreecommitdiffstats
path: root/packet-giop.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-12-17 22:45:18 +0000
committerGuy Harris <guy@alum.mit.edu>2001-12-17 22:45:18 +0000
commit3c2c59b9c914af94f0e4b1b35ed9a812778bba44 (patch)
tree4a89d47bc782e2bc43683f642554a74e13ab72c6 /packet-giop.c
parentb2533029da1b658da9d92c00611c22ae51caa512 (diff)
Save the current protocol string, and set the current protocol string to
the string for the subdissector's protocol, before calling a GIOP subdissector, and restore it before returning. svn path=/trunk/; revision=4416
Diffstat (limited to 'packet-giop.c')
-rw-r--r--packet-giop.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/packet-giop.c b/packet-giop.c
index ac5f35e4f8..904c9bba6c 100644
--- a/packet-giop.c
+++ b/packet-giop.c
@@ -9,7 +9,7 @@
* Frank Singleton <frank.singleton@ericsson.com>
* Trevor Shepherd <eustrsd@am1.ericsson.se>
*
- * $Id: packet-giop.c,v 1.51 2001/12/15 20:40:18 guy Exp $
+ * $Id: packet-giop.c,v 1.52 2001/12/17 22:45:18 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -1740,23 +1740,29 @@ static gboolean try_heuristic_giop_dissector(tvbuff_t *tvb, packet_info *pinfo,
int i,len;
gboolean res = FALSE; /* result of calling a heuristic sub dissector */
giop_sub_handle_t *subh = NULL;
+ const char *saved_proto;
len = g_slist_length(giop_sub_list); /* find length */
if (len == 0)
return FALSE;
+ saved_proto = pinfo->current_proto;
for (i=0; i<len; i++) {
subh = (giop_sub_handle_t *) g_slist_nth_data(giop_sub_list,i); /* grab dissector handle */
if (proto_is_protocol_enabled(subh->sub_proto)) {
+ pinfo->current_proto =
+ proto_get_protocol_short_name(subh->sub_proto);
res = (subh->sub_fn)(tvb,pinfo,tree,offset,header,operation,NULL); /* callit TODO - replace NULL */
if (res) {
+ pinfo->current_proto = saved_proto;
return TRUE; /* found one, lets return */
}
} /* protocol_is_enabled */
} /* loop */
+ pinfo->current_proto = saved_proto;
return res; /* result */
}
@@ -1782,6 +1788,7 @@ static gboolean try_explicit_giop_dissector(tvbuff_t *tvb, packet_info *pinfo, p
gchar *modname = NULL;
struct giop_module_key module_key;
struct giop_module_val *module_val = NULL;
+ const char *saved_proto;
/*
@@ -1823,7 +1830,11 @@ static gboolean try_explicit_giop_dissector(tvbuff_t *tvb, packet_info *pinfo, p
if (proto_is_protocol_enabled(subdiss->sub_proto)) {
+ saved_proto = pinfo->current_proto;
+ pinfo->current_proto =
+ proto_get_protocol_short_name(subdiss->sub_proto);
res = (subdiss->sub_fn)(tvb,pinfo,tree,offset,header,operation, modname); /* callit, TODO replace NULL with idlname */
+ pinfo->current_proto = saved_proto;
} /* protocol_is_enabled */
} /* offset exists */