ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/myhttpd/netgeo.pl
(Generate patch)

Comparing Coro/myhttpd/netgeo.pl (file contents):
Revision 1.18 by root, Sat Dec 8 21:01:16 2007 UTC vs.
Revision 1.19 by root, Sat Jan 23 21:27:51 2010 UTC

22$netgeo::iprange = new BerkeleyDB::Btree 22$netgeo::iprange = new BerkeleyDB::Btree
23 -Env => $db_env, 23 -Env => $db_env,
24 -Filename => "iprange", 24 -Filename => "iprange",
25 -Flags => DB_CREATE, 25 -Flags => DB_CREATE,
26 or die "unable to create/open iprange table"; 26 or die "unable to create/open iprange table";
27
28sub clear_cache() {
29 %netgeo::whois = ();
30 $netgeo::iprange->truncate (my $dummy);
31}
27 32
28package Whois; 33package Whois;
29 34
30use Coro::EV; 35use Coro::EV;
31 36
228 and return; 233 and return;
229 234
230 $whois =~ /^\*de: This network range is not allocated to /m # APINIC e.g. 24.0.0.0 235 $whois =~ /^\*de: This network range is not allocated to /m # APINIC e.g. 24.0.0.0
231 and return; 236 and return;
232 237
238 $whois =~ /^\*de: Not allocated by APNIC/m # APINIC e.g. 189.47.24.97
239 and return;
240
233 $whois =~ /^\*ac: XXX0/m # 192.0.0.0 241 $whois =~ /^\*ac: XXX0/m # 192.0.0.0
234 and return; 242 and return;
235 243
236 $whois =~ /^\*st: (?:ALLOCATED )?UNSPECIFIED/m 244 $whois =~ /^\*st: (?:ALLOCATED )?UNSPECIFIED/m
237 and return; 245 and return;
341 my ($arin, $ripe, $apnic); 349 my ($arin, $ripe, $apnic);
342 350
343 $whois = $WHOIS{RIPE}->ip_request($ip) 351 $whois = $WHOIS{RIPE}->ip_request($ip)
344 || $WHOIS{APNIC} ->ip_request($ip) 352 || $WHOIS{APNIC} ->ip_request($ip)
345 || $WHOIS{ARIN} ->ip_request($ip) 353 || $WHOIS{ARIN} ->ip_request($ip)
346# || $WHOIS{LACNIC}->ip_request($ip) 354 || $WHOIS{LACNIC}->ip_request($ip)
347 ; 355 ;
348 356
349 $whois =~ /^\*in: ([0-9.]+)\s+-\s+([0-9.]+)\s*$/mi 357 $whois =~ /^\*in: ([0-9.]+)\s+-\s+([0-9.]+)\s*$/mi
350 or do { warn "$whois($ip): no addresses found\n", last }; 358 or do { warn "$whois($ip): no addresses found\n", last };
351 359

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines