Diffstat (limited to 'noncore/net/wellenreiter/daemon/source/daemon.cc') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/daemon/source/daemon.cc | 24 |
1 files changed, 16 insertions, 8 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 @@ | |||
11 | #define MAXCHANNEL 13 | 11 | #define MAXCHANNEL 13 |
12 | int card_type; | ||
12 | char sniffer_device[6]; | 13 | char sniffer_device[6]; |
@@ -15,8 +16,15 @@ int timedout=1; | |||
15 | 16 | ||
16 | static int chanswitch() | 17 | void chanswitch(int blah) |
17 | { | 18 | { |
18 | if(channel >= MAXCHANNEL) | 19 | if(channel >= MAXCHANNEL) |
19 | channel=1 | 20 | { |
21 | channel=1; | ||
22 | } | ||
23 | else | ||
24 | { | ||
25 | channel++; | ||
26 | } | ||
20 | card_set_channel(sniffer_device, channel, card_type); | 27 | card_set_channel(sniffer_device, channel, card_type); |
21 | timedout=0; | 28 | timedout=0; |
29 | alarm(1); | ||
22 | } | 30 | } |
@@ -26,3 +34,3 @@ int main(int argc, char **argv) | |||
26 | { | 34 | { |
27 | int sock, maxfd, retval, card_type; | 35 | int sock, maxfd, retval; |
28 | char buffer[WL_SOCKBUF]; | 36 | char buffer[WL_SOCKBUF]; |
@@ -42,4 +50,4 @@ int main(int argc, char **argv) | |||
42 | // removed soon, see above | 50 | // removed soon, see above |
43 | SIGNAL(SIGALRM, chanswitch); | 51 | signal(SIGALRM, chanswitch); |
44 | 52 | alarm(1); | |
45 | /* Set sniffer device */ | 53 | /* Set sniffer device */ |
@@ -50,3 +58,3 @@ int main(int argc, char **argv) | |||
50 | card_type = atoi(argv[2]); | 58 | card_type = atoi(argv[2]); |
51 | if(card_type < 1 || card_type > 3) | 59 | if(card_type < 1 || card_type > 4) |
52 | usage(); | 60 | usage(); |
@@ -93,3 +101,2 @@ int main(int argc, char **argv) | |||
93 | timedout=1; | 101 | timedout=1; |
94 | alarm(1); | ||
95 | 102 | ||
@@ -154,3 +161,4 @@ void usage(void) | |||
154 | "\t\t\t\tNG\t= 2\n" \ | 161 | "\t\t\t\tNG\t= 2\n" \ |
155 | "\t\t\t\tHOSTAP\t= 3\n"); | 162 | "\t\t\t\tHOSTAP\t= 3\n" \ |
163 | "\t\t\t\tLUCENT\t= 4\n"); | ||
156 | exit(-1); | 164 | exit(-1); |