#!/usr/bin/perl
#!C:\perl\bin\perl.exe
=Copyright Infomation
==========================================================
Program Name : IP To Country Database Maker
Program Author : Ahmed Amin Elsheshtawy
Home Page : http://www.mewsoft.com
Email : support@mewsoft.com
File Version : 1.00
Copyrights © 2008 Mewsoft® Corporation. All rights reserved.
Products: We provide a large line of free and commercial products including:
Auction software, Classifieds software, forum software,Pay per click search engine software,
classified software, Bulletin board software,Website and server backup software, Site Builder Software,
Partners software, Comes Complete With All Source Code In Perl, email spider software,
Website Screenshot Thumbnail, Internet Explorer Website Snapshotter Plugin
==========================================================
Requirements
==========================================================
You need these Perl modules to be installed and their prerequests:
Net::IP;
Net::FTP;
Archive::Zip
==========================================================
Usage
==========================================================
This is a command line program, so you need to run it from the DOS prompt
or Telnet connection on your server. Of course you need to have Perl installed
and the above required Perl modules on your computer or server.
To start the program, simply type at the system prompt, on unix systems:
% perl ip2country.cgi
On Windows systems, from the DOS prompt type:
C:\Perl\bin\perl ip2country.cgi
The program takes between 10 to 20 minutes to complete this process
depends on your internet conncetion and also on ftp.apnic.net traffic, your
connectin may be refused sometimes if their ftp server reached its limit.
==========================================================
License
==========================================================
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
==========================================================
Purpose
==========================================================
This Perl program crawls the IP to country databases from the internet registeries:
afrinic , apnic, arin, iana, lacnic, ripencc
It grabs the latest files from ftp.apnic.net, process them and create a single file contains
the information about all the IP to country mapping for the entire world.
The created "ip2country.txt" file format as follows:
ipstart|ipend|type|registry|date|cc
Where
ipstart: the starting ip of the block
ipend: the ending ip of the block
type: ip version type, ipv4, ipv6
registry: one of these, afrinic , apnic, arin, iana, lacnic, ripencc
date: the date allocated or assigned in the form yyyymmdd
cc: Two letters country code, for exampe "EG" for Egypt
The program also create a compressed zip file called "ip2country.zip" which
contains the file "ip2country.txt" only.
This program handles both IPV4 and IPV6. The IPV6 are very large
long long integers, these are 128 bit integers, for example:
55836662342468902610309824900350607360|55836662342468902610309824900350607378|ipv6|ripencc|20051230|FR
While all IPV4 integers can be handled as long integers like:
3252516352|3252516607|ipv4|ripencc|20050526|GB
To handle IPV6 in Perl you need to use Math::BigInt or alternatives.
==========================================================
Resources
==========================================================
The directory ftp://ftp.apnic.net/pub/stats/apnic/ contains
daily summary reports of the allocations and assignments of numeric
Internet address resources within ranges originally delegated to
APNIC and historical ranges transferred to APNIC by other
registries.
Files formats: ftp://ftp.apnic.net/public/apnic/stats/apnic/README.TXT
==========================================================
=cut
#==========================================================
$| = 1;
#print "Content-type: text/html\n\n";
use CGI::Carp qw(fatalsToBrowser);
#==========================================================
use Net::IP;
use Net::FTP;
use Archive::Zip qw( :ERROR_CODES :CONSTANTS );
#==========================================================
#my @countries = (undef,"AP","EU","AD","AE","AF","AG","AI","AL","AM","AN","AO","AQ","AR","AS","AT","AU","AW","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BM","BN","BO","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","FX","GA","GB","GD","GE","GF","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IN","IO","IQ","IR","IS","IT","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","ST","SV","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TM","TN","TO","TL","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","RS","ZA","ZM","ME","ZW","A1","A2","AX","GG","IM","JE");
#my @code3s = ( undef,"AP","EU","AND","ARE","AFG","ATG","AIA","ALB","ARM","ANT","AGO","AQ","ARG","ASM","AUT","AUS","ABW","AZE","BIH","BRB","BGD","BEL","BFA","BGR","BHR","BDI","BEN","BMU","BRN","BOL","BRA","BHS","BTN","BV","BWA","BLR","BLZ","CAN","CC","COD","CAF","COG","CHE","CIV","COK","CHL","CMR","CHN","COL","CRI","CUB","CPV","CX","CYP","CZE","DEU","DJI","DNK","DMA","DOM","DZA","ECU","EST","EGY","ESH","ERI","ESP","ETH","FIN","FJI","FLK","FSM","FRO","FRA","FX","GAB","GBR","GRD","GEO","GUF","GHA","GIB","GRL","GMB","GIN","GLP","GNQ","GRC","GS","GTM","GUM","GNB","GUY","HKG","HM","HND","HRV","HTI","HUN","IDN","IRL","ISR","IND","IO","IRQ","IRN","ISL","ITA","JAM","JOR","JPN","KEN","KGZ","KHM","KIR","COM","KNA","PRK","KOR","KWT","CYM","KAZ","LAO","LBN","LCA","LIE","LKA","LBR","LSO","LTU","LUX","LVA","LBY","MAR","MCO","MDA","MDG","MHL","MKD","MLI","MMR","MNG","MAC","MNP","MTQ","MRT","MSR","MLT","MUS","MDV","MWI","MEX","MYS","MOZ","NAM","NCL","NER","NFK","NGA","NIC","NLD","NOR","NPL","NRU","NIU","NZL","OMN","PAN","PER","PYF","PNG","PHL","PAK","POL","SPM","PCN","PRI","PSE","PRT","PLW","PRY","QAT","REU","ROM","RUS","RWA","SAU","SLB","SYC","SDN","SWE","SGP","SHN","SVN","SJM","SVK","SLE","SMR","SEN","SOM","SUR","STP","SLV","SYR","SWZ","TCA","TCD","TF","TGO","THA","TJK","TKL","TKM","TUN","TON","TLS","TUR","TTO","TUV","TWN","TZA","UKR","UGA","UM","USA","URY","UZB","VAT","VCT","VEN","VGB","VIR","VNM","VUT","WLF","WSM","YEM","YT","SRB","ZAF","ZMB","MNE","ZWE","A1","A2","ALA","GGY","IMN","JEY");
#my @names = (undef,"Asia/Pacific Region","Europe","Andorra","United Arab Emirates","Afghanistan","Antigua and Barbuda","Anguilla","Albania","Armenia","Netherlands Antilles","Angola","Antarctica","Argentina","American Samoa","Austria","Australia","Aruba","Azerbaijan","Bosnia and Herzegovina","Barbados","Bangladesh","Belgium","Burkina Faso","Bulgaria","Bahrain","Burundi","Benin","Bermuda","Brunei Darussalam","Bolivia","Brazil","Bahamas","Bhutan","Bouvet Island","Botswana","Belarus","Belize","Canada","Cocos (Keeling) Islands","Congo, The Democratic Republic of the","Central African Republic","Congo","Switzerland","Cote D'Ivoire","Cook Islands","Chile","Cameroon","China","Colombia","Costa Rica","Cuba","Cape Verde","Christmas Island","Cyprus","Czech Republic","Germany","Djibouti","Denmark","Dominica","Dominican Republic","Algeria","Ecuador","Estonia","Egypt","Western Sahara","Eritrea","Spain","Ethiopia","Finland","Fiji","Falkland Islands (Malvinas)","Micronesia, Federated States of","Faroe Islands","France","France, Metropolitan","Gabon","United Kingdom","Grenada","Georgia","French Guiana","Ghana","Gibraltar","Greenland","Gambia","Guinea","Guadeloupe","Equatorial Guinea","Greece","South Georgia and the South Sandwich Islands","Guatemala","Guam","Guinea-Bissau","Guyana","Hong Kong","Heard Island and McDonald Islands","Honduras","Croatia","Haiti","Hungary","Indonesia","Ireland","Israel","India","British Indian Ocean Territory","Iraq","Iran, Islamic Republic of","Iceland","Italy","Jamaica","Jordan","Japan","Kenya","Kyrgyzstan","Cambodia","Kiribati","Comoros","Saint Kitts and Nevis","Korea, Democratic People's Republic of","Korea, Republic of","Kuwait","Cayman Islands","Kazakhstan","Lao People's Democratic Republic","Lebanon","Saint Lucia","Liechtenstein","Sri Lanka","Liberia","Lesotho","Lithuania","Luxembourg","Latvia","Libyan Arab Jamahiriya","Morocco","Monaco","Moldova, Republic of","Madagascar","Marshall Islands","Macedonia","Mali","Myanmar","Mongolia","Macau","Northern Mariana Islands","Martinique","Mauritania","Montserrat","Malta","Mauritius","Maldives","Malawi","Mexico","Malaysia","Mozambique","Namibia","New Caledonia","Niger","Norfolk Island","Nigeria","Nicaragua","Netherlands","Norway","Nepal","Nauru","Niue","New Zealand","Oman","Panama","Peru","French Polynesia","Papua New Guinea","Philippines","Pakistan","Poland","Saint Pierre and Miquelon","Pitcairn Islands","Puerto Rico","Palestinian Territory","Portugal","Palau","Paraguay","Qatar","Reunion","Romania","Russian Federation","Rwanda","Saudi Arabia","Solomon Islands","Seychelles","Sudan","Sweden","Singapore","Saint Helena","Slovenia","Svalbard and Jan Mayen","Slovakia","Sierra Leone","San Marino","Senegal","Somalia","Suriname","Sao Tome and Principe","El Salvador","Syrian Arab Republic","Swaziland","Turks and Caicos Islands","Chad","French Southern Territories","Togo","Thailand","Tajikistan","Tokelau","Turkmenistan","Tunisia","Tonga","Timor-Leste","Turkey","Trinidad and Tobago","Tuvalu","Taiwan","Tanzania, United Republic of","Ukraine","Uganda","United States Minor Outlying Islands","United States","Uruguay","Uzbekistan","Holy See (Vatican City State)","Saint Vincent and the Grenadines","Venezuela","Virgin Islands, British","Virgin Islands, U.S.","Vietnam","Vanuatu","Wallis and Futuna","Samoa","Yemen","Mayotte","Serbia","South Africa","Zambia","Montenegro","Zimbabwe","Anonymous Proxy","Satellite Provider","Aland Islands","Guernsey","Isle of Man","Jersey");
my %CountryCode;
#==========================================================
#ftp://ftp.apnic.net/public/apnic/stats/apnic/
#ftp://ftp.apnic.net/public/apnic/stats/apnic/README.TXT
#==========================================================
# Main
#==========================================================
&PrepareCountryCode;
&CrawlRegistries;
&BuildDatabase;
print "Finished!.\n";
exit;
#==========================================================
#==========================================================
sub CrawlRegistries{
&CrawlRegistry('afrinic');
&CrawlRegistry('apnic');
&CrawlRegistry('arin');
&CrawlRegistry('iana');
&CrawlRegistry('lacnic');
&CrawlRegistry('ripe-ncc');
}
#==========================================================
sub CrawlRegistry{
my ($registry) = @_;
print "Rertiving registry: $registry\n";
my $registryfile = $registry;
$registryfile =~ s/\-//;
my $host = 'ftp.apnic.net';
my $user = 'anonymous';
my $password = '-anonymous@mewsoft.com';
my $path = "";
if ($registry eq "apnic") {
$path = '/pub/apnic/stats/' . $registry;
}
else {
$path = '/pub/stats/' . $registry;
}
my $ftp = Net::FTP->new($host, Debug => 0) or die "Cannot connect to $domain: $@";
$ftp->login($user, $password) or die "Cannot login ", $ftp->message;
$ftp->cwd($path) or die "Cannot change working directory ", $ftp->message;
$ftp->ascii or die "Set ASCII mode failed ", $ftp->message;
my $filename = "delegated\-". $registryfile . "\-latest";
$ftp->get($filename, "$registryfile\.txt") or die "retrive file failed ", $ftp->message;
$ftp->quit;
}
#==========================================================
sub BuildDatabase {
my @registry = ('afrinic' ,'apnic', 'arin', 'iana', 'lacnic', 'ripencc');
open OUT, ">ip2countrytemp.txt" or die "Cannot create file ip2country.txt: $!\n";
foreach my $registryname (@registry) {
print "Processing registry: $registryname\n";
my $registryfile = $registryname.".txt";
open IN, "$registryfile" or die "Cannot open file $registryfile: $!";
my @lines = <IN>;
close IN;
foreach my $line (@lines) {
#print "$line\n";
#File format: ftp://ftp.apnic.net/public/apnic/stats/apnic/README.TXT
$line =~ s/^\s+//;
$line =~ s/\s+$//;
if ($line eq "") {next;} #skip empty lines
if ($line =~/^\#/) {next;} #skip comments lines
if ($line =~/^\d+\|/) {next;} #skip version line
if ($line =~/\|summary/) {next;} #skip summary lines
my ($registry, $cc, $type, $start, $value, $date, $status, $extensions) = split /\|/, $line;
#type: asn,ipv4,ipv6
if ($type eq "ipv4" || $type eq "ipv6") {
#print "$start + $value\n";
my $endvalue = $value - 1;
my $ip = new Net::IP ("$start + $endvalue") or die (Net::IP::Error());
$ipstart = $ip->intip();
$ipend = $ip->last_int();
#The output format can be changed to anything
print OUT "$ipstart|$ipend|$type|$registry|$date|$cc\n";
}
}
}
close OUT;
my $size = -s "ip2countrytemp.txt";
if (-e "ip2countrytemp\.txt" && $size >0) {
unlink "ip2country.txt";# or print "does not exist\n";
rename "ip2countrytemp\.txt", "ip2country\.txt" or print "Rename file failed: $!\n";
}
#--------- Zip file--------------
print "Compressing file $File\n";
my $Zip = Archive::Zip->new();
my $Member = $Zip->addFile("ip2country.txt", $File);
my $Member = $Zip->addFile("ip2country.cgi", $File);
$Member->desiredCompressionMethod(COMPRESSION_DEFLATED); #COMPRESSION_STORED
$Member->desiredCompressionLevel(9); #0..9
my $Status = $Zip->writeToFileNamed("ip2country\.zip");
}
#==========================================================
sub my_aton{
my ($ip_address) = @_;
my (@octets,$octet,$ip_number, $ip_address);
@octets = split(/\./, $ip_address);
$ip_number = 0;
foreach $octet (@octets) {
$ip_number <<= 8;
$ip_number |= $octet;
}
return $ip_number;
}
#==========================================================
sub my_ntoa{
my ($ip_number) = @_;
my (@octets,$i,$ip_number,$ip_number_display, $ip_address);
$ip_number_display = $ip_number;
#chomp($ip_number);
for($i = 3; $i >= 0; $i--) {
$octets[$i] = ($ip_number & 0xFF);
$ip_number >>= 8;
}
$ip_address = join('.', @octets);
return $ip_address;
}
#==========================================================
sub get_ip_address() {
my ($gi, $host) = @_;
my $ip_address;
#check if host is ip address
if ($host =~ m!^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$!) {
#host is ip address
$ip_address = $host;
} else {
#host is domain name do a dns lookup
$ip_address = join('.',unpack('C4',(gethostbyname($host))[4]));
}
return $ip_address;
}
#==========================================================
sub addr_to_num {
my @a = split('\.',$_[0]);
return $a[0]*16777216+$a[1]*65536+$a[2]*256+$a[3];
}
#==========================================================
sub PrepareCountryCode{
my @data = <DATA>;
close(DATA);
undef %CountryCode;
foreach my $line (@data) {
$line =~ s/^\s+|\s+$|\n//;
if ($line eq "") {next;}
#@{$country[$Count++]}{qw(alpha2, alpha3, numeric, countries)} = @Row;
my ($alpha2, $alpha3, $numeric, @countries) = split(/:/, $line);
$alpha2 = uc($alpha2);
$alpha3 = uc($alpha3);
$CountryCode{$alpha2}[0] = $alpha2;
$CountryCode{$alpha2}[1] = $alpha3;
$CountryCode{$alpha2}[2] = $numeric;
$CountryCode{$alpha2}[3] = $countries[0];
}
}
#==========================================================
#==========================================================
__DATA__
ad:and:020:Andorra
ae:are:784:United Arab Emirates
af:afg:004:Afghanistan
ag:atg:028:Antigua and Barbuda
ai:aia:660:Anguilla
al:alb:008:Albania
am:arm:051:Armenia
an:ant:530:Netherlands Antilles
ao:ago:024:Angola
aq:ata:010:Antarctica
ar:arg:032:Argentina
as:asm:016:American Samoa
at:aut:040:Austria
au:aus:036:Australia
aw:abw:533:Aruba
ax:ala:248:Aland Islands
az:aze:031:Azerbaijan
ba:bih:070:Bosnia and Herzegovina
bb:brb:052:Barbados
bd:bgd:050:Bangladesh
be:bel:056:Belgium
bf:bfa:854:Burkina Faso
bg:bgr:100:Bulgaria
bh:bhr:048:Bahrain
bi:bdi:108:Burundi
bj:ben:204:Benin
bm:bmu:060:Bermuda
bn:brn:096:Brunei Darussalam
bo:bol:068:Bolivia
br:bra:076:Brazil
bs:bhs:044:Bahamas
bt:btn:064:Bhutan
bv:bvt:074:Bouvet Island
bw:bwa:072:Botswana
by:blr:112:Belarus
bz:blz:084:Belize
ca:can:124:Canada
cc:cck:166:Cocos (Keeling) Islands
cd:cod:180:Congo, The Democratic Republic of the:Zaire:Congo, Democratic Republic of the
cf:caf:140:Central African Republic
cg:cog:178:Congo:Congo, Republic of the
ch:che:756:Switzerland
ci:civ:384:Cote D'Ivoire
ck:cok:184:Cook Islands
cl:chl:152:Chile
cm:cmr:120:Cameroon
cn:chn:156:China
co:col:170:Colombia
cr:cri:188:Costa Rica
cs:scg:891:Serbia and Montenegro:Yugoslavia
cu:cub:192:Cuba
cv:cpv:132:Cape Verde
cx:cxr:162:Christmas Island
cy:cyp:196:Cyprus
cz:cze:203:Czech Republic
de:deu:276:Germany
dj:dji:262:Djibouti
dk:dnk:208:Denmark
dm:dma:212:Dominica
do:dom:214:Dominican Republic
dz:dza:012:Algeria
ec:ecu:218:Ecuador
ee:est:233:Estonia
eg:egy:818:Egypt
eh:esh:732:Western Sahara
er:eri:232:Eritrea
es:esp:724:Spain
et:eth:231:Ethiopia
fi:fin:246:Finland
fj:fji:242:Fiji
fk:flk:238:Falkland Islands (Malvinas):Falkland Islands (Islas Malvinas)
fm:fsm:583:Micronesia, Federated States of
fo:fro:234:Faroe Islands
fr:fra:250:France
fx:fxx:249:France, Metropolitan
ga:gab:266:Gabon
gb:gbr:826:United Kingdom:Great Britain
gd:grd:308:Grenada
ge:geo:268:Georgia
gf:guf:254:French Guiana
gh:gha:288:Ghana
gi:gib:292:Gibraltar
gl:grl:304:Greenland
gm:gmb:270:Gambia
gn:gin:324:Guinea
gp:glp:312:Guadeloupe
gq:gnq:226:Equatorial Guinea
gr:grc:300:Greece
gs:sgs:239:South Georgia and the South Sandwich Islands
gt:gtm:320:Guatemala
gu:gum:316:Guam
gw:gnb:624:Guinea-Bissau
gy:guy:328:Guyana
hk:hkg:344:Hong Kong
hm:hmd:334:Heard Island and McDonald Islands
hn:hnd:340:Honduras
hr:hrv:191:Croatia
ht:hti:332:Haiti
hu:hun:348:Hungary
id:idn:360:Indonesia
ie:irl:372:Ireland
il:isr:376:Israel
in:ind:356:India
io:iot:086:British Indian Ocean Territory
iq:irq:368:Iraq
ir:irn:364:Iran, Islamic Republic of:Iran
is:isl:352:Iceland
it:ita:380:Italy
jm:jam:388:Jamaica
jo:jor:400:Jordan
jp:jpn:392:Japan
ke:ken:404:Kenya
kg:kgz:417:Kyrgyzstan
kh:khm:116:Cambodia
ki:kir:296:Kiribati
km:com:174:Comoros
kn:kna:659:Saint Kitts and Nevis
kp:prk:408:Korea, Democratic People's Republic of:Korea, North:North Korea
kr:kor:410:Korea, Republic of:Korea, South:South Korea
kw:kwt:414:Kuwait
ky:cym:136:Cayman Islands
kz:kaz:398:Kazakhstan:Kazakstan
la:lao:418:Lao People's Democratic Republic
lb:lbn:422:Lebanon
lc:lca:662:Saint Lucia
li:lie:438:Liechtenstein
lk:lka:144:Sri Lanka
lr:lbr:430:Liberia
ls:lso:426:Lesotho
lt:ltu:440:Lithuania
lu:lux:442:Luxembourg
lv:lva:428:Latvia
ly:lby:434:Libyan Arab Jamahiriya:Libya
ma:mar:504:Morocco
mc:mco:492:Monaco
md:mda:498:Moldova, Republic of:Moldova
mg:mdg:450:Madagascar
mh:mhl:584:Marshall Islands
mk:mkd:807:Macedonia, the Former Yugoslav Republic of:Macedonia, Former Yugoslav Republic of:Macedonia
ml:mli:466:Mali
mm:mmr:104:Myanmar:Burma
mn:mng:496:Mongolia
mo:mac:446:Macao:Macau
mp:mnp:580:Northern Mariana Islands
mq:mtq:474:Martinique
mr:mrt:478:Mauritania
ms:msr:500:Montserrat
mt:mlt:470:Malta
mu:mus:480:Mauritius
mv:mdv:462:Maldives
mw:mwi:454:Malawi
mx:mex:484:Mexico
my:mys:458:Malaysia
mz:moz:508:Mozambique
na:nam:516:Namibia
nc:ncl:540:New Caledonia
ne:ner:562:Niger
nf:nfk:574:Norfolk Island
ng:nga:566:Nigeria
ni:nic:558:Nicaragua
nl:nld:528:Netherlands
no:nor:578:Norway
np:npl:524:Nepal
nr:nru:520:Nauru
nu:niu:570:Niue
nz:nzl:554:New Zealand
om:omn:512:Oman
pa:pan:591:Panama
pe:per:604:Peru
pf:pyf:258:French Polynesia
pg:png:598:Papua New Guinea
ph:phl:608:Philippines
pk:pak:586:Pakistan
pl:pol:616:Poland
pm:spm:666:Saint Pierre and Miquelon
pn:pcn:612:Pitcairn:Pitcairn Island
pr:pri:630:Puerto Rico
ps:pse:275:Palestinian Territory, Occupied
pt:prt:620:Portugal
pw:plw:585:Palau
py:pry:600:Paraguay
qa:qat:634:Qatar
re:reu:638:Reunion
ro:rou:642:Romania
ru:rus:643:Russian Federation:Russia
rw:rwa:646:Rwanda
sa:sau:682:Saudi Arabia
sb:slb:090:Solomon Islands
sc:syc:690:Seychelles
sd:sdn:736:Sudan
se:swe:752:Sweden
sg:sgp:702:Singapore
sh:shn:654:Saint Helena
si:svn:705:Slovenia
sj:sjm:744:Svalbard and Jan Mayen:Jan Mayen:Svalbard
sk:svk:703:Slovakia
sl:sle:694:Sierra Leone
sm:smr:674:San Marino
sn:sen:686:Senegal
so:som:706:Somalia
sr:sur:740:Suriname
st:stp:678:Sao Tome and Principe
sv:slv:222:El Salvador
sy:syr:760:Syrian Arab Republic:Syria
sz:swz:748:Swaziland
tc:tca:796:Turks and Caicos Islands
td:tcd:148:Chad
tf:atf:260:French Southern Territories:French Southern and Antarctic Lands
tg:tgo:768:Togo
th:tha:764:Thailand
tj:tjk:762:Tajikistan
tk:tkl:772:Tokelau
tm:tkm:795:Turkmenistan
tn:tun:788:Tunisia
to:ton:776:Tonga
tl:tls:626:Timor-Leste:East Timor
tr:tur:792:Turkey
tt:tto:780:Trinidad and Tobago
tv:tuv:798:Tuvalu
tw:twn:158:Taiwan, Province of China:Taiwan
tz:tza:834:Tanzania, United Republic of:Tanzania
ua:ukr:804:Ukraine
ug:uga:800:Uganda
um:umi:581:United States Minor Outlying Islands
us:usa:840:United States:USA:United States of America
uy:ury:858:Uruguay
uz:uzb:860:Uzbekistan
va:vat:336:Holy See (Vatican City State):Holy See (Vatican City)
vc:vct:670:Saint Vincent and the Grenadines
ve:ven:862:Venezuela
vg:vgb:092:Virgin Islands, British:British Virgin Islands
vi:vir:850:Virgin Islands, U.S.
vn:vnm:704:Vietnam
vu:vut:548:Vanuatu
wf:wlf:876:Wallis and Futuna
ws:wsm:882:Samoa
ye:yem:887:Yemen
yt:myt:175:Mayotte
za:zaf:710:South Africa
zm:zmb:894:Zambia
zw:zwe:716:Zimbabwe
|