author | mjm <mjm> | 2002-11-28 00:00:08 (UTC) |
---|---|---|
committer | mjm <mjm> | 2002-11-28 00:00:08 (UTC) |
commit | 3d3add0a024d650d6247108ed6a19c11efd63724 (patch) (unidiff) | |
tree | 312b281a110b9414253c321fd436eed1805cba24 | |
parent | 6eea92f02035e62e61c8600f2e9fe52dee5a4b6c (diff) | |
download | opie-3d3add0a024d650d6247108ed6a19c11efd63724.zip opie-3d3add0a024d650d6247108ed6a19c11efd63724.tar.gz opie-3d3add0a024d650d6247108ed6a19c11efd63724.tar.bz2 |
temporary moved handlesettings to daemon.cc
-rw-r--r-- | noncore/net/wellenreiter/daemon/source/daemon.cc | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/noncore/net/wellenreiter/daemon/source/daemon.cc b/noncore/net/wellenreiter/daemon/source/daemon.cc index b836a31..6467af7 100644 --- a/noncore/net/wellenreiter/daemon/source/daemon.cc +++ b/noncore/net/wellenreiter/daemon/source/daemon.cc | |||
@@ -19,15 +19,37 @@ int main(int argc, char **argv) | |||
19 | fd_set rset; | 19 | fd_set rset; |
20 | 20 | ||
21 | fprintf(stderr, "wellenreiterd %s\n\n", VERSION); | 21 | fprintf(stderr, "wellenreiterd %s\n\n", VERSION); |
22 | 22 | ||
23 | if(!card_into_monitormode(handletopcap, SNIFFER_DEVICE, CARD_TYPE_NG)) | 23 | if(!card_into_monitormode(&handletopcap, SNIFFER_DEVICE, CARD_TYPE_NG)) |
24 | { | 24 | { |
25 | wl_logerr("Cannot set card into mon mode, aborting"); | 25 | wl_logerr("Cannot set card into mon mode, aborting"); |
26 | exit(-1); | 26 | exit(-1); |
27 | } | 27 | } |
28 | wl_loginfo("Set card into monitor mode"); | 28 | wl_loginfo("Set card into monitor mode"); |
29 | 29 | ||
30 | /////// following line will be moved to lib as soon as possible //////////// | ||
31 | if((handletopcap = pcap_open_live(SNIFFER_DEVICE, BUFSIZ, 1, 0, NULL)) == NULL) | ||
32 | { | ||
33 | wl_logerr("pcap_open_live() failed: %s", strerror(errno)); | ||
34 | exit(-1); | ||
35 | } | ||
36 | |||
37 | #ifdef HAVE_PCAP_NONBLOCK | ||
38 | pcap_setnonblock(handletopcap, 1, NULL); | ||
39 | #endif | ||
40 | |||
41 | /* getting the datalink type */ | ||
42 | retval = pcap_datalink(handletopcap); | ||
43 | if (retval != DLT_IEEE802_11) /* Rawmode is IEEE802_11 */ | ||
44 | { | ||
45 | wl_loginfo("Interface %s does not work in the correct 802.11 raw mode", SNIFFER_DEVICE); | ||
46 | pcap_close(handletopcap); | ||
47 | return 0; | ||
48 | } | ||
49 | wl_loginfo("Your successfully listen on %s in 802.11 raw mode", SNIFFER_DEVICE); | ||
50 | //////////////////////////////////////// | ||
51 | |||
30 | /* Setup socket for incoming commands */ | 52 | /* Setup socket for incoming commands */ |
31 | if((sock=commsock(DAEMONADDR, DAEMONPORT)) < 0) | 53 | if((sock=commsock(DAEMONADDR, DAEMONPORT)) < 0) |
32 | { | 54 | { |
33 | wl_logerr("Cannot setup socket"); | 55 | wl_logerr("Cannot setup socket"); |