Added new field reassembled_in to the fragment data structure.
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>
Wed, 9 Apr 2003 09:04:08 +0000 (09:04 -0000)
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>
Wed, 9 Apr 2003 09:04:08 +0000 (09:04 -0000)
This field gets set to the frame number when this pdu was first completely reassembled.

This is useful since it will allow us to do reassembly properly in say packet-ip.c
instead of printing the full pdu for every fragment and thus making NFSoverUDP  rpc-rtt statistics less than useful.

A dissector using fragment_add() can tehn choose to only dissect the reassembled PDU only for the frame where it was first reassembled.

svn path=/trunk/; revision=7427

reassemble.c
reassemble.h

index 5d6a4544ed06d3b177bfa08e8a5a91947034c0d3..b89b5bff72f631a51ec90d2be50bc553dfcdc678 100644 (file)
@@ -1,7 +1,7 @@
 /* reassemble.c
  * Routines for {fragment,segment} reassembly
  *
- * $Id: reassemble.c,v 1.29 2003/03/04 06:47:10 guy Exp $
+ * $Id: reassemble.c,v 1.30 2003/04/09 09:04:08 sahlberg Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -465,6 +465,7 @@ fragment_add(tvbuff_t *tvb, int offset, packet_info *pinfo, guint32 id,
                fd_head->len=0;
                fd_head->flags=0;
                fd_head->data=NULL;
+               fd_head->reassembled_in=0;
 
                /*
                 * We're going to use the key to insert the fragment,
@@ -647,7 +648,8 @@ fragment_add(tvbuff_t *tvb, int offset, packet_info *pinfo, guint32 id,
        /* mark this packet as defragmented.
            allows us to skip any trailing fragments */
        fd_head->flags |= FD_DEFRAGMENTED;
-
+       fd_head->reassembled_in=pinfo->fd->num;
+       
        return fd_head;
 }
 
@@ -837,6 +839,7 @@ fragment_add_seq_work(fragment_data *fd_head, tvbuff_t *tvb, int offset,
        /* mark this packet as defragmented.
            allows us to skip any trailing fragments */
        fd_head->flags |= FD_DEFRAGMENTED;
+       fd_head->reassembled_in=pinfo->fd->num;
 
        return TRUE;
 }
@@ -892,6 +895,7 @@ fragment_add_seq(tvbuff_t *tvb, int offset, packet_info *pinfo, guint32 id,
                fd_head->len=0;
                fd_head->flags=FD_BLOCKSEQUENCE;
                fd_head->data=NULL;
+               fd_head->reassembled_in=0;
 
                /*
                 * We're going to use the key to insert the fragment,
@@ -1031,6 +1035,7 @@ fragment_add_seq_check_work(tvbuff_t *tvb, int offset, packet_info *pinfo,
                fd_head->len=0;
                fd_head->flags=FD_BLOCKSEQUENCE;
                fd_head->data=NULL;
+               fd_head->reassembled_in=0;
 
                if (!more_frags) {
                        /*
index f1276f0d102bdd9416556308d330a9bb85cd0617..38301ef732dcb7308f22b0cf8b6fe6a2afe0280c 100644 (file)
@@ -1,7 +1,7 @@
 /* reassemble.h
  * Declarations of outines for {fragment,segment} reassembly
  *
- * $Id: reassemble.h,v 1.13 2002/12/19 11:22:38 sahlberg Exp $
+ * $Id: reassemble.h,v 1.14 2003/04/09 09:04:08 sahlberg Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -57,6 +57,9 @@ typedef struct _fragment_data {
        guint32 offset;
        guint32 len;
        guint32 datalen; /*Only valid in first item of list */
+       guint32 reassembled_in; /* frame where this PDU was reassembled,
+                                  only valid in the first item of the list
+                                  and when FD_DEFRAGMENTED is set*/
        guint32 flags;
        unsigned char *data;
 } fragment_data;