Deleted Added
full compact
network.subr (179314) network.subr (179961)
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 179314 2008-05-26 10:10:11Z dougb $
25# $FreeBSD: head/etc/network.subr 179961 2008-06-23 20:50:11Z mtm $
26#
27
28#
29# Subroutines commonly used from network startup scripts.
30# Requires that rc.conf be loaded first.
31#
32
33# ifn_start ifn

--- 9 unchanged lines hidden (view full) ---

43 [ -z "$ifn" ] && err 1 "ifn_start called without an interface"
44
45 ifscript_up ${ifn} && cfg=0
46 ifconfig_up ${ifn} && cfg=0
47 ipv4_up ${ifn} && cfg=0
48 ipx_up ${ifn} && cfg=0
49 childif_create ${ifn}
50
26#
27
28#
29# Subroutines commonly used from network startup scripts.
30# Requires that rc.conf be loaded first.
31#
32
33# ifn_start ifn

--- 9 unchanged lines hidden (view full) ---

43 [ -z "$ifn" ] && err 1 "ifn_start called without an interface"
44
45 ifscript_up ${ifn} && cfg=0
46 ifconfig_up ${ifn} && cfg=0
47 ipv4_up ${ifn} && cfg=0
48 ipx_up ${ifn} && cfg=0
49 childif_create ${ifn}
50
51 if [ "$cfg" -eq 0 ]; then
52 ifconfig ${ifn}
53 fi
54
55 return $cfg
56}
57
58# ifn_start ifn
59# Shutdown and de-configure an interface. If action is taken print the
60# interface name.
61#
62ifn_stop()

--- 5 unchanged lines hidden (view full) ---

68 [ -z "$ifn" ] && return 1
69
70 ipx_down ${ifn} && cfg=0
71 ipv4_down ${ifn} && cfg=0
72 ifconfig_down ${ifn} && cfg=0
73 ifscript_down ${ifn} && cfg=0
74 childif_destroy ${ifn}
75
51 return $cfg
52}
53
54# ifn_start ifn
55# Shutdown and de-configure an interface. If action is taken print the
56# interface name.
57#
58ifn_stop()

--- 5 unchanged lines hidden (view full) ---

64 [ -z "$ifn" ] && return 1
65
66 ipx_down ${ifn} && cfg=0
67 ipv4_down ${ifn} && cfg=0
68 ifconfig_down ${ifn} && cfg=0
69 ifscript_down ${ifn} && cfg=0
70 childif_destroy ${ifn}
71
76 if [ "$cfg" -eq 0 ]; then
77 echo -n " ${ifn}"
78 fi
79
80 return $cfg
81}
82
83# ifconfig_up if
84# Evaluate ifconfig(8) arguments for interface $if and
85# run ifconfig(8) with those arguments. It returns 0 if
86# arguments were found and executed or 1 if the interface
87# had no arguments. Pseudo arguments DHCP and WPA are handled

--- 1001 unchanged lines hidden ---
72 return $cfg
73}
74
75# ifconfig_up if
76# Evaluate ifconfig(8) arguments for interface $if and
77# run ifconfig(8) with those arguments. It returns 0 if
78# arguments were found and executed or 1 if the interface
79# had no arguments. Pseudo arguments DHCP and WPA are handled

--- 1001 unchanged lines hidden ---