From cfc707f76372f4411961b97c2afc9174825b2216 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Fri, 19 Nov 2004 23:12:26 +0000 Subject: Add Copyright to each file that we have touched so far and re attribute the file to Manuel Kasper such as: Copyright (C) 2004 Scott Ullrich All rights reserved. originally part of m0n0wall (http://m0n0.ch/wall) Copyright (C) 2003-2004 Manuel Kasper . All rights reserved. --- usr/local/www/firewall_nat_out_edit.php | 88 +++++++++++++++++---------------- 1 file changed, 45 insertions(+), 43 deletions(-) (limited to 'usr/local/www/firewall_nat_out_edit.php') diff --git a/usr/local/www/firewall_nat_out_edit.php b/usr/local/www/firewall_nat_out_edit.php index 723de78..0d4c991 100755 --- a/usr/local/www/firewall_nat_out_edit.php +++ b/usr/local/www/firewall_nat_out_edit.php @@ -1,22 +1,24 @@ #!/usr/local/bin/php -. All rights reserved. - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE @@ -33,7 +35,7 @@ require("guiconfig.inc"); if (!is_array($config['nat']['advancedoutbound']['rule'])) $config['nat']['advancedoutbound']['rule'] = array(); - + $a_out = &$config['nat']['advancedoutbound']['rule']; nat_out_rules_sort(); @@ -74,19 +76,19 @@ if (isset($id) && $a_out[$id]) { } if ($_POST) { - + if ($_POST['destination_type'] == "any") { $_POST['destination'] = "any"; $_POST['destination_subnet'] = 24; } - + unset($input_errors); $pconfig = $_POST; /* input validation */ $reqdfields = explode(" ", "interface source source_subnet destination destination_subnet"); $reqdfieldsn = explode(",", "Interface,Source,Source bit count,Destination,Destination bit count"); - + do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); if ($_POST['source'] && !is_ipaddr($_POST['source'])) { @@ -106,7 +108,7 @@ if ($_POST) { if ($_POST['target'] && !is_ipaddr($_POST['target'])) { $input_errors[] = "A valid target IP address must be specified."; } - + /* check for existing entries */ $osn = gen_subnet($_POST['source'], $_POST['source_subnet']) . "/" . $_POST['source_subnet']; if ($_POST['destination_type'] == "any") @@ -114,7 +116,7 @@ if ($_POST) { else $ext = gen_subnet($_POST['destination'], $_POST['destination_subnet']) . "/" . $_POST['destination_subnet']; - + if ($_POST['target']) { /* check for clashes with 1:1 NAT (Server NAT is OK) */ if (is_array($config['nat']['onetoone'])) { @@ -126,14 +128,14 @@ if ($_POST) { } } } - + foreach ($a_out as $natent) { if (isset($id) && ($a_out[$id]) && ($a_out[$id] === $natent)) continue; - + if (!$natent['interface']) $natent['interface'] == "wan"; - + if (($natent['interface'] == $_POST['interface']) && ($natent['source']['network'] == $osn)) { if (isset($natent['destination']['not']) == isset($_POST['destination_not'])) { if ((isset($natent['destination']['any']) && ($ext == "any")) || @@ -151,24 +153,24 @@ if ($_POST) { $natent['descr'] = $_POST['descr']; $natent['target'] = $_POST['target']; $natent['interface'] = $_POST['interface']; - + if ($ext == "any") $natent['destination']['any'] = true; else $natent['destination']['network'] = $ext; - + if (isset($_POST['destination_not']) && $ext != "any") $natent['destination']['not'] = true; - + if (isset($id) && $a_out[$id]) $a_out[$id] = $natent; else $a_out[] = $natent; - + touch($d_natconfdirty_path); - + write_config(); - + header("Location: firewall_nat_out.php"); exit; } @@ -216,7 +218,7 @@ function typesel_change() { $interfaces['opt' . $i] = $config['interfaces']['opt' . $i]['descr']; } foreach ($interfaces as $iface => $ifacename): ?> - @@ -224,12 +226,12 @@ function typesel_change() { Choose which interface this rule applies to.
Hint: in most cases, you'll want to use WAN here.
- + Source - - / + + / > @@ -248,22 +250,22 @@ function typesel_change() { Use this option to invert the sense of the match.

- + - + -
Type:  
Address:   - / + /
 Enter the destination network for + Enter the destination network for the outbound NAT mapping.
- + Target
Packets matching this rule will be mapped to the IP address given here. Leave blank to use the selected interface's IP address. - + Description - - -
You may enter a description here + + +
You may enter a description here for your reference (not parsed). - +   - - + + - + -- cgit v1.1