
#-----------------------------------------------------------------------
# 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
#-----------------------------------------------------------------------
#
# 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
#-----------------------------------------------------------------------
#
#A# accept
#N# bigpond
#T# servers
#
#   |--------------------------------------------------------------------|
#D# Accept the BigPond Advanced Cable heartbeats (UDP from port 5051).
#D# Example: accept-eth1-bigpond-servers="24.192.3.18"
#   |--------------------------------------------------------------------|
#
#-----------------------------------------------------------------------
# START OF MODULE CODE
#-----------------------------------------------------------------------

for host in `Option_Value accept $INTOPT bigpond servers`
do
	echo "Accept $INTOPT $IPADDR Port# $UNPRIVPORTS/udp <-> $host BPA Heartbeat $LOG_MSG"
	ipchains -A $INCHAIN  -j ACCEPT -p udp -s $host 5050:5055      -d $IPADDR $UNPRIVPORTS $LOG
	ipchains -A $OUTCHAIN -j ACCEPT -p udp -s $IPADDR $UNPRIVPORTS -d $host 5050           $LOG
done
unset host

