diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2002-11-29 11:02:13 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2002-11-29 11:02:13 +0000 |
commit | 56e511657d75536fdc12ae41fdbb89419bee940f (patch) | |
tree | e5a872f9f52a2af9d7940017ab153fb8a4bb4b0b | |
parent | 85fd3afd2f040b8df6af52fef0c9f92801ed4b41 (diff) | |
download | wireshark-56e511657d75536fdc12ae41fdbb89419bee940f.tar.gz |
calculate delta and rel time earlier and unconditionally of whether the packet passed the displayfilter or not.
there may be tap listeners that want to examine this field.
svn path=/trunk/; revision=6702
-rw-r--r-- | file.c | 60 |
1 files changed, 30 insertions, 30 deletions
@@ -1,7 +1,7 @@ /* file.c * File I/O routines * - * $Id: file.c,v 1.294 2002/11/23 03:19:39 guy Exp $ + * $Id: file.c,v 1.295 2002/11/29 11:02:13 sahlberg Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -656,6 +656,35 @@ add_packet_to_packet_list(frame_data *fdata, capture_file *cf, firstsec = fdata->abs_secs; firstusec = fdata->abs_usecs; } + /* If we don't have the time stamp of the previous displayed packet, + it's because this is the first displayed packet. Save the time + stamp of this packet as the time stamp of the previous displayed + packet. */ + if (!prevsec && !prevusec) { + prevsec = fdata->abs_secs; + prevusec = fdata->abs_usecs; + } + + /* Get the time elapsed between the first packet and this packet. */ + compute_timestamp_diff(&fdata->rel_secs, &fdata->rel_usecs, + fdata->abs_secs, fdata->abs_usecs, firstsec, firstusec); + + /* If it's greater than the current elapsed time, set the elapsed time + to it (we check for "greater than" so as not to be confused by + time moving backwards). */ + if ((gint32)cf->esec < fdata->rel_secs + || ((gint32)cf->esec == fdata->rel_secs && (gint32)cf->eusec < fdata->rel_usecs)) { + cf->esec = fdata->rel_secs; + cf->eusec = fdata->rel_usecs; + } + + /* Get the time elapsed between the previous displayed packet and + this packet. */ + compute_timestamp_diff(&fdata->del_secs, &fdata->del_usecs, + fdata->abs_secs, fdata->abs_usecs, prevsec, prevusec); + prevsec = fdata->abs_secs; + prevusec = fdata->abs_usecs; + /* If either @@ -712,35 +741,6 @@ add_packet_to_packet_list(frame_data *fdata, capture_file *cf, if (fdata->flags.passed_dfilter) { /* This frame passed the display filter, so add it to the clist. */ - /* If we don't have the time stamp of the previous displayed packet, - it's because this is the first displayed packet. Save the time - stamp of this packet as the time stamp of the previous displayed - packet. */ - if (!prevsec && !prevusec) { - prevsec = fdata->abs_secs; - prevusec = fdata->abs_usecs; - } - - /* Get the time elapsed between the first packet and this packet. */ - compute_timestamp_diff(&fdata->rel_secs, &fdata->rel_usecs, - fdata->abs_secs, fdata->abs_usecs, firstsec, firstusec); - - /* If it's greater than the current elapsed time, set the elapsed time - to it (we check for "greater than" so as not to be confused by - time moving backwards). */ - if ((gint32)cf->esec < fdata->rel_secs - || ((gint32)cf->esec == fdata->rel_secs && (gint32)cf->eusec < fdata->rel_usecs)) { - cf->esec = fdata->rel_secs; - cf->eusec = fdata->rel_usecs; - } - - /* Get the time elapsed between the previous displayed packet and - this packet. */ - compute_timestamp_diff(&fdata->del_secs, &fdata->del_usecs, - fdata->abs_secs, fdata->abs_usecs, prevsec, prevusec); - prevsec = fdata->abs_secs; - prevusec = fdata->abs_usecs; - epan_dissect_fill_in_columns(edt); /* If we haven't yet seen the first frame, this is it. |