aboutsummaryrefslogtreecommitdiffstats
path: root/summary.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>1999-12-29 21:30:28 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>1999-12-29 21:30:28 +0000
commitcffadb58ef71f8ddaf3142df38cfd08e1dcbb701 (patch)
treee5505782dfe75ac62979421ef2448cb94bc3301d /summary.c
parent4c3ff16e7940e10641d634a1825a2d356a2e7412 (diff)
If there aren't any packets in the capture (which could be the case if,
for example, you're doing a live capture with "Update list of packets in real time" and none have arrived yet, or if you've read in a capture file where there aren't actually any packets), don't look for the start or stop time, and don't accumulate the number of captured bytes or the number of packets that passed the display filter. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1394 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'summary.c')
-rw-r--r--summary.c46
1 files changed, 24 insertions, 22 deletions
diff --git a/summary.c b/summary.c
index 68dc50a3a3..4a1951e215 100644
--- a/summary.c
+++ b/summary.c
@@ -1,7 +1,7 @@
/* summary.c
* Routines for capture file summary info
*
- * $Id: summary.c,v 1.15 1999/12/10 04:20:53 gram Exp $
+ * $Id: summary.c,v 1.16 1999/12/29 21:30:28 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -46,15 +46,15 @@ tally_frame_data(frame_data *cur_frame, summary_tally *sum_tally)
cur_time = secs_usecs(cur_frame->abs_secs, cur_frame->abs_usecs);
- if (cur_time < sum_tally->start_time) {
- sum_tally->start_time = cur_time;
- }
- if (cur_time > sum_tally->stop_time){
- sum_tally->stop_time = cur_time;
- }
- sum_tally->bytes += cur_frame->pkt_len;
- if (cur_frame->passed_dfilter)
- sum_tally->filtered_count++;
+ if (cur_time < sum_tally->start_time) {
+ sum_tally->start_time = cur_time;
+ }
+ if (cur_time > sum_tally->stop_time){
+ sum_tally->stop_time = cur_time;
+ }
+ sum_tally->bytes += cur_frame->pkt_len;
+ if (cur_frame->passed_dfilter)
+ sum_tally->filtered_count++;
}
void
@@ -65,18 +65,23 @@ summary_fill_in(summary_tally *st)
int i;
frame_data *cur_glist;
- /* initialize the tally */
- first_frame = cf.plist;
- st->start_time = secs_usecs(first_frame->abs_secs,first_frame->abs_usecs) ;
- st->stop_time = secs_usecs(first_frame->abs_secs,first_frame->abs_usecs) ;
+ st->start_time = 0;
+ st->stop_time = 0;
st->bytes = 0;
st->filtered_count = 0;
- cur_glist = cf.plist;
- for (i = 0; i < cf.count; i++) {
- cur_frame = cur_glist;
- tally_frame_data(cur_frame, st);
- cur_glist = cur_glist->next;
+ /* initialize the tally */
+ if (cf.plist != NULL) {
+ first_frame = cf.plist;
+ st->start_time = secs_usecs(first_frame->abs_secs,first_frame->abs_usecs);
+ st->stop_time = secs_usecs(first_frame->abs_secs,first_frame->abs_usecs);
+ cur_glist = cf.plist;
+
+ for (i = 0; i < cf.count; i++) {
+ cur_frame = cur_glist;
+ tally_frame_data(cur_frame, st);
+ cur_glist = cur_glist->next;
+ }
}
st->filename = cf.filename;
@@ -94,7 +99,4 @@ summary_fill_in(summary_tally *st)
#else
st->cfilter = NULL;
#endif
-
-
}
-