network.subr (161386) | network.subr (162490) |
---|---|
1# 2# Copyright (c) 2003 The FreeBSD Project. All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions 6# are met: 7# 1. Redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer. --- 8 unchanged lines hidden (view full) --- 17# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23# SUCH DAMAGE. 24# | 1# 2# Copyright (c) 2003 The FreeBSD Project. All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions 6# are met: 7# 1. Redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer. --- 8 unchanged lines hidden (view full) --- 17# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23# SUCH DAMAGE. 24# |
25# $FreeBSD: head/etc/network.subr 161386 2006-08-17 03:03:38Z brooks $ | 25# $FreeBSD: head/etc/network.subr 162490 2006-09-21 01:44:52Z brooks $ |
26# 27 28# 29# Subroutines commonly used from network startup scripts. 30# Requires that rc.conf be loaded first. 31# 32 33# ifconfig_up if --- 198 unchanged lines hidden (view full) --- 232 [Ww][Pp][Aa]) 233 return 0 234 ;; 235 esac 236 done 237 return 1 238} 239 | 26# 27 28# 29# Subroutines commonly used from network startup scripts. 30# Requires that rc.conf be loaded first. 31# 32 33# ifconfig_up if --- 198 unchanged lines hidden (view full) --- 232 [Ww][Pp][Aa]) 233 return 0 234 ;; 235 esac 236 done 237 return 1 238} 239 |
240# ipv6if if 241# Returns 0 if the interface should be configured for IPv6 and 242# 1 otherwise. 243ipv6if() 244{ 245 if ! checkyesno ipv6_enable; then 246 return 1 247 fi 248 case "${ipv6_network_interfaces}" in 249 [Aa][Uu][Tt][Oo]) 250 return 0 251 ;; 252 ''|[Nn][Oo][Nn][Ee]) 253 return 1 254 ;; 255 esac 256 for v6if in ${ipv6_network_interfaces}; do 257 if [ "${v6if}" = "${1}" ]; then 258 return 0 259 fi 260 done 261 return 1 262} 263 |
|
240# ifexists if 241# Returns 0 if the interface exists and 1 otherwise. 242ifexists() 243{ 244 ifconfig $1 > /dev/null 2>&1 245} 246 247# ipv4_up if --- 638 unchanged lines hidden --- | 264# ifexists if 265# Returns 0 if the interface exists and 1 otherwise. 266ifexists() 267{ 268 ifconfig $1 > /dev/null 2>&1 269} 270 271# ipv4_up if --- 638 unchanged lines hidden --- |