lib: add constants to define max-length
o MAX_LEN_IPV4 o MAX_LEN_IPV6
This commit is contained in:
parent
b93f428e97
commit
585b867394
|
@ -9,4 +9,6 @@ $files4 = scandir ("../registry/data/route/");
|
|||
// Define array() we are gonna store data inside.
|
||||
$roas = array();
|
||||
|
||||
define ("MAX_LEN_IPV4", 28);
|
||||
define ("MAX_LEN_IPV6", 64);
|
||||
?>
|
||||
|
|
|
@ -91,7 +91,7 @@ foreach ($raw_array as $sub_array)
|
|||
$_maxlength = (isset ($maxlength[0]) ? $maxlength[0] : "");
|
||||
else
|
||||
// Do fallback to default prefix size if max-length was not set.
|
||||
$_maxlength = ($prefix[2] < 64 ? 64 : $prefix[2]);
|
||||
$_maxlength = ($prefix[2] < MAX_LEN_IPV6 ? MAX_LEN_IPV6 : $prefix[2]);
|
||||
|
||||
$_mnt = $mnt[0];
|
||||
|
||||
|
@ -190,7 +190,7 @@ foreach ($raw_array as $sub_array)
|
|||
$_maxlength = (isset ($maxlength[0]) ? $maxlength[0] : "");
|
||||
else
|
||||
// Do fallback to default prefix size if max-length was not set.
|
||||
$_maxlength = ($prefix[2] < 29 ? 29 : $prefix[2]);
|
||||
$_maxlength = ($prefix[2] < MAX_LEN_IPV4 ? MAX_LEN_IPV4 : $prefix[2]);
|
||||
|
||||
$_mnt = $mnt[0];
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ foreach ($raw_array as $sub_array)
|
|||
$_maxlength = (isset ($maxlength[0]) ? $maxlength[0] : "");
|
||||
else
|
||||
// Do fallback to default prefix size if max-length was not set.
|
||||
$_maxlength = ($prefix[2] < 64 ? 64 : $prefix[2]);
|
||||
$_maxlength = ($prefix[2] < MAX_LEN_IPV6 ? MAX_LEN_IPV6 : $prefix[2]);
|
||||
|
||||
// Loop through each asn in single route6 object and assign
|
||||
// other values accordingly.
|
||||
|
@ -167,7 +167,7 @@ foreach ($raw_array as $sub_array)
|
|||
$_maxlength = (isset ($maxlength[0]) ? $maxlength[0] : "");
|
||||
else
|
||||
// Do fallback to default prefix size if max-length was not set.
|
||||
$_maxlength = ($prefix[2] < 29 ? 29 : $prefix[2]);
|
||||
$_maxlength = ($prefix[2] < MAX_LEN_IPV4 ? MAX_LEN_IPV4 : $prefix[2]);
|
||||
|
||||
// Loop through each asn in single route6 object and assign
|
||||
// other values accordingly.
|
||||
|
|
Loading…
Reference in a new issue