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) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/daemon/source/daemon.cc | 27 |
1 files changed, 8 insertions, 19 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 @@ -12,4 +12,5 @@ #define CHANINTERVAL 500000 + /* Main function of wellenreiterd */ int main(int argc, char **argv) @@ -19,5 +20,5 @@ int main(int argc, char **argv) struct pcap_pkthdr header; struct sockaddr_in saddr; - pcap_t *handletopcap; +// pcap_t *handletopcap; wl_cardtype_t cardtype; pthread_t sub; @@ -41,24 +42,12 @@ int main(int argc, char **argv) usage(); - /* set card into monitor mode */ - if(!card_into_monitormode(&handletopcap, cardtype.iface, - cardtype.type)) + /* 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("Cannot initialize the wireless-card, aborting"); - exit(EXIT_FAILURE); + wl_logerr("daemon, start_sniff did not return proper, 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) - { - wl_logerr("pcap_open_live() failed: %s", strerror(errno)); - exit(EXIT_FAILURE); - } - -#ifdef HAVE_PCAP_NONBLOCK - pcap_setnonblock(handletopcap, 1, NULL); -#endif + wl_loginfo ("daemon, wireless card prepared for sniffing"); /* Setup socket for incoming commands */ |