Hinzugefügt:
* GeoIP git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@140 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
@@ -12,6 +12,7 @@
|
||||
* Digest-HMAC-1.01
|
||||
* Digest-SHA1-2.10
|
||||
* GD-2.12
|
||||
* Geo-IP-PurePerl-1.17
|
||||
* HTML-Parser-3.45
|
||||
* HTML-Tagset-3.04
|
||||
* IO-stringy-2.110
|
||||
|
||||
98
html/cgi-bin/country.cgi
Executable file
@@ -0,0 +1,98 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
#
|
||||
# This code is distributed under the terms of the GPL
|
||||
#
|
||||
# Country Codes
|
||||
#
|
||||
# 01.01.2006 Stephen Crooks
|
||||
|
||||
use strict;
|
||||
|
||||
use Locale::Country;
|
||||
|
||||
my $flagdir = '/home/httpd/html/images/flags';
|
||||
my $lines = '1';
|
||||
my $lines2 = '';
|
||||
my @flaglist=();
|
||||
my @flaglistfiles=();
|
||||
my $flag = '';
|
||||
|
||||
require '/var/ipcop/general-functions.pl';
|
||||
require "${General::swroot}/lang.pl";
|
||||
require "${General::swroot}/header.pl";
|
||||
|
||||
&Header::showhttpheaders();
|
||||
|
||||
&Header::openpage('Country Codes', 1, '');
|
||||
&Header::openbigbox('100%', 'LEFT');
|
||||
|
||||
&Header::openbox('100%', 'LEFT', 'Flags & Country Codes:');
|
||||
print "<TABLE WIDTH='100%'>";
|
||||
print "<tr><td width='5%'><b>Flag</b></td>";
|
||||
print "<td width='5%'><b>Code</b></td>";
|
||||
print "<td width='40%'><b>Country</b></td>";
|
||||
print "<td><b> </b></td>";
|
||||
print "<td width='5%'><b>Flag</b></td>";
|
||||
print "<td width='5%'><b>Code</b></td>";
|
||||
print "<td width='40%'><b>Country</b></td></tr>";
|
||||
|
||||
@flaglist = <$flagdir/*>;
|
||||
|
||||
undef @flaglistfiles;
|
||||
|
||||
foreach (@flaglist)
|
||||
{
|
||||
if (!-d) { push(@flaglistfiles,substr($_,rindex($_,"/")+1)); }
|
||||
}
|
||||
|
||||
foreach $flag (@flaglistfiles)
|
||||
{
|
||||
$lines++;
|
||||
|
||||
my $flagcode = uc(substr($flag, 0, 2));
|
||||
my $fcode = lc($flagcode);
|
||||
my $country = Locale::Country::code2country($fcode);
|
||||
if($fcode eq 'eu') { $country = 'Europe'; }
|
||||
if($fcode eq 'tp') { $country = 'East Timor'; }
|
||||
if($fcode eq 'yu') { $country = 'Yugoslavia'; }
|
||||
if ($lines % 2) {
|
||||
print "<td><a name='$fcode'/><img src='/images/flags/$fcode.png' border='0' align='absmiddle' alt='$flagcode'</td>";
|
||||
print "<td>$flagcode</td>";
|
||||
print "<td>$country</td></tr>\n";
|
||||
}
|
||||
else {
|
||||
$lines2++;
|
||||
if($lines2 % 2) {
|
||||
print "<tr bgcolor='${Header::table1colour}'>";
|
||||
} else {
|
||||
print "<tr bgcolor='${Header::table2colour}'>";
|
||||
}
|
||||
print "<td><a name='$fcode'/><img src='/images/flags/$fcode.png' border='0' align='absmiddle' alt='$flagcode'</td>";
|
||||
print "<td>$flagcode</td>";
|
||||
print "<td>$country</td>";
|
||||
#print "<td><img src='/blob.gif' alt='*' /></td>";
|
||||
print "<td> </td>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
print "</TABLE>";
|
||||
&Header::closebox();
|
||||
|
||||
&Header::closebigbox();
|
||||
|
||||
print <<END
|
||||
<div align='center'>
|
||||
<table width='80%'>
|
||||
<tr>
|
||||
<td align='center'><a href='$ENV{'HTTP_REFERER'}'>$Lang::tr{'back'}</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
END
|
||||
;
|
||||
|
||||
&Header::closepage();
|
||||
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
#
|
||||
use strict;
|
||||
|
||||
use Geo::IP::PurePerl;
|
||||
use Getopt::Std;
|
||||
|
||||
# enable only the following on debugging purpose
|
||||
#use warnings;
|
||||
#use CGI::Carp 'fatalsToBrowser';
|
||||
@@ -307,6 +310,7 @@ print <<END
|
||||
<td width='5%' align='center' class='boldbase'><b>$Lang::tr{'iface'}</b></td>
|
||||
<td width='5%' align='center' class='boldbase'><b>$Lang::tr{'proto'}</b></td>
|
||||
<td width='16%' align='center' class='boldbase'><b>$Lang::tr{'source'}</b></td>
|
||||
<td align='center' class='boldbase'><b>Flag</b></td>
|
||||
<td width='10%' align='center' class='boldbase'><b>$Lang::tr{'src port'}</b></td>
|
||||
<td width='5%' align='center' class='boldbase'><b>$Lang::tr{'mac address'}</b></td>
|
||||
<td width='16%' align='center' class='boldbase'><b>$Lang::tr{'destination'}</b></td>
|
||||
@@ -326,7 +330,6 @@ foreach $_ (@log)
|
||||
my $comment = $3;
|
||||
my $packet = $4;
|
||||
|
||||
|
||||
$packet =~ /IN=(\w+)/; my $iface=$1;
|
||||
$packet =~ /SRC=([\d\.]+)/; my $srcaddr=$1;
|
||||
$packet =~ /DST=([\d\.]+)/; my $dstaddr=$1;
|
||||
@@ -334,6 +337,11 @@ foreach $_ (@log)
|
||||
$packet =~ /PROTO=(\w+)/; my $proto=$1;
|
||||
$packet =~ /SPT=(\d+)/; my $srcport=$1;
|
||||
$packet =~ /DPT=(\d+)/; my $dstport=$1;
|
||||
|
||||
my $gi = Geo::IP::PurePerl->new();
|
||||
my $ccode = $gi->country_code_by_name($srcaddr);
|
||||
my $fcode = lc($ccode);
|
||||
|
||||
my $servi = uc(getservbyport($srcport, lc($proto)));
|
||||
if ($servi ne '' && $srcport < 1024) {
|
||||
$srcport = "$srcport($servi)"; }
|
||||
@@ -352,11 +360,8 @@ foreach $_ (@log)
|
||||
<td align='center'>$comment</td>
|
||||
<td align='center'>$iface</td>
|
||||
<td align='center'>$proto</td>
|
||||
<td align='center'>
|
||||
<table width='100%' cellpadding='0' cellspacing='0'><tr>
|
||||
<td align='center'><a href='/cgi-bin/ipinfo.cgi?ip=$srcaddr'>$srcaddr</a></td>
|
||||
</tr></table>
|
||||
</td>
|
||||
<td align='center'><a href='../country.cgi#$fcode'><img src='/images/flags/$fcode.png' border='0' align='absmiddle' alt='$ccode'></a></td>
|
||||
<td align='center'>$srcport</td>
|
||||
<td align='center'>$macaddr</td>
|
||||
<td align='center'>
|
||||
|
||||
BIN
html/html/images/flags/ad.png
Normal file
|
After Width: | Height: | Size: 570 B |
BIN
html/html/images/flags/ae.png
Normal file
|
After Width: | Height: | Size: 411 B |
BIN
html/html/images/flags/af.png
Normal file
|
After Width: | Height: | Size: 594 B |
BIN
html/html/images/flags/ag.png
Normal file
|
After Width: | Height: | Size: 670 B |
BIN
html/html/images/flags/ai.png
Normal file
|
After Width: | Height: | Size: 670 B |
BIN
html/html/images/flags/al.png
Normal file
|
After Width: | Height: | Size: 572 B |
BIN
html/html/images/flags/am.png
Normal file
|
After Width: | Height: | Size: 574 B |
BIN
html/html/images/flags/an.png
Normal file
|
After Width: | Height: | Size: 578 B |
BIN
html/html/images/flags/ao.png
Normal file
|
After Width: | Height: | Size: 588 B |
BIN
html/html/images/flags/aq.png
Normal file
|
After Width: | Height: | Size: 610 B |
BIN
html/html/images/flags/ar.png
Normal file
|
After Width: | Height: | Size: 578 B |
BIN
html/html/images/flags/as.png
Normal file
|
After Width: | Height: | Size: 653 B |
BIN
html/html/images/flags/at.png
Normal file
|
After Width: | Height: | Size: 551 B |
BIN
html/html/images/flags/au.png
Normal file
|
After Width: | Height: | Size: 634 B |
BIN
html/html/images/flags/aw.png
Normal file
|
After Width: | Height: | Size: 573 B |
BIN
html/html/images/flags/az.png
Normal file
|
After Width: | Height: | Size: 603 B |
BIN
html/html/images/flags/ba.png
Normal file
|
After Width: | Height: | Size: 619 B |
BIN
html/html/images/flags/bb.png
Normal file
|
After Width: | Height: | Size: 574 B |
BIN
html/html/images/flags/bd.png
Normal file
|
After Width: | Height: | Size: 572 B |
BIN
html/html/images/flags/be.png
Normal file
|
After Width: | Height: | Size: 534 B |
BIN
html/html/images/flags/bf.png
Normal file
|
After Width: | Height: | Size: 568 B |
BIN
html/html/images/flags/bg.png
Normal file
|
After Width: | Height: | Size: 555 B |
BIN
html/html/images/flags/bh.png
Normal file
|
After Width: | Height: | Size: 514 B |
BIN
html/html/images/flags/bi.png
Normal file
|
After Width: | Height: | Size: 668 B |
BIN
html/html/images/flags/bj.png
Normal file
|
After Width: | Height: | Size: 544 B |
BIN
html/html/images/flags/bm.png
Normal file
|
After Width: | Height: | Size: 615 B |
BIN
html/html/images/flags/bn.png
Normal file
|
After Width: | Height: | Size: 633 B |
BIN
html/html/images/flags/bo.png
Normal file
|
After Width: | Height: | Size: 583 B |
BIN
html/html/images/flags/br.png
Normal file
|
After Width: | Height: | Size: 665 B |
BIN
html/html/images/flags/bs.png
Normal file
|
After Width: | Height: | Size: 606 B |
BIN
html/html/images/flags/bt.png
Normal file
|
After Width: | Height: | Size: 614 B |
BIN
html/html/images/flags/bv.png
Normal file
|
After Width: | Height: | Size: 604 B |
BIN
html/html/images/flags/bw.png
Normal file
|
After Width: | Height: | Size: 566 B |
BIN
html/html/images/flags/by.png
Normal file
|
After Width: | Height: | Size: 556 B |
BIN
html/html/images/flags/bz.png
Normal file
|
After Width: | Height: | Size: 618 B |
BIN
html/html/images/flags/ca.png
Normal file
|
After Width: | Height: | Size: 606 B |
BIN
html/html/images/flags/cc.png
Normal file
|
After Width: | Height: | Size: 668 B |
BIN
html/html/images/flags/cd.png
Normal file
|
After Width: | Height: | Size: 608 B |
BIN
html/html/images/flags/cf.png
Normal file
|
After Width: | Height: | Size: 611 B |
BIN
html/html/images/flags/cg.png
Normal file
|
After Width: | Height: | Size: 558 B |
BIN
html/html/images/flags/ch.png
Normal file
|
After Width: | Height: | Size: 581 B |
BIN
html/html/images/flags/ci.png
Normal file
|
After Width: | Height: | Size: 533 B |
BIN
html/html/images/flags/ck.png
Normal file
|
After Width: | Height: | Size: 606 B |
BIN
html/html/images/flags/cl.png
Normal file
|
After Width: | Height: | Size: 481 B |
BIN
html/html/images/flags/cm.png
Normal file
|
After Width: | Height: | Size: 548 B |
BIN
html/html/images/flags/cn.png
Normal file
|
After Width: | Height: | Size: 482 B |
BIN
html/html/images/flags/co.png
Normal file
|
After Width: | Height: | Size: 573 B |
BIN
html/html/images/flags/cr.png
Normal file
|
After Width: | Height: | Size: 593 B |
BIN
html/html/images/flags/cs.png
Normal file
|
After Width: | Height: | Size: 442 B |
BIN
html/html/images/flags/cu.png
Normal file
|
After Width: | Height: | Size: 624 B |
BIN
html/html/images/flags/cv.png
Normal file
|
After Width: | Height: | Size: 603 B |
BIN
html/html/images/flags/cx.png
Normal file
|
After Width: | Height: | Size: 627 B |
BIN
html/html/images/flags/cy.png
Normal file
|
After Width: | Height: | Size: 564 B |
BIN
html/html/images/flags/cz.png
Normal file
|
After Width: | Height: | Size: 582 B |
BIN
html/html/images/flags/de.png
Normal file
|
After Width: | Height: | Size: 540 B |
BIN
html/html/images/flags/dj.png
Normal file
|
After Width: | Height: | Size: 509 B |
BIN
html/html/images/flags/dk.png
Normal file
|
After Width: | Height: | Size: 562 B |
BIN
html/html/images/flags/dm.png
Normal file
|
After Width: | Height: | Size: 681 B |
BIN
html/html/images/flags/do.png
Normal file
|
After Width: | Height: | Size: 607 B |
BIN
html/html/images/flags/dz.png
Normal file
|
After Width: | Height: | Size: 568 B |
BIN
html/html/images/flags/ec.png
Normal file
|
After Width: | Height: | Size: 607 B |
BIN
html/html/images/flags/ee.png
Normal file
|
After Width: | Height: | Size: 543 B |
BIN
html/html/images/flags/eg.png
Normal file
|
After Width: | Height: | Size: 559 B |
BIN
html/html/images/flags/eh.png
Normal file
|
After Width: | Height: | Size: 552 B |
BIN
html/html/images/flags/er.png
Normal file
|
After Width: | Height: | Size: 606 B |
BIN
html/html/images/flags/es.png
Normal file
|
After Width: | Height: | Size: 589 B |
BIN
html/html/images/flags/et.png
Normal file
|
After Width: | Height: | Size: 607 B |
BIN
html/html/images/flags/eu.png
Normal file
|
After Width: | Height: | Size: 632 B |
BIN
html/html/images/flags/fi.png
Normal file
|
After Width: | Height: | Size: 569 B |
BIN
html/html/images/flags/fj.png
Normal file
|
After Width: | Height: | Size: 612 B |
BIN
html/html/images/flags/fk.png
Normal file
|
After Width: | Height: | Size: 684 B |
BIN
html/html/images/flags/fm.png
Normal file
|
After Width: | Height: | Size: 572 B |
BIN
html/html/images/flags/fo.png
Normal file
|
After Width: | Height: | Size: 583 B |
BIN
html/html/images/flags/fr.png
Normal file
|
After Width: | Height: | Size: 522 B |
BIN
html/html/images/flags/ga.png
Normal file
|
After Width: | Height: | Size: 580 B |
BIN
html/html/images/flags/gb.png
Normal file
|
After Width: | Height: | Size: 679 B |
BIN
html/html/images/flags/gd.png
Normal file
|
After Width: | Height: | Size: 599 B |
BIN
html/html/images/flags/ge.png
Normal file
|
After Width: | Height: | Size: 495 B |
BIN
html/html/images/flags/gf.png
Normal file
|
After Width: | Height: | Size: 514 B |
BIN
html/html/images/flags/gh.png
Normal file
|
After Width: | Height: | Size: 456 B |
BIN
html/html/images/flags/gi.png
Normal file
|
After Width: | Height: | Size: 561 B |
BIN
html/html/images/flags/gl.png
Normal file
|
After Width: | Height: | Size: 574 B |
BIN
html/html/images/flags/gm.png
Normal file
|
After Width: | Height: | Size: 457 B |
BIN
html/html/images/flags/gn.png
Normal file
|
After Width: | Height: | Size: 543 B |
BIN
html/html/images/flags/gp.png
Normal file
|
After Width: | Height: | Size: 577 B |
BIN
html/html/images/flags/gq.png
Normal file
|
After Width: | Height: | Size: 585 B |
BIN
html/html/images/flags/gr.png
Normal file
|
After Width: | Height: | Size: 585 B |
BIN
html/html/images/flags/gs.png
Normal file
|
After Width: | Height: | Size: 661 B |
BIN
html/html/images/flags/gt.png
Normal file
|
After Width: | Height: | Size: 595 B |
BIN
html/html/images/flags/gu.png
Normal file
|
After Width: | Height: | Size: 579 B |
BIN
html/html/images/flags/gw.png
Normal file
|
After Width: | Height: | Size: 461 B |
BIN
html/html/images/flags/gy.png
Normal file
|
After Width: | Height: | Size: 535 B |
BIN
html/html/images/flags/hk.png
Normal file
|
After Width: | Height: | Size: 609 B |
BIN
html/html/images/flags/hm.png
Normal file
|
After Width: | Height: | Size: 651 B |
BIN
html/html/images/flags/hn.png
Normal file
|
After Width: | Height: | Size: 578 B |
BIN
html/html/images/flags/hr.png
Normal file
|
After Width: | Height: | Size: 604 B |
BIN
html/html/images/flags/ht.png
Normal file
|
After Width: | Height: | Size: 587 B |