summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2013-01-24 12:28:33 -0200
committerRenato Botelho <garga@FreeBSD.org>2013-01-24 12:28:33 -0200
commit5440451927ac20d486cad52fcfac5d2efa363683 (patch)
tree1637816972b91322fc31dea5d508968b9d817b4c /etc/inc
parent736698bd60fc0d10d05acd4888ae51a745e6d540 (diff)
downloadpfsense-5440451927ac20d486cad52fcfac5d2efa363683.zip
pfsense-5440451927ac20d486cad52fcfac5d2efa363683.tar.gz
Move is_inrange() to util.inc and rename it to is_inrange_v4()
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/util.inc8
1 files changed, 8 insertions, 0 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index 783b175..f9e18fc 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -679,6 +679,14 @@ function is_valid_shaperbw($val) {
return (preg_match("/^(\d+(?:\.\d+)?)([MKG]?b|%)$/", $val));
}
+/* returns true if $test is in the range between $start and $end */
+function is_inrange_v4($test, $start, $end) {
+ if ( (ip2ulong($test) <= ip2ulong($end)) && (ip2ulong($test) >= ip2ulong($start)) )
+ return true;
+ else
+ return false;
+}
+
/* return the configured carp interface list */
function get_configured_carp_interface_list() {
global $config;
OpenPOWER on IntegriCloud