From owner-svn-src-all@FreeBSD.ORG Fri Jan 14 20:43:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 230C7106564A; Fri, 14 Jan 2011 20:43:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 10D518FC18; Fri, 14 Jan 2011 20:43:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0EKhLXP000415; Fri, 14 Jan 2011 20:43:21 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0EKhLrR000412; Fri, 14 Jan 2011 20:43:21 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101142043.p0EKhLrR000412@svn.freebsd.org> From: Marius Strobl Date: Fri, 14 Jan 2011 20:43:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217422 - in stable/8: sbin/ifconfig sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jan 2011 20:43:22 -0000 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. */