Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/wiconfig bring over WEP mode from FreeBSD/OpenBSD



details:   https://anonhg.NetBSD.org/src/rev/74e2457ed9f6
branches:  trunk
changeset: 481710:74e2457ed9f6
user:      explorer <explorer%NetBSD.org@localhost>
date:      Fri Feb 04 07:59:45 2000 +0000

description:
bring over WEP mode from FreeBSD/OpenBSD

diffstat:

 usr.sbin/wiconfig/wiconfig.8 |  136 ++++++++++++----------
 usr.sbin/wiconfig/wiconfig.c |  259 +++++++++++++++++++++++++++++++++++++++---
 2 files changed, 309 insertions(+), 86 deletions(-)

diffs (truncated from 648 to 300 lines):

diff -r d3c4ec96f11a -r 74e2457ed9f6 usr.sbin/wiconfig/wiconfig.8
--- a/usr.sbin/wiconfig/wiconfig.8      Fri Feb 04 07:59:20 2000 +0000
+++ b/usr.sbin/wiconfig/wiconfig.8      Fri Feb 04 07:59:45 2000 +0000
@@ -1,3 +1,5 @@
+.\"    $NetBSD: wiconfig.8,v 1.4 2000/02/04 07:59:45 explorer Exp $
+.\"
 .\" Copyright (c) 1997, 1998, 1999
 .\"    Bill Paul <wpaul%ctr.columbia.edu@localhost> All rights reserved.
 .\"
@@ -28,50 +30,43 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 .\" THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\"    $Id: wiconfig.8,v 1.3 1999/07/15 14:31:52 sommerfeld Exp $
+.\"    From: wicontrol.8,v 1.6 1999/05/22 16:12:47 wpaul Exp $
 .\"
 .Dd April 21, 1999
 .Dt WICONFIG 8
-.Os NetBSD 1.5
+.Os
 .Sh NAME
 .Nm wiconfig
 .Nd configure WaveLAN/IEEE devices
 .Sh SYNOPSIS
 .Nm wiconfig
-.Fl i Ar iface Op Fl o
-.Nm wiconfig
-.Fl i Ar iface Fl t Ar tx rate
-.Nm wiconfig
-.Fl i Ar iface Fl n Ar network name
-.Nm wiconfig
-.Fl i Ar iface Fl s Ar station name
-.Nm wiconfig
-.Fl i Ar iface Fl c Ar 0|1
-.Nm wiconfig
-.Fl i Ar iface Fl q Ar SSID
-.Nm wiconfig
-.Fl i Ar iface Fl p Ar port type
-.Nm wiconfig
-.Fl i Ar iface Fl a Ar access point density
-.Nm wiconfig
-.Fl i Ar iface Fl m Ar mac address
-.Nm wiconfig
-.Fl i Ar iface Fl d Ar max data length
-.Nm wiconfig
-.Fl i Ar iface Fl r Ar RTS threshold
-.Nm wiconfig
-.Fl i Ar iface Fl f Ar frequency
-.Nm wiconfig
-.Fl i Ar iface Fl P Ar 0|1
-.Nm wiconfig
-.Fl i Ar iface Fl S Ar max_sleep_duration
+.Ar interface
+.Op Fl o
+.Op Fl e Ar 0|1
+.Op Fl k Ar key "[ -v 1|2|3|4 ]"
+.Op Fl t Ar tx rate
+.Op Fl n Ar network name
+.Op Fl s Ar station name
+.Op Fl c Ar 0|1
+.Op Fl q Ar SSID
+.Op Fl p Ar port type
+.Op Fl a Ar access point density
+.Op Fl m Ar MAC address
+.Op Fl d Ar max data length
+.Op Fl r Ar RTS threshold
+.Op Fl f Ar frequency
+.Op Fl P Ar 0|1
+.Op Fl S Ar max sleep duration
+.Op Fl T Ar 1|2|3|4
 .Sh DESCRIPTION
 The
 .Nm
 command controls the operation of WaveLAN/IEEE wireless networking
 devices via the
 .Xr wi 4
-driver. Most of the parameters that can be changed relate to the
+and
+.Xr awi 4
+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
@@ -88,16 +83,41 @@
 device (wi0, wi1, etc...).
 .Sh OPTIONS
 The options are as follows:
+.Pp
 .Bl -tag -width Fl
-.It Fl i Ar iface Op Fl o
+.It Fl o
 Display the current settings of the specified WaveLAN/IEEE interface.
-This retrives the current card settings from the driver and prints them
+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.
-.It Fl i Ar iface Fl t Ar tx rate
+.It Fl e Ar 0|1
+Enable or disable WEP encryption. Permitted values are
+.Ar 0
+(encryption disabled) or
+.Ar 1
+(encryption enabled). Encryption is off by default.
+.It Fl k Ar key "[ -v 1|2|3|4 ]"
+Set WEP encryption keys. There are four default encryption keys that can be
+programmed. A specific key can be set using the
+.Fl v
+flag. If the
+.Fl v
+flag is not specified, the first key will be set. Encryption keys can either
+be normal text (i.e., "hello") or a series of hexadecimal digits
+(i.e., "0x1234512345"). For WaveLAN Silver cards, the key is
+restricted to 40 bits, hence the key can be either a 5-character text string
+or 10 hexadecimal digits. For WaveLAN Gold cards, the key can be up to
+112 bits, which means the key can be specified as either a 14-character
+text string or 28 hexadecimal digits.  (The card claims to be 128-bit RC4,
+but you can only send 112 bits to the driver.  Strange, I wonder where the
+other 16 bits come from, and what they are.)
+.It Fl T Ar 1|2|3|4
+Specify which of the four WEP encryption keys will be used to encrypt
+transmitted packets.
+.It Fl t Ar tx rate
 Set the transmit rate of the specified interface. The legal values
 for the transmit rate vary depending on whether the interface is a
 standard WaveLAN/IEEE or a WaveLAN/IEEE Turbo adapter. The standard
@@ -114,44 +134,38 @@
 5      Fixed High (6Mbps)
 6      Auto Rate Select (Standard)
 7      Auto Rate Select (Medium)
+11     Fixed Turbo (11Mbps)
 .El
 .Ed
 .Pp
 The standard NICs support only settings 1 through 3. Turbo NICs support
 all the above listed speed settings.
 The default driver setting is 3 (auto rate select).
-.It Fl i Ar iface Fl n Ar network name
+.It Fl n Ar network name
 Set the name of the service set (IBSS) that this station wishes to
 join. The
 .Ar network name
 can be any text string up to 30 characters in length. The default name
-is the empty string, which should allow the station to connect to the
-first available access point.  
-Use 
-.Fl n Ar ''
-to specify an empty network name.
-The interface should be set for BSS mode using
+is the empty string which should allow the station to connect to the first
+available access point. The interface should be set for BSS mode using
 the
 .Fl p
 flag in order for this to work.
-.Pp
-Note that some other drivers may use the string "ANY" to reflect this
-in the driver's user interface.
-.It Fl i Ar iface Fl s Ar station name
+.It Fl s Ar station name
 Sets the
 .Ar station name
 for the specified interface. The
 .Ar station name
 is used for diagnostic purposes. The Lucent WaveMANAGER sofware can
 poll the names of remote hosts.
-.It Fl i Ar iface Fl c Ar 0|1
+.It Fl c Ar 0|1
 Allow the station to create a service set (IBSS). Permitted values
 are 0 (don't create IBSS) and 1 (enable creation of IBSS). The default
 is 0.
 .Pp
 Note: this option is provided for experimental purposes only: enabling
 the creation of an IBSS on a host system doesn't appear to actually work.
-.It Fl i Ar iface Fl q Ar SSID
+.It Fl q Ar SSID
 Specify the name of an IBSS (SSID) to create on a given interface.
 The
 .Ar SSID
@@ -159,39 +173,39 @@
 .Pp
 Note: this option is provided for experimental purposes only: enabling
 the creation of an IBSS on a host system doesn't appear to actually work.
-.It Fl i Ar iface Fl p Ar port type
+.It Fl p Ar port type
 Set the
 .Ar port type
 for a specified interface. The legal values for
 .Ar port type
 are 1 (BSS mode) and 3 (ad-hoc) mode. In ad-hoc mode, the station can
-comminicate directly with any other stations within direct radio range
+communicate directly with any other stations within direct radio range
 (provided that they are also operating in ad-hoc mode). In BSS mode,
 hosts must associate with a service set controlled by an access point,
 which relays traffic between end stations. The default setting is 3
 (ad-hoc mode).
-.It Fl i Ar iface Fl a Ar access_point_density
+.It Fl a Ar access_point_density
 Specify the
 .Ar access point density
 for a given interface. Legal values are 1 (low), 2 (medium) and 3 (high).
 This setting influences some of the radio modem threshold settings.
-.It Fl i Ar iface Fl m Ar mac address
+.It Fl m Ar MAC address
 Set the station address for the specified interface. The
-.Ar mac address
+.Ar MAC address
 is specified as a series of six hexadecimal values separated by colons,
 e.g.: 00:60:1d:12:34:56. This programs the new address into the card
 and updates the interface as well.
-.It Fl i Ar iface Fl d Ar max_data_length
+.It Fl d Ar max_data_length
 Set the maximum receive and transmit frame size for a specified interface.
 The
 .Ar max data length
 can be any number from 350 to 2304. The default is 2304.
-.It Fl i Ar iface Fl r Ar RTS threshold
+.It Fl r Ar RTS threshold
 Set the RTS/CTS threshold for a given interface. This controls the
-number of bytes used for the RTS/CTS handhake boundary. The
+number of bytes used for the RTS/CTS handshake boundary. The
 .Ar RTS threshold
 can be any value between 0 and 2047. The default is 2347.
-.It Fl i Ar iface Fl f Ar frequency
+.It Fl f Ar frequency
 Set the radio frequency of a given interface. The
 .Ar frequency
 should be specfied as a channel ID as shown in the table below. The
@@ -225,7 +239,7 @@
 channel is 11. For NICs sold in Japan, the only available channel is 14.
 Note that two stations must be set to the same channel in order to
 communicate.
-.It Fl i Ar iface Fl P Ar 0|1
+.It Fl P Ar 0|1
 Enable or disable power management on a given interface. Enabling
 power management uses an alternating sleep/wake protocol to help
 conserve power on mobile stations, at the cost of some increased
@@ -236,25 +250,21 @@
 later, and in WaveLAN PCMCIA adapter firmware 2.00 or later. Older
 revisions will silently ignore the power management setting. Legal
 values for this parameter are 0 (off) and 1 (on).
-.It Fl i Ar iface Fl S Ar max_sleep_interval
+.It Fl S Ar max sleep interval
 Specify the sleep interval to use when power management is enabled.
 The
 .Are max sleep interval
 is specified in milliseconds. The default is 100.
 .El
 .Sh SEE ALSO
+.Xr awi 4 ,
 .Xr wi 4 ,
 .Xr ifconfig 8
 .Sh HISTORY
 The
 .Nm
 command first appeared in
-.Fx 3.0 ,
-as
-.Xr wicontrol 8 .
-It was added to
-.Nx 1.5 
-under its present name.
+.Fx 3.0 .
 .Sh AUTHOR
 The
 .Nm
diff -r d3c4ec96f11a -r 74e2457ed9f6 usr.sbin/wiconfig/wiconfig.c
--- a/usr.sbin/wiconfig/wiconfig.c      Fri Feb 04 07:59:20 2000 +0000
+++ b/usr.sbin/wiconfig/wiconfig.c      Fri Feb 04 07:59:45 2000 +0000
@@ -29,7 +29,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
- *     $Id: wiconfig.c,v 1.1 1999/07/14 22:33:34 sommerfeld Exp $
+ *     $Id: wiconfig.c,v 1.2 2000/02/04 07:59:45 explorer Exp $
  */
 
 #include <sys/types.h>
@@ -40,12 +40,24 @@
 #include <sys/socket.h>
 
 #include <net/if.h>
-#include <net/if_ether.h>
+#ifdef __FreeBSD__
+#include <net/if_var.h>
+#include <net/ethernet.h>
 
+#include <machine/if_wavelan_ieee.h>
+#else
+#include <netinet/in.h>
+#include <netinet/if_ether.h>
+#ifdef __NetBSD__
 #include <dev/pcmcia/if_wi_ieee.h>
+#else
+#include <dev/pcmcia/if_wavelan_ieee.h>
+#endif
+#endif
 
 #include <stdio.h>



Home | Main Index | Thread Index | Old Index