summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/daemon/source/daemon.cc26
-rw-r--r--noncore/net/wellenreiter/daemon/source/daemon.hh1
-rw-r--r--noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc9
3 files changed, 25 insertions, 11 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);
@@ -152,5 +159,6 @@ void usage(void)
"\t<device> = Wirelessdevice (e.g. wlan0)\n" \
- "\t<cardtype> = Cardtype:\t Cisco\t= 1\n" \
+ "\t<cardtype> = Cardtype:\tCisco\t= 1\n" \
"\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;
}