void history_rotate() {
hash_node_type* n = NULL;
+ struct pcap_stat ps;
+
history_pos = (history_pos + 1) % HISTORY_LENGTH;
hash_next_item(history, &n);
while(n != NULL) {
if(history_len < HISTORY_LENGTH) {
history_len++;
}
+
+ pcap_stats(pd, &ps);
+ history_totals.lost_packets = ps.ps_drop + ps.ps_ifdrop;
}
long sent[HISTORY_LENGTH];
double long total_sent;
double long total_recv;
+ long lost_packets;
int last_write;
} history_type;
readable_size(history_totals.total_recv + history_totals.total_sent, buf2_10, 10, 1024, 1);
printf("%s %10s %10s %10s\n", labellong, buf0_10, buf1_10, buf2_10);
+ /* Dropped packets */
+ snprintf(labellong, PRINT_WIDTH + 9, "%-*s", PRINT_WIDTH + 9, "Dropped packets:");
+ readable_size(history_totals.lost_packets, buf0_10, 10, 1024, options.bandwidth_unit);
+ printf("%s %10s\n", labellong, buf0_10, buf1_10, buf2_10);
+
/* Double divider line */
for (j = 0; j < PRINT_WIDTH + 52; j++) {
printf("=");
readable_size(peakrecv / RESOLUTION, line, 10, 1024, options.bandwidth_unit);
mvaddstr(y+1, 39, line);
- readable_size(peaktotal / RESOLUTION, line, 10, 1024, options.bandwidth_unit);
+ /* lost packets */
+ mvaddstr(y+2, 32, "lost: ");
+ readable_size(history_totals.lost_packets, line, 10, 1000, OPTION_BW_PKTS);
mvaddstr(y+2, 39, line);
mvaddstr(y, COLS - 8 * HISTORY_DIVISIONS - 8, "rates:");