svn commit: r217422 - in stable/8: sbin/ifconfig sys/net
Marius Strobl
marius at FreeBSD.org
Fri Jan 14 20:43:22 UTC 2011
Author: marius
Date: Fri Jan 14 20:43:21 2011
New Revision: 217422
URL: http://svn.freebsd.org/changeset/base/217422
Log:
MFC: r217013
Teach ifconfig(8) the handy shared option shortcut aliases the NetBSD
counterpart also takes, i.e. "fdx" for "full-duplex", "flow" for
"flowcontrol", "hdx" for "half-duplex" as well as "loop" and "loopback"
for "hw-loopback".
Modified:
stable/8/sbin/ifconfig/ifmedia.c
stable/8/sys/net/if_media.h
Directory Properties:
stable/8/sbin/ifconfig/ (props changed)
stable/8/sys/ (props changed)
stable/8/sys/amd64/include/xen/ (props changed)
stable/8/sys/cddl/contrib/opensolaris/ (props changed)
stable/8/sys/contrib/dev/acpica/ (props changed)
stable/8/sys/contrib/pf/ (props changed)
Modified: stable/8/sbin/ifconfig/ifmedia.c
==============================================================================
--- stable/8/sbin/ifconfig/ifmedia.c Fri Jan 14 20:30:17 2011 (r217421)
+++ stable/8/sbin/ifconfig/ifmedia.c Fri Jan 14 20:43:21 2011 (r217422)
@@ -425,6 +425,9 @@ static struct ifmedia_description ifm_su
static struct ifmedia_description ifm_shared_option_descriptions[] =
IFM_SHARED_OPTION_DESCRIPTIONS;
+static struct ifmedia_description ifm_shared_option_aliases[] =
+ IFM_SHARED_OPTION_ALIASES;
+
struct ifmedia_type_to_subtype {
struct {
struct ifmedia_description *desc;
@@ -433,7 +436,7 @@ struct ifmedia_type_to_subtype {
struct {
struct ifmedia_description *desc;
int alias;
- } options[3];
+ } options[4];
struct {
struct ifmedia_description *desc;
int alias;
@@ -452,6 +455,7 @@ static struct ifmedia_type_to_subtype if
},
{
{ &ifm_shared_option_descriptions[0], 0 },
+ { &ifm_shared_option_aliases[0], 1 },
{ &ifm_subtype_ethernet_option_descriptions[0], 0 },
{ NULL, 0 },
},
@@ -469,6 +473,7 @@ static struct ifmedia_type_to_subtype if
},
{
{ &ifm_shared_option_descriptions[0], 0 },
+ { &ifm_shared_option_aliases[0], 1 },
{ &ifm_subtype_tokenring_option_descriptions[0], 0 },
{ NULL, 0 },
},
@@ -486,6 +491,7 @@ static struct ifmedia_type_to_subtype if
},
{
{ &ifm_shared_option_descriptions[0], 0 },
+ { &ifm_shared_option_aliases[0], 1 },
{ &ifm_subtype_fddi_option_descriptions[0], 0 },
{ NULL, 0 },
},
@@ -503,6 +509,7 @@ static struct ifmedia_type_to_subtype if
},
{
{ &ifm_shared_option_descriptions[0], 0 },
+ { &ifm_shared_option_aliases[0], 1 },
{ &ifm_subtype_ieee80211_option_descriptions[0], 0 },
{ NULL, 0 },
},
@@ -522,6 +529,7 @@ static struct ifmedia_type_to_subtype if
},
{
{ &ifm_shared_option_descriptions[0], 0 },
+ { &ifm_shared_option_aliases[0], 1 },
{ &ifm_subtype_atm_option_descriptions[0], 0 },
{ NULL, 0 },
},
Modified: stable/8/sys/net/if_media.h
==============================================================================
--- stable/8/sys/net/if_media.h Fri Jan 14 20:30:17 2011 (r217421)
+++ stable/8/sys/net/if_media.h Fri Jan 14 20:43:21 2011 (r217422)
@@ -596,6 +596,15 @@ struct ifmedia_description {
{ 0, NULL }, \
}
+#define IFM_SHARED_OPTION_ALIASES { \
+ { IFM_FDX, "fdx" }, \
+ { IFM_HDX, "hdx" }, \
+ { IFM_FLOW, "flow" }, \
+ { IFM_LOOP, "loop" }, \
+ { IFM_LOOP, "loopback" }, \
+ { 0, NULL }, \
+}
+
/*
* Baudrate descriptions for the various media types.
*/
More information about the svn-src-stable-8
mailing list