make_as32_del.pl: support ASPLAIN AS32

This commit is contained in:
Marco d'Itri 2013-12-26 07:34:31 +01:00
parent 363d101ac7
commit 4612f7f986

View File

@ -9,13 +9,19 @@ while (<STDIN>) {
s/\s*#.*$//;
next if /^$/;
my ($fh, $fl, $lh, $ll, $s) = /^(\d+)\.(\d+)\s+(\d+)\.(\d+)\s+([\w\.-]+)$/;
die "format error: $_" unless $s;
my ($fh, $fl, $lh, $ll, $s, $f, $l);
if (($fh, $fl, $lh, $ll, $s) =
/^(\d+)\.(\d+)\s+(\d+)\.(\d+)\s+([\w\.-]+)$/) {
$f = ($fh << 16) + $fl;
$l = ($lh << 16) + $ll;
my $f = ($fh << 16) + $fl;
my $l = ($lh << 16) + $ll;
my $server = ($s =~ /\./) ? $s : "whois.$s.net";
print qq({ $f, $l,\t"$server" },\t/* $fh.$fl $lh.$ll */\n);
my $server = ($s =~ /\./) ? $s : "whois.$s.net";
print qq({ $f, $l,\t"$server" },\t/* $fh.$fl $lh.$ll */\n);
} elsif (($f, $l, $s) = /^(\d+)\s+(\d+)\s+([\w\.-]+)$/) {
my $server = ($s =~ /\./) ? $s : "whois.$s.net";
print qq({ ${f}u, ${l}u,\t"$server" },\n);
} else {
die "format error: $_";
}
}