2 * Copyright (c) 1997, 1998, 1999
3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. All advertising materials mentioning features or use of this software
14 * must display the following acknowledgement:
15 * This product includes software developed by Bill Paul.
16 * 4. Neither the name of the author nor the names of any co-contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30 * THE POSSIBILITY OF SUCH DAMAGE.
32 * @(#) Copyright (c) 1997, 1998, 1999 Bill Paul. All rights reserved.
33 * $FreeBSD: src/usr.sbin/wicontrol/wicontrol.c,v 1.9.2.7 2002/08/03 07:24:17 imp Exp $
34 * $DragonFly: src/usr.sbin/wicontrol/Attic/wicontrol.c,v 1.3 2003/08/08 04:18:49 dillon Exp $
37 #include <sys/types.h>
38 #include <sys/cdefs.h>
39 #include <sys/param.h>
40 #include <sys/socket.h>
41 #include <sys/ioctl.h>
42 #include <sys/socket.h>
45 #include <net/if_var.h>
46 #include <net/ethernet.h>
48 #include <net/if_ieee80211.h>
49 #include <dev/netif/wi/if_wavelan_ieee.h>
50 #include <dev/netif/wi/wi_hostap.h>
51 #include <dev/netif/wi/if_wireg.h>
61 static void wi_getval(const char *, struct wi_req *);
62 static void wi_setval(const char *, struct wi_req *);
63 static void wi_printstr(struct wi_req *);
64 static void wi_setstr(const char *, int, char *);
65 static void wi_setbytes(const char *, int, char *, int);
66 static void wi_setword(const char *, int, int);
67 static void wi_sethex(const char *, int, char *);
68 static void wi_printwords(struct wi_req *);
69 static void wi_printbool(struct wi_req *);
70 static void wi_printhex(struct wi_req *);
71 static void wi_dumpinfo(const char *);
72 static void wi_dumpstats(const char *);
73 static void wi_setkeys(const char *, char *, int);
74 static void wi_printkeys(struct wi_req *);
75 static void wi_printaplist(const char *);
76 static int wi_hex2int(char);
77 static void wi_str2key(char *, struct wi_key *);
79 static void wi_zerocache(const char *);
80 static void wi_readcache(const char *);
82 static void usage(const char *);
87 * Print a value a la the %b format of the kernel's printf
88 * (ripped screaming from ifconfig/ifconfig.c)
99 if (bits && *bits == 8)
100 printf("%s=%o", s, v);
102 printf("%s=%x", s, v);
106 while ((i = *bits++)) {
107 if (v & (1 << (i-1))) {
111 for (; (c = *bits) > 32; bits++)
114 for (; *bits > 32; bits++)
122 wi_getval(const char *iface, struct wi_req *wreq)
127 bzero((char *)&ifr, sizeof(ifr));
129 strlcpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name));
130 ifr.ifr_data = (caddr_t)wreq;
132 s = socket(AF_INET, SOCK_DGRAM, 0);
137 if (ioctl(s, SIOCGWAVELAN, &ifr) == -1)
138 err(1, "SIOCGWAVELAN");
146 wi_setval(const char *iface, struct wi_req *wreq)
151 bzero((char *)&ifr, sizeof(ifr));
153 strlcpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name));
154 ifr.ifr_data = (caddr_t)wreq;
156 s = socket(AF_INET, SOCK_DGRAM, 0);
161 if (ioctl(s, SIOCSWAVELAN, &ifr) == -1)
162 err(1, "SIOCSWAVELAN");
170 wi_printstr(struct wi_req *wreq)
175 if (wreq->wi_type == WI_RID_SERIALNO) {
176 ptr = (char *)&wreq->wi_val;
177 for (i = 0; i < (wreq->wi_len - 1) * 2; i++) {
182 ptr = (char *)&wreq->wi_val[1];
183 for (i = 0; i < wreq->wi_val[0]; i++) {
190 printf("[ %s ]", ptr);
196 wi_setstr(const char *iface, int code, char *str)
201 errx(1, "must specify interface name");
204 errx(1, "must specify string");
206 bzero((char *)&wreq, sizeof(wreq));
208 if (strlen(str) > 30)
209 errx(1, "string too long");
213 wreq.wi_val[0] = strlen(str);
214 bcopy(str, (char *)&wreq.wi_val[1], strlen(str));
216 wi_setval(iface, &wreq);
222 wi_setbytes(const char *iface, int code, char *bytes, int len)
227 errx(1, "must specify interface name");
229 bzero((char *)&wreq, sizeof(wreq));
232 wreq.wi_len = (len / 2) + 1;
233 bcopy(bytes, (char *)&wreq.wi_val[0], len);
235 wi_setval(iface, &wreq);
241 wi_setword(const char *iface, int code, int word)
245 bzero((char *)&wreq, sizeof(wreq));
249 wreq.wi_val[0] = word;
251 wi_setval(iface, &wreq);
257 wi_sethex(const char *iface, int code, char *str)
259 struct ether_addr *addr;
262 errx(1, "must specify address");
264 addr = ether_aton(str);
267 errx(1, "badly formatted address");
269 wi_setbytes(iface, code, (char *)addr, ETHER_ADDR_LEN);
277 if (c >= '0' && c <= '9')
279 if (c >= 'A' && c <= 'F')
280 return (c - 'A' + 10);
281 if (c >= 'a' && c <= 'f')
282 return (c - 'a' + 10);
288 wi_str2key(char *s, struct wi_key *k)
293 /* Is this a hex string? */
294 if (s[0] == '0' && (s[1] == 'x' || s[1] == 'X')) {
295 /* Yes, convert to int. */
297 p = (char *)&k->wi_keydat[0];
298 for (i = 2; s[i] != '\0' && s[i + 1] != '\0'; i+= 2) {
299 *p++ = (wi_hex2int(s[i]) << 4) + wi_hex2int(s[i + 1]);
303 errx(1, "hex strings must be of even length");
306 /* No, just copy it in. */
307 bcopy(s, k->wi_keydat, strlen(s));
308 k->wi_keylen = strlen(s);
315 wi_setkeys(const char *iface, char *key, int idx)
319 struct wi_ltv_keys *keys;
322 bzero((char *)&wreq, sizeof(wreq));
323 wreq.wi_len = WI_MAX_DATALEN;
324 wreq.wi_type = WI_RID_WEP_AVAIL;
326 wi_getval(iface, &wreq);
327 if (wreq.wi_val[0] == 0)
328 errx(1, "no WEP option available on this card");
330 bzero((char *)&wreq, sizeof(wreq));
331 wreq.wi_len = WI_MAX_DATALEN;
332 wreq.wi_type = WI_RID_DEFLT_CRYPT_KEYS;
334 wi_getval(iface, &wreq);
335 keys = (struct wi_ltv_keys *)&wreq;
337 keylen = strlen(key);
338 if (key[0] == '0' && (key[1] == 'x' || key[1] == 'X')) {
339 if (keylen != 2 && keylen != 12 && keylen != 28) {
340 errx(1, "encryption key must be 0, 10, or 26 "
344 if (keylen != 0 && keylen != 5 && keylen != 13) {
345 errx(1, "encryption key must be 0, 5, or 13 "
351 errx(1, "only 4 encryption keys available");
353 k = &keys->wi_keys[idx];
356 wreq.wi_len = (sizeof(struct wi_ltv_keys) / 2) + 1;
357 wreq.wi_type = WI_RID_DEFLT_CRYPT_KEYS;
358 wi_setval(iface, &wreq);
364 wi_printkeys(struct wi_req *wreq)
369 struct wi_ltv_keys *keys;
372 keys = (struct wi_ltv_keys *)wreq;
374 for (i = 0; i < 4; i++) {
375 k = &keys->wi_keys[i];
376 ptr = (char *)k->wi_keydat;
378 for (j = 0; j < k->wi_keylen; j++) {
379 if (!isprint(ptr[j])) {
386 printf("[ %s ]", ptr);
389 for (j = 0; j < k->wi_keylen; j++) {
390 printf("%02x", ptr[j] & 0xFF);
401 wi_printwords(struct wi_req *wreq)
406 for (i = 0; i < wreq->wi_len - 1; i++)
407 printf("%d ", wreq->wi_val[i]);
414 wi_printbool(struct wi_req *wreq)
425 wi_printhex(struct wi_req *wreq)
430 c = (unsigned char *)&wreq->wi_val;
433 for (i = 0; i < (wreq->wi_len - 1) * 2; i++) {
434 printf("%02x", c[i]);
435 if (i < ((wreq->wi_len - 1) * 2) - 1)
444 wi_printaplist(const char *iface)
446 int prism2, len, i = 0, j;
448 struct wi_scan_p2_hdr *wi_p2_h;
449 struct wi_scan_res *res;
451 printf("Available APs:\n");
453 /* first determine if this is a prism2 card or not */
454 wreq.wi_len = WI_MAX_DATALEN;
455 wreq.wi_type = WI_RID_PRISM2;
457 wi_getval(iface, &wreq);
458 prism2 = wreq.wi_val[0];
460 /* send out a scan request */
461 wreq.wi_len = prism2 ? 3 : 1;
462 wreq.wi_type = WI_RID_SCAN_REQ;
465 wreq.wi_val[0] = 0x3FFF;
466 wreq.wi_val[1] = 0x000F;
469 wi_setval(iface, &wreq);
472 * sleep for 100 milliseconds so there's enough time for the card to
473 * respond... prism2's take a little longer.
475 usleep(prism2 ? 500000 : 100000);
477 /* get the scan results */
478 wreq.wi_len = WI_MAX_DATALEN;
479 wreq.wi_type = WI_RID_SCAN_RES;
481 wi_getval(iface, &wreq);
484 wi_p2_h = (struct wi_scan_p2_hdr *)wreq.wi_val;
486 /* if the reason is 0, this info is invalid */
487 if (wi_p2_h->wi_reason == 0)
493 len = prism2 ? WI_PRISM2_RES_SIZE : WI_WAVELAN_RES_SIZE;
495 for (; i < (wreq.wi_len * 2) - len; i += len) {
496 res = (struct wi_scan_res *)((char *)wreq.wi_val + i);
498 res->wi_ssid[res->wi_ssid_len] = '\0';
500 printf(" %-8s [ %02x:%02x:%02x:%02x:%02x:%02x ] [ %-2d ] "
501 "[ %d %d %d ] %-3d ", res->wi_ssid,
502 res->wi_bssid[0], res->wi_bssid[1], res->wi_bssid[2],
503 res->wi_bssid[3], res->wi_bssid[4], res->wi_bssid[5],
504 res->wi_chan, res->wi_signal - res->wi_noise,
505 res->wi_signal, res->wi_noise, res->wi_interval);
507 if (res->wi_capinfo) {
509 if (res->wi_capinfo & WI_CAPINFO_ESS)
511 if (res->wi_capinfo & WI_CAPINFO_IBSS)
513 if (res->wi_capinfo & WI_CAPINFO_PRIV)
520 for (j = 0; res->wi_srates[j] != 0; j++) {
521 res->wi_srates[j] = res->wi_srates[j] &
523 printf("%d.%d ", res->wi_srates[j] / 2,
524 (res->wi_srates[j] % 2) * 5);
528 printf("* %2.1f *", res->wi_rate == 0xa ? 1 :
529 (res->wi_rate == 0x14 ? 2 :
530 (res->wi_rate == 0x37 ? 5.5 :
531 (res->wi_rate == 0x6e ? 11 : 0))));
540 #define WI_STRING 0x01
542 #define WI_WORDS 0x03
543 #define WI_HEXBYTES 0x04
544 #define WI_KEYSTRUCT 0x05
552 static struct wi_table wi_table[] = {
553 { WI_RID_SERIALNO, WI_STRING, "NIC serial number:\t\t\t" },
554 { WI_RID_NODENAME, WI_STRING, "Station name:\t\t\t\t" },
555 { WI_RID_OWN_SSID, WI_STRING, "SSID for IBSS creation:\t\t\t" },
556 { WI_RID_CURRENT_SSID, WI_STRING, "Current netname (SSID):\t\t\t" },
557 { WI_RID_DESIRED_SSID, WI_STRING, "Desired netname (SSID):\t\t\t" },
558 { WI_RID_CURRENT_BSSID, WI_HEXBYTES, "Current BSSID:\t\t\t\t" },
559 { WI_RID_CHANNEL_LIST, WI_WORDS, "Channel list:\t\t\t\t" },
560 { WI_RID_OWN_CHNL, WI_WORDS, "IBSS channel:\t\t\t\t" },
561 { WI_RID_CURRENT_CHAN, WI_WORDS, "Current channel:\t\t\t" },
562 { WI_RID_COMMS_QUALITY, WI_WORDS, "Comms quality/signal/noise:\t\t" },
563 { WI_RID_PROMISC, WI_BOOL, "Promiscuous mode:\t\t\t" },
564 { WI_RID_PROCFRAME, WI_BOOL, "Process 802.11b Frame:\t\t\t" },
565 { WI_RID_PRISM2, WI_WORDS, "Intersil-Prism2 based card:\t\t" },
566 { WI_RID_PORTTYPE, WI_WORDS, "Port type (1=BSS, 3=ad-hoc):\t\t"},
567 { WI_RID_MAC_NODE, WI_HEXBYTES, "MAC address:\t\t\t\t"},
568 { WI_RID_TX_RATE, WI_WORDS, "TX rate (selection):\t\t\t"},
569 { WI_RID_CUR_TX_RATE, WI_WORDS, "TX rate (actual speed):\t\t\t"},
570 { WI_RID_RTS_THRESH, WI_WORDS, "RTS/CTS handshake threshold:\t\t"},
571 { WI_RID_CREATE_IBSS, WI_BOOL, "Create IBSS:\t\t\t\t" },
572 { WI_RID_SYSTEM_SCALE, WI_WORDS, "Access point density:\t\t\t" },
573 { WI_RID_PM_ENABLED, WI_WORDS, "Power Mgmt (1=on, 0=off):\t\t" },
574 { WI_RID_MAX_SLEEP, WI_WORDS, "Max sleep time:\t\t\t\t" },
578 static struct wi_table wi_crypt_table[] = {
579 { WI_RID_ENCRYPTION, WI_BOOL, "WEP encryption:\t\t\t\t" },
580 { WI_RID_TX_CRYPT_KEY, WI_WORDS, "TX encryption key:\t\t\t" },
581 { WI_RID_DEFLT_CRYPT_KEYS, WI_KEYSTRUCT, "Encryption keys:\t\t\t" },
586 wi_dumpinfo(const char *iface)
592 bzero((char *)&wreq, sizeof(wreq));
594 wreq.wi_len = WI_MAX_DATALEN;
595 wreq.wi_type = WI_RID_WEP_AVAIL;
597 wi_getval(iface, &wreq);
598 has_wep = wreq.wi_val[0];
602 for (i = 0; w[i].wi_type; i++) {
603 bzero((char *)&wreq, sizeof(wreq));
605 wreq.wi_len = WI_MAX_DATALEN;
606 wreq.wi_type = w[i].wi_code;
608 wi_getval(iface, &wreq);
609 printf("%s", w[i].wi_str);
610 switch(w[i].wi_type) {
615 wi_printwords(&wreq);
631 for (i = 0; w[i].wi_type; i++) {
632 bzero((char *)&wreq, sizeof(wreq));
634 wreq.wi_len = WI_MAX_DATALEN;
635 wreq.wi_type = w[i].wi_code;
637 wi_getval(iface, &wreq);
638 printf("%s", w[i].wi_str);
639 switch(w[i].wi_type) {
644 if (wreq.wi_type == WI_RID_TX_CRYPT_KEY)
646 wi_printwords(&wreq);
665 wi_printaplist(iface);
671 wi_dumpstats(const char *iface)
674 struct wi_counters *c;
677 errx(1, "must specify interface name");
679 bzero((char *)&wreq, sizeof(wreq));
680 wreq.wi_len = WI_MAX_DATALEN;
681 wreq.wi_type = WI_RID_IFACE_STATS;
683 wi_getval(iface, &wreq);
685 c = (struct wi_counters *)&wreq.wi_val;
687 printf("Transmitted unicast frames:\t\t%d\n",
688 c->wi_tx_unicast_frames);
689 printf("Transmitted multicast frames:\t\t%d\n",
690 c->wi_tx_multicast_frames);
691 printf("Transmitted fragments:\t\t\t%d\n",
693 printf("Transmitted unicast octets:\t\t%d\n",
694 c->wi_tx_unicast_octets);
695 printf("Transmitted multicast octets:\t\t%d\n",
696 c->wi_tx_multicast_octets);
697 printf("Single transmit retries:\t\t%d\n",
698 c->wi_tx_single_retries);
699 printf("Multiple transmit retries:\t\t%d\n",
700 c->wi_tx_multi_retries);
701 printf("Transmit retry limit exceeded:\t\t%d\n",
702 c->wi_tx_retry_limit);
703 printf("Transmit discards:\t\t\t%d\n",
705 printf("Transmit discards due to wrong SA:\t%d\n",
706 c->wi_tx_discards_wrong_sa);
707 printf("Received unicast frames:\t\t%d\n",
708 c->wi_rx_unicast_frames);
709 printf("Received multicast frames:\t\t%d\n",
710 c->wi_rx_multicast_frames);
711 printf("Received fragments:\t\t\t%d\n",
713 printf("Received unicast octets:\t\t%d\n",
714 c->wi_rx_unicast_octets);
715 printf("Received multicast octets:\t\t%d\n",
716 c->wi_rx_multicast_octets);
717 printf("Receive FCS errors:\t\t\t%d\n",
718 c->wi_rx_fcs_errors);
719 printf("Receive discards due to no buffer:\t%d\n",
720 c->wi_rx_discards_nobuf);
721 printf("Can't decrypt WEP frame:\t\t%d\n",
722 c->wi_rx_WEP_cant_decrypt);
723 printf("Received message fragments:\t\t%d\n",
724 c->wi_rx_msg_in_msg_frags);
725 printf("Received message bad fragments:\t\t%d\n",
726 c->wi_rx_msg_in_bad_msg_frags);
734 fprintf(stderr, "usage: %s -i iface\n", p);
735 fprintf(stderr, "\t%s -i iface -o\n", p);
736 fprintf(stderr, "\t%s -i iface -l\n", p);
737 fprintf(stderr, "\t%s -i iface -t tx rate\n", p);
738 fprintf(stderr, "\t%s -i iface -n network name\n", p);
739 fprintf(stderr, "\t%s -i iface -s station name\n", p);
740 fprintf(stderr, "\t%s -i iface -c 0|1\n", p);
741 fprintf(stderr, "\t%s -i iface -q SSID\n", p);
742 fprintf(stderr, "\t%s -i iface -p port type\n", p);
743 fprintf(stderr, "\t%s -i iface -a access point density\n", p);
744 fprintf(stderr, "\t%s -i iface -m mac address\n", p);
745 fprintf(stderr, "\t%s -i iface -d max data length\n", p);
746 fprintf(stderr, "\t%s -i iface -e 0|1\n", p);
747 fprintf(stderr, "\t%s -i iface -k encryption key [-v 1|2|3|4]\n", p);
748 fprintf(stderr, "\t%s -i iface -r RTS threshold\n", p);
749 fprintf(stderr, "\t%s -i iface -f frequency\n", p);
750 fprintf(stderr, "\t%s -i iface -F 0|1\n", p);
751 fprintf(stderr, "\t%s -i iface -P 0|1\n", p);
752 fprintf(stderr, "\t%s -i iface -S max sleep duration\n", p);
753 fprintf(stderr, "\t%s -i iface -T 1|2|3|4\n", p);
755 fprintf(stderr, "\t%s -i iface -Z zero out signal cache\n", p);
756 fprintf(stderr, "\t%s -i iface -C print signal cache\n", p);
763 wi_dumpstations(const char *iface)
765 struct hostap_getall reqall;
766 struct hostap_sta stas[WIHAP_MAX_STATIONS];
770 bzero(&ifr, sizeof(ifr));
771 strlcpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name));
772 ifr.ifr_data = (caddr_t) & reqall;
773 bzero(&reqall, sizeof(reqall));
774 reqall.size = sizeof(stas);
776 bzero(&stas, sizeof(stas));
778 s = socket(AF_INET, SOCK_DGRAM, 0);
782 if (ioctl(s, SIOCHOSTAP_GETALL, &ifr) < 0)
783 err(1, "SIOCHOSTAP_GETALL");
785 printf("%d station%s:\n", reqall.nstations, reqall.nstations>1?"s":"");
786 for (i = 0; i < reqall.nstations; i++) {
787 struct hostap_sta *info = &stas[i];
789 printf("%02x:%02x:%02x:%02x:%02x:%02x asid=%04x",
790 info->addr[0], info->addr[1], info->addr[2],
791 info->addr[3], info->addr[4], info->addr[5],
792 info->asid - 0xc001);
793 printb(", flags", info->flags, HOSTAP_FLAGS_BITS);
794 printb(", caps", info->capinfo, IEEE80211_CAPINFO_BITS);
795 printb(", rates", info->rates, WI_RATES_BITS);
797 printf(", sig=%d/%d",
798 info->sig_info >> 8, info->sig_info & 0xff);
805 wi_zerocache(const char *iface)
810 errx(1, "must specify interface name");
812 bzero((char *)&wreq, sizeof(wreq));
814 wreq.wi_type = WI_RID_ZERO_CACHE;
816 wi_getval(iface, &wreq);
820 wi_readcache(const char *iface)
824 struct wi_sigcache *sc;
829 errx(1, "must specify interface name");
831 bzero((char *)&wreq, sizeof(wreq));
832 wreq.wi_len = WI_MAX_DATALEN;
833 wreq.wi_type = WI_RID_READ_CACHE;
835 wi_getval(iface, &wreq);
837 wi_sigitems = (int *) &wreq.wi_val;
838 pt = ((char *) &wreq.wi_val);
840 sc = (struct wi_sigcache *) pt;
842 for (i = 0; i < *wi_sigitems; i++) {
843 printf("[%d/%d]:", i+1, *wi_sigitems);
844 printf(" %02x:%02x:%02x:%02x:%02x:%02x,",
851 printf(" %d.%d.%d.%d,",((sc->ipsrc >> 0) & 0xff),
852 ((sc->ipsrc >> 8) & 0xff),
853 ((sc->ipsrc >> 16) & 0xff),
854 ((sc->ipsrc >> 24) & 0xff));
855 printf(" sig: %d, noise: %d, qual: %d\n",
867 main(int argc, char *argv[])
870 const char *iface = NULL;
875 /* Get the interface name */
877 ch = getopt(argc, argv, "i:");
881 if (argc > 1 && *argv[1] != '-') {
892 while((ch = getopt(argc, argv,
893 "a:hoc:d:e:f:i:k:lp:r:q:t:n:s:m:v:F:LP:S:T:ZC")) != -1) {
899 printf("WICACHE not available\n");
907 printf("WICACHE not available\n");
916 wi_setword(iface, WI_RID_CREATE_IBSS, atoi(optarg));
920 wi_setword(iface, WI_RID_MAX_DATALEN, atoi(optarg));
924 wi_setword(iface, WI_RID_ENCRYPTION, atoi(optarg));
928 wi_setword(iface, WI_RID_OWN_CHNL, atoi(optarg));
932 wi_setword(iface, WI_RID_PROCFRAME, atoi(optarg));
942 wi_dumpstations(iface);
946 wi_setword(iface, WI_RID_PORTTYPE, atoi(optarg));
950 wi_setword(iface, WI_RID_RTS_THRESH, atoi(optarg));
954 wi_setword(iface, WI_RID_TX_RATE, atoi(optarg));
958 wi_setstr(iface, WI_RID_DESIRED_SSID, optarg);
962 wi_setstr(iface, WI_RID_NODENAME, optarg);
966 wi_sethex(iface, WI_RID_MAC_NODE, optarg);
970 wi_setstr(iface, WI_RID_OWN_SSID, optarg);
974 wi_setword(iface, WI_RID_MAX_SLEEP, atoi(optarg));
979 WI_RID_TX_CRYPT_KEY, atoi(optarg) - 1);
983 wi_setword(iface, WI_RID_PM_ENABLED, atoi(optarg));
987 wi_setword(iface, WI_RID_SYSTEM_SCALE, atoi(optarg));
991 modifier = atoi(optarg);
1005 wi_setkeys(iface, key, modifier);