X-Git-Url: http://git.samba.org/samba.git/?p=obnox%2Fwireshark%2Fwip.git;a=blobdiff_plain;f=summary.c;h=82831b78d4ac6ac662ab40de187a1b49c12fe579;hp=b21706c6be82d2db28257ce695545ad2231430d4;hb=e7724e50107794f8632230c461e936b62e69aef0;hpb=e7e62591fe23566d2bb5685ade31d2a925ed726c diff --git a/summary.c b/summary.c index b21706c6be..82831b78d4 100644 --- a/summary.c +++ b/summary.c @@ -3,8 +3,8 @@ * * $Id$ * - * Ethereal - Network traffic analyzer - * By Gerald Combs + * Wireshark - Network traffic analyzer + * By Gerald Combs * Copyright 1998 Gerald Combs * * This program is free software; you can redistribute it and/or @@ -26,6 +26,10 @@ # include "config.h" #endif +#ifdef HAVE_SYS_TYPES_H +#include +#endif + #include #include "cfile.h" #include "summary.h" @@ -54,7 +58,7 @@ tally_frame_data(frame_data *cur_frame, summary_tally *sum_tally) sum_tally->filtered_stop = cur_time; } else { if (cur_time < sum_tally->filtered_start) { - sum_tally->start_time = cur_time; + sum_tally->filtered_start = cur_time; } if (cur_time > sum_tally->filtered_stop) { sum_tally->filtered_stop = cur_time; @@ -63,9 +67,24 @@ tally_frame_data(frame_data *cur_frame, summary_tally *sum_tally) sum_tally->filtered_count++; sum_tally->filtered_bytes += cur_frame->pkt_len ; } - if (cur_frame->flags.marked) + if (cur_frame->flags.marked){ + if (sum_tally->marked_count==0){ + sum_tally->marked_start= cur_time; + sum_tally->marked_stop = cur_time; + } else { + if (cur_time < sum_tally->marked_start) { + sum_tally->marked_start = cur_time; + } + if (cur_time > sum_tally->marked_stop) { + sum_tally->marked_stop = cur_time; + } + } sum_tally->marked_count++; - + sum_tally->marked_bytes += cur_frame->pkt_len ; + } + if (cur_frame->flags.ignored){ + sum_tally->ignored_count++; + } } void @@ -81,16 +100,20 @@ summary_fill_in(capture_file *cf, summary_tally *st) st->bytes = 0; st->filtered_count = 0; st->filtered_start = 0; - st->filtered_stop = 0; + st->filtered_stop = 0; st->filtered_bytes = 0; st->marked_count = 0; + st->marked_start = 0; + st->marked_stop = 0; + st->marked_bytes = 0; + st->ignored_count = 0; /* initialize the tally */ - if (cf->plist != NULL) { - first_frame = cf->plist; + if (cf->plist_start != NULL) { + first_frame = cf->plist_start; st->start_time = nstime_to_sec(&first_frame->abs_ts); st->stop_time = nstime_to_sec(&first_frame->abs_ts); - cur_glist = cf->plist; + cur_glist = cf->plist_start; for (i = 0; i < cf->count; i++) { cur_frame = cur_glist; @@ -101,7 +124,8 @@ summary_fill_in(capture_file *cf, summary_tally *st) st->filename = cf->filename; st->file_length = cf->f_datalen; - st->encap_type = cf->cd_t; + st->file_type = cf->cd_t; + st->encap_type = cf->lnk_t; st->has_snap = cf->has_snap; st->snap = cf->snap; st->elapsed_time = nstime_to_sec(&cf->elapsed_time); @@ -123,10 +147,6 @@ summary_fill_in_capture(capture_options *capture_opts, summary_tally *st) { st->cfilter = capture_opts->cfilter; st->iface = capture_opts->iface; - if(st->iface) { - st->iface_descr = get_interface_descriptive_name(st->iface); - } else { - st->iface_descr = NULL; - } + st->iface_descr = get_iface_description(capture_opts); } #endif