From c60f17e085a3d260c2d4cd962a640b25f1388d8e Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Tue, 21 Jun 2005 23:52:23 +0000 Subject: sync w/ m0n0wall --- usr/local/www/guiconfig.inc | 74 +-------------------------------------------- 1 file changed, 1 insertion(+), 73 deletions(-) diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc index 4623076..e43dff1 100755 --- a/usr/local/www/guiconfig.inc +++ b/usr/local/www/guiconfig.inc @@ -512,76 +512,4 @@ function update_if_changed($varname, & $orig, $new) { return false; } -function address_to_pconfig($adr, &$padr, &$pmask, &$pnot, &$pbeginport, &$pendport) { - - if (isset($adr['any'])) - $padr = "any"; - else if ($adr['network']) - $padr = $adr['network']; - else if ($adr['address']) { - list($padr, $pmask) = explode("/", $adr['address']); - if (!$pmask) - $pmask = 32; - } - - if (isset($adr['not'])) - $pnot = 1; - else - $pnot = 0; - - if ($adr['port']) { - list($pbeginport, $pendport) = explode("-", $adr['port']); - if (!$pendport) - $pendport = $pbeginport; - } else { - if(alias_expand($pbeginport) <> "" || alias_expand($pendport) <> "") { - /* Item is a port alias */ - } else { - $pbeginport = "any"; - $pendport = "any"; - } - } -} - - -function pconfig_to_address(&$adr, $padr, $pmask, $pnot=false, $pbeginport=0, $pendport=0) { - - $adr = array(); - - if ($padr == "any") - $adr['any'] = true; - else if (is_specialnet($padr)) - $adr['network'] = $padr; - else { - $adr['address'] = $padr; - if ($pmask != 32) - $adr['address'] .= "/" . $pmask; - } - - if ($pnot) - $adr['not'] = true; - else - unset($addr['not']); - - if (($pbeginport != 0) && ($pbeginport != "any")) { - if ($pbeginport != $pendport) - $adr['port'] = $pbeginport . "-" . $pendport; - else - $adr['port'] = $pbeginport; - } - - if(alias_expand($pbeginport)) { - $adr['port'] = $pbeginport; - } -} - -function is_specialnet($net) { - global $specialsrcdst; - - if (in_array($net, $specialsrcdst) || strstr($net, "opt")) - return true; - else - return false; -} - -?> +?> \ No newline at end of file -- cgit v1.1