summaryrefslogtreecommitdiffstats
path: root/usr/local/www
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-06-22 01:39:16 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-06-22 01:39:16 +0000
commitbbd0311987b64a9629208e2bb4b7ec0130d089c6 (patch)
tree47e2ed3bdc30addc814aa1384dd52958543861a8 /usr/local/www
parent94420171e9f6ed7dc29e0ce8a2b4fbb2f7738640 (diff)
downloadpfsense-bbd0311987b64a9629208e2bb4b7ec0130d089c6.zip
pfsense-bbd0311987b64a9629208e2bb4b7ec0130d089c6.tar.gz
Add address_to_pconfig()
Diffstat (limited to 'usr/local/www')
-rwxr-xr-xusr/local/www/firewall_rules_edit.php31
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";
+ }
+}
+
+?>
OpenPOWER on IntegriCloud