summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjason <jason@openbsd.org>1998-09-03 23:08:09 +0000
committerjason <jason@openbsd.org>1998-09-03 23:08:09 +0000
commit24279f7f297a75fcf105b9effc6acbf67f5aed0b (patch)
tree4a64480f54d8a96f49f8f17f8556398c94bea8b5
parenttypo (diff)
downloadwireguard-openbsd-24279f7f297a75fcf105b9effc6acbf67f5aed0b.tar.xz
wireguard-openbsd-24279f7f297a75fcf105b9effc6acbf67f5aed0b.zip
Documentation for ifmedia & updated ifconfig usage
-rw-r--r--sbin/ifconfig/ifconfig.880
-rw-r--r--sbin/ifconfig/ifconfig.c8
-rw-r--r--share/man/man4/Makefile6
-rw-r--r--share/man/man4/ifmedia.4190
-rw-r--r--share/man/man4/netintro.413
5 files changed, 279 insertions, 18 deletions
diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8
index d5374b14a94..9fd17bc60c8 100644
--- a/sbin/ifconfig/ifconfig.8
+++ b/sbin/ifconfig/ifconfig.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ifconfig.8,v 1.12 1998/08/29 21:11:06 deraadt Exp $
+.\" $OpenBSD: ifconfig.8,v 1.13 1998/09/03 23:08:09 jason Exp $
.\" $NetBSD: ifconfig.8,v 1.11 1996/01/04 21:27:29 pk Exp $
.\" $FreeBSD: ifconfig.8,v 1.16 1998/02/01 07:03:29 steve Exp $
.\"
@@ -35,7 +35,7 @@
.\"
.\" @(#)ifconfig.8 8.4 (Berkeley) 6/1/94
.\"
-.Dd June 1, 1994
+.Dd Sept 3, 1998
.Dt IFCONFIG 8
.Os BSD 4.2
.Sh NAME
@@ -53,9 +53,15 @@
.Ar interface
.Op Ar address_family
.Nm ifconfig
-.Fl a
+.Fl m
+.Ar interface
+.Op address_family
.Nm ifconfig
-.Fl A
+.Op Fl a | am
+.Op Ar address_family
+.Nm ifconfig
+.Op Fl A | Am
+.Op Ar address_family
.Sh DESCRIPTION
.Nm Ifconfig
is used to assign an address
@@ -183,6 +189,39 @@ of the destination.
IP encapsulation of
.Tn CLNP
packets is done differently.
+.It Cm media Ar type
+Set the media type of the interface to
+.Ar type .
+Some interfaces support the mutually exclusive use of one of several
+different physical media connectors. For example, a 10Mb/s Ethernet
+interface might support the use of either
+.Tn AUI
+or twisted pair connectors. Setting the media type to
+.Dq 10base5
+or
+.Dq AUI
+would change the currently active connector to the AUI port.
+Setting it to
+.Dq 10baseT
+or
+.Dq UTP
+would activate twisted pair. Refer to the interfaces' driver
+specific man page for a complete list of the available types.
+.It Cm mediaopt Ar opts
+Set the specified media options on the interface.
+.Ar opts
+is a comma delimited list of options to apply to the interface.
+Refer to the interfaces' driver specific man page for a complete
+list of available options.
+.It Fl mediaopt Ar opts
+Disable the specified media options on the interface.
+.It Cm instance Ar minst
+Set the media instance to
+.Ar minst .
+This is useful for devices which have multiple physical layer interfaces
+(PHYs). Setting the instance on such devices may not be strictly required
+by the network interface driver as the driver may take care of this
+automatically; see the driver's manual page for more information.
.It Cm metric Ar n
Set the routing metric of the interface to
.Ar n ,
@@ -286,15 +325,27 @@ when no optional parameters are supplied.
If a protocol family is specified,
ifconfig will report only the details specific to that protocol family.
.Pp
-The interface name
-.Fl a
-causes information on all interfaces to be displayed.
-The protocol family may be specified as well.
+Using
+.Fl a ,
+causes
+.Nm ifconfig
+to print information on all interfaces.
+The protocol family may be specified as well. Additionally, if
+.Fl am ,
+is used, interface media information is printed.
.Pp
-The interface name
+If
.Fl A
-causes full interface alias information for each interface to be
-displayed.
+is used, it causes full interface alias information for each interface to
+be displayed. If
+.Fl Am
+is used, interface media information is printed for all interfaces
+as well.
+.Pp
+If
+.Fl m
+followed by an interface name is specified, then the media information
+for that interface will be printed.
.Pp
Only the super-user may modify the configuration of a network interface.
.Pp
@@ -310,12 +361,19 @@ Assign the ipx(3) address of 12625920 specified in decimal to interface fxp0.
.It Cm ifconfig fxp0 atalk 39108.128 range 39107-39109 phase 2
Assign the AppleTalk network 39108 and server node 128 with a network
range of 39107-39109 to interface fxp0 on a phase 2 AppleTalk network.
+.Pp
+.It Cm ifconfig xl0 media 10baseT
+Configure the xl0 interface to use 10baseT.
+.Pp
+.It Cm ifconfig xl0 media 100baseT mediaopt full-duplex
+Configure the xl0 interface to use 100baseT, full duplex.
.El
.Sh DIAGNOSTICS
Messages indicating the specified interface does not exist, the
requested address is unknown, or the user is not privileged and
tried to alter an interface's configuration.
.Sh SEE ALSO
+.Xr ifmedia 4 ,
.Xr netstat 1 ,
.Xr netintro 4 ,
.Xr rc 8 ,
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index b40c780a50a..de8c5af4511 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ifconfig.c,v 1.19 1998/09/03 06:24:18 jason Exp $ */
+/* $OpenBSD: ifconfig.c,v 1.20 1998/09/03 23:08:09 jason Exp $ */
/* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */
/*
@@ -81,7 +81,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)ifconfig.c 8.2 (Berkeley) 2/16/94";
#else
-static char rcsid[] = "$OpenBSD: ifconfig.c,v 1.19 1998/09/03 06:24:18 jason Exp $";
+static char rcsid[] = "$OpenBSD: ifconfig.c,v 1.20 1998/09/03 23:08:09 jason Exp $";
#endif
#endif /* not lint */
@@ -1557,10 +1557,12 @@ usage()
fprintf(stderr, "usage: ifconfig interface\n%s",
"\t[ [af] [ address [ dest_addr ] ] [ up ] [ down ] "
"[ netmask mask ] ]\n"
+ "\t[media media_type] [mediaopt media_option]\n"
"\t[ metric n ]\n"
"\t[ arp | -arp ]\n"
"\t[ -802.2 | -802.3 | -802.2tr | -snap | -EtherII ]\n"
"\t[ link0 | -link0 ] [ link1 | -link1 ] [ link2 | -link2 ]\n"
- " ifconfig [-a | -A] [ af ]\n");
+ " ifconfig [-a | -A | -am | -Am] [ af ]\n"
+ " ifconfig -m interface [af]\n");
exit(1);
}
diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile
index b0e04e23c82..4aab50178bb 100644
--- a/share/man/man4/Makefile
+++ b/share/man/man4/Makefile
@@ -1,10 +1,10 @@
-# $OpenBSD: Makefile,v 1.41 1998/08/25 02:50:57 millert Exp $
+# $OpenBSD: Makefile,v 1.42 1998/09/03 23:08:10 jason Exp $
# $NetBSD: Makefile,v 1.22.4.2 1996/07/18 00:51:10 jtc Exp $
MAN= atalk.4 audio.4 acd.4 ahc.4 bpf.4 ccd.4 cd.4 ch.4 clnp.4 cltp.4 ddb.4 \
de.4 drum.4 eap.4 esis.4 fd.4 ffs_softupdates.4 fpa.4 fxp.4 icmp.4 \
- idp.4 imp.4 inet.4 ip.4 ipl.4 ipsec.4 isapnp.4 iso.4 isp.4 ksyms.4 \
- lkm.4 lo.4 mtio.4 ncr.4 netintro.4 ns.4 \
+ idp.4 ifmedia.4 imp.4 inet.4 ip.4 ipl.4 ipsec.4 isapnp.4 iso.4 isp.4 \
+ ksyms.4 lkm.4 lo.4 mtio.4 ncr.4 netintro.4 ns.4 \
nsip.4 null.4 options.4 pty.4 random.4 route.4 scsi.4 sd.4 sl.4 \
spp.4 st.4 sv.4 \
tb.4 tcp.4 termios.4 tty.4 tp.4 tun.4 udp.4 uk.4 unix.4 vnd.4 wd.4 ym.4
diff --git a/share/man/man4/ifmedia.4 b/share/man/man4/ifmedia.4
new file mode 100644
index 00000000000..edf791e6f83
--- /dev/null
+++ b/share/man/man4/ifmedia.4
@@ -0,0 +1,190 @@
+.\" $OpenBSD: ifmedia.4,v 1.1 1998/09/03 23:08:10 jason Exp $
+.\" $NetBSD: ifmedia.4,v 1.1 1998/08/09 00:37:17 thorpej Exp $
+.\"
+.\" Copyright (c) 1998 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
+.\" NASA Ames Research Center.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the NetBSD
+.\" Foundation, Inc. and its contributors.
+.\" 4. Neither the name of The NetBSD Foundation nor the names of its
+.\" contributors may be used to endorse or promote products derived
+.\" from this software without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd August 8, 1998
+.Dt IFMEDIA 4
+.Os OpenBSD
+.Sh NAME
+.Nm ifmedia
+.Nd network interface media settings
+.Sh SYNOPSIS
+.Fd #include <sys/socket.h>
+.Fd #include <net/if.h>
+.Fd #include <net/if_media.h>
+.Sh DESCRIPTION
+The
+.Nm
+interface provides a consistent method for querying and setting
+network inerface media and media options. The media is typically
+set using the
+.Xr ifconfig 8
+command.
+.Pp
+There are currently three link types supported by
+.Nm Ns :
+.Bl -tag -offset indent -width IFM_ETHER
+.It IFM_ETHER
+Ethernet
+.It IFM_TOKEN
+Token Ring
+.It IFM_FDDI
+FDDI
+.El
+.Pp
+The following sections describe the possible media settings for each
+link type. Not all of these are supported by every device; refer to
+your device's manual page for more information.
+.Pp
+The lists below provide the possible names of each media type or option.
+The first name in the list is the canonical name of the media type or
+option. Additional names are acceptable aliases for the media type or
+option.
+.Sh COMMON MEDIA TYPES AND OPTIONS
+The followng media types are shared by all link types:
+.Bl -tag -offset indent -width IFM_MANUAL
+.It IFM_AUTO
+Autoselect the best media. [autoselect, auto]
+.It IFM_MANUAL
+Jumper or switch on device selects media. [manual]
+.It IFM_NONE
+Deselect all media. [none]
+.El
+.Pp
+The following media options are shared by all link types:
+.Bl -tag -offset indent -width IFM_FLAG0
+.It IFM_FDX
+Place the device into full-duplex mode. This option only has meaning
+if the device is normally not full-duplex. [full-duplex, fdx]
+.It IFM_HDX
+Place the device into half-duplex mode. This option only has meaning
+if the device is normally not half-duplex. [half-duplex, hdx]
+.It IFM_FLAG0
+Driver-defined flag. [flag0]
+.It IFM_FLAG1
+Driver-defined flag. [flag1]
+.It IFM_FLAG2
+Driver-defined flag. [flag2]
+.It IFM_LOOP
+Place the device into hardware loopback mode. [loopback, hw-loopback, loop]
+.El
+.Sh MEDIA TYPES AND OPTIONS FOR ETHERNET
+The following media types are defined for Ethernet:
+.Bl -tag -offset indent -width IFM_1000_FX
+.It IFM_10_T
+10baseT, 10Mb/s over unshielded twisted pair, RJ45 connector. [10baseT,
+UTP, 10UTP]
+.It IFM_10_2
+10base2, 10Mb/s over coaxial cable, BNC connector, also called Thinnet.
+[10base2, BNC, 10BNC]
+.It IFM_10_5
+10base5, 10Mb/s over 15-wire cables, DB15 connector, also called AUI.
+[10base5, AUI, 10AUI]
+.It IFM_100_TX
+100baseTX, 100Mb/s over unshielded twisted pair, RJ45 connector. [100baseTX,
+100TX]
+.It IFM_100_FX
+100baseFX, 100Mb/s over fiber optic cables. [100baseFX, 100FX]
+.It IFM_100_T4
+100baseT4, 100Mb/s over 4-wire (category 3) unshielded twisted pair, RJ45
+connector. [100baseT4, 100T4]
+.It IFM_100_VG
+100baseVG AnyLAN. [100baseVG, 100VG]
+.It IFM_100_T2
+100baseT2. [100baseT2, 100T2]
+.It IFM_1000_FX
+1000baseFX, 1Gb/s over fiber optic cables. [1000baseFX, 1000FX]
+.It IFM_10_STP
+10baseSTP, 10Mb/s over shielded twisted pair, DB9 connector. [10baseSTP,
+STP, 10STP]
+.It IFM_10_FL
+10baseFL, 10Mb/s over fiber optic cables. [10baseFL, FL, 10FL]
+.El
+.Pp
+There are no link type-specific options defined for Ethernet.
+.Sh MEDIA TYPES AND OPTIONS FOR TOKEN RING
+The following media types are defined for Token Ring:
+.Bl -tag -offset indent -width IFM_TOK_UTP16
+.It IFM_TOK_STP4
+4Mb/s, shielded twisted pair, DB9 connector. [DB9/4Mbit, 4STP]
+.It IFM_TOK_STP16
+16Mb/s, shielded twisted pair, DB9 connector. [DB9/16Mbit, 16STP]
+.It IFM_TOK_UTP4
+4Mb/s, unshielded twisted pair, RJ45 connector. [UTP/4Mbit, 4UTP]
+.It IFM_TOK_UTP16
+16Mb/s, unshielded twisted pair, RJ45 connector. [UTP/16Mbit, 16UTP]
+.El
+.Pp
+The following media options are defined for Token Ring:
+.Bl -tag -offset indent -width IFM_TOK_SRCRT
+.It IFM_TOK_ETR
+Early token release. [EarlyTokenRelease, ETR]
+.It IFM_TOK_SRCRT
+Enable source routing features. [SourceRouting, SRCRT]
+.It IFM_TOK_ALLR
+All routes vs. single route broadcast. [AllRoutes, ALLR]
+.El
+.Sh MEDIA TYPES AND OPTIONS FOR FDDI
+The following media types are defined for FDDI:
+.Bl -tag -offset indent -width IFM_FDDI_SMF
+.It IFM_FDDI_SMF
+Single-mode fiber. [Single-mode, SMF]
+.It IFM_FDDI_MMF
+Multi-mode fiber. [Multi-mode, MMF]
+.It IFM_FDDI_UTP
+Unshielded twisted pair, RJ45 connector. [UTP, CDDI]
+.El
+.Pp
+The following media options are defined for FDDI:
+.Bl -tag -offset indent -width IFM_FDDI_DA
+.It IFM_FDDI_DA
+Dual-attached station vs. Single-attached station. [dual-attach, das]
+.El
+.Sh SEE ALSO
+.Xr ifconfig 8 ,
+.Xr netintro 4
+.Sh HISTORY
+The
+.Nm
+interface first appeared in
+.Bsx 3.0 .
+The implementation that appeared in
+.Nx 1.3
+was written by Jonathan Stone and Jason R. Thorpe to be compatible with
+the BSDI API. It has since gone through several revisions which have
+extended the API while maintaining backwards compatibility with the
+original API.
diff --git a/share/man/man4/netintro.4 b/share/man/man4/netintro.4
index f48ccf4d7e9..d1692eb6933 100644
--- a/share/man/man4/netintro.4
+++ b/share/man/man4/netintro.4
@@ -1,3 +1,4 @@
+.\" $OpenBSD: netintro.4,v 1.7 1998/09/03 23:08:10 jason Exp $
.\" $NetBSD: netintro.4,v 1.4 1995/10/19 08:03:40 jtc Exp $
.\"
.\" Copyright (c) 1983, 1990, 1991, 1993
@@ -33,7 +34,7 @@
.\"
.\" @(#)netintro.4 8.2 (Berkeley) 11/30/93
.\"
-.Dd November 30, 1993
+.Dd Sept 3, 1994
.Dt NETINTRO 4
.Os BSD 4.2
.Sh NAME
@@ -208,6 +209,7 @@ struct ifreq {
#define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
#define ifr_flags ifr_ifru.ifru_flags /* flags */
#define ifr_metric ifr_ifru.ifru_metric /* metric */
+#define ifr_media ifr_ifru.ifru_metric /* media options (overload) */
#define ifr_data ifr_ifru.ifru_data /* for use by interface */
};
.Ed
@@ -245,6 +247,14 @@ some interfaces may be reset so that incoming packets are no longer received.
When marked up again, the interface is reinitialized.
.It Dv SIOCGIFFLAGS
Get interface flags.
+.It Dv SIOCSIFMEDIA
+Set interface media. See
+.Xr ifmedia 4
+for possible values.
+.It Dv SIOCGIFMEDIA
+Get interface media. See
+.Xr ifmedia 4
+for interpretting this value.
.It Dv SIOCSIFMETRIC
Set interface routing metric.
The metric is used only by user-level routers.
@@ -338,6 +348,7 @@ struct ifconf {
.Xr ioctl 2 ,
.Xr intro 4 ,
.Xr config 8 ,
+.Xr ifmedia 4 ,
.Xr routed 8
.Sh HISTORY
The