diff options
author | Guy Harris <guy@alum.mit.edu> | 2003-04-20 00:27:29 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2003-04-20 00:27:29 +0000 |
commit | 8140efea8e7036280b6bd0859df406d70c7d006e (patch) | |
tree | 6820d35aeafbc94301b5e19e36d034ac74e84f06 /reassemble.c | |
parent | ea29d0768a900d31a1a442695d5341b84dbc3654 (diff) |
Add a "fragment_add_multiple_ok()" routine that skips the check for a
fragment having been added already. In protocols using the ONC
RPC-over-TCP record-marking mechanism (RPC-over-TCP and NDMP), there can
be more than one record-marking-layer fragment in a single TCP segment,
and thus can be more than one fragment in a frame being added to a given
higher-level packet.
svn path=/trunk/; revision=7508
Diffstat (limited to 'reassemble.c')
-rw-r--r-- | reassemble.c | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/reassemble.c b/reassemble.c index a113c14c15..064ad0cdc8 100644 --- a/reassemble.c +++ b/reassemble.c @@ -1,7 +1,7 @@ /* reassemble.c * Routines for {fragment,segment} reassembly * - * $Id: reassemble.c,v 1.33 2003/04/20 00:11:28 guy Exp $ + * $Id: reassemble.c,v 1.34 2003/04/20 00:27:29 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -638,9 +638,10 @@ fragment_add_work(fragment_data *fd_head, tvbuff_t *tvb, int offset, } fragment_data * -fragment_add(tvbuff_t *tvb, int offset, packet_info *pinfo, guint32 id, +fragment_add_common(tvbuff_t *tvb, int offset, packet_info *pinfo, guint32 id, GHashTable *fragment_table, guint32 frag_offset, - guint32 frag_data_len, gboolean more_frags) + guint32 frag_data_len, gboolean more_frags, + gboolean check_already_added) { fragment_key key, *new_key; fragment_data *fd_head; @@ -660,8 +661,9 @@ fragment_add(tvbuff_t *tvb, int offset, packet_info *pinfo, guint32 id, * we've already done all the reassembly and added all the * fragments. * - * If it's not true, just check if we have seen this fragment before, - * i.e., if we have already added it to reassembly. + * If it's not true, but "check_already_added" is true, just check + * if we have seen this fragment before, i.e., if we have already + * added it to reassembly. * That can be true even if "pinfo->fd->flags.visited" is false * since we sometimes might call a subdissector multiple times. * As an additional check, just make sure we have not already added @@ -671,7 +673,7 @@ fragment_add(tvbuff_t *tvb, int offset, packet_info *pinfo, guint32 id, * We don't check it because its "frame" member isn't initialized * to anything, and because it doesn't count in any case. */ - if (!already_added && fd_head != NULL) { + if (!already_added && check_already_added && fd_head != NULL) { for(fd_item=fd_head->next;fd_item;fd_item=fd_item->next){ if(pinfo->fd->num==fd_item->frame){ already_added=TRUE; @@ -733,6 +735,29 @@ fragment_add(tvbuff_t *tvb, int offset, packet_info *pinfo, guint32 id, } fragment_data * +fragment_add(tvbuff_t *tvb, int offset, packet_info *pinfo, guint32 id, + GHashTable *fragment_table, guint32 frag_offset, + guint32 frag_data_len, gboolean more_frags) +{ + return fragment_add_common(tvb, offset, pinfo, id, fragment_table, + frag_offset, frag_data_len, more_frags, TRUE); +} + +/* + * For use when you can have multiple fragments in the same frame added + * to the same reassembled PDU, e.g. with ONC RPC-over-TCP. + */ +fragment_data * +fragment_add_multiple_ok(tvbuff_t *tvb, int offset, packet_info *pinfo, + guint32 id, GHashTable *fragment_table, + guint32 frag_offset, guint32 frag_data_len, + gboolean more_frags) +{ + return fragment_add_common(tvb, offset, pinfo, id, fragment_table, + frag_offset, frag_data_len, more_frags, FALSE); +} + +fragment_data * fragment_add_check(tvbuff_t *tvb, int offset, packet_info *pinfo, guint32 id, GHashTable *fragment_table, GHashTable *reassembled_table, guint32 frag_offset, |