Diffstat (limited to 'noncore/net/wellenreiter/daemon/source/daemon.cc') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/daemon/source/daemon.cc | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/noncore/net/wellenreiter/daemon/source/daemon.cc b/noncore/net/wellenreiter/daemon/source/daemon.cc index a2e1f96..75b2222 100644 --- a/noncore/net/wellenreiter/daemon/source/daemon.cc +++ b/noncore/net/wellenreiter/daemon/source/daemon.cc | |||
@@ -8,4 +8,2 @@ | |||
8 | #include "daemon.hh" | 8 | #include "daemon.hh" |
9 | #include "cardmode.hh" | ||
10 | #include "sniffer.hh" | ||
11 | 9 | ||
@@ -16,6 +14,3 @@ int main(int argc, char **argv) | |||
16 | char buffer[128]; | 14 | char buffer[128]; |
17 | pcap_t *handletopcap; /* The handle to the libpcap */ | 15 | pcap_t *handletopcap; |
18 | char errbuf[PCAP_ERRBUF_SIZE]; /* The errorbuffer of libpacap */ | ||
19 | struct pcap_pkthdr header; /* The packet header from pcap*/ | ||
20 | const u_char *packet; /* The actual packet content*/ | ||
21 | 16 | ||
@@ -25,16 +20,9 @@ int main(int argc, char **argv) | |||
25 | 20 | ||
26 | #if 0 | ||
27 | /* will be replaced soon, just for max because max is lazy :-) */ | 21 | /* will be replaced soon, just for max because max is lazy :-) */ |
28 | if(card_into_monitormode (SNIFFER_DEVICE, CARD_TYPE_NG) < 0) | 22 | if(!card_into_monitormode(handletopcap, SNIFFER_DEVICE, CARD_TYPE_NG)) |
29 | { | 23 | { |
30 | fprintf(stderr, "Cannot set card into mon mode, aborting\n"); | 24 | wl_logerr("Cannot set card into mon mode, aborting"); |
31 | exit(-1); | 25 | exit(-1); |
32 | } | 26 | } |
33 | #endif | 27 | wl_loginfo("Set card into monitor mode"); |
34 | |||
35 | /* opening the pcap for sniffing */ | ||
36 | handletopcap = pcap_open_live(SNIFFER_DEVICE, BUFSIZ, 1, 1000, errbuf); | ||
37 | #ifdef HAVE_PCAP_NONBLOCK | ||
38 | pcap_setnonblock(handletopcap, 1, errstr); | ||
39 | #endif | ||
40 | 28 | ||