2 * iwinfo - Wireless Information Library - Command line frontend
4 * Copyright (C) 2011 Jo-Philipp Wich <xm@subsignal.org>
6 * The iwinfo library is free software: you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License version 2
8 * as published by the Free Software Foundation.
10 * The iwinfo library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with the iwinfo library. If not, see http://www.gnu.org/licenses/.
25 static char * format_bssid(unsigned char *mac
)
29 snprintf(buf
, sizeof(buf
), "%02X:%02X:%02X:%02X:%02X:%02X",
30 mac
[0], mac
[1], mac
[2], mac
[3], mac
[4], mac
[5]);
35 static char * format_ssid(char *ssid
)
37 static char buf
[IWINFO_ESSID_MAX_SIZE
+3];
40 snprintf(buf
, sizeof(buf
), "\"%s\"", ssid
);
42 snprintf(buf
, sizeof(buf
), "unknown");
47 static char * format_channel(int ch
)
52 snprintf(buf
, sizeof(buf
), "unknown");
54 snprintf(buf
, sizeof(buf
), "%d", ch
);
59 static char * format_frequency(int freq
)
64 snprintf(buf
, sizeof(buf
), "unknown");
66 snprintf(buf
, sizeof(buf
), "%.3f GHz", ((float)freq
/ 1000.0));
71 static char * format_txpower(int pwr
)
76 snprintf(buf
, sizeof(buf
), "unknown");
78 snprintf(buf
, sizeof(buf
), "%d dBm", pwr
);
83 static char * format_quality(int qual
)
88 snprintf(buf
, sizeof(buf
), "unknown");
90 snprintf(buf
, sizeof(buf
), "%d", qual
);
95 static char * format_quality_max(int qmax
)
100 snprintf(buf
, sizeof(buf
), "unknown");
102 snprintf(buf
, sizeof(buf
), "%d", qmax
);
107 static char * format_signal(int sig
)
112 snprintf(buf
, sizeof(buf
), "unknown");
114 snprintf(buf
, sizeof(buf
), "%d dBm", sig
);
119 static char * format_noise(int noise
)
124 snprintf(buf
, sizeof(buf
), "unknown");
126 snprintf(buf
, sizeof(buf
), "%d dBm", noise
);
131 static char * format_rate(int rate
)
136 snprintf(buf
, sizeof(buf
), "unknown");
138 snprintf(buf
, sizeof(buf
), "%d.%d MBit/s",
139 rate
/ 1000, (rate
% 1000) / 100);
144 static char * format_enc_ciphers(int ciphers
)
146 static char str
[128] = { 0 };
149 if (ciphers
& IWINFO_CIPHER_WEP40
)
150 pos
+= sprintf(pos
, "WEP-40, ");
152 if (ciphers
& IWINFO_CIPHER_WEP104
)
153 pos
+= sprintf(pos
, "WEP-104, ");
155 if (ciphers
& IWINFO_CIPHER_TKIP
)
156 pos
+= sprintf(pos
, "TKIP, ");
158 if (ciphers
& IWINFO_CIPHER_CCMP
)
159 pos
+= sprintf(pos
, "CCMP, ");
161 if (ciphers
& IWINFO_CIPHER_CCMP256
)
162 pos
+= sprintf(pos
, "CCMP-256, ");
164 if (ciphers
& IWINFO_CIPHER_GCMP
)
165 pos
+= sprintf(pos
, "GCMP, ");
167 if (ciphers
& IWINFO_CIPHER_GCMP256
)
168 pos
+= sprintf(pos
, "GCMP-256, ");
170 if (ciphers
& IWINFO_CIPHER_WRAP
)
171 pos
+= sprintf(pos
, "WRAP, ");
173 if (ciphers
& IWINFO_CIPHER_AESOCB
)
174 pos
+= sprintf(pos
, "AES-OCB, ");
176 if (ciphers
& IWINFO_CIPHER_CKIP
)
177 pos
+= sprintf(pos
, "CKIP, ");
179 if (!ciphers
|| (ciphers
& IWINFO_CIPHER_NONE
))
180 pos
+= sprintf(pos
, "NONE, ");
187 static char * format_enc_suites(int suites
)
189 static char str
[64] = { 0 };
192 if (suites
& IWINFO_KMGMT_PSK
)
193 pos
+= sprintf(pos
, "PSK/");
195 if (suites
& IWINFO_KMGMT_8021x
)
196 pos
+= sprintf(pos
, "802.1X/");
198 if (suites
& IWINFO_KMGMT_SAE
)
199 pos
+= sprintf(pos
, "SAE/");
201 if (suites
& IWINFO_KMGMT_OWE
)
202 pos
+= sprintf(pos
, "OWE/");
204 if (!suites
|| (suites
& IWINFO_KMGMT_NONE
))
205 pos
+= sprintf(pos
, "NONE/");
212 static char * format_encryption(struct iwinfo_crypto_entry
*c
)
214 static char buf
[512];
220 snprintf(buf
, sizeof(buf
), "unknown");
225 if (c
->auth_algs
&& !c
->wpa_version
)
227 if ((c
->auth_algs
& IWINFO_AUTH_OPEN
) &&
228 (c
->auth_algs
& IWINFO_AUTH_SHARED
))
230 snprintf(buf
, sizeof(buf
), "WEP Open/Shared (%s)",
231 format_enc_ciphers(c
->pair_ciphers
));
233 else if (c
->auth_algs
& IWINFO_AUTH_OPEN
)
235 snprintf(buf
, sizeof(buf
), "WEP Open System (%s)",
236 format_enc_ciphers(c
->pair_ciphers
));
238 else if (c
->auth_algs
& IWINFO_AUTH_SHARED
)
240 snprintf(buf
, sizeof(buf
), "WEP Shared Auth (%s)",
241 format_enc_ciphers(c
->pair_ciphers
));
246 else if (c
->wpa_version
)
248 for (i
= 0, n
= 0; i
< 3; i
++)
249 if (c
->wpa_version
& (1 << i
))
253 pos
+= sprintf(pos
, "mixed ");
255 for (i
= 0; i
< 3; i
++)
256 if (c
->wpa_version
& (1 << i
))
258 pos
+= sprintf(pos
, "WPA%d/", i
+ 1);
260 pos
+= sprintf(pos
, "WPA/");
264 sprintf(pos
, " %s (%s)",
265 format_enc_suites(c
->auth_suites
),
266 format_enc_ciphers(c
->pair_ciphers
| c
->group_ciphers
));
270 snprintf(buf
, sizeof(buf
), "none");
275 snprintf(buf
, sizeof(buf
), "none");
281 static char * format_hwmodes(int modes
)
286 snprintf(buf
, sizeof(buf
), "unknown");
288 snprintf(buf
, sizeof(buf
), "802.11%s%s%s%s%s%s%s",
289 (modes
& IWINFO_80211_A
) ? "a" : "",
290 (modes
& IWINFO_80211_B
) ? "b" : "",
291 (modes
& IWINFO_80211_G
) ? "g" : "",
292 (modes
& IWINFO_80211_N
) ? "n" : "",
293 (modes
& IWINFO_80211_AC
) ? "ac" : "",
294 (modes
& IWINFO_80211_AD
) ? "ad" : "",
295 (modes
& IWINFO_80211_AX
) ? "ax" : "");
300 static char * format_assocrate(struct iwinfo_rate_entry
*r
)
308 snprintf(buf
, sizeof(buf
), "unknown");
312 p
+= snprintf(p
, l
, "%s", format_rate(r
->rate
));
313 l
= sizeof(buf
) - (p
- buf
);
317 p
+= snprintf(p
, l
, ", MCS %d, %dMHz", r
->mcs
, r
->mhz
);
318 l
= sizeof(buf
) - (p
- buf
);
322 p
+= snprintf(p
, l
, ", VHT-MCS %d, %dMHz", r
->mcs
, r
->mhz
);
323 l
= sizeof(buf
) - (p
- buf
);
327 p
+= snprintf(p
, l
, ", VHT-NSS %d", r
->nss
);
328 l
= sizeof(buf
) - (p
- buf
);
333 p
+= snprintf(p
, l
, ", HE-MCS %d, %dMHz", r
->mcs
, r
->mhz
);
334 l
= sizeof(buf
) - (p
- buf
);
336 p
+= snprintf(p
, l
, ", HE-NSS %d", r
->nss
);
337 l
= sizeof(buf
) - (p
- buf
);
339 p
+= snprintf(p
, l
, ", HE-GI %d", r
->he_gi
);
340 l
= sizeof(buf
) - (p
- buf
);
342 p
+= snprintf(p
, l
, ", HE-DCM %d", r
->he_dcm
);
343 l
= sizeof(buf
) - (p
- buf
);
350 static const char* format_chan_width(uint16_t width
)
353 case 20: return "20 MHz";
354 case 2040: return "40 MHz and upper or 20 MHz with intolerant bit";
355 case 40: return "40 MHz or lower";
356 case 80: return "80 MHz";
357 case 8080: return "80+80 MHz";
358 case 160: return "160 MHz";
365 static const char * print_type(const struct iwinfo_ops
*iw
, const char *ifname
)
367 const char *type
= iwinfo_type(ifname
);
368 return type
? type
: "unknown";
371 static char * print_hardware_id(const struct iwinfo_ops
*iw
, const char *ifname
)
374 struct iwinfo_hardware_id ids
;
376 if (!iw
->hardware_id(ifname
, (char *)&ids
))
378 snprintf(buf
, sizeof(buf
), "%04X:%04X %04X:%04X",
379 ids
.vendor_id
, ids
.device_id
,
380 ids
.subsystem_vendor_id
, ids
.subsystem_device_id
);
384 snprintf(buf
, sizeof(buf
), "unknown");
390 static char * print_hardware_name(const struct iwinfo_ops
*iw
, const char *ifname
)
392 static char buf
[128];
394 if (iw
->hardware_name(ifname
, buf
))
395 snprintf(buf
, sizeof(buf
), "unknown");
400 static char * print_txpower_offset(const struct iwinfo_ops
*iw
, const char *ifname
)
405 if (iw
->txpower_offset(ifname
, &off
))
406 snprintf(buf
, sizeof(buf
), "unknown");
408 snprintf(buf
, sizeof(buf
), "%d dB", off
);
410 snprintf(buf
, sizeof(buf
), "none");
415 static char * print_frequency_offset(const struct iwinfo_ops
*iw
, const char *ifname
)
420 if (iw
->frequency_offset(ifname
, &off
))
421 snprintf(buf
, sizeof(buf
), "unknown");
423 snprintf(buf
, sizeof(buf
), "%.3f GHz", ((float)off
/ 1000.0));
425 snprintf(buf
, sizeof(buf
), "none");
430 static char * print_ssid(const struct iwinfo_ops
*iw
, const char *ifname
)
432 char buf
[IWINFO_ESSID_MAX_SIZE
+1] = { 0 };
434 if (iw
->ssid(ifname
, buf
))
435 memset(buf
, 0, sizeof(buf
));
437 return format_ssid(buf
);
440 static char * print_bssid(const struct iwinfo_ops
*iw
, const char *ifname
)
442 static char buf
[18] = { 0 };
444 if (iw
->bssid(ifname
, buf
))
445 snprintf(buf
, sizeof(buf
), "00:00:00:00:00:00");
450 static char * print_mode(const struct iwinfo_ops
*iw
, const char *ifname
)
453 static char buf
[128];
455 if (iw
->mode(ifname
, &mode
))
456 mode
= IWINFO_OPMODE_UNKNOWN
;
458 snprintf(buf
, sizeof(buf
), "%s", IWINFO_OPMODE_NAMES
[mode
]);
463 static char * print_channel(const struct iwinfo_ops
*iw
, const char *ifname
)
466 if (iw
->channel(ifname
, &ch
))
469 return format_channel(ch
);
472 static char * print_center_chan1(const struct iwinfo_ops
*iw
, const char *ifname
)
475 if (iw
->center_chan1(ifname
, &ch
))
478 return format_channel(ch
);
481 static char * print_center_chan2(const struct iwinfo_ops
*iw
, const char *ifname
)
484 if (iw
->center_chan2(ifname
, &ch
))
487 return format_channel(ch
);
490 static char * print_frequency(const struct iwinfo_ops
*iw
, const char *ifname
)
493 if (iw
->frequency(ifname
, &freq
))
496 return format_frequency(freq
);
499 static char * print_txpower(const struct iwinfo_ops
*iw
, const char *ifname
)
502 if (iw
->txpower_offset(ifname
, &off
))
505 if (iw
->txpower(ifname
, &pwr
))
510 return format_txpower(pwr
);
513 static char * print_quality(const struct iwinfo_ops
*iw
, const char *ifname
)
516 if (iw
->quality(ifname
, &qual
))
519 return format_quality(qual
);
522 static char * print_quality_max(const struct iwinfo_ops
*iw
, const char *ifname
)
525 if (iw
->quality_max(ifname
, &qmax
))
528 return format_quality_max(qmax
);
531 static char * print_signal(const struct iwinfo_ops
*iw
, const char *ifname
)
534 if (iw
->signal(ifname
, &sig
))
537 return format_signal(sig
);
540 static char * print_noise(const struct iwinfo_ops
*iw
, const char *ifname
)
543 if (iw
->noise(ifname
, &noise
))
546 return format_noise(noise
);
549 static char * print_rate(const struct iwinfo_ops
*iw
, const char *ifname
)
552 if (iw
->bitrate(ifname
, &rate
))
555 return format_rate(rate
);
558 static char * print_encryption(const struct iwinfo_ops
*iw
, const char *ifname
)
560 struct iwinfo_crypto_entry c
= { 0 };
561 if (iw
->encryption(ifname
, (char *)&c
))
562 return format_encryption(NULL
);
564 return format_encryption(&c
);
567 static char * print_hwmodes(const struct iwinfo_ops
*iw
, const char *ifname
)
570 if (iw
->hwmodelist(ifname
, &modes
))
573 return format_hwmodes(modes
);
576 static char * print_mbssid_supp(const struct iwinfo_ops
*iw
, const char *ifname
)
581 if (iw
->mbssid_support(ifname
, &supp
))
582 snprintf(buf
, sizeof(buf
), "no");
584 snprintf(buf
, sizeof(buf
), "%s", supp
? "yes" : "no");
589 static char * print_phyname(const struct iwinfo_ops
*iw
, const char *ifname
)
593 if (!iw
->phyname(ifname
, buf
))
600 static void print_info(const struct iwinfo_ops
*iw
, const char *ifname
)
602 printf("%-9s ESSID: %s\n",
604 print_ssid(iw
, ifname
));
605 printf(" Access Point: %s\n",
606 print_bssid(iw
, ifname
));
607 printf(" Mode: %s Channel: %s (%s)\n",
608 print_mode(iw
, ifname
),
609 print_channel(iw
, ifname
),
610 print_frequency(iw
, ifname
));
611 if (iw
->center_chan1
!= NULL
) {
612 printf(" Center Channel 1: %s",
613 print_center_chan1(iw
, ifname
));
614 printf(" 2: %s\n", print_center_chan2(iw
, ifname
));
616 printf(" Tx-Power: %s Link Quality: %s/%s\n",
617 print_txpower(iw
, ifname
),
618 print_quality(iw
, ifname
),
619 print_quality_max(iw
, ifname
));
620 printf(" Signal: %s Noise: %s\n",
621 print_signal(iw
, ifname
),
622 print_noise(iw
, ifname
));
623 printf(" Bit Rate: %s\n",
624 print_rate(iw
, ifname
));
625 printf(" Encryption: %s\n",
626 print_encryption(iw
, ifname
));
627 printf(" Type: %s HW Mode(s): %s\n",
628 print_type(iw
, ifname
),
629 print_hwmodes(iw
, ifname
));
630 printf(" Hardware: %s [%s]\n",
631 print_hardware_id(iw
, ifname
),
632 print_hardware_name(iw
, ifname
));
633 printf(" TX power offset: %s\n",
634 print_txpower_offset(iw
, ifname
));
635 printf(" Frequency offset: %s\n",
636 print_frequency_offset(iw
, ifname
));
637 printf(" Supports VAPs: %s PHY name: %s\n",
638 print_mbssid_supp(iw
, ifname
),
639 print_phyname(iw
, ifname
));
643 static void print_scanlist(const struct iwinfo_ops
*iw
, const char *ifname
)
646 char buf
[IWINFO_BUFSIZE
];
647 struct iwinfo_scanlist_entry
*e
;
649 if (iw
->scanlist(ifname
, buf
, &len
))
651 printf("Scanning not possible\n\n");
656 printf("No scan results\n\n");
660 for (i
= 0, x
= 1; i
< len
; i
+= sizeof(struct iwinfo_scanlist_entry
), x
++)
662 e
= (struct iwinfo_scanlist_entry
*) &buf
[i
];
664 printf("Cell %02d - Address: %s\n",
666 format_bssid(e
->mac
));
667 printf(" ESSID: %s\n",
668 format_ssid(e
->ssid
));
669 printf(" Mode: %s Channel: %s\n",
670 IWINFO_OPMODE_NAMES
[e
->mode
],
671 format_channel(e
->channel
));
672 printf(" Signal: %s Quality: %s/%s\n",
673 format_signal(e
->signal
- 0x100),
674 format_quality(e
->quality
),
675 format_quality_max(e
->quality_max
));
676 printf(" Encryption: %s\n",
677 format_encryption(&e
->crypto
));
678 printf(" HT Operation:\n");
679 printf(" Primary Channel: %d\n",
680 e
->ht_chan_info
.primary_chan
);
681 printf(" Secondary Channel Offset: %s\n",
682 ht_secondary_offset
[e
->ht_chan_info
.secondary_chan_off
]);
683 printf(" Channel Width: %s\n",
684 format_chan_width(e
->ht_chan_info
.chan_width
));
686 if (e
->vht_chan_info
.center_chan_1
) {
687 printf(" VHT Operation:\n");
688 printf(" Channel Width: %s\n",
689 format_chan_width(e
->vht_chan_info
.chan_width
));
690 printf(" Center Frequency 1: %d\n",
691 e
->vht_chan_info
.center_chan_1
);
692 printf(" Center Frequency 2: %d\n",
693 e
->vht_chan_info
.center_chan_2
);
701 static void print_txpwrlist(const struct iwinfo_ops
*iw
, const char *ifname
)
703 int len
, pwr
, off
, i
;
704 char buf
[IWINFO_BUFSIZE
];
705 struct iwinfo_txpwrlist_entry
*e
;
707 if (iw
->txpwrlist(ifname
, buf
, &len
) || len
<= 0)
709 printf("No TX power information available\n");
713 if (iw
->txpower(ifname
, &pwr
))
716 if (iw
->txpower_offset(ifname
, &off
))
719 for (i
= 0; i
< len
; i
+= sizeof(struct iwinfo_txpwrlist_entry
))
721 e
= (struct iwinfo_txpwrlist_entry
*) &buf
[i
];
723 printf("%s%3d dBm (%4d mW)\n",
724 (pwr
== e
->dbm
) ? "*" : " ",
726 iwinfo_dbm2mw(e
->dbm
+ off
));
731 static void print_freqlist(const struct iwinfo_ops
*iw
, const char *ifname
)
734 char buf
[IWINFO_BUFSIZE
];
735 struct iwinfo_freqlist_entry
*e
;
737 if (iw
->freqlist(ifname
, buf
, &len
) || len
<= 0)
739 printf("No frequency information available\n");
743 if (iw
->channel(ifname
, &ch
))
746 for (i
= 0; i
< len
; i
+= sizeof(struct iwinfo_freqlist_entry
))
748 e
= (struct iwinfo_freqlist_entry
*) &buf
[i
];
750 printf("%s %s (Channel %s)%s\n",
751 (ch
== e
->channel
) ? "*" : " ",
752 format_frequency(e
->mhz
),
753 format_channel(e
->channel
),
754 e
->restricted
? " [restricted]" : "");
759 static void print_assoclist(const struct iwinfo_ops
*iw
, const char *ifname
)
762 char buf
[IWINFO_BUFSIZE
];
763 struct iwinfo_assoclist_entry
*e
;
765 if (iw
->assoclist(ifname
, buf
, &len
))
767 printf("No information available\n");
772 printf("No station connected\n");
776 for (i
= 0; i
< len
; i
+= sizeof(struct iwinfo_assoclist_entry
))
778 e
= (struct iwinfo_assoclist_entry
*) &buf
[i
];
780 printf("%s %s / %s (SNR %d) %d ms ago\n",
781 format_bssid(e
->mac
),
782 format_signal(e
->signal
),
783 format_noise(e
->noise
),
784 (e
->signal
- e
->noise
),
787 printf(" RX: %-38s %8d Pkts.\n",
788 format_assocrate(&e
->rx_rate
),
792 printf(" TX: %-38s %8d Pkts.\n",
793 format_assocrate(&e
->tx_rate
),
797 printf(" expected throughput: %s\n\n",
798 format_rate(e
->thr
));
803 static char * lookup_country(char *buf
, int len
, int iso3166
)
806 struct iwinfo_country_entry
*c
;
808 for (i
= 0; i
< len
; i
+= sizeof(struct iwinfo_country_entry
))
810 c
= (struct iwinfo_country_entry
*) &buf
[i
];
812 if (c
->iso3166
== iso3166
)
819 static void print_countrylist(const struct iwinfo_ops
*iw
, const char *ifname
)
822 char buf
[IWINFO_BUFSIZE
];
825 const struct iwinfo_iso3166_label
*l
;
827 if (iw
->countrylist(ifname
, buf
, &len
))
829 printf("No country code information available\n");
833 if (iw
->country(ifname
, curcode
))
834 memset(curcode
, 0, sizeof(curcode
));
836 for (l
= IWINFO_ISO3166_NAMES
; l
->iso3166
; l
++)
838 if ((ccode
= lookup_country(buf
, len
, l
->iso3166
)) != NULL
)
840 printf("%s %4s %c%c\n",
841 strncmp(ccode
, curcode
, 2) ? " " : "*",
842 ccode
, (l
->iso3166
/ 256), (l
->iso3166
% 256));
847 static void print_htmodelist(const struct iwinfo_ops
*iw
, const char *ifname
)
851 if (iw
->htmodelist(ifname
, &htmodes
))
853 printf("No HT mode information available\n");
857 for (i
= 0; i
< ARRAY_SIZE(IWINFO_HTMODE_NAMES
); i
++)
858 if (htmodes
& (1 << i
))
859 printf("%s ", IWINFO_HTMODE_NAMES
[i
]);
864 static void lookup_phy(const struct iwinfo_ops
*iw
, const char *section
)
866 char buf
[IWINFO_BUFSIZE
];
870 fprintf(stderr
, "Not supported\n");
874 if (iw
->lookup_phy(section
, buf
))
876 fprintf(stderr
, "Phy not found\n");
884 static void lookup_path(const struct iwinfo_ops
*iw
, const char *phy
)
888 if (!iw
->phy_path
|| iw
->phy_path(phy
, &path
) || !path
)
891 printf("%s\n", path
);
894 int main(int argc
, char **argv
)
898 const struct iwinfo_ops
*iw
;
901 if (argc
> 1 && argc
< 3)
905 " iwinfo <device> info\n"
906 " iwinfo <device> scan\n"
907 " iwinfo <device> txpowerlist\n"
908 " iwinfo <device> freqlist\n"
909 " iwinfo <device> assoclist\n"
910 " iwinfo <device> countrylist\n"
911 " iwinfo <device> htmodelist\n"
912 " iwinfo <backend> phyname <section>\n"
920 glob("/sys/class/net/*", 0, NULL
, &globbuf
);
922 for (i
= 0; i
< globbuf
.gl_pathc
; i
++)
924 p
= strrchr(globbuf
.gl_pathv
[i
], '/');
929 iw
= iwinfo_backend(++p
);
944 iw
= iwinfo_backend_by_name(argv
[1]);
948 fprintf(stderr
, "No such wireless backend: %s\n", argv
[1]);
953 if (!strcmp(argv
[2], "path")) {
954 lookup_path(iw
, argv
[3]);
960 lookup_phy(iw
, argv
[3]);
964 fprintf(stderr
, "Unknown command: %s\n", argv
[2]);
971 iw
= iwinfo_backend(argv
[1]);
975 fprintf(stderr
, "No such wireless device: %s\n", argv
[1]);
980 for (i
= 2; i
< argc
; i
++)
985 print_info(iw
, argv
[1]);
989 print_scanlist(iw
, argv
[1]);
993 print_txpwrlist(iw
, argv
[1]);
997 print_freqlist(iw
, argv
[1]);
1001 print_assoclist(iw
, argv
[1]);
1005 print_countrylist(iw
, argv
[1]);
1009 print_htmodelist(iw
, argv
[1]);
1013 fprintf(stderr
, "Unknown command: %s\n", argv
[i
]);