summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpdw <>2014-01-01 12:36:35 +0000
committerpdw <>2014-01-01 12:36:35 +0000
commit59cf360690c99ad5149305ce3600151fa0f1483b (patch)
tree48b9e1f989229a31d62704ec66bd4eeafccaaa90
parent9be050ef4cf2fa0dad1cb0973b45a294231695cd (diff)
downloadiftop-59cf360690c99ad5149305ce3600151fa0f1483b.zip
Code tidying.
-rw-r--r--iftop.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/iftop.c b/iftop.c
index 06778d6..f0e692f 100644
--- a/iftop.c
+++ b/iftop.c
@@ -140,7 +140,6 @@ void tick(int print) {
t = time(NULL);
if(t - last_timestamp >= RESOLUTION) {
- //printf("TICKING\n");
analyse_data();
ui_print();
history_rotate();
@@ -574,9 +573,9 @@ static void handle_eth_packet(unsigned char* args, const struct pcap_pkthdr* pkt
tick(0);
if(ether_type == ETHERTYPE_8021Q) {
- struct vlan_8021q_header* vptr;
- vptr = (struct vlan_8021q_header*)payload;
- ether_type = ntohs(vptr->ether_type);
+ struct vlan_8021q_header* vptr;
+ vptr = (struct vlan_8021q_header*)payload;
+ ether_type = ntohs(vptr->ether_type);
payload += sizeof(struct vlan_8021q_header);
}
@@ -592,11 +591,11 @@ static void handle_eth_packet(unsigned char* args, const struct pcap_pkthdr* pkt
dir = 1;
}
else if(have_hw_addr && memcmp(eptr->ether_dhost, if_hw_addr, 6) == 0 ) {
- /* packet entering this i/f */
- dir = 0;
- }
- else if (memcmp("\xFF\xFF\xFF\xFF\xFF\xFF", eptr->ether_dhost, 6) == 0) {
- /* broadcast packet, count as incoming */
+ /* packet entering this i/f */
+ dir = 0;
+ }
+ else if (memcmp("\xFF\xFF\xFF\xFF\xFF\xFF", eptr->ether_dhost, 6) == 0) {
+ /* broadcast packet, count as incoming */
dir = 0;
}