diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-06-22 01:39:16 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-06-22 01:39:16 +0000 |
commit | bbd0311987b64a9629208e2bb4b7ec0130d089c6 (patch) | |
tree | 47e2ed3bdc30addc814aa1384dd52958543861a8 /usr/local | |
parent | 94420171e9f6ed7dc29e0ce8a2b4fbb2f7738640 (diff) | |
download | pfsense-bbd0311987b64a9629208e2bb4b7ec0130d089c6.zip pfsense-bbd0311987b64a9629208e2bb4b7ec0130d089c6.tar.gz |
Add address_to_pconfig()
Diffstat (limited to 'usr/local')
-rwxr-xr-x | usr/local/www/firewall_rules_edit.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/usr/local/www/firewall_rules_edit.php b/usr/local/www/firewall_rules_edit.php index 9e1520e..e3bc7e2 100755 --- a/usr/local/www/firewall_rules_edit.php +++ b/usr/local/www/firewall_rules_edit.php @@ -855,3 +855,34 @@ var customarray=new Array(<?php echo $aliases; ?>); <?php include("fend.inc"); ?> </body> </html> + +<?php + +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 { + $pbeginport = "any"; + $pendport = "any"; + } +} + +?> |