diff options
author | sahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7> | 2002-11-29 11:02:13 +0000 |
---|---|---|
committer | sahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7> | 2002-11-29 11:02:13 +0000 |
commit | 07d45699b7ea08bac30747cc9e39e7cbd41ac3ba (patch) | |
tree | e5a872f9f52a2af9d7940017ab153fb8a4bb4b0b /file.c | |
parent | beb43ca2ceddc09521eae55f3f52ad0408b3d35e (diff) |
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.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6702 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'file.c')
-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. |