author | max <max> | 2003-03-04 14:04:52 (UTC) |
---|---|---|
committer | max <max> | 2003-03-04 14:04:52 (UTC) |
commit | 3adca473d5440b00e15781627e00465350e9118b (patch) (side-by-side diff) | |
tree | e60e57f10c8297eee39f9e31974f9199013c4930 /noncore/net/wellenreiter/daemon | |
parent | 7cf53b4030437bdbd405b8b16684ba9f68e2891d (diff) | |
download | opie-3adca473d5440b00e15781627e00465350e9118b.zip opie-3adca473d5440b00e15781627e00465350e9118b.tar.gz opie-3adca473d5440b00e15781627e00465350e9118b.tar.bz2 |
start_sniff
Diffstat (limited to 'noncore/net/wellenreiter/daemon') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/daemon/source/daemon.cc | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/noncore/net/wellenreiter/daemon/source/daemon.cc b/noncore/net/wellenreiter/daemon/source/daemon.cc index 3a28217..b840f17 100644 --- a/noncore/net/wellenreiter/daemon/source/daemon.cc +++ b/noncore/net/wellenreiter/daemon/source/daemon.cc @@ -13,2 +13,3 @@ + /* Main function of wellenreiterd */ @@ -20,3 +21,3 @@ int main(int argc, char **argv) struct sockaddr_in saddr; - pcap_t *handletopcap; +// pcap_t *handletopcap; wl_cardtype_t cardtype; @@ -42,22 +43,10 @@ int main(int argc, char **argv) - /* set card into monitor mode */ - if(!card_into_monitormode(&handletopcap, cardtype.iface, - cardtype.type)) - { - wl_logerr("Cannot initialize the wireless-card, aborting"); - exit(EXIT_FAILURE); - } - wl_loginfo("Set card into monitor mode"); - - /* setup pcap */ - if((handletopcap = pcap_open_live(cardtype.iface, - BUFSIZ, 1, 0, NULL)) == NULL) + /* Until we do not act as a read daemon, it starts the sniffer + right after startup */ + if (!start_sniffer(cardtype.iface,cardtype.type)) { - wl_logerr("pcap_open_live() failed: %s", strerror(errno)); + wl_logerr("daemon, start_sniff did not return proper, aborting"); exit(EXIT_FAILURE); } - -#ifdef HAVE_PCAP_NONBLOCK - pcap_setnonblock(handletopcap, 1, NULL); -#endif + wl_loginfo ("daemon, wireless card prepared for sniffing"); |