diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-11-29 09:05:25 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-11-29 09:05:25 +0000 |
commit | 3396fb27775653bf37decb1432f6646b387b7a0a (patch) | |
tree | e7819d6917de02e0bc49a69cdc5a1458daedc93b /epan/packet.c | |
parent | ec19562f1ac6c81cf75fa6c2d9388436ea90f1dd (diff) |
Update from Ronnie Sahlberg:
1. Changes how can_desegment works so that can_desegment is
only != 0 for whichever dissector is running immediately on
top of whoever offers the can_desegment service.
Thus DCERPC needs no special handling to see if it can trust
can_desegment (which is currently only available ontop of TCP
and not ontop of tcp->nbss->smb).
2. Changes fragment reassembly of transaction smb to only show
the defragmented packet for the transaction smb holding the
first fragment.
To see why, test it with a transaction SMB containing a ~60kb
PDU or larger. The old behaviour had approximately quadratic
behaviour regarding runtime for dissecting such PDUs.
(example: NetShareEnum is a command which can grow really really
large if the number of shares and comments are large)
svn path=/trunk/; revision=4296
Diffstat (limited to 'epan/packet.c')
-rw-r--r-- | epan/packet.c | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/epan/packet.c b/epan/packet.c index ad0e9a69c1..92e494308c 100644 --- a/epan/packet.c +++ b/epan/packet.c @@ -1,7 +1,7 @@ /* packet.c * Routines for packet disassembly * - * $Id: packet.c,v 1.43 2001/11/27 07:13:32 guy Exp $ + * $Id: packet.c,v 1.44 2001/11/29 09:05:25 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -366,6 +366,15 @@ dissector_try_port(dissector_table_t sub_dissectors, guint32 port, dtbl_entry_t *dtbl_entry; const char *saved_proto; guint32 saved_match_port; + guint16 saved_can_desegment; + + /* can_desegment is set to 2 by anyone which offers this api/service. + then everytime a subdissector is called it is decremented by one. + thus only the subdissector immediately ontop of whoever offers this + serveice can use it. + */ + saved_can_desegment=pinfo->can_desegment; + pinfo->can_desegment = saved_can_desegment-(saved_can_desegment>0); dtbl_entry = g_hash_table_lookup(sub_dissectors, GUINT_TO_POINTER(port)); @@ -380,6 +389,7 @@ dissector_try_port(dissector_table_t sub_dissectors, guint32 port, * so that other dissectors might have a chance * to dissect this packet. */ + pinfo->can_desegment=saved_can_desegment; return FALSE; } @@ -396,9 +406,11 @@ dissector_try_port(dissector_table_t sub_dissectors, guint32 port, (*dtbl_entry->current.dissector)(tvb, pinfo, tree); pinfo->current_proto = saved_proto; pinfo->match_port = saved_match_port; + pinfo->can_desegment=saved_can_desegment; return TRUE; - } else - return FALSE; + } + pinfo->can_desegment=saved_can_desegment; + return FALSE; } gint @@ -617,10 +629,20 @@ dissector_try_heuristic(heur_dissector_list_t sub_dissectors, const char *saved_proto; GSList *entry; heur_dtbl_entry_t *dtbl_entry; + guint16 saved_can_desegment; + + /* can_desegment is set to 2 by anyone which offers this api/service. + then everytime a subdissector is called it is decremented by one. + thus only the subdissector immediately ontop of whoever offers this + service can use it. + */ + saved_can_desegment=pinfo->can_desegment; + pinfo->can_desegment = saved_can_desegment-(saved_can_desegment>0); status = FALSE; saved_proto = pinfo->current_proto; for (entry = sub_dissectors; entry != NULL; entry = g_slist_next(entry)) { + pinfo->can_desegment = saved_can_desegment-(saved_can_desegment>0); dtbl_entry = (heur_dtbl_entry_t *)entry->data; if (dtbl_entry->proto_index != -1 && !proto_is_protocol_enabled(dtbl_entry->proto_index)) { @@ -640,6 +662,7 @@ dissector_try_heuristic(heur_dissector_list_t sub_dissectors, } } pinfo->current_proto = saved_proto; + pinfo->can_desegment=saved_can_desegment; return status; } |