Fixed sent/recv bug.

Added totals.
This commit is contained in:
pdw
2002-03-26 23:50:40 +00:00
parent 5d52b1f944
commit 945ae2e394
3 changed files with 117 additions and 58 deletions

View File

@@ -126,10 +126,10 @@ static void handle_packet(char* args, const struct pcap_pkthdr* pkthdr,const cha
/* Update record */
ht->last_write = history_pos;
if(iptr->ip_src.s_addr < iptr->ip_dst.s_addr) {
ht->recv[history_pos] += ntohs(iptr->ip_len);
ht->sent[history_pos] += ntohs(iptr->ip_len);
}
else {
ht->sent[history_pos] += ntohs(iptr->ip_len);
ht->recv[history_pos] += ntohs(iptr->ip_len);
}
}