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;
}
void packet_init() {
char errbuf[PCAP_ERRBUF_SIZE];
char *m;
- int i;
int dlt;
int result;
}
if(have_hw_addr) {
- fprintf(stderr, "MAC address is:");
- for (i = 0; i < 6; ++i)
- fprintf(stderr, "%c%02x", i ? ':' : ' ', (unsigned int)if_hw_addr[i]);
- fprintf(stderr, "\n");
+ fprintf(stderr, "MAC address is: %s\n", ether_ntoa(if_hw_addr));
}
// exit(0);