… | |
… | |
120 | sub ip_request { |
120 | sub ip_request { |
121 | my ($self, $ip) = @_; |
121 | my ($self, $ip) = @_; |
122 | |
122 | |
123 | my $whois = $self->whois_request($ip); |
123 | my $whois = $self->whois_request($ip); |
124 | |
124 | |
125 | return () if $whois =~ /^No match/; |
125 | return if $whois =~ /^No match/; |
|
|
126 | return if $whois =~ /^\*de: This network range is not allocated to /; # APINIC e.g. 24.0.0.0 |
126 | |
127 | |
127 | if ($whois =~ /^To single out one record/m) { |
128 | if ($whois =~ /^To single out one record/m) { |
128 | my $handle; |
129 | my $handle; |
129 | while ($whois =~ /\G\S.*\(([A-Z0-9\-]+)\).*\n/mg) { |
130 | while ($whois =~ /\G\S.*\(([A-Z0-9\-]+)\).*\n/mg) { |
130 | $handle = $1; |
131 | $handle = $1; |
131 | #return if $handle =~ /-(RIPE|APNIC)/; # heuristic, bbut bad because ripe might not have better info |
132 | #return if $handle =~ /-(RIPE|APNIC)/; # heuristic, but bad because ripe might not have better info |
132 | } |
133 | } |
133 | $handle or die "$whois ($ip): unparseable multimatch\n"; |
134 | $handle or die "$whois ($ip): unparseable multimatch\n"; |
134 | $whois = $self->whois_request("!$handle"); |
135 | $whois = $self->whois_request("!$handle"); |
135 | } |
136 | } |
136 | |
137 | |