
#-----------------------------------------------------------------------
# DESCRIPTION
#-----------------------------------------------------------------------
#
# Support the BigPond Advanced Cable heartbeats.
#
# To install, copy this file to /etc/firewall-modules/public/services/
# 360-bigpond-servers and execute rc.firewall with the --update-config
# parameter. The proper options will be added to the configuration file.
#
#-----------------------------------------------------------------------
# CHANGES
#-----------------------------------------------------------------------
#
# 2001-04-16  Dougal Holmes <dholmes@bigpond.net.au>
#             Allow outgoing tcp connections to port 5050 for login
#             (Only required in paranoid mode)
# 2000-12-23  Dougal Holmes <dholmes@bigpond.net.au>
#             Updated text message about range of accepted ports
# 2000-10-19  Jean-Sebastien Morisset <jsmoriss@jsm-mv.dyndns.org>
#             Changed outgoing destination port from 5051 to 5050.
#             Source port was changed from 5051 to 5050:5055.
#             Also renamed 'HOST' variable to 'host'.
# 2000-10-17  Jean-Sebastien Morisset <jsmoriss@jsm-mv.dyndns.org>
#             Added an OUTCHAIN to allow outgoing heart-beat replies.
# 2000-10-15  Jean-Sebastien Morisset <jsmoriss@jsm-mv.dyndns.org>
#             Renamed 'option_value' function to 'Option_Value'.
#
#-----------------------------------------------------------------------
# MODULE CONFIGURATION
#-----------------------------------------------------------------------
#
#m# 123
#n# bigpond
#a# accept
#t# servers
#   |--------------------------------------------------------------------|
#D# Accept the BigPond Advanced Cable heartbeats (UDP port 5050:5055)
#D# Example: accept-eth1-bigpond-servers="24.192.3.18"
#   |--------------------------------------------------------------------|
#
#-----------------------------------------------------------------------
# START OF MODULE CODE
#-----------------------------------------------------------------------


for host in `Option_Value accept $INTERFACE bigpond servers`
do
	[ "$MODE" -ge "3" ] && Accept_Hostports remote tcp "BPAlogin" $host 5050
	echo "Accept $INTERFACE $IPADDR Port# 5050:5055/udp <-> $host BPA Heartbeat $LOG_MSG"
	ipchains -A $INCHAIN  -j ACCEPT -p udp -s $host 5050:5055      -d $IPADDR 5050:5055    $LOG
	ipchains -A $OUTCHAIN -j ACCEPT -p udp -s $IPADDR 5050:5055    -d $host 5050:5055      $LOG
done
unset host

