summaryrefslogtreecommitdiff
path: root/make_as32_del.pl
blob: 15bbdbb6b05071a210b657757b29a743c7e90767 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/perl

use warnings;
use strict;

while (<STDIN>) {
	chomp;
	s/^\s*(.+)\s*$/$1/;
	s/\s*#.*$//;
	next if /^$/;

	my ($fh, $fl, $lh, $ll, $s) = /^(\d+)\.(\d+)\s+(\d+)\.(\d+)\s+([\w\.-]+)$/;
	die "format error: $_" unless $s;

	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);
}