Bring frame_data_init() and add_packet_to_packet_list() more in sync by adding 'ref_time' handling to frame_data_init(). For tshark/rawshark this is unused because they only do a single pass through the capture file

svn path=/trunk/; revision=30055
This commit is contained in:
Kovarththanan Rajaratnam 2009-09-21 20:17:59 +00:00
parent 8af452f83d
commit 1989aa700d
2 changed files with 19 additions and 12 deletions

View File

@ -228,6 +228,19 @@ frame_data_init(frame_data *fdata, guint32 num,
*first_ts = fdata->abs_ts;
}
/* if this frames is marked as a reference time frame, reset
firstsec and firstusec to this frame */
if(fdata->flags.ref_time){
*first_ts = fdata->abs_ts;
}
/* If we don't have the time stamp of the previous displayed packet,
it's because this is the first packet that's being displayed. Save the time
stamp of this packet as the time stamp of the previous displayed
packet. */
if (nstime_is_unset(prev_dis_ts))
*prev_dis_ts = fdata->abs_ts;
/* If we don't have the time stamp of the previous captured packet,
it's because this is the first packet. Save the time
stamp of this packet as the time stamp of the previous captured
@ -247,13 +260,6 @@ frame_data_init(frame_data *fdata, guint32 num,
*elapsed_time = fdata->rel_ts;
}
/* If we don't have the time stamp of the previous displayed packet,
it's because this is the first packet that's being displayed. Save the time
stamp of this packet as the time stamp of the previous displayed
packet. */
if (nstime_is_unset(prev_dis_ts))
*prev_dis_ts = fdata->abs_ts;
/* Get the time elapsed between the previous displayed packet and
this packet. */
nstime_delta(&fdata->del_dis_ts, &fdata->abs_ts, prev_dis_ts);

11
file.c
View File

@ -1089,6 +1089,7 @@ add_packet_to_packet_list(frame_data *fdata, capture_file *cf,
if (nstime_is_unset(&first_ts)) {
first_ts = fdata->abs_ts;
}
/* if this frames is marked as a reference time frame, reset
firstsec and firstusec to this frame */
if(fdata->flags.ref_time){
@ -1170,7 +1171,7 @@ add_packet_to_packet_list(frame_data *fdata, capture_file *cf,
row = new_packet_list_append(cinfo, fdata, &edt.pi);
}
if( (fdata->flags.passed_dfilter) || (fdata->flags.ref_time) )
if(fdata->flags.passed_dfilter || fdata->flags.ref_time)
{
/* This frame either passed the display filter list or is marked as
a time reference frame. All time reference frames are displayed
@ -1185,6 +1186,10 @@ add_packet_to_packet_list(frame_data *fdata, capture_file *cf,
fdata->cum_bytes = cum_bytes;
}
/* Set the time of the previous displayed frame to the time of this
frame. */
prev_dis_ts = fdata->abs_ts;
/* If we haven't yet seen the first frame, this is it.
XXX - we must do this before we add the row to the display,
@ -1204,10 +1209,6 @@ add_packet_to_packet_list(frame_data *fdata, capture_file *cf,
/* This is the last frame we've seen so far. */
cf->last_displayed = fdata;
/* Set the time of the previous displayed frame to the time of this
frame. */
prev_dis_ts = fdata->abs_ts;
cf->displayed_count++;
}