diff options
author | harti <harti@FreeBSD.org> | 2003-07-28 13:30:42 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2003-07-28 13:30:42 +0000 |
commit | 33549ec7ad9964be49b9d2a7ea2fb73d188b8d14 (patch) | |
tree | 29b421aea59e200f6b87d1e1de470c13b1bd53c2 /etc/rc.d/atm2 | |
parent | df37a5270c965c0d1d1461fce913ee30a095d353 (diff) | |
download | FreeBSD-src-33549ec7ad9964be49b9d2a7ea2fb73d188b8d14.zip FreeBSD-src-33549ec7ad9964be49b9d2a7ea2fb73d188b8d14.tar.gz |
Convert the atm{2,3}.sh rc scripts to normal rc.d scripts. Add support
for the harp(4) pseudo driver and for loadable native HARP drivers
(like hfa_pci).
To use harp(4) the rc variable natm_interfaces must be set to the
list of NATM interfaces to be used for HARP. These interfaces
will be brought up with ifconfig and the harp(4) will be loaded.
To use loadable native HARP drivers atm_load must be set to
the list of drivers to load.
Reviewed by: mtm, gordon (partly)
Diffstat (limited to 'etc/rc.d/atm2')
-rw-r--r-- | etc/rc.d/atm2 | 57 |
1 files changed, 25 insertions, 32 deletions
diff --git a/etc/rc.d/atm2 b/etc/rc.d/atm2 index ad69f72..be1404f 100644 --- a/etc/rc.d/atm2 +++ b/etc/rc.d/atm2 @@ -35,15 +35,37 @@ # # Additional ATM interface configuration # - . /etc/rc.subr +name="atm2" +rcvar="atm_enable" +start_cmd="atm2_start" +stop_cmd=":" + atm2_start() { # Configure network interfaces + + # get a list of physical interfaces + atm_phy=`atm show stat int | { read junk ; read junk ; \ + while read dev junk ; do + case ${dev} in + en[0-9] | en[0-9][0-9]) + ;; + *) + echo "${dev} " + ;; + esac + done ; }` + for phy in ${atm_phy}; do eval netif_args=\$atm_netif_${phy} set -- ${netif_args} + # skip unused physical interfaces + if [ $# -lt 2 ] ; then + continue + fi + netname=$1 netcnt=$2 netindx=0 @@ -58,23 +80,6 @@ atm2_start() atm set arpserver ${net} ${atmarp_args} || continue fi - eval scsparp_args=\$atm_scsparp_${net} - - case ${scsparp_args} in - [Yy][Ee][Ss]) - case ${atmarp_args} in - local) - ;; - *) - echo ' local arpserver required for SCSP' - continue - ;; - esac - - atm_atmarpd="${atm_atmarpd} ${net}" - atm_scspd=1 - ;; - esac done done echo '.' @@ -86,19 +91,7 @@ atm2_start() atm add arp ${arp_args} done fi - - # 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 } -load_rc_config "XXX" - -case ${atm_enable} in -[Yy][Ee][Ss]) - atm2_start - ;; -esac +load_rc_config $name +run_rc_command "$1" |