debugcode
This commit is contained in:
2
Makefile
2
Makefile
@@ -42,7 +42,7 @@ connection.o: connection.cpp connection.h nethogs.h
|
|||||||
hashtbl.o: hashtbl.cpp hashtbl.h nethogs.h
|
hashtbl.o: hashtbl.cpp hashtbl.h nethogs.h
|
||||||
$(GCC) $(CFLAGS) -c hashtbl.cpp
|
$(GCC) $(CFLAGS) -c hashtbl.cpp
|
||||||
decpcap.o: decpcap.c decpcap.h
|
decpcap.o: decpcap.c decpcap.h
|
||||||
gcc $(CFLAGS) -c decpcap.c
|
gcc-3.3 $(CFLAGS) -c decpcap.c
|
||||||
cui.o: cui.cpp cui.h nethogs.h
|
cui.o: cui.cpp cui.h nethogs.h
|
||||||
$(GCC) $(CFLAGS) -c cui.cpp -DVERSION=\"$(VERSION)\" -DSUBVERSION=\"$(SUBVERSION)\" -DMINORVERSION=\"$(MINORVERSION)\"
|
$(GCC) $(CFLAGS) -c cui.cpp -DVERSION=\"$(VERSION)\" -DSUBVERSION=\"$(SUBVERSION)\" -DMINORVERSION=\"$(MINORVERSION)\"
|
||||||
|
|
||||||
|
|||||||
17
decpcap.c
17
decpcap.c
@@ -30,6 +30,19 @@ struct dp_handle * dp_open_live(char * device, int snaplen, int promisc, int to_
|
|||||||
|
|
||||||
retval->linktype = pcap_datalink(retval->pcap_handle);
|
retval->linktype = pcap_datalink(retval->pcap_handle);
|
||||||
|
|
||||||
|
switch (retval->linktype) {
|
||||||
|
case (DLT_EN10MB):
|
||||||
|
std::cout << 'Ethernet link detected\n";
|
||||||
|
break;
|
||||||
|
case (DLT_PPP):
|
||||||
|
std::cout << 'PPP link detected\n";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
std::cout << 'No PPP or Ethernet link: " << retval->linktype << std::endl;
|
||||||
|
// TODO maybe error? or 'other' callback?
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,6 +89,7 @@ void dp_parse_ip (struct dp_handle * handle, const dp_header * header, const u_c
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// TODO
|
// TODO
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,6 +112,7 @@ void dp_parse_ip6 (struct dp_handle * handle, const dp_header * header, const u_
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// TODO
|
// TODO
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,6 +143,7 @@ void dp_parse_ethernet (struct dp_handle * handle, const dp_header * header, con
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// TODO
|
// TODO
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,6 +189,7 @@ void dp_parse_ppp (struct dp_handle * handle, const dp_header * header, const u_
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// TODO
|
// TODO
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user