summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpdw <>2010-03-01 22:13:32 +0000
committerpdw <>2010-03-01 22:13:32 +0000
commitae7a11d202d331d4884e6e5234c4b1246252ab86 (patch)
treecaf71319dd1bc713fae5d1d61c4f97286c2f89c4
parentcc31a604f302b58723f29ff74df3ef9ae7a75629 (diff)
downloadiftop-ae7a11d202d331d4884e6e5234c4b1246252ab86.zip
Made DLT_PFLOG code conditional to avoid compilation problems on other
platforms.
-rw-r--r--iftop.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/iftop.c b/iftop.c
index 397d815..db8b2d6 100644
--- a/iftop.c
+++ b/iftop.c
@@ -302,6 +302,7 @@ static void handle_raw_packet(unsigned char* args, const struct pcap_pkthdr* pkt
handle_ip_packet((struct ip*)packet, -1);
}
+#ifdef DLT_PFLOG
static void handle_pflog_packet(unsigned char* args, const struct pcap_pkthdr* pkthdr, const unsigned char* packet)
{
register u_int length = pkthdr->len;
@@ -314,6 +315,7 @@ static void handle_pflog_packet(unsigned char* args, const struct pcap_pkthdr* p
packet += hdrlen;
handle_ip_packet((struct ip*)packet, length);
}
+#endif
static void handle_llc_packet(const struct llc* llc, int dir) {
@@ -533,9 +535,11 @@ void packet_init() {
if(dlt == DLT_EN10MB) {
packet_handler = handle_eth_packet;
}
+#ifdef DLT_PFLOG
else if (dlt == DLT_PFLOG) {
packet_handler = handle_pflog_packet;
}
+#endif
else if(dlt == DLT_RAW || dlt == DLT_NULL) {
packet_handler = handle_raw_packet;
}