Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Jan 2011 20:43:21 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r217422 - in stable/8: sbin/ifconfig sys/net
Message-ID:  <201101142043.p0EKhLrR000412@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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.
  */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101142043.p0EKhLrR000412>