3 # Copyright (c) 2000 The FreeBSD Project
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
9 # 1. Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
11 # 2. Redistributions in binary form must reproduce the above copyright
12 # notice, this list of conditions and the following disclaimer in the
13 # documentation and/or other materials provided with the distribution.
15 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 # $FreeBSD: src/etc/rc.atm,v 1.6.2.3 2001/11/19 10:42:28 sheldonh Exp $
31 # ATM networking startup script
33 # Initial interface configuration.
34 # N.B. /usr is not mounted.
37 # Locate all probed ATM adapters
38 atmdev=`atm sh stat int | while read dev junk; do
40 hea[0-9] | hea[0-9][0-9])
43 hfa[0-9] | hfa[0-9][0-9])
52 if [ -z "${atmdev}" ]; then
53 echo 'No ATM adapters found'
57 # Load microcode into FORE adapters (if needed)
58 if [ `expr "${atmdev}" : '.*hfa.*'` -ne 0 ]; then
62 # Configure physical interfaces
64 for phy in ${atmdev}; do
65 echo -n "Configuring ATM device ${phy}:"
67 # Define network interfaces
68 eval netif_args=\$atm_netif_${phy}
69 if [ -n "${netif_args}" ]; then
70 atm set netif ${phy} ${netif_args} || continue
72 echo ' missing network interface definition'
76 # Override physical MAC address
77 eval macaddr_args=\$atm_macaddr_${phy}
78 if [ -n "${macaddr_args}" ]; then
79 case ${macaddr_args} in
83 atm set mac ${phy} ${macaddr_args} || continue
88 # Configure signalling manager
89 eval sigmgr_args=\$atm_sigmgr_${phy}
90 if [ -n "${sigmgr_args}" ]; then
91 atm attach ${phy} ${sigmgr_args} || continue
93 echo ' missing signalling manager definition'
97 # Configure UNI NSAP prefix
98 eval prefix_args=\$atm_prefix_${phy}
99 if [ `expr "${sigmgr_args}" : '[uU][nN][iI].*'` -ne 0 ]; then
100 if [ -z "${prefix_args}" ]; then
101 echo ' missing NSAP prefix for UNI interface'
105 case ${prefix_args} in
110 atm set prefix ${phy} ${prefix_args} || continue
115 atm_phy="${atm_phy} ${phy}"
119 echo -n 'Starting initial ATM daemons:'
120 # Start ILMI daemon (if needed)
133 # Finish up configuration.
134 # N.B. /usr is not mounted.
137 echo -n 'Configuring ATM network interfaces:'
142 # Configure network interfaces
143 for phy in ${atm_phy}; do
144 eval netif_args=\$atm_netif_${phy}
149 while [ ${netindx} -lt ${netcnt} ]; do
150 net="${netname}${netindx}"
151 netindx=$((${netindx} + 1))
154 # Configure atmarp server
155 eval atmarp_args=\$atm_arpserver_${net}
156 if [ -n "${atmarp_args}" ]; then
157 atm set arpserver ${net} ${atmarp_args} ||
160 eval scsparp_args=\$atm_scsparp_${net}
162 case ${scsparp_args} in
164 case ${atmarp_args} in
168 echo ' local arpserver required for SCSP'
173 atm_atmarpd="${atm_atmarpd} ${net}"
181 if [ -n "${atm_pvcs}" ]; then
182 for i in ${atm_pvcs}; do
183 eval pvc_args=\$atm_pvc_${i}
184 atm add pvc ${pvc_args}
188 # Define any permanent ARP entries.
189 if [ -n "${atm_arps}" ]; then
190 for i in ${atm_arps}; do
191 eval arp_args=\$atm_arp_${i}
192 atm add arp ${arp_args}
199 # Start any necessary daemons.
202 # Start SCSP daemon (if needed)
210 # Start ATMARP daemon (if needed)
211 if [ -n "${atm_atmarpd}" ]; then
213 atmarpd ${atm_atmarpd}