author | max <max> | 2003-02-07 17:17:35 (UTC) |
---|---|---|
committer | max <max> | 2003-02-07 17:17:35 (UTC) |
commit | 014608882b23343473c5d0e7dca3ea09cf02dcfb (patch) (side-by-side diff) | |
tree | 90eac99cbb0faca581cc9b5cc37a9fd460548050 /noncore/net/wellenreiter | |
parent | a14c5974339f5beef433754d52c952cb99834619 (diff) | |
download | opie-014608882b23343473c5d0e7dca3ea09cf02dcfb.zip opie-014608882b23343473c5d0e7dca3ea09cf02dcfb.tar.gz opie-014608882b23343473c5d0e7dca3ea09cf02dcfb.tar.bz2 |
Chanswitch
-rw-r--r-- | noncore/net/wellenreiter/daemon/source/daemon.cc | 24 | ||||
-rw-r--r-- | noncore/net/wellenreiter/daemon/source/daemon.hh | 1 | ||||
-rw-r--r-- | noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc | 9 |
3 files changed, 24 insertions, 10 deletions
diff --git a/noncore/net/wellenreiter/daemon/source/daemon.cc b/noncore/net/wellenreiter/daemon/source/daemon.cc index d6e8f6b..b57e6a0 100644 --- a/noncore/net/wellenreiter/daemon/source/daemon.cc +++ b/noncore/net/wellenreiter/daemon/source/daemon.cc @@ -11,2 +11,3 @@ #define MAXCHANNEL 13 +int card_type; char sniffer_device[6]; @@ -15,8 +16,15 @@ int timedout=1; -static int chanswitch() +void chanswitch(int blah) { if(channel >= MAXCHANNEL) - channel=1 + { + channel=1; + } + else + { + channel++; + } card_set_channel(sniffer_device, channel, card_type); timedout=0; + alarm(1); } @@ -26,3 +34,3 @@ int main(int argc, char **argv) { - int sock, maxfd, retval, card_type; + int sock, maxfd, retval; char buffer[WL_SOCKBUF]; @@ -42,4 +50,4 @@ int main(int argc, char **argv) // removed soon, see above - SIGNAL(SIGALRM, chanswitch); - + signal(SIGALRM, chanswitch); + alarm(1); /* Set sniffer device */ @@ -50,3 +58,3 @@ int main(int argc, char **argv) card_type = atoi(argv[2]); - if(card_type < 1 || card_type > 3) + if(card_type < 1 || card_type > 4) usage(); @@ -93,3 +101,2 @@ int main(int argc, char **argv) timedout=1; - alarm(1); @@ -154,3 +161,4 @@ void usage(void) "\t\t\t\tNG\t= 2\n" \ - "\t\t\t\tHOSTAP\t= 3\n"); + "\t\t\t\tHOSTAP\t= 3\n" \ + "\t\t\t\tLUCENT\t= 4\n"); exit(-1); diff --git a/noncore/net/wellenreiter/daemon/source/daemon.hh b/noncore/net/wellenreiter/daemon/source/daemon.hh index 1cc3c7c..d50487a 100644 --- a/noncore/net/wellenreiter/daemon/source/daemon.hh +++ b/noncore/net/wellenreiter/daemon/source/daemon.hh @@ -14,2 +14,3 @@ #include <errno.h> +#include <signal.h> diff --git a/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc b/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc index 697d182..0c23922 100644 --- a/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc +++ b/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc @@ -75,2 +75,6 @@ int card_into_monitormode (pcap_t **orighandle, char *device, int cardtype) } + else + { + wl_loginfo("Successfully set %s into raw mode",device); + } } @@ -158,3 +162,2 @@ int card_set_channel (const char *device, int channel, int cardtype) { - if (cardtype == CARD_TYPE_CISCO) @@ -169,3 +172,3 @@ int card_set_channel (const char *device, int channel, int cardtype) char lucentcmd[62]; - snprintf(lucentreset, sizeof(lucentreset) -1,"$(which iwpriv) %s card_reset", device); + snprintf(lucentreset, sizeof(lucentreset) -1,"$(which iwpriv) %s force_reset", device); if (system(lucentreset) != 0) @@ -181,2 +184,4 @@ int card_set_channel (const char *device, int channel, int cardtype) } + wl_loginfo("Channel %d set on interface %s",channel,device); + return 1; } |