From owner-svn-src-head@FreeBSD.ORG Sat Sep 12 23:01:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B914C1065679; Sat, 12 Sep 2009 23:01:36 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CF0C8FC16; Sat, 12 Sep 2009 23:01:36 +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 n8CN1aFS000200; Sat, 12 Sep 2009 23:01:36 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8CN1aj6000198; Sat, 12 Sep 2009 23:01:36 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <200909122301.n8CN1aj6000198@svn.freebsd.org> From: Hiroki Sato Date: Sat, 12 Sep 2009 23:01:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197147 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Sep 2009 23:01:36 -0000 Author: hrs Date: Sat Sep 12 23:01:36 2009 New Revision: 197147 URL: http://svn.freebsd.org/changeset/base/197147 Log: Add missing comments and whitespace clean-ups. Modified: head/etc/network.subr Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Sat Sep 12 23:00:01 2009 (r197146) +++ head/etc/network.subr Sat Sep 12 23:01:36 2009 (r197147) @@ -31,8 +31,8 @@ # # ifn_start ifn -# Bring up and configure an interface. If some configuration is applied -# print the interface configuration. +# Bring up and configure an interface. If some configuration is +# applied print the interface configuration. # ifn_start() { @@ -53,8 +53,8 @@ ifn_start() } # ifn_stop ifn -# Shutdown and de-configure an interface. If action is taken print the -# interface name. +# Shutdown and de-configure an interface. If action is taken +# print the interface name. # ifn_stop() { @@ -176,11 +176,11 @@ ifconfig_down() } # get_if_var if var [default] -# Return the value of the pseudo-hash corresponding to $if where -# $var is a string containg the sub-string "IF" which will be -# replaced with $if after the characters defined in _punct are -# replaced with '_'. If the variable is unset, replace it with -# $default if given. +# Return the value of the pseudo-hash corresponding to $if where +# $var is a string containg the sub-string "IF" which will be +# replaced with $if after the characters defined in _punct are +# replaced with '_'. If the variable is unset, replace it with +# $default if given. get_if_var() { local _if _punct _var _default prefix suffix @@ -463,7 +463,7 @@ ifexists() } # ipv4_up if -# add IPv4 addresses to the interface $if +# add IPv4 addresses to the interface $if ipv4_up() { local _if _ret @@ -500,7 +500,7 @@ ipv6_up() } # ipv4_down if -# remove IPv4 addresses from the interface $if +# remove IPv4 addresses from the interface $if ipv4_down() { local _if _ifs _ret inetList oldifs _inet @@ -568,10 +568,10 @@ ipv6_down() } # ipv4_addrs_common if action -# Evaluate the ifconfig_if_ipv4 arguments for interface $if -# and use $action to add or remove IPv4 addresses from $if. +# Evaluate the ifconfig_if_ipv4 arguments for interface $if and +# use $action to add or remove IPv4 addresses from $if. ipv4_addrs_common() -{ +{ local _ret _if _action _cidr _cidr_addr local _ipaddr _netmask _range _ipnet _iplow _iphigh _ipcount _ret=1 @@ -652,7 +652,7 @@ ifalias_ipv4_up() break ;; esac - alias=$((${alias} + 1)) + alias=$((${alias} + 1)) done return $_ret @@ -701,7 +701,7 @@ ifalias_ipv6_up() return $_ret } -#ifalias_down if af +# ifalias_down if af # Remove aliases for network interface $if. # It returns 0 if at least one alias was removed or # 1 if there were none. @@ -723,7 +723,7 @@ ifalias_down() return $_ret } -#ifalias_ipv4_down if +# ifalias_ipv4_down if # Helper function for ifalias_down(). Handles IPv4. # ifalias_ipv4_down() @@ -743,13 +743,13 @@ ifalias_ipv4_down() break ;; esac - alias=$((${alias} + 1)) + alias=$((${alias} + 1)) done return $_ret } -#ifalias_ipv6_down if +# ifalias_ipv6_down if # Helper function for ifalias_down(). Handles IPv6. # ifalias_ipv6_down() @@ -869,7 +869,8 @@ ifscript_down() fi } -# Create cloneable interfaces. +# clone_up +# Create cloneable interfaces. # clone_up() { @@ -888,8 +889,9 @@ clone_up() debug "Cloned: ${_list}" } -# Destroy cloned interfaces. Destroyed interfaces are echoed -# to standard output. +# clone_down +# Destroy cloned interfaces. Destroyed interfaces are echoed to +# standard output. # clone_down() { @@ -907,8 +909,9 @@ clone_down() debug "Destroyed clones: ${_list}" } -# Create and configure child interfaces. -# Return 0 if child interfaces are created. +# childif_create +# Create and configure child interfaces. Return 0 if child +# interfaces are created. # childif_create() { @@ -943,7 +946,8 @@ childif_create() return ${cfg} } -# Destroy child interfaces. +# childif_destroy +# Destroy child interfaces. # childif_destroy() { @@ -958,16 +962,22 @@ childif_destroy() return ${cfg} } -# Create netgraph nodes. +# ng_mkpeer +# Create netgraph nodes. # -ng_mkpeer() { +ng_mkpeer() +{ ngctl -f - 2> /dev/null <