From da6cb29eb5a53c1f4356ffd8ceb781ad61c3e499 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Fri, 6 Dec 2013 09:41:59 -0200 Subject: Add function is_inrange() that calls is_inrange_v6 or is_inrange_v4 accordingly --- etc/inc/util.inc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/etc/inc/util.inc b/etc/inc/util.inc index 968cb72..6e91eb6 100644 --- a/etc/inc/util.inc +++ b/etc/inc/util.inc @@ -794,6 +794,11 @@ function is_inrange_v6($test, $start, $end) { return false; } +/* returns true if $test is in the range between $start and $end */ +function is_inrange($test, $start, $end) { + return is_ipaddrv6($test) ? is_inrange_v6($test, $start, $end) : is_inrange_v4($test, $start, $end); +} + /* XXX: return the configured carp interface list */ function get_configured_carp_interface_list() { global $config; -- cgit v1.1