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
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])
46 idt[0-9] | idt[0-9][0-9])
55 if [ -z "${atmdev}" ]; then
56 echo 'No ATM adapters found'
60 # Load microcode into FORE adapters (if needed)
61 if [ `expr "${atmdev}" : '.*hfa.*'` -ne 0 ]; then
65 # Configure physical interfaces
67 for phy in ${atmdev}; do
68 echo -n "Configuring ATM device ${phy}:"
70 # Define network interfaces
71 eval netif_args=\$atm_netif_${phy}
72 if [ -n "${netif_args}" ]; then
73 atm set netif ${phy} ${netif_args} || continue
75 echo ' missing network interface definition'
79 # Override physical MAC address
80 eval macaddr_args=\$atm_macaddr_${phy}
81 if [ -n "${macaddr_args}" ]; then
82 case ${macaddr_args} in
86 atm set mac ${phy} ${macaddr_args} || continue
91 # Configure signalling manager
92 eval sigmgr_args=\$atm_sigmgr_${phy}
93 if [ -n "${sigmgr_args}" ]; then
94 atm attach ${phy} ${sigmgr_args} || continue
96 echo ' missing signalling manager definition'
100 # Configure UNI NSAP prefix
101 eval prefix_args=\$atm_prefix_${phy}
102 if [ `expr "${sigmgr_args}" : '[uU][nN][iI].*'` -ne 0 ]; then
103 if [ -z "${prefix_args}" ]; then
104 echo ' missing NSAP prefix for UNI interface'
108 case ${prefix_args} in
113 atm set prefix ${phy} ${prefix_args} || continue
118 atm_phy="${atm_phy} ${phy}"
122 echo -n 'Starting initial ATM daemons:'
123 # Start ILMI daemon (if needed)
136 # Finish up configuration.
137 # N.B. /usr is not mounted.
140 echo -n 'Configuring ATM network interfaces:'
145 # Configure network interfaces
146 for phy in ${atm_phy}; do
147 eval netif_args=\$atm_netif_${phy}
152 while [ ${netindx} -lt ${netcnt} ]; do
153 net="${netname}${netindx}"
154 netindx=$((${netindx} + 1))
157 # Configure atmarp server
158 eval atmarp_args=\$atm_arpserver_${net}
159 if [ -n "${atmarp_args}" ]; then
160 atm set arpserver ${net} ${atmarp_args} ||
163 eval scsparp_args=\$atm_scsparp_${net}
165 case ${scsparp_args} in
167 case ${atmarp_args} in
171 echo ' local arpserver required for SCSP'
176 atm_atmarpd="${atm_atmarpd} ${net}"
184 if [ -n "${atm_pvcs}" ]; then
185 for i in ${atm_pvcs}; do
186 eval pvc_args=\$atm_pvc_${i}
187 atm add pvc ${pvc_args}
191 # Define any permanent ARP entries.
192 if [ -n "${atm_arps}" ]; then
193 for i in ${atm_arps}; do
194 eval arp_args=\$atm_arp_${i}
195 atm add arp ${arp_args}
202 # Start any necessary daemons.
205 # Start SCSP daemon (if needed)
213 # Start ATMARP daemon (if needed)
214 if [ -n "${atm_atmarpd}" ]; then
216 atmarpd ${atm_atmarpd}