summaryrefslogtreecommitdiffstats
path: root/usr/local/bin/easyrule
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2015-03-13 23:28:12 +0545
committerPhil Davis <phil.davis@inf.org>2015-03-13 23:28:12 +0545
commit7d61beba45e06f4be2fc5436f14e879ec7dd2675 (patch)
tree15d21def93d92267bc1be37e0a4b15846ae358c9 /usr/local/bin/easyrule
parentf2f34088ace895b0113b468b856ceb02301585d1 (diff)
downloadpfsense-7d61beba45e06f4be2fc5436f14e879ec7dd2675.zip
pfsense-7d61beba45e06f4be2fc5436f14e879ec7dd2675.tar.gz
Code Style sbin tmp usr
Bits and pieces from sbin tmp and usr but not yet usr/local/www
Diffstat (limited to 'usr/local/bin/easyrule')
-rwxr-xr-xusr/local/bin/easyrule35
1 files changed, 20 insertions, 15 deletions
diff --git a/usr/local/bin/easyrule b/usr/local/bin/easyrule
index 9850aee..f00a7cb 100755
--- a/usr/local/bin/easyrule
+++ b/usr/local/bin/easyrule
@@ -10,11 +10,11 @@
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.
+ 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.
+ 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
@@ -50,29 +50,32 @@ function pconfig_to_address(&$adr, $padr, $pmask, $pnot=false, $pbeginport=0, $p
$adr = array();
- if ($padr == "any")
+ if ($padr == "any") {
$adr['any'] = true;
- else if (is_specialnet($padr))
+ } else if (is_specialnet($padr)) {
$adr['network'] = $padr;
- else {
+ } else {
$adr['address'] = $padr;
- if ($pmask != 32)
+ if ($pmask != 32) {
$adr['address'] .= "/" . $pmask;
+ }
}
- if ($pnot)
+ if ($pnot) {
$adr['not'] = true;
- else
+ } else {
unset($adr['not']);
+ }
if (($pbeginport != 0) && ($pbeginport != "any")) {
- if ($pbeginport != $pendport)
+ if ($pbeginport != $pendport) {
$adr['port'] = $pbeginport . "-" . $pendport;
- else
+ } else {
$adr['port'] = $pbeginport;
+ }
}
- if(is_alias($pbeginport)) {
+ if (is_alias($pbeginport)) {
$adr['port'] = $pbeginport;
}
}
@@ -81,12 +84,14 @@ function pconfig_to_address(&$adr, $padr, $pmask, $pnot=false, $pbeginport=0, $p
function is_specialnet($net) {
global $specialsrcdst;
- if(!$net)
+ if (!$net) {
return false;
- if (in_array($net, $specialsrcdst))
+ }
+ if (in_array($net, $specialsrcdst)) {
return true;
- else
+ } else {
return false;
+ }
}
OpenPOWER on IntegriCloud