author | mjm <mjm> | 2002-11-27 22:06:43 (UTC) |
---|---|---|
committer | mjm <mjm> | 2002-11-27 22:06:43 (UTC) |
commit | 31a16f8dc73d79178a4840d9e7aa4a07bfd65a26 (patch) (side-by-side diff) | |
tree | 25ca113de74febde5d72a46d09315bd9d329ef8f /noncore/net/wellenreiter/daemon/source/daemon.cc | |
parent | 2a84b561e50f8fd7973b56b3b0a87471f6b5f18c (diff) | |
download | opie-31a16f8dc73d79178a4840d9e7aa4a07bfd65a26.zip opie-31a16f8dc73d79178a4840d9e7aa4a07bfd65a26.tar.gz opie-31a16f8dc73d79178a4840d9e7aa4a07bfd65a26.tar.bz2 |
moved cardmode and sniffer to library to provide a generic lib.
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 @@ #include "daemon.hh" -#include "cardmode.hh" -#include "sniffer.hh" @@ -16,6 +14,3 @@ int main(int argc, char **argv) char buffer[128]; - pcap_t *handletopcap; /* The handle to the libpcap */ - char errbuf[PCAP_ERRBUF_SIZE]; /* The errorbuffer of libpacap */ - struct pcap_pkthdr header; /* The packet header from pcap*/ - const u_char *packet; /* The actual packet content*/ + pcap_t *handletopcap; @@ -25,16 +20,9 @@ int main(int argc, char **argv) -#if 0 /* will be replaced soon, just for max because max is lazy :-) */ - if(card_into_monitormode (SNIFFER_DEVICE, CARD_TYPE_NG) < 0) + if(!card_into_monitormode(handletopcap, SNIFFER_DEVICE, CARD_TYPE_NG)) { - fprintf(stderr, "Cannot set card into mon mode, aborting\n"); + wl_logerr("Cannot set card into mon mode, aborting"); exit(-1); } -#endif - - /* opening the pcap for sniffing */ - handletopcap = pcap_open_live(SNIFFER_DEVICE, BUFSIZ, 1, 1000, errbuf); -#ifdef HAVE_PCAP_NONBLOCK - pcap_setnonblock(handletopcap, 1, errstr); -#endif + wl_loginfo("Set card into monitor mode"); |