diff options
Diffstat (limited to 'etc/rc.d/atm2')
-rw-r--r-- | etc/rc.d/atm2 | 159 |
1 files changed, 23 insertions, 136 deletions
diff --git a/etc/rc.d/atm2 b/etc/rc.d/atm2 index 1c53c7f..8854605 100644 --- a/etc/rc.d/atm2 +++ b/etc/rc.d/atm2 @@ -27,118 +27,19 @@ # $FreeBSD$ # -# -# ATM networking startup script -# -# Initial interface configuration. -# N.B. /usr is not mounted. -# -atm_pass1() { - # Locate all probed ATM adapters - atmdev=`atm sh stat int | while read dev junk; do - case ${dev} in - hea[0-9] | hea[0-9][0-9]) - echo "${dev} " - ;; - hfa[0-9] | hfa[0-9][0-9]) - echo "${dev} " - ;; - *) - continue - ;; - esac - done` - - if [ -z "${atmdev}" ]; then - echo 'No ATM adapters found' - return 0 - fi - - # Load microcode into FORE adapters (if needed) - if [ `expr "${atmdev}" : '.*hfa.*'` -ne 0 ]; then - fore_dnld - fi - - # Configure physical interfaces - ilmid=0 - for phy in ${atmdev}; do - echo -n "Configuring ATM device ${phy}:" - - # Define network interfaces - eval netif_args=\$atm_netif_${phy} - if [ -n "${netif_args}" ]; then - atm set netif ${phy} ${netif_args} || continue - else - echo ' missing network interface definition' - continue - fi - - # Override physical MAC address - eval macaddr_args=\$atm_macaddr_${phy} - if [ -n "${macaddr_args}" ]; then - case ${macaddr_args} in - [Nn][Oo] | '') - ;; - *) - atm set mac ${phy} ${macaddr_args} || continue - ;; - esac - fi - - # Configure signalling manager - eval sigmgr_args=\$atm_sigmgr_${phy} - if [ -n "${sigmgr_args}" ]; then - atm attach ${phy} ${sigmgr_args} || continue - else - echo ' missing signalling manager definition' - continue - fi - - # Configure UNI NSAP prefix - eval prefix_args=\$atm_prefix_${phy} - if [ `expr "${sigmgr_args}" : '[uU][nN][iI].*'` -ne 0 ]; then - if [ -z "${prefix_args}" ]; then - echo ' missing NSAP prefix for UNI interface' - continue - fi - - case ${prefix_args} in - ILMI) - ilmid=1 - ;; - *) - atm set prefix ${phy} ${prefix_args} || continue - ;; - esac - fi - - atm_phy="${atm_phy} ${phy}" - echo '.' - done - - echo -n 'Starting initial ATM daemons:' - # Start ILMI daemon (if needed) - case ${ilmid} in - 1) - echo -n ' ilmid' - ilmid - ;; - esac - - echo '.' - atm_pass1_done=YES -} +# PROVIDE: atm2 +# REQUIRE: atm1 network1 +# BEFORE: network2 +# KEYWORD: FreeBSD # -# Finish up configuration. -# N.B. /usr is not mounted. +# Additional ATM interface configuration # -atm_pass2() { - echo -n 'Configuring ATM network interfaces:' - atm_scspd=0 - atm_atmarpd="" +. /etc/rc.subr +atm2_start() +{ # Configure network interfaces for phy in ${atm_phy}; do eval netif_args=\$atm_netif_${phy} @@ -155,7 +56,7 @@ atm_pass2() { eval atmarp_args=\$atm_arpserver_${net} if [ -n "${atmarp_args}" ]; then atm set arpserver ${net} ${atmarp_args} || - continue + continue fi eval scsparp_args=\$atm_scsparp_${net} @@ -172,19 +73,12 @@ atm_pass2() { atm_atmarpd="${atm_atmarpd} ${net}" atm_scspd=1 + ;; esac done done echo '.' - # Define any PVCs. - if [ -n "${atm_pvcs}" ]; then - for i in ${atm_pvcs}; do - eval pvc_args=\$atm_pvc_${i} - atm add pvc ${pvc_args} - done - fi - # Define any permanent ARP entries. if [ -n "${atm_arps}" ]; then for i in ${atm_arps}; do @@ -192,26 +86,19 @@ atm_pass2() { atm add arp ${arp_args} done fi - atm_pass2_done=YES -} -# -# Start any necessary daemons. -# -atm_pass3() { - # Start SCSP daemon (if needed) - case ${atm_scspd} in - 1) - echo -n ' scspd' - scspd - ;; - esac + # XXX - required by atm3.sh. I don't like having one script depend + # on variables in another script (especially in a dynamic + # ordered system like this), but it's necessary for the moment. + # + export atm_atmarpd + export atm_scspd +} - # Start ATMARP daemon (if needed) - if [ -n "${atm_atmarpd}" ]; then - echo -n ' atmarpd' - atmarpd ${atm_atmarpd} - fi +load_rc_config "XXX" - atm_pass3_done=YES -} +case ${atm_enable} in +[Yy][Ee][Ss]) + atm2_start + ;; +esac |