summaryrefslogtreecommitdiffstats
path: root/etc/inc/util.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-01-24 04:34:52 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-01-24 04:34:52 +0000
commit5a1eebc7efe36e28a3543f8d30d66c7fd98e985d (patch)
tree551646e0c68635504c20040310158215da62c88a /etc/inc/util.inc
parentc3214aed6e692803edd3761af90e390875976442 (diff)
downloadpfsense-5a1eebc7efe36e28a3543f8d30d66c7fd98e985d.zip
pfsense-5a1eebc7efe36e28a3543f8d30d66c7fd98e985d.tar.gz
Backport the alias rowhelper description feature
Diffstat (limited to 'etc/inc/util.inc')
-rw-r--r--etc/inc/util.inc12
1 files changed, 11 insertions, 1 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index d13dd3e..44beb93 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -232,6 +232,16 @@ function is_port($port) {
return true;
}
+/* returns true if $portrange is a valid TCP/UDP portrange ("<port>:<port>") */
+function is_portrange($portrange) {
+ $ports = explode(":", $portrange);
+
+ if(count($ports) == 2 && is_port($ports[0]) && is_port($ports[1]))
+ return true;
+ else
+ return false;
+}
+
/* returns true if $val is a valid shaper bandwidth value */
function is_valid_shaperbw($val) {
return (preg_match("/^[0-9]+(Kb|Mb|Gb|%)$/", $val));
@@ -553,4 +563,4 @@ function mac_format($clientmac) {
}
}
-?>
+?> \ No newline at end of file
OpenPOWER on IntegriCloud