# /etc/conf.d/net:
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/net,v 1.7 2002/11/18 19:39:22 azarah Exp $

# Global config file for net.* rc-scripts

# This is basically the ifconfig argument without the ifconfig $iface
# For the wired Broadcom 4401 ethernet card - modprobe b44
#
# Work
config_eth0="128.40.8.142 broadcast 128.40.8.255 netmask 255.255.255.0"
routes_eth0=( "default via 128.40.8.245" )

# For wireless interfaces
#
# Built-in Intel PRO/Wireless 2200BG - modprobe ipw2200
config_eth1="10.0.0.14 broadcast 10.0.0.255 netmask 255.255.255.0"
# Old US Robotics card at home
config_wlan0="10.0.0.14 broadcast 10.0.0.255 netmask 255.255.255.0"
# Belkin card in flat
config_ra0="192.168.1.50 broadcast 192.168.1.255 netmask 255.255.255.0"

# Modules used by wireless and configuration
#
modules=( "iwconfig" )

essid_eth1="NETGEAR"
key_NETGEAR="[1] 1234-5678-AB [1] enc open"
routes_eth1=( "default via 10.0.0.2" )
channel_eth1="11"

essid_wlan0="NETGEAR"
key_NETGEAR="[1] 1234-5678-AB [1] enc open"
routes_wlan0=( "default via 10.0.0.2" )
channel_wlan0="11"

essid_ra0="NETGEAR"
key_NETGEAR="[1] 1234-5678-AB [1] enc open"
routes_ra0=( "default via 10.0.0.2" )
channel_ra0="11"

preferred_aps=( "GWART2-54125" )

# Preup routine for all
#preup() {
#       # Installs the modules for the wireless and wired connections.
#       if [[ ${IFACE} == "wlan0" ]]; then
#               return 0
#       fi
#       if [[ ${IFACE} == "eth0" ]]; then
#               modprobe b44
#	       return 0
#       fi
#       if [[ ${IFACE} == "eth1" ]]; then
#               modprobe ipw2200
#	       return 0
#       fi
#
#       # Remember to return 0 on success
#       return 0
#}

# Postup/down routines
postup() {
#       # Configs essid/key
#       if [[ ${IFACE} == "wlan0" ]]; then
#             iwconfig wlan0 essid "NETGEAR" key 4ba71add34
#       fi
#       return 0

       # Test for link on the interface prior to bringing it up.  This
       # only works on some network adapters and requires the ethtool
       # package to be installed.
       if ethtool ${IFACE} | grep -q 'Link detected: no'; then
               ewarn "No link on ${IFACE}, aborting configuration"
	       /etc/init.d/net.${IFACE} stop
               return 1
       fi

       # Remember to return 0 on success
       return 0
}

#postdown() {
#      if [[ ${IFACE} == "wlan0" ]]; then
#             rmmod ndiswrapper
#      fi
#      if [[ ${IFACE} == "ra0" ]]; then
#             rmmod rt2500
#      fi
#      #if [[ ${IFACE} == "eth0" ]]; then
#      #       rmmod ipw2200
#      #fi
#      #if [[ ${IFACE} == "eth1" ]]; then
#      #       rmmod b44
#      #fi
#      return 0
#}

# For DHCP set iface_eth? to "dhcp"
# For passing options to dhcpcd use dhcpcd_eth?
#
#iface_eth0="dhcp"
#dhcpcd_eth0="..."

# For adding aliases to a interface
#
#alias_eth0="192.168.0.3 192.168.0.4"

# NB:  The next is only used for aliases.
#
# To add a custom netmask/broadcast address to created aliases,
# uncomment and change accordingly.  Leave commented to assign
# defaults for that interface.
#
#broadcast_eth0="192.168.0.255 192.168.0.255"
#netmask_eth0="255.255.255.0 255.255.255.0"
