|
Revision 1560, 0.7 kB
(checked in by mbr, 3 years ago)
|
added missed files from whois-4.7.13
|
- Property svn:executable set to
*
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
use strict; |
|---|
| 4 |
|
|---|
| 5 |
while (<>) { |
|---|
| 6 |
chomp; |
|---|
| 7 |
s/^\s*(.*)\s*$/$1/; |
|---|
| 8 |
s/\s* |
|---|
| 9 |
next if /^$/; |
|---|
| 10 |
|
|---|
| 11 |
die "invalid line:\n$_\n" |
|---|
| 12 |
if not m |
|---|
| 13 |
my $len = $3; my $s = $4; |
|---|
| 14 |
my $i1 = $1; my $i2 = $2; |
|---|
| 15 |
my $net = (hex($i1) << 16) + hex $i2; |
|---|
| 16 |
|
|---|
| 17 |
if (0) { |
|---|
| 18 |
my $bs = unpack('B32', pack('N', $net)); |
|---|
| 19 |
$bs =~ s/(.{8})/$1 /g; |
|---|
| 20 |
print "${i1}:${i2}::/$len\t$bs $s\n"; |
|---|
| 21 |
next; |
|---|
| 22 |
} |
|---|
| 23 |
|
|---|
| 24 |
print qq|{ ${net}UL, $len, "|; |
|---|
| 25 |
if ($s =~ /\./) { |
|---|
| 26 |
print $s; |
|---|
| 27 |
} elsif ($s eq '6to4') { |
|---|
| 28 |
print "\\x0A"; |
|---|
| 29 |
} elsif ($s eq 'UNALLOCATED') { |
|---|
| 30 |
print "\\006"; |
|---|
| 31 |
} else { |
|---|
| 32 |
print $s =~ /\./ ? $s : "whois.$s.net"; |
|---|
| 33 |
} |
|---|
| 34 |
print qq|" },\n|; |
|---|
| 35 |
} |
|---|
| 36 |
|
|---|