Subversion Repositories vgwhois

Rev

Rev 77 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 77 Rev 85
Line 3... Line 3...
3
 
3
 
4
#
4
#
5
#  VGWhoIs (ViaThinkSoft Global WhoIs, a fork of generic Whois / gwhois)
5
#  VGWhoIs (ViaThinkSoft Global WhoIs, a fork of generic Whois / gwhois)
6
#  Maintenance / Developer utilities
6
#  Maintenance / Developer utilities
7
#
7
#
8
#  (c) 2012-2019 by Daniel Marschall, ViaThinkSoft <info@daniel-marschall.de>
8
#  (c) 2012-2022 by Daniel Marschall, ViaThinkSoft <info@daniel-marschall.de>
9
#
9
#
10
#  License: https://www.gnu.org/licenses/gpl-2.0.html (GPL version 2)
10
#  License: https://www.gnu.org/licenses/gpl-2.0.html (GPL version 2)
11
#
11
#
12
 
12
 
13
# TODO: also use extended stats of the RIRs, which may have avails / reserved?
13
# TODO: also use extended stats of the RIRs, which may have avails / reserved?
Line 33... Line 33...
33
$iana_asn_data = explode("\n", cached_file(IANA_AS_NUMBERS, CACHE_FILE_DIR));
33
$iana_asn_data = explode("\n", cached_file(IANA_AS_NUMBERS, CACHE_FILE_DIR));
34
$iana_asn_data = array_map('trim', $iana_asn_data);
34
$iana_asn_data = array_map('trim', $iana_asn_data);
35
 
35
 
36
echo "ASN: Parsing...\n";
36
echo "ASN: Parsing...\n";
37
 
37
 
-
 
38
$version = '';
-
 
39
foreach ($iana_asn_data as $i => $line) {
-
 
40
	if (trim($line) == 'Last Updated') {
38
$version = trim(str_replace('-', '', $iana_asn_data[3]));
41
		$version = trim(str_replace('-', '', $iana_asn_data[$i+1]));
-
 
42
	}
-
 
43
}
-
 
44
if ($version == '') die('ERROR: Cannot detect version of IANA ASN file ('.__FILE__.')');
39
 
45
 
40
$iana_asn_data = grep($iana_asn_data, 'whois');
46
$iana_asn_data = grep($iana_asn_data, 'whois');
41
 
47
 
42
$iana_asn_data = implode("\n", $iana_asn_data);
48
$iana_asn_data = implode("\n", $iana_asn_data);
43
 
49