diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2009-04-18 18:19:39 -0400 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2009-04-18 18:19:39 -0400 |
commit | 1a3fcfac91774ffd0d8e71d3302d5eed782f3773 (patch) | |
tree | d528aabb4ae3b4b13fc9f8a25166e2fbc219f006 | |
parent | 4fa610928619a48ce2de1f0f18e4715f8590e333 (diff) | |
download | pfsense-packages-1a3fcfac91774ffd0d8e71d3302d5eed782f3773.tar.gz pfsense-packages-1a3fcfac91774ffd0d8e71d3302d5eed782f3773.tar.bz2 pfsense-packages-1a3fcfac91774ffd0d8e71d3302d5eed782f3773.zip |
Fix formatting.
-rw-r--r-- | config/squid/squid.inc | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/config/squid/squid.inc b/config/squid/squid.inc index 2dd401f9..1980e1de 100644 --- a/config/squid/squid.inc +++ b/config/squid/squid.inc @@ -1219,56 +1219,56 @@ function squid_generate_rules($type) { $port = ($squid_conf['proxy_port'] ? $squid_conf['proxy_port'] : 3128); switch($type) { - case 'nat': - $rules .= "\n# Setup Squid proxy redirect\n"; - if ($squid_conf['private_subnet_proxy_off'] == 'on') { - foreach ($ifaces as $iface){ - $rules .= "no rdr on $iface proto tcp from any to { 192.168.0.0/16, 172.16.0.0/12, 10.0.0.0/8 } port 80\n"; - } - } - if (!empty($squid_conf['defined_ip_proxy_off'])) { - $defined_ip_proxy_off = explode(";", $squid_conf['defined_ip_proxy_off']); - $exempt_ip = ""; - foreach ($defined_ip_proxy_off as $ip_proxy_off) { - if(!empty($ip_proxy_off)) { - $ip_proxy_off = trim($ip_proxy_off); - $exempt_ip .= ", $ip_proxy_off"; + case 'nat': + $rules .= "\n# Setup Squid proxy redirect\n"; + if ($squid_conf['private_subnet_proxy_off'] == 'on') { + foreach ($ifaces as $iface) { + $rules .= "no rdr on $iface proto tcp from any to { 192.168.0.0/16, 172.16.0.0/12, 10.0.0.0/8 } port 80\n"; } } - $exempt_ip = substr($exempt_ip,2); + if (!empty($squid_conf['defined_ip_proxy_off'])) { + $defined_ip_proxy_off = explode(";", $squid_conf['defined_ip_proxy_off']); + $exempt_ip = ""; + foreach ($defined_ip_proxy_off as $ip_proxy_off) { + if(!empty($ip_proxy_off)) { + $ip_proxy_off = trim($ip_proxy_off); + $exempt_ip .= ", $ip_proxy_off"; + } + } + $exempt_ip = substr($exempt_ip,2); + foreach ($ifaces as $iface) { + $rules .= "no rdr on $iface proto tcp from { $exempt_ip } to any port 80\n"; + } + } foreach ($ifaces as $iface) { - $rules .= "no rdr on $iface proto tcp from { $exempt_ip } to any port 80\n"; - } - } - foreach ($ifaces as $iface) { - $rules .= "rdr on $iface proto tcp from any to !($iface) port 80 -> 127.0.0.1 port 80\n"; - } - /* Handle PPPOE case */ - if($config['pppoe']['mode'] == "server") { - $rules .= "rdr on \$pppoe proto tcp from any to !(\$pppoe) port 80 -> 127.0.0.1 port 80\n"; - } - /* Handle PPTP case */ - if($config['pptpd']['mode'] == "server") { - $rules .= "rdr on \$pptp proto tcp from any to !(\$pptp) port 80 -> 127.0.0.1 port 80\n"; - } - $rules .= "\n"; - break; - case 'filter': - foreach ($ifaces as $iface){ - $rules .= "# Setup squid pass rules for proxy\n"; - $rules .= "pass in quick on $iface proto tcp from any to !($iface) port 80 flags S/SA keep state\n"; - $rules .= "pass in quick on $iface proto tcp from any to !($iface) port $port flags S/SA keep state\n"; + $rules .= "rdr on $iface proto tcp from any to !($iface) port 80 -> 127.0.0.1 port 80\n"; + } + /* Handle PPPOE case */ + if($config['pppoe']['mode'] == "server") { + $rules .= "rdr on \$pppoe proto tcp from any to !(\$pppoe) port 80 -> 127.0.0.1 port 80\n"; + } + /* Handle PPTP case */ + if($config['pptpd']['mode'] == "server") { + $rules .= "rdr on \$pptp proto tcp from any to !(\$pptp) port 80 -> 127.0.0.1 port 80\n"; + } $rules .= "\n"; - }; - if($config['pppoe']['mode'] == "server") { - $rules .= "pass in quick on \$pppoe proto tcp from any to !(\$pppoe) port $port flags S/SA keep state\n"; - } - if($config['pptpd']['mode'] == "server") { - $rules .= "pass in quick on \$pptp proto tcp from any to !(\$pptp) port $port flags S/SA keep state\n"; - } - break; - default: - break; + break; + case 'filter': + foreach ($ifaces as $iface) { + $rules .= "# Setup squid pass rules for proxy\n"; + $rules .= "pass in quick on $iface proto tcp from any to !($iface) port 80 flags S/SA keep state\n"; + $rules .= "pass in quick on $iface proto tcp from any to !($iface) port $port flags S/SA keep state\n"; + $rules .= "\n"; + }; + if($config['pppoe']['mode'] == "server") { + $rules .= "pass in quick on \$pppoe proto tcp from any to !(\$pppoe) port $port flags S/SA keep state\n"; + } + if($config['pptpd']['mode'] == "server") { + $rules .= "pass in quick on \$pptp proto tcp from any to !(\$pptp) port $port flags S/SA keep state\n"; + } + break; + default: + break; } return $rules; |