Main Page | Class List | File List | Class Members | File Members

GeoIP.cpp File Reference

#include "GeoIP.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <netdb.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <assert.h>
#include <sys/types.h>
#include <sys/stat.h>

Include dependency graph for GeoIP.cpp:

Go to the source code of this file.

Defines

#define INADDR_NONE   -1
#define COUNTRY_BEGIN   16776960
#define STATE_BEGIN_REV0   16700000
#define STATE_BEGIN_REV1   16000000
#define STRUCTURE_INFO_MAX_SIZE   20
#define DATABASE_INFO_MAX_SIZE   100
#define MAX_ORG_RECORD_LENGTH   300
#define US_OFFSET   1
#define CANADA_OFFSET   677
#define WORLD_OFFSET   1353
#define FIPS_RANGE   360
#define GEOIPDATADIR   "/usr/local/share/GeoIP"
#define CHECK_ERR(err, msg)

Functions

char * _full_path_to (const char *file_name)
void _setup_dbfilename ()
int _file_exists (const char *file_name)
int GeoIP_db_avail (int type)
void _setup_segments (GeoIP *gi)
int _check_mtime (GeoIP *gi)
unsigned int _seek_record (GeoIP *gi, unsigned long ipnum)
unsigned long _addr_to_num (const char *addr)
GeoIPGeoIP_open_type (int type, int flags)
GeoIPGeoIP_new (int flags)
GeoIPGeoIP_open (const char *filename, int flags)
void GeoIP_delete (GeoIP *gi)
const char * GeoIP_country_code_by_name (GeoIP *gi, const char *name)
const char * GeoIP_country_code3_by_name (GeoIP *gi, const char *name)
const char * GeoIP_country_name_by_name (GeoIP *gi, const char *name)
unsigned long lookupaddress (const char *host)
int GeoIP_id_by_name (GeoIP *gi, const char *name)
const char * GeoIP_country_code_by_addr (GeoIP *gi, const char *addr)
const char * GeoIP_country_code3_by_addr (GeoIP *gi, const char *addr)
const char * GeoIP_country_name_by_addr (GeoIP *gi, const char *addr)
const char * GeoIP_country_code_by_ipnum (GeoIP *gi, unsigned long ipnum)
int GeoIP_country_id_by_addr (GeoIP *gi, const char *addr)
int GeoIP_country_id_by_name (GeoIP *gi, const char *host)
int GeoIP_id_by_addr (GeoIP *gi, const char *addr)
int GeoIP_id_by_ipnum (GeoIP *gi, unsigned long ipnum)
char * GeoIP_database_info (GeoIP *gi)
void GeoIP_assign_region_by_inetaddr (GeoIP *gi, unsigned long inetaddr, GeoIPRegion *region)
GeoIPRegion_get_region (GeoIP *gi, unsigned long ipnum)
GeoIPRegionGeoIP_region_by_addr (GeoIP *gi, const char *addr)
GeoIPRegionGeoIP_region_by_name (GeoIP *gi, const char *name)
void GeoIPRegion_delete (GeoIPRegion *gir)
char * _get_name (GeoIP *gi, unsigned long ipnum)
char * GeoIP_name_by_addr (GeoIP *gi, const char *addr)
char * GeoIP_name_by_name (GeoIP *gi, const char *name)
char * GeoIP_org_by_addr (GeoIP *gi, const char *addr)
char * GeoIP_org_by_name (GeoIP *gi, const char *name)
unsigned char GeoIP_database_edition (GeoIP *gi)

Variables

const char GeoIP_country_code [247][3] = { "--","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","TP","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","YU","ZA","ZM","ZR","ZW","A1","A2","O1"}
const char GeoIP_country_code3 [247][4] = { "--","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","ROU","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","TLS","TKM","TUN","TON","TUR","TTO","TUV","TWN","TZA","UKR","UGA","UM","USA","URY","UZB","VAT","VCT","VEN","VGB","VIR","VNM","VUT","WLF","WSM","YEM","YT","YUG","ZAF","ZMB","ZR","ZWE","A1","A2","O1"}
const char * GeoIP_country_name [247]
const char GeoIP_country_continent [247][3] = {"--","AS","EU","EU","AS","AS","SA","SA","EU","AS","SA","AF","AN","SA","OC","EU","OC","SA","AS","EU","SA","AS","EU","AF","EU","AS","AF","AF","SA","AS","SA","SA","SA","AS","AF","AF","EU","SA","NA","AS","AF","AF","AF","EU","AF","OC","SA","AF","AS","SA","SA","SA","AF","AS","AS","EU","EU","AF","EU","SA","SA","AF","SA","EU","AF","AF","AF","EU","AF","EU","OC","SA","OC","EU","EU","EU","AF","EU","SA","AS","SA","AF","EU","SA","AF","AF","SA","AF","EU","SA","SA","OC","AF","SA","AS","AF","SA","EU","SA","EU","AS","EU","AS","AS","AS","AS","AS","EU","EU","SA","AS","AS","AF","AS","AS","OC","AF","SA","AS","AS","AS","SA","AS","AS","AS","SA","EU","AS","AF","AF","EU","EU","EU","AF","AF","EU","EU","AF","OC","EU","AF","AS","AS","AS","OC","SA","AF","SA","EU","AF","AS","AF","NA","AS","AF","AF","OC","AF","OC","AF","SA","EU","EU","AS","OC","OC","OC","AS","SA","SA","OC","OC","AS","AS","EU","SA","OC","SA","AS","EU","OC","SA","AS","AF","EU","AS","AF","AS","OC","AF","AF","EU","AS","AF","EU","EU","EU","AF","EU","AF","AF","SA","AF","SA","AS","AF","SA","AF","AF","AF","AS","AS","OC","AS","AF","OC","AS","AS","SA","OC","AS","AF","EU","AF","OC","NA","SA","AS","EU","SA","SA","SA","SA","AS","OC","OC","OC","AS","AF","EU","AF","AF","AF","AF"}
const char * GeoIPDBDescription [NUM_DB_TYPES] = {NULL, "GeoIP Country Edition", "GeoIP City Edition, Rev 1", "GeoIP Region Edition, Rev 1", "GeoIP ISP Edition", "GeoIP Organization Edition", "GeoIP City Edition, Rev 0", "GeoIP Region Edition, Rev 0","GeoIP Proxy Edition","GeoIP ASNum Edition","GeoIP Netspeed Edition"}
char ** GeoIPDBFileName = NULL


Define Documentation

#define CANADA_OFFSET   677
 

Definition at line 67 of file GeoIP.cpp.

Referenced by GeoIP_assign_region_by_inetaddr().

#define CHECK_ERR err,
msg   ) 
 

Value:

{ \
                if (err != Z_OK) { \
                                fprintf(stderr, "%s error: %d\n", msg, err); \
                                exit(1); \
                } \
}

Definition at line 73 of file GeoIP.cpp.

#define COUNTRY_BEGIN   16776960
 

Definition at line 60 of file GeoIP.cpp.

Referenced by _setup_segments(), GeoIP_id_by_addr(), GeoIP_id_by_ipnum(), and GeoIP_id_by_name().

#define DATABASE_INFO_MAX_SIZE   100
 

Definition at line 64 of file GeoIP.cpp.

Referenced by GeoIP_database_info().

#define FIPS_RANGE   360
 

Definition at line 69 of file GeoIP.cpp.

Referenced by GeoIP_assign_region_by_inetaddr().

#define GEOIPDATADIR   "/usr/local/share/GeoIP"
 

Definition at line 71 of file GeoIP.cpp.

Referenced by _full_path_to().

#define INADDR_NONE   -1
 

Definition at line 57 of file GeoIP.cpp.

Referenced by lookupaddress().

#define MAX_ORG_RECORD_LENGTH   300
 

Definition at line 65 of file GeoIP.cpp.

Referenced by _get_name().

#define STATE_BEGIN_REV0   16700000
 

Definition at line 61 of file GeoIP.cpp.

Referenced by _setup_segments(), and GeoIP_assign_region_by_inetaddr().

#define STATE_BEGIN_REV1   16000000
 

Definition at line 62 of file GeoIP.cpp.

Referenced by _setup_segments(), and GeoIP_assign_region_by_inetaddr().

#define STRUCTURE_INFO_MAX_SIZE   20
 

Definition at line 63 of file GeoIP.cpp.

Referenced by _setup_segments(), and GeoIP_database_info().

#define US_OFFSET   1
 

Definition at line 66 of file GeoIP.cpp.

Referenced by GeoIP_assign_region_by_inetaddr().

#define WORLD_OFFSET   1353
 

Definition at line 68 of file GeoIP.cpp.

Referenced by GeoIP_assign_region_by_inetaddr().


Function Documentation

unsigned long _addr_to_num const char *  addr  ) 
 

Definition at line 315 of file GeoIP.cpp.

Referenced by GeoIP_id_by_addr(), GeoIP_name_by_addr(), and GeoIP_region_by_addr().

int _check_mtime GeoIP gi  ) 
 

Definition at line 211 of file GeoIP.cpp.

References _setup_segments(), GEOIP_CHECK_CACHE, and GEOIP_MEMORY_CACHE.

Referenced by _seek_record(), and GeoIP_database_info().

int _file_exists const char *  file_name  ) 
 

Definition at line 139 of file GeoIP.cpp.

Referenced by GeoIP_db_avail().

char* _full_path_to const char *  file_name  ) 
 

Definition at line 92 of file GeoIP.cpp.

References GEOIPDATADIR.

Referenced by _setup_dbfilename().

char* _get_name GeoIP gi,
unsigned long  ipnum
 

Definition at line 735 of file GeoIP.cpp.

References _seek_record(), GEOIP_ASNUM_EDITION, GEOIP_ISP_EDITION, GEOIP_ORG_EDITION, GeoIPDBDescription, and MAX_ORG_RECORD_LENGTH.

Referenced by GeoIP_name_by_addr(), and GeoIP_name_by_name().

GeoIPRegion* _get_region GeoIP gi,
unsigned long  ipnum
 

Definition at line 691 of file GeoIP.cpp.

References GeoIP_assign_region_by_inetaddr().

Referenced by GeoIP_region_by_addr(), and GeoIP_region_by_name().

unsigned int _seek_record GeoIP gi,
unsigned long  ipnum
 

Definition at line 243 of file GeoIP.cpp.

References _check_mtime(), and MAX_RECORD_LENGTH.

Referenced by _get_name(), GeoIP_assign_region_by_inetaddr(), GeoIP_id_by_addr(), GeoIP_id_by_ipnum(), and GeoIP_id_by_name().

void _setup_dbfilename  ) 
 

Definition at line 121 of file GeoIP.cpp.

References _full_path_to(), GEOIP_ASNUM_EDITION, GEOIP_CITY_EDITION_REV0, GEOIP_CITY_EDITION_REV1, GEOIP_COUNTRY_EDITION, GEOIP_ISP_EDITION, GEOIP_NETSPEED_EDITION, GEOIP_ORG_EDITION, GEOIP_PROXY_EDITION, GEOIP_REGION_EDITION_REV0, GEOIP_REGION_EDITION_REV1, GeoIPDBFileName, and NUM_DB_TYPES.

Referenced by GeoIP_new(), and GeoIP_open_type().

void _setup_segments GeoIP gi  ) 
 

Definition at line 156 of file GeoIP.cpp.

References COUNTRY_BEGIN, GEOIP_ASNUM_EDITION, GEOIP_CITY_EDITION_REV0, GEOIP_CITY_EDITION_REV1, GEOIP_COUNTRY_EDITION, GEOIP_ISP_EDITION, GEOIP_NETSPEED_EDITION, GEOIP_ORG_EDITION, GEOIP_PROXY_EDITION, GEOIP_REGION_EDITION_REV0, GEOIP_REGION_EDITION_REV1, ORG_RECORD_LENGTH, SEGMENT_RECORD_LENGTH, STANDARD_RECORD_LENGTH, STATE_BEGIN_REV0, STATE_BEGIN_REV1, and STRUCTURE_INFO_MAX_SIZE.

Referenced by _check_mtime(), and GeoIP_open().

void GeoIP_assign_region_by_inetaddr GeoIP gi,
unsigned long  inetaddr,
GeoIPRegion region
 

Definition at line 646 of file GeoIP.cpp.

References _seek_record(), CANADA_OFFSET, FIPS_RANGE, GeoIP_country_code, GEOIP_REGION_EDITION_REV0, GEOIP_REGION_EDITION_REV1, STATE_BEGIN_REV0, STATE_BEGIN_REV1, US_OFFSET, and WORLD_OFFSET.

Referenced by _get_region().

const char* GeoIP_country_code3_by_addr GeoIP gi,
const char *  addr
 

Definition at line 536 of file GeoIP.cpp.

References GeoIP_country_code3, and GeoIP_id_by_addr().

Referenced by GeoIPWrapper::getCountryCode3ByAddr().

const char* GeoIP_country_code3_by_name GeoIP gi,
const char *  name
 

Definition at line 456 of file GeoIP.cpp.

References GeoIP_country_code3, and GeoIP_id_by_name().

Referenced by GeoIPWrapper::getCountryCode3ByName().

const char* GeoIP_country_code_by_addr GeoIP gi,
const char *  addr
 

Definition at line 530 of file GeoIP.cpp.

References GeoIP_country_code, and GeoIP_id_by_addr().

Referenced by GeoIPWrapper::getCountryCodeByAddr().

const char* GeoIP_country_code_by_ipnum GeoIP gi,
unsigned long  ipnum
 

Definition at line 550 of file GeoIP.cpp.

References GeoIP_country_code, and GeoIP_id_by_ipnum().

const char* GeoIP_country_code_by_name GeoIP gi,
const char *  name
 

Definition at line 450 of file GeoIP.cpp.

References GeoIP_country_code, and GeoIP_id_by_name().

Referenced by GeoIPWrapper::getCountryCodeByName().

int GeoIP_country_id_by_addr GeoIP gi,
const char *  addr
 

Definition at line 556 of file GeoIP.cpp.

References GeoIP_id_by_addr().

int GeoIP_country_id_by_name GeoIP gi,
const char *  host
 

Definition at line 560 of file GeoIP.cpp.

References GeoIP_id_by_name().

const char* GeoIP_country_name_by_addr GeoIP gi,
const char *  addr
 

Definition at line 543 of file GeoIP.cpp.

References GeoIP_country_name, and GeoIP_id_by_addr().

Referenced by GeoIPWrapper::getCountryNameByAddr().

const char* GeoIP_country_name_by_name GeoIP gi,
const char *  name
 

Definition at line 462 of file GeoIP.cpp.

References GeoIP_country_name, and GeoIP_id_by_name().

Referenced by GeoIPWrapper::getCountryNameByName().

unsigned char GeoIP_database_edition GeoIP gi  ) 
 

Definition at line 794 of file GeoIP.cpp.

char* GeoIP_database_info GeoIP gi  ) 
 

Definition at line 600 of file GeoIP.cpp.

References _check_mtime(), DATABASE_INFO_MAX_SIZE, and STRUCTURE_INFO_MAX_SIZE.

int GeoIP_db_avail int  type  ) 
 

Definition at line 144 of file GeoIP.cpp.

References _file_exists(), GeoIPDBFileName, and NUM_DB_TYPES.

void GeoIP_delete GeoIP gi  ) 
 

Definition at line 436 of file GeoIP.cpp.

Referenced by GeoIPWrapper::~GeoIPWrapper().

int GeoIP_id_by_addr GeoIP gi,
const char *  addr
 

Definition at line 564 of file GeoIP.cpp.

References _addr_to_num(), _seek_record(), COUNTRY_BEGIN, GEOIP_COUNTRY_EDITION, GEOIP_NETSPEED_EDITION, GEOIP_PROXY_EDITION, and GeoIPDBDescription.

Referenced by GeoIP_country_code3_by_addr(), GeoIP_country_code_by_addr(), GeoIP_country_id_by_addr(), GeoIP_country_name_by_addr(), and GeoIPWrapper::getIdByAddr().

int GeoIP_id_by_ipnum GeoIP gi,
unsigned long  ipnum
 

Definition at line 583 of file GeoIP.cpp.

References _seek_record(), COUNTRY_BEGIN, GEOIP_COUNTRY_EDITION, GEOIP_NETSPEED_EDITION, GEOIP_PROXY_EDITION, and GeoIPDBDescription.

Referenced by GeoIP_country_code_by_ipnum().

int GeoIP_id_by_name GeoIP gi,
const char *  name
 

Definition at line 513 of file GeoIP.cpp.

References _seek_record(), COUNTRY_BEGIN, GEOIP_COUNTRY_EDITION, GEOIP_NETSPEED_EDITION, GEOIP_PROXY_EDITION, GeoIPDBDescription, and lookupaddress().

Referenced by GeoIP_country_code3_by_name(), GeoIP_country_code_by_name(), GeoIP_country_id_by_name(), GeoIP_country_name_by_name(), and GeoIPWrapper::getIdByName().

char* GeoIP_name_by_addr GeoIP gi,
const char *  addr
 

Definition at line 767 of file GeoIP.cpp.

References _addr_to_num(), and _get_name().

Referenced by GeoIP_org_by_addr().

char* GeoIP_name_by_name GeoIP gi,
const char *  name
 

Definition at line 776 of file GeoIP.cpp.

References _get_name(), and lookupaddress().

Referenced by GeoIP_org_by_name().

GeoIP* GeoIP_new int  flags  ) 
 

Definition at line 367 of file GeoIP.cpp.

References _setup_dbfilename(), GEOIP_COUNTRY_EDITION, GeoIP_open(), and GeoIPDBFileName.

Referenced by GeoIPWrapper::GeoIPWrapper().

GeoIP* GeoIP_open const char *  filename,
int  flags
 

Definition at line 374 of file GeoIP.cpp.

References _setup_segments(), GEOIP_INDEX_CACHE, and GEOIP_MEMORY_CACHE.

Referenced by GeoIP_new(), GeoIP_open_type(), and GeoIPWrapper::GeoIPWrapper().

GeoIP* GeoIP_open_type int  type,
int  flags
 

Definition at line 350 of file GeoIP.cpp.

References _setup_dbfilename(), GeoIP_open(), GeoIPDBFileName, and NUM_DB_TYPES.

char* GeoIP_org_by_addr GeoIP gi,
const char *  addr
 

Definition at line 786 of file GeoIP.cpp.

References GeoIP_name_by_addr().

char* GeoIP_org_by_name GeoIP gi,
const char *  name
 

Definition at line 790 of file GeoIP.cpp.

References GeoIP_name_by_name().

GeoIPRegion* GeoIP_region_by_addr GeoIP gi,
const char *  addr
 

Definition at line 701 of file GeoIP.cpp.

References _addr_to_num(), _get_region(), GEOIP_REGION_EDITION_REV0, GEOIP_REGION_EDITION_REV1, and GeoIPDBDescription.

GeoIPRegion* GeoIP_region_by_name GeoIP gi,
const char *  name
 

Definition at line 715 of file GeoIP.cpp.

References _get_region(), GEOIP_REGION_EDITION_REV0, GEOIP_REGION_EDITION_REV1, GeoIPDBDescription, and lookupaddress().

void GeoIPRegion_delete GeoIPRegion gir  ) 
 

Definition at line 730 of file GeoIP.cpp.

unsigned long lookupaddress const char *  host  ) 
 

Definition at line 468 of file GeoIP.cpp.

References INADDR_NONE.

Referenced by GeoIP_id_by_name(), GeoIP_name_by_name(), and GeoIP_region_by_name().


Variable Documentation

const char GeoIP_country_code[247][3] = { "--","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","TP","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","YU","ZA","ZM","ZR","ZW","A1","A2","O1"}
 

Definition at line 80 of file GeoIP.cpp.

Referenced by GeoIP_assign_region_by_inetaddr(), GeoIP_country_code_by_addr(), GeoIP_country_code_by_ipnum(), GeoIP_country_code_by_name(), and GeoIPWrapper::idToCountryCode().

const char GeoIP_country_code3[247][4] = { "--","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","ROU","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","TLS","TKM","TUN","TON","TUR","TTO","TUV","TWN","TZA","UKR","UGA","UM","USA","URY","UZB","VAT","VCT","VEN","VGB","VIR","VNM","VUT","WLF","WSM","YEM","YT","YUG","ZAF","ZMB","ZR","ZWE","A1","A2","O1"}
 

Definition at line 82 of file GeoIP.cpp.

Referenced by GeoIP_country_code3_by_addr(), GeoIP_country_code3_by_name(), and GeoIPWrapper::idToCountryCode3().

const char GeoIP_country_continent[247][3] = {"--","AS","EU","EU","AS","AS","SA","SA","EU","AS","SA","AF","AN","SA","OC","EU","OC","SA","AS","EU","SA","AS","EU","AF","EU","AS","AF","AF","SA","AS","SA","SA","SA","AS","AF","AF","EU","SA","NA","AS","AF","AF","AF","EU","AF","OC","SA","AF","AS","SA","SA","SA","AF","AS","AS","EU","EU","AF","EU","SA","SA","AF","SA","EU","AF","AF","AF","EU","AF","EU","OC","SA","OC","EU","EU","EU","AF","EU","SA","AS","SA","AF","EU","SA","AF","AF","SA","AF","EU","SA","SA","OC","AF","SA","AS","AF","SA","EU","SA","EU","AS","EU","AS","AS","AS","AS","AS","EU","EU","SA","AS","AS","AF","AS","AS","OC","AF","SA","AS","AS","AS","SA","AS","AS","AS","SA","EU","AS","AF","AF","EU","EU","EU","AF","AF","EU","EU","AF","OC","EU","AF","AS","AS","AS","OC","SA","AF","SA","EU","AF","AS","AF","NA","AS","AF","AF","OC","AF","OC","AF","SA","EU","EU","AS","OC","OC","OC","AS","SA","SA","OC","OC","AS","AS","EU","SA","OC","SA","AS","EU","OC","SA","AS","AF","EU","AS","AF","AS","OC","AF","AF","EU","AS","AF","EU","EU","EU","AF","EU","AF","AF","SA","AF","SA","AS","AF","SA","AF","AF","AF","AS","AS","OC","AS","AF","OC","AS","AS","SA","OC","AS","AF","EU","AF","OC","NA","SA","AS","EU","SA","SA","SA","SA","AS","OC","OC","OC","AS","AF","EU","AF","AF","AF","AF"}
 

Definition at line 88 of file GeoIP.cpp.

const char* GeoIP_country_name[247]
 

Initial value:

 {"N/A","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, Occupied","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","East Timor","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","Yugoslavia","South Africa","Zambia","Zaire","Zimbabwe",
"Anonymous Proxy","Satellite Provider","Other"}

Definition at line 84 of file GeoIP.cpp.

Referenced by GeoIP_country_name_by_addr(), GeoIP_country_name_by_name(), and GeoIPWrapper::idToCountryName().

const char* GeoIPDBDescription[NUM_DB_TYPES] = {NULL, "GeoIP Country Edition", "GeoIP City Edition, Rev 1", "GeoIP Region Edition, Rev 1", "GeoIP ISP Edition", "GeoIP Organization Edition", "GeoIP City Edition, Rev 0", "GeoIP Region Edition, Rev 0","GeoIP Proxy Edition","GeoIP ASNum Edition","GeoIP Netspeed Edition"}
 

Definition at line 90 of file GeoIP.cpp.

Referenced by _get_name(), GeoIP_id_by_addr(), GeoIP_id_by_ipnum(), GeoIP_id_by_name(), GeoIP_region_by_addr(), and GeoIP_region_by_name().

char** GeoIPDBFileName = NULL
 

Definition at line 119 of file GeoIP.cpp.

Referenced by _setup_dbfilename(), GeoIP_db_avail(), GeoIP_new(), and GeoIP_open_type().


Generated on Tue Jun 28 01:09:09 2005 for CountryFilter by  doxygen 1.4.3-20050623