From 51a25f677ceb64a15d59aa6104285241aeafb9b4 Mon Sep 17 00:00:00 2001 From: Guillaume Mazoyer Date: Thu, 29 May 2014 14:40:07 +0200 Subject: Add utils functions. --- utils.php | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 utils.php diff --git a/utils.php b/utils.php new file mode 100644 index 0000000..a123294 --- /dev/null +++ b/utils.php @@ -0,0 +1,43 @@ + array('min_range' => 1, 'max_range' => 4294967294) + ); + $options_16bit_private = array( + 'options' => array( 'min_range' => 64512, 'max_range' => 65534) + ); + $options_32bit_private = array( + 'options' => array('min_range' => 4200000000, 'max_range' => 4294967294) + ); + + return (filter_var($as, FILTER_VALIDATE_INT, $options_wide_range) && + !filter_var($as, FILTER_VALIDATE_INT, $options_16bit_private) && + !filter_var($as, FILTER_VALIDATE_INT, $options_32bit_private)); +} + +function match_aspath_regex($aspath_regex) { + // TODO: validate a regex with a regex? + return true; +} + +// End of utils.php -- cgit v1.2.3