
#-----------------------------------------------------------------------
# CHANGES
#-----------------------------------------------------------------------
#
# 2001-02-07  Jean-Sebastien Morisset <jsmoriss@mvlan.net>
#             Added check for CLUSTER_NAME and assoc. rules.
# 2000-10-26  Jean-Sebastien Morisset <jsmoriss@jsm-mv.dyndns.org>
#             Added the "#m# 1 2 3" module config.
# 2000-10-14  Jean-Sebastien Morisset <jsmoriss@jsm-mv.dyndns.org>
#             Initial module written for v5.0.
#
#-----------------------------------------------------------------------
# MODULE CONFIGURATION
#-----------------------------------------------------------------------
#
#m# 123
#a# accept
#i# cluster novirtual
#n# printer
#t# servers
#
#   |--------------------------------------------------------------------|
#d# In strict mode, printing to remote (public) servers is denied. You can
#d# enter the host names of specific servers where you send print jobs. 
#d# All other destinations will be blocked in strict mode.
#   |--------------------------------------------------------------------|
#
#-----------------------------------------------------------------------
# START OF MODULE CODE
#-----------------------------------------------------------------------

for host in `Option_Value accept $INTOPT printer servers`
do
	echo "Accept $INTOPT $IPADDR -> $host PRINTER $LOG_MSG"
	if [ "$CLUSTER_NAME" ]
	then
		ipchains -A $OUTCHAIN -j ACCEPT -p tcp ! -y -s $host   printer    -d $IPADDR $PRIVPORTS $LOG
		ipchains -A $INCHAIN  -j ACCEPT -p tcp      -s $IPADDR $PRIVPORTS -d $host   printer    $LOG
	else
		ipchains -A $INCHAIN  -j ACCEPT -p tcp ! -y -s $host   printer    -d $IPADDR $PRIVPORTS $LOG
		ipchains -A $OUTCHAIN -j ACCEPT -p tcp      -s $IPADDR $PRIVPORTS -d $host   printer    $LOG
	fi
done
unset host

