diff options
author | Hakan Olsson <ho@cvs.openbsd.org> | 2000-03-02 18:50:01 +0000 |
---|---|---|
committer | Hakan Olsson <ho@cvs.openbsd.org> | 2000-03-02 18:50:01 +0000 |
commit | 1aa9102ecf68743c7f0c3f4dd2e36caa54f996b5 (patch) | |
tree | c3bb7a35029c1e83e66b2f4eeb0296f5df57b04a /sbin | |
parent | b665a2f2115a23d394c199e71f6843e2b64c9f08 (diff) |
Fix; don't print settings with other options present. Slightly modify
the -o option handling. Modify manpage to match. (angelos@ ok)
Angelos also spotted that usage() still said 'wiconfig', not 'wicontrol'.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/wicontrol/wicontrol.8 | 21 | ||||
-rw-r--r-- | sbin/wicontrol/wicontrol.c | 21 |
2 files changed, 19 insertions, 23 deletions
diff --git a/sbin/wicontrol/wicontrol.8 b/sbin/wicontrol/wicontrol.8 index ab8652865a9..da397fe75ed 100644 --- a/sbin/wicontrol/wicontrol.8 +++ b/sbin/wicontrol/wicontrol.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: wicontrol.8,v 1.6 2000/02/03 00:53:59 angelos Exp $ +.\" $OpenBSD: wicontrol.8,v 1.7 2000/03/02 18:50:00 ho Exp $ .\" .\" Copyright (c) 1997, 1998, 1999 .\" Bill Paul <wpaul@ctr.columbia.edu> All rights reserved. @@ -70,10 +70,7 @@ drivers. Most of the parameters that can be changed relate to the IEEE 802.11 protocol which the WaveLAN implements. This includes the station name, whether the station is operating in ad-hoc (point to point) or BSS (service set) mode, and the network name of a service -set to join (IBSS) if BSS mode is enabled. The -.Nm -command can also be used to view the current settings of these paremeters -and to dump out the values of the card's statistics counters. +set to join (IBSS) if BSS mode is enabled. .Pp The .Ar iface @@ -81,18 +78,18 @@ argument given to .Nm should be the logical interface name associated with the WaveLAN/IEEE device (wi0, wi1, etc...). +.Pp +The +.Nm +command given without any additional flags retrieves the current card +settings from the driver and prints them out. .Sh OPTIONS The options are as follows: .Pp .Bl -tag -width Fl .It Fl o -Display the current settings of the specified WaveLAN/IEEE interface. -This retrieves the current card settings from the driver and prints them -out. Using the additional -.Fl o -flag will cause -.Nm -to print out the statistics counters instead of the card settings. +Display the statistics counters for the specified WaveLAN/IEEE +interface. .It Fl e Ar 0|1 Enable or disable WEP encryption. Permitted values are .Ar 0 diff --git a/sbin/wicontrol/wicontrol.c b/sbin/wicontrol/wicontrol.c index 6efa8d9b2ba..5364f523554 100644 --- a/sbin/wicontrol/wicontrol.c +++ b/sbin/wicontrol/wicontrol.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wicontrol.c,v 1.6 2000/02/26 23:36:28 ho Exp $ */ +/* $OpenBSD: wicontrol.c,v 1.7 2000/03/02 18:50:00 ho Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -66,7 +66,7 @@ static const char copyright[] = "@(#) Copyright (c) 1997, 1998, 1999\ Bill Paul. All rights reserved."; static const char rcsid[] = - "@(#) $Id: wicontrol.c,v 1.6 2000/02/26 23:36:28 ho Exp $"; + "@(#) $Id: wicontrol.c,v 1.7 2000/03/02 18:50:00 ho Exp $"; #endif static void wi_getval __P((char *, struct wi_req *)); @@ -593,7 +593,7 @@ static void usage(p) char *p; { fprintf(stderr, - "usage: wiconfig interface " + "usage: wicontrol interface " "[-o] [-t tx rate] [-n network name] [-s station name]\n" " [-e 0|1] [-k key [-v 1|2|3|4]] [-T 1|2|3|4]\n" " [-c 0|1] [-q SSID] [-p port type] [-a access point density]\n" @@ -633,7 +633,7 @@ int main(argc, argv) char *argv[]; { char *iface = NULL; - int ch, p, dumpstats = 0; + int ch, p, dumpstats = 0, dumpinfo = 1; if (argc > 1 && argv[1][0] != '-') { iface = argv[1]; @@ -648,7 +648,7 @@ int main(argc, argv) wi_opt[p].optarg = optarg; if (ch == 'T') /* key 1-4/0-3 kludge */ (*optarg)--; - ch = 0; + dumpinfo = ch = 0; } switch(ch) { case 0: @@ -679,17 +679,16 @@ int main(argc, argv) if (iface == NULL) usage(argv[0]); - if (dumpstats) { - wi_dumpstats(iface); - exit(0); - } - for (p = 0; wi_opt[p].key; p++) if (wi_opt[p].optarg != NULL) wi_opt[p].function(iface, wi_opt[p].wi_code, wi_opt[p].optarg); - wi_dumpinfo(iface); + if (dumpstats) + wi_dumpstats(iface); + + if (dumpinfo && !dumpstats) + wi_dumpinfo(iface); exit(0); } |