
#-----------------------------------------------------------------------
# CHANGES
#-----------------------------------------------------------------------
#
# 2001-04-02  Vladimir Smelhaus <smelhaus@bpt.cz>
#             Added to v5.1.1
#
#-----------------------------------------------------------------------
# MODULE CONFIGURATION
#-----------------------------------------------------------------------
#
#m# 123
#a# accept
#i# cluster
#n# transparentproxy
#t# clients
#
#   |--------------------------------------------------------------------|
#d# Redirect connections to remote http servers from these clients, to a 
#d# local proxy server (squid, etc.). You must also specify the ports
#d# which are to be redirected in the accept-{int}-transparentproxy-ports
#d# option. It is assumed that a local http proxy is runing ON THE FIRST
#d# PORT LISTED in the accept-{int}-proxy-ports option. Additional ports
#d# in this option are ignored.
#   |--------------------------------------------------------------------|
#
#-----------------------------------------------------------------------
# START OF MODULE CODE
#-----------------------------------------------------------------------

for host in `Option_Value accept $INTOPT transparentproxy clients`
do
	for transparentport in `Option_Value accept $INTOPT transparentproxy ports`
	do
	    for proxyport in `Option_Value accept $INTOPT proxy ports`
	    do
			echo "Accept $INTOPT $IPADDR Transparent Proxy Port# $transparentport <- $host $log_msg"
			ipchains -A $INCHAIN  -j REDIRECT $proxyport -p tcp      -s $host $UNPRIVPORTS   -d 0/0 $transparentport $LOG
			ipchains -A $OUTCHAIN -j ACCEPT              -p tcp ! -y -s 0/0 $transparentport -d $host $UNPRIVPORTS   $LOG
			continue
	    done
	done
done
unset host proxyport transparentport

