Deleted Added
full compact
ancontrol.c (99800) ancontrol.c (108401)
1/*
2 * Copyright 1997, 1998, 1999
3 * Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 20 unchanged lines hidden (view full) ---

29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30 * THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#ifndef lint
34static const char copyright[] = "@(#) Copyright (c) 1997, 1998, 1999\
35 Bill Paul. All rights reserved.";
36static const char rcsid[] =
1/*
2 * Copyright 1997, 1998, 1999
3 * Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 20 unchanged lines hidden (view full) ---

29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30 * THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#ifndef lint
34static const char copyright[] = "@(#) Copyright (c) 1997, 1998, 1999\
35 Bill Paul. All rights reserved.";
36static const char rcsid[] =
37 "$FreeBSD: head/usr.sbin/ancontrol/ancontrol.c 99800 2002-07-11 18:31:16Z alfred $";
37 "$FreeBSD: head/usr.sbin/ancontrol/ancontrol.c 108401 2002-12-29 19:22:07Z ambrisko $";
38#endif
39
40#include <sys/types.h>
41#include <sys/cdefs.h>
42#include <sys/socket.h>
43#include <sys/ioctl.h>
44#include <sys/socket.h>
45

--- 7 unchanged lines hidden (view full) ---

53
54#include <stdio.h>
55#include <string.h>
56#include <stdlib.h>
57#include <unistd.h>
58#include <errno.h>
59#include <err.h>
60#include <md4.h>
38#endif
39
40#include <sys/types.h>
41#include <sys/cdefs.h>
42#include <sys/socket.h>
43#include <sys/ioctl.h>
44#include <sys/socket.h>
45

--- 7 unchanged lines hidden (view full) ---

53
54#include <stdio.h>
55#include <string.h>
56#include <stdlib.h>
57#include <unistd.h>
58#include <errno.h>
59#include <err.h>
60#include <md4.h>
61#include <ctype.h>
61
62
62static void an_getval(const char *, struct an_req *);
63static int an_getval(const char *, struct an_req *);
63static void an_setval(const char *, struct an_req *);
64static void an_printwords(u_int16_t *, int);
65static void an_printspeeds(u_int8_t*, int);
66static void an_printbool(int);
67static void an_printhex(char *, int);
68static void an_printstr(char *, int);
69static void an_dumpstatus(const char *);
70static void an_dumpstats(const char *);

--- 10 unchanged lines hidden (view full) ---

81static void an_zerocache(const char *);
82static void an_readcache(const char *);
83#endif
84static int an_hex2int(char);
85static void an_str2key(char *, struct an_ltv_key *);
86static void an_setkeys(const char *, char *, int);
87static void an_enable_tx_key(const char *, char *);
88static void an_enable_leap_mode(const char *, char *);
64static void an_setval(const char *, struct an_req *);
65static void an_printwords(u_int16_t *, int);
66static void an_printspeeds(u_int8_t*, int);
67static void an_printbool(int);
68static void an_printhex(char *, int);
69static void an_printstr(char *, int);
70static void an_dumpstatus(const char *);
71static void an_dumpstats(const char *);

--- 10 unchanged lines hidden (view full) ---

82static void an_zerocache(const char *);
83static void an_readcache(const char *);
84#endif
85static int an_hex2int(char);
86static void an_str2key(char *, struct an_ltv_key *);
87static void an_setkeys(const char *, char *, int);
88static void an_enable_tx_key(const char *, char *);
89static void an_enable_leap_mode(const char *, char *);
90static void an_dumprssimap(const char *);
89static void usage(char *);
90int main(int, char **);
91
92#define ACT_DUMPSTATS 1
93#define ACT_DUMPCONFIG 2
94#define ACT_DUMPSTATUS 3
95#define ACT_DUMPCAPS 4
96#define ACT_DUMPSSID 5

--- 29 unchanged lines hidden (view full) ---

126
127#define ACT_ENABLE_WEP 33
128#define ACT_SET_KEY_TYPE 34
129#define ACT_SET_KEYS 35
130#define ACT_ENABLE_TX_KEY 36
131#define ACT_SET_MONITOR_MODE 37
132#define ACT_SET_LEAP_MODE 38
133
91static void usage(char *);
92int main(int, char **);
93
94#define ACT_DUMPSTATS 1
95#define ACT_DUMPCONFIG 2
96#define ACT_DUMPSTATUS 3
97#define ACT_DUMPCAPS 4
98#define ACT_DUMPSSID 5

--- 29 unchanged lines hidden (view full) ---

128
129#define ACT_ENABLE_WEP 33
130#define ACT_SET_KEY_TYPE 34
131#define ACT_SET_KEYS 35
132#define ACT_ENABLE_TX_KEY 36
133#define ACT_SET_MONITOR_MODE 37
134#define ACT_SET_LEAP_MODE 38
135
134static void an_getval(iface, areq)
136#define ACT_DUMPRSSIMAP 39
137
138static int an_getval(iface, areq)
135 const char *iface;
136 struct an_req *areq;
137{
138 struct ifreq ifr;
139 const char *iface;
140 struct an_req *areq;
141{
142 struct ifreq ifr;
139 int s;
143 int s, okay = 1;
140
141 bzero((char *)&ifr, sizeof(ifr));
142
143 strlcpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name));
144 ifr.ifr_data = (caddr_t)areq;
145
146 s = socket(AF_INET, SOCK_DGRAM, 0);
147
148 if (s == -1)
149 err(1, "socket");
150
144
145 bzero((char *)&ifr, sizeof(ifr));
146
147 strlcpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name));
148 ifr.ifr_data = (caddr_t)areq;
149
150 s = socket(AF_INET, SOCK_DGRAM, 0);
151
152 if (s == -1)
153 err(1, "socket");
154
151 if (ioctl(s, SIOCGAIRONET, &ifr) == -1)
155 if (ioctl(s, SIOCGAIRONET, &ifr) == -1) {
156 okay = 0;
152 err(1, "SIOCGAIRONET");
157 err(1, "SIOCGAIRONET");
158 }
153
154 close(s);
155
159
160 close(s);
161
156 return;
162 return okay;
157}
158
159static void an_setval(iface, areq)
160 const char *iface;
161 struct an_req *areq;
162{
163 struct ifreq ifr;
164 int s;

--- 90 unchanged lines hidden (view full) ---

255
256
257
258static void an_dumpstatus(iface)
259 const char *iface;
260{
261 struct an_ltv_status *sts;
262 struct an_req areq;
163}
164
165static void an_setval(iface, areq)
166 const char *iface;
167 struct an_req *areq;
168{
169 struct ifreq ifr;
170 int s;

--- 90 unchanged lines hidden (view full) ---

261
262
263
264static void an_dumpstatus(iface)
265 const char *iface;
266{
267 struct an_ltv_status *sts;
268 struct an_req areq;
269 struct an_ltv_rssi_map an_rssimap;
270 int rssimap_valid = 0;
263
271
272 /*
273 * Try to get RSSI to percent and dBM table
274 */
275
276 an_rssimap.an_len = sizeof(an_rssimap);
277 an_rssimap.an_type = AN_RID_RSSI_MAP;
278 rssimap_valid = an_getval(iface, (struct an_req*)&an_rssimap);
279
280 if (rssimap_valid)
281 printf("RSSI table:\t\t[ present ]\n");
282 else
283 printf("RSSI table:\t\t[ not available ]\n");
284
264 areq.an_len = sizeof(areq);
265 areq.an_type = AN_RID_STATUS;
266
267 an_getval(iface, &areq);
268
269 sts = (struct an_ltv_status *)&areq;
270
271 printf("MAC address:\t\t");

--- 11 unchanged lines hidden (view full) ---

283 printf("associated ");
284 if (sts->an_opmode & AN_STATUS_OPMODE_LEAP)
285 printf("LEAP ");
286 if (sts->an_opmode & AN_STATUS_OPMODE_ERROR)
287 printf("error ");
288 printf("]\n");
289 printf("Error code:\t\t");
290 an_printhex((char *)&sts->an_errcode, 1);
285 areq.an_len = sizeof(areq);
286 areq.an_type = AN_RID_STATUS;
287
288 an_getval(iface, &areq);
289
290 sts = (struct an_ltv_status *)&areq;
291
292 printf("MAC address:\t\t");

--- 11 unchanged lines hidden (view full) ---

304 printf("associated ");
305 if (sts->an_opmode & AN_STATUS_OPMODE_LEAP)
306 printf("LEAP ");
307 if (sts->an_opmode & AN_STATUS_OPMODE_ERROR)
308 printf("error ");
309 printf("]\n");
310 printf("Error code:\t\t");
311 an_printhex((char *)&sts->an_errcode, 1);
291 printf("\nSignal quality:\t\t");
292 an_printhex((char *)&sts->an_cur_signal_quality, 1);
293 printf("\nSignal strength:\t[ %d%% ]",sts->an_normalized_rssi);
294 printf("\nMax Noise:\t\t[ %d%% ]",sts->an_avg_noise_prev_min);
312 if (rssimap_valid)
313 printf("\nSignal strength:\t[ %d%% ]",
314 an_rssimap.an_entries[
315 sts->an_normalized_strength].an_rss_pct);
316 else
317 printf("\nSignal strength:\t[ %d%% ]",
318 sts->an_normalized_strength);
319 printf("\nAverage Noise:\t\t[ %d%% ]",sts->an_avg_noise_prev_min_pc);
320 if (rssimap_valid)
321 printf("\nSignal quality:\t\t[ %d%% ]",
322 an_rssimap.an_entries[
323 sts->an_cur_signal_quality].an_rss_pct);
324 else
325 printf("\nSignal quality:\t\t[ %d ]",
326 sts->an_cur_signal_quality);
327 printf("\nMax Noise:\t\t[ %d%% ]",sts->an_max_noise_prev_min_pc);
295 /*
296 * XXX: This uses the old definition of the rate field (units of
297 * 500kbps). Technically the new definition is that this field
298 * contains arbitrary values, but no devices which need this
299 * support exist and the IEEE seems to intend to use the old
300 * definition until they get something big so we'll keep using
301 * it as well because this will work with new cards with
302 * rate <= 63.5Mbps.

--- 70 unchanged lines hidden (view full) ---

373 printf(" ]");
374 printf("\nRegulatory domain:\t");
375 an_printwords(&caps->an_regdomain, 1);
376 printf("\nAssigned CallID:\t");
377 an_printhex((char *)&caps->an_callid, 6);
378 printf("\nSupported speeds:\t");
379 an_printspeeds(caps->an_rates, 8);
380 printf("\nRX Diversity:\t\t[ ");
328 /*
329 * XXX: This uses the old definition of the rate field (units of
330 * 500kbps). Technically the new definition is that this field
331 * contains arbitrary values, but no devices which need this
332 * support exist and the IEEE seems to intend to use the old
333 * definition until they get something big so we'll keep using
334 * it as well because this will work with new cards with
335 * rate <= 63.5Mbps.

--- 70 unchanged lines hidden (view full) ---

406 printf(" ]");
407 printf("\nRegulatory domain:\t");
408 an_printwords(&caps->an_regdomain, 1);
409 printf("\nAssigned CallID:\t");
410 an_printhex((char *)&caps->an_callid, 6);
411 printf("\nSupported speeds:\t");
412 an_printspeeds(caps->an_rates, 8);
413 printf("\nRX Diversity:\t\t[ ");
381 if (caps->an_rx_diversity == AN_DIVERSITY_ANTENNA_1_ONLY)
414 if (caps->an_rx_diversity == AN_DIVERSITY_FACTORY_DEFAULT)
415 printf("factory default");
416 else if (caps->an_rx_diversity == AN_DIVERSITY_ANTENNA_1_ONLY)
382 printf("antenna 1 only");
383 else if (caps->an_rx_diversity == AN_DIVERSITY_ANTENNA_2_ONLY)
384 printf("antenna 2 only");
385 else if (caps->an_rx_diversity == AN_DIVERSITY_ANTENNA_1_AND_2)
386 printf("antenna 1 and 2");
387 printf(" ]");
388 printf("\nTX Diversity:\t\t[ ");
417 printf("antenna 1 only");
418 else if (caps->an_rx_diversity == AN_DIVERSITY_ANTENNA_2_ONLY)
419 printf("antenna 2 only");
420 else if (caps->an_rx_diversity == AN_DIVERSITY_ANTENNA_1_AND_2)
421 printf("antenna 1 and 2");
422 printf(" ]");
423 printf("\nTX Diversity:\t\t[ ");
389 if (caps->an_rx_diversity == AN_DIVERSITY_ANTENNA_1_ONLY)
424 if (caps->an_tx_diversity == AN_DIVERSITY_FACTORY_DEFAULT)
425 printf("factory default");
426 else if (caps->an_tx_diversity == AN_DIVERSITY_ANTENNA_1_ONLY)
390 printf("antenna 1 only");
427 printf("antenna 1 only");
391 else if (caps->an_rx_diversity == AN_DIVERSITY_ANTENNA_2_ONLY)
428 else if (caps->an_tx_diversity == AN_DIVERSITY_ANTENNA_2_ONLY)
392 printf("antenna 2 only");
429 printf("antenna 2 only");
393 else if (caps->an_rx_diversity == AN_DIVERSITY_ANTENNA_1_AND_2)
430 else if (caps->an_tx_diversity == AN_DIVERSITY_ANTENNA_1_AND_2)
394 printf("antenna 1 and 2");
395 printf(" ]");
396 printf("\nSupported power levels:\t");
397 an_printwords(caps->an_tx_powerlevels, 8);
398 printf("\nHardware revision:\t");
399 tmp = ntohs(caps->an_hwrev);
400 an_printhex((char *)&tmp, 2);
401 printf("\nSoftware revision:\t");

--- 379 unchanged lines hidden (view full) ---

781 printf("802.11 DS");
782 else if (cfg->an_radiotype & AN_RADIOTYPE_LM2000_DS)
783 printf("LM2000 DS");
784 else
785 printf("unknown (%x)", cfg->an_radiotype);
786 printf(" ]");
787 printf("\nRX Diversity:\t\t\t\t[ ");
788 diversity = cfg->an_diversity & 0xFF;
431 printf("antenna 1 and 2");
432 printf(" ]");
433 printf("\nSupported power levels:\t");
434 an_printwords(caps->an_tx_powerlevels, 8);
435 printf("\nHardware revision:\t");
436 tmp = ntohs(caps->an_hwrev);
437 an_printhex((char *)&tmp, 2);
438 printf("\nSoftware revision:\t");

--- 379 unchanged lines hidden (view full) ---

818 printf("802.11 DS");
819 else if (cfg->an_radiotype & AN_RADIOTYPE_LM2000_DS)
820 printf("LM2000 DS");
821 else
822 printf("unknown (%x)", cfg->an_radiotype);
823 printf(" ]");
824 printf("\nRX Diversity:\t\t\t\t[ ");
825 diversity = cfg->an_diversity & 0xFF;
789 if (diversity == AN_DIVERSITY_ANTENNA_1_ONLY)
826 if (diversity == AN_DIVERSITY_FACTORY_DEFAULT)
827 printf("factory default");
828 else if (diversity == AN_DIVERSITY_ANTENNA_1_ONLY)
790 printf("antenna 1 only");
791 else if (diversity == AN_DIVERSITY_ANTENNA_2_ONLY)
792 printf("antenna 2 only");
793 else if (diversity == AN_DIVERSITY_ANTENNA_1_AND_2)
794 printf("antenna 1 and 2");
795 printf(" ]");
796 printf("\nTX Diversity:\t\t\t\t[ ");
797 diversity = (cfg->an_diversity >> 8) & 0xFF;
829 printf("antenna 1 only");
830 else if (diversity == AN_DIVERSITY_ANTENNA_2_ONLY)
831 printf("antenna 2 only");
832 else if (diversity == AN_DIVERSITY_ANTENNA_1_AND_2)
833 printf("antenna 1 and 2");
834 printf(" ]");
835 printf("\nTX Diversity:\t\t\t\t[ ");
836 diversity = (cfg->an_diversity >> 8) & 0xFF;
798 if (diversity == AN_DIVERSITY_ANTENNA_1_ONLY)
837 if (diversity == AN_DIVERSITY_FACTORY_DEFAULT)
838 printf("factory default");
839 else if (diversity == AN_DIVERSITY_ANTENNA_1_ONLY)
799 printf("antenna 1 only");
800 else if (diversity == AN_DIVERSITY_ANTENNA_2_ONLY)
801 printf("antenna 2 only");
802 else if (diversity == AN_DIVERSITY_ANTENNA_1_AND_2)
803 printf("antenna 1 and 2");
804 printf(" ]");
805 printf("\nTransmit power level:\t\t\t");
806 an_printwords(&cfg->an_tx_power, 1);

--- 16 unchanged lines hidden (view full) ---

823
824 printf("\n");
825 printf("\n");
826 an_readkeyinfo(iface);
827
828 return;
829}
830
840 printf("antenna 1 only");
841 else if (diversity == AN_DIVERSITY_ANTENNA_2_ONLY)
842 printf("antenna 2 only");
843 else if (diversity == AN_DIVERSITY_ANTENNA_1_AND_2)
844 printf("antenna 1 and 2");
845 printf(" ]");
846 printf("\nTransmit power level:\t\t\t");
847 an_printwords(&cfg->an_tx_power, 1);

--- 16 unchanged lines hidden (view full) ---

864
865 printf("\n");
866 printf("\n");
867 an_readkeyinfo(iface);
868
869 return;
870}
871
872static void an_dumprssimap(iface)
873 const char *iface;
874{
875 struct an_ltv_rssi_map *rssi;
876 struct an_req areq;
877 int i;
831
878
879 areq.an_len = sizeof(areq);
880 areq.an_type = AN_RID_RSSI_MAP;
881
882 an_getval(iface, &areq);
883
884 rssi = (struct an_ltv_rssi_map *)&areq;
885
886 printf("idx\tpct\t dBm\n");
887
888 for (i = 0; i < 0xFF; i++) {
889 /*
890 * negate the dBm value: it's the only way the power
891 * level makes sense
892 */
893 printf("%3d\t%3d\t%4d\n", i,
894 rssi->an_entries[i].an_rss_pct,
895 - rssi->an_entries[i].an_rss_dbm);
896 }
897
898 return;
899}
900
832static void usage(p)
833 char *p;
834{
835 fprintf(stderr, "usage: %s -i iface -A (show specified APs)\n", p);
836 fprintf(stderr, "\t%s -i iface -N (show specified SSIDss)\n", p);
837 fprintf(stderr, "\t%s -i iface -S (show NIC status)\n", p);
838 fprintf(stderr, "\t%s -i iface -I (show NIC capabilities)\n", p);
839 fprintf(stderr, "\t%s -i iface -T (show stats counters)\n", p);
840 fprintf(stderr, "\t%s -i iface -C (show current config)\n", p);
901static void usage(p)
902 char *p;
903{
904 fprintf(stderr, "usage: %s -i iface -A (show specified APs)\n", p);
905 fprintf(stderr, "\t%s -i iface -N (show specified SSIDss)\n", p);
906 fprintf(stderr, "\t%s -i iface -S (show NIC status)\n", p);
907 fprintf(stderr, "\t%s -i iface -I (show NIC capabilities)\n", p);
908 fprintf(stderr, "\t%s -i iface -T (show stats counters)\n", p);
909 fprintf(stderr, "\t%s -i iface -C (show current config)\n", p);
910 fprintf(stderr, "\t%s -i iface -R (show RSSI map)\n", p);
841 fprintf(stderr, "\t%s -i iface -t 0-4 (set TX speed)\n", p);
842 fprintf(stderr, "\t%s -i iface -s 0-3 (set power save mode)\n", p);
843 fprintf(stderr, "\t%s -i iface [-v 1-4] -a AP (specify AP)\n", p);
844 fprintf(stderr, "\t%s -i iface -b val (set beacon period)\n", p);
845 fprintf(stderr, "\t%s -i iface [-v 0|1] -d val (set diversity)\n", p);
846 fprintf(stderr, "\t%s -i iface -j val (set netjoin timeout)\n", p);
847 fprintf(stderr, "\t%s -i iface -e 0-4 (enable transmit key)\n", p);
848 fprintf(stderr, "\t%s -i iface [-v 0-8] -k key (set key)\n", p);

--- 70 unchanged lines hidden (view full) ---

919 break;
920 case 3:
921 diversity = AN_DIVERSITY_ANTENNA_1_AND_2;
922 break;
923 default:
924 errx(1, "bad diversity setting: %d", diversity);
925 break;
926 }
911 fprintf(stderr, "\t%s -i iface -t 0-4 (set TX speed)\n", p);
912 fprintf(stderr, "\t%s -i iface -s 0-3 (set power save mode)\n", p);
913 fprintf(stderr, "\t%s -i iface [-v 1-4] -a AP (specify AP)\n", p);
914 fprintf(stderr, "\t%s -i iface -b val (set beacon period)\n", p);
915 fprintf(stderr, "\t%s -i iface [-v 0|1] -d val (set diversity)\n", p);
916 fprintf(stderr, "\t%s -i iface -j val (set netjoin timeout)\n", p);
917 fprintf(stderr, "\t%s -i iface -e 0-4 (enable transmit key)\n", p);
918 fprintf(stderr, "\t%s -i iface [-v 0-8] -k key (set key)\n", p);

--- 70 unchanged lines hidden (view full) ---

989 break;
990 case 3:
991 diversity = AN_DIVERSITY_ANTENNA_1_AND_2;
992 break;
993 default:
994 errx(1, "bad diversity setting: %d", diversity);
995 break;
996 }
927 if (atoi(arg) == ACT_SET_DIVERSITY_RX) {
928 cfg->an_diversity &= 0x00FF;
929 cfg->an_diversity |= (diversity << 8);
930 } else {
997 if (act == ACT_SET_DIVERSITY_RX) {
931 cfg->an_diversity &= 0xFF00;
932 cfg->an_diversity |= diversity;
998 cfg->an_diversity &= 0xFF00;
999 cfg->an_diversity |= diversity;
1000 } else {
1001 cfg->an_diversity &= 0x00FF;
1002 cfg->an_diversity |= (diversity << 8);
933 }
934 break;
935 case ACT_SET_TXPWR:
936 for (i = 0; i < 8; i++) {
937 if (caps->an_tx_powerlevels[i] == atoi(arg))
938 break;
939 }
940 if (i == 8)

--- 573 unchanged lines hidden (view full) ---

1514 iface = "an0";
1515 optind = 1;
1516 }
1517 optreset = 1;
1518 }
1519 opterr = 1;
1520
1521 while ((ch = getopt(argc, argv,
1003 }
1004 break;
1005 case ACT_SET_TXPWR:
1006 for (i = 0; i < 8; i++) {
1007 if (caps->an_tx_powerlevels[i] == atoi(arg))
1008 break;
1009 }
1010 if (i == 8)

--- 573 unchanged lines hidden (view full) ---

1584 iface = "an0";
1585 optind = 1;
1586 }
1587 optreset = 1;
1588 }
1589 opterr = 1;
1590
1591 while ((ch = getopt(argc, argv,
1522 "ANISCTht:a:e:o:s:n:v:d:j:b:c:r:p:w:m:l:k:K:W:QZM:L:")) != -1) {
1592 "ANISCTRht:a:e:o:s:n:v:d:j:b:c:r:p:w:m:l:k:K:W:QZM:L:")) != -1) {
1523 switch(ch) {
1524 case 'Z':
1525#ifdef ANCACHE
1526 act = ACT_ZEROCACHE;
1527#else
1528 errx(1, "ANCACHE not available");
1529#endif
1530 break;

--- 17 unchanged lines hidden (view full) ---

1548 act = ACT_DUMPCAPS;
1549 break;
1550 case 'T':
1551 act = ACT_DUMPSTATS;
1552 break;
1553 case 'C':
1554 act = ACT_DUMPCONFIG;
1555 break;
1593 switch(ch) {
1594 case 'Z':
1595#ifdef ANCACHE
1596 act = ACT_ZEROCACHE;
1597#else
1598 errx(1, "ANCACHE not available");
1599#endif
1600 break;

--- 17 unchanged lines hidden (view full) ---

1618 act = ACT_DUMPCAPS;
1619 break;
1620 case 'T':
1621 act = ACT_DUMPSTATS;
1622 break;
1623 case 'C':
1624 act = ACT_DUMPCONFIG;
1625 break;
1626 case 'R':
1627 act = ACT_DUMPRSSIMAP;
1628 break;
1556 case 't':
1557 act = ACT_SET_TXRATE;
1558 arg = optarg;
1559 break;
1560 case 's':
1561 act = ACT_SET_PWRSAVE;
1562 arg = optarg;
1563 break;

--- 36 unchanged lines hidden (view full) ---

1600 switch(modifier) {
1601 case 0:
1602 act = ACT_SET_DIVERSITY_RX;
1603 break;
1604 case 1:
1605 act = ACT_SET_DIVERSITY_TX;
1606 break;
1607 default:
1629 case 't':
1630 act = ACT_SET_TXRATE;
1631 arg = optarg;
1632 break;
1633 case 's':
1634 act = ACT_SET_PWRSAVE;
1635 arg = optarg;
1636 break;

--- 36 unchanged lines hidden (view full) ---

1673 switch(modifier) {
1674 case 0:
1675 act = ACT_SET_DIVERSITY_RX;
1676 break;
1677 case 1:
1678 act = ACT_SET_DIVERSITY_TX;
1679 break;
1680 default:
1608 errx(1, "must specift RX or TX diversity");
1681 errx(1, "must specify RX or TX diversity");
1609 break;
1610 }
1682 break;
1683 }
1684 if (!isdigit(*optarg)) {
1685 errx(1, "%s is not numeric", optarg);
1686 exit(1);
1687 }
1611 arg = optarg;
1612 break;
1613 case 'j':
1614 act = ACT_SET_NETJOIN;
1615 arg = optarg;
1616 break;
1617 case 'l':
1618 act = ACT_SET_MYNAME;

--- 94 unchanged lines hidden (view full) ---

1713 an_dumpconfig(iface);
1714 break;
1715 case ACT_DUMPSSID:
1716 an_dumpssid(iface);
1717 break;
1718 case ACT_DUMPAP:
1719 an_dumpap(iface);
1720 break;
1688 arg = optarg;
1689 break;
1690 case 'j':
1691 act = ACT_SET_NETJOIN;
1692 arg = optarg;
1693 break;
1694 case 'l':
1695 act = ACT_SET_MYNAME;

--- 94 unchanged lines hidden (view full) ---

1790 an_dumpconfig(iface);
1791 break;
1792 case ACT_DUMPSSID:
1793 an_dumpssid(iface);
1794 break;
1795 case ACT_DUMPAP:
1796 an_dumpap(iface);
1797 break;
1798 case ACT_DUMPRSSIMAP:
1799 an_dumprssimap(iface);
1800 break;
1721 case ACT_SET_SSID1:
1722 case ACT_SET_SSID2:
1723 case ACT_SET_SSID3:
1724 an_setssid(iface, act, arg);
1725 break;
1726 case ACT_SET_AP1:
1727 case ACT_SET_AP2:
1728 case ACT_SET_AP3:

--- 32 unchanged lines hidden ---
1801 case ACT_SET_SSID1:
1802 case ACT_SET_SSID2:
1803 case ACT_SET_SSID3:
1804 an_setssid(iface, act, arg);
1805 break;
1806 case ACT_SET_AP1:
1807 case ACT_SET_AP2:
1808 case ACT_SET_AP3:

--- 32 unchanged lines hidden ---