comparison anoclaims.php @ 4:c642254dc9ee draft default tip

Fixed transfer chain generation and construction of empty updates, some small improvements in tools
author Ivo Smits <Ivo@UCIS.nl>
date Sat, 22 Nov 2014 18:18:52 +0100
parents caa68b502313
children
comparison
equal deleted inserted replaced
3:5c8c4fa95803 4:c642254dc9ee
52 function argtolabel($argv, &$argi) { 52 function argtolabel($argv, &$argi) {
53 $t = $argv[$argi++]; 53 $t = $argv[$argi++];
54 if (preg_match('/^AS[0-9]{1-9}$/', $t)) return chr(3).marc_decode_int32be(substr($argv[$argi++], 2)); 54 if (preg_match('/^AS[0-9]{1-9}$/', $t)) return chr(3).marc_decode_int32be(substr($argv[$argi++], 2));
55 if (preg_match('_^[0-9]{1-3}\.[0-9]{1-3}\.[0-9]{1-3}\.[0-9]{1-3}/[0-9]{1-2}$_', $t)) return ipv4tolabel($t); 55 if (preg_match('_^[0-9]{1-3}\.[0-9]{1-3}\.[0-9]{1-3}\.[0-9]{1-3}/[0-9]{1-2}$_', $t)) return ipv4tolabel($t);
56 if (preg_match('_^(((?=.*(::))(?!.*\3.+\3))\3?|([\dA-F]{1,4}(\3|:\b|$)|\2))(?4){5}((?4){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4})\z/[0-9]{1-3}_i', $t)) return ipv6tolabel($t); 56 if (preg_match('_^(((?=.*(::))(?!.*\3.+\3))\3?|([\dA-F]{1,4}(\3|:\b|$)|\2))(?4){5}((?4){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4})\z/[0-9]{1-3}_i', $t)) return ipv6tolabel($t);
57 if (preg_match('/^[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,6}$/i', $t)) return chr(4).strtolower(trim($t, '.')); 57 if (preg_match('/^[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z0-9]{2,6}$/i', $t)) return chr(4).strtolower(trim($t, '.'));
58 throw new Exception('Could not detect label type for '.$t); 58 throw new Exception('Could not detect label type for '.$t);
59 } 59 }
60 function ipnettolabel($s) { 60 function ipnettolabel($s) {
61 $ip = inet_pton(strtok($s, '/')); 61 $ip = inet_pton(strtok($s, '/'));
62 $pl = intval(strtok('/')); 62 $pl = intval(strtok('/'));