GeoIP
1.6.12
About: GeoIP is a C library that enables the user to find the country that any IP address or hostname originates from (contains an initial free GeoIP Country database).
![]() ![]() |
#include <sys/types.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
Go to the source code of this file.
Data Structures | |
struct | GeoIPTag |
struct | GeoIPLookup |
struct | GeoIPRegionTag |
Macros | |
#define | SEGMENT_RECORD_LENGTH 3 |
#define | LARGE_SEGMENT_RECORD_LENGTH 4 |
#define | STANDARD_RECORD_LENGTH 3 |
#define | ORG_RECORD_LENGTH 4 |
#define | MAX_RECORD_LENGTH 4 |
#define | NUM_DB_TYPES (38 + 1) |
#define | GEOIP_CHKBIT_V6(bit, ptr) (ptr[((127UL - bit) >> 3)] & (1UL << (~(127 - bit) & 7))) |
#define | GEOIP_API |
#define | GEOIP_DATA |
Typedefs | |
typedef struct in6_addr | geoipv6_t |
typedef struct GeoIPTag | GeoIP |
typedef struct GeoIPLookup | GeoIPLookup |
typedef struct GeoIPRegionTag | GeoIPRegion |
Variables | |
char ** | GeoIPDBFileName |
const char * | GeoIPDBDescription [(38+1)] |
const char * | GeoIPCountryDBFileName |
const char * | GeoIPRegionDBFileName |
const char * | GeoIPCityDBFileName |
const char * | GeoIPOrgDBFileName |
const char * | GeoIPISPDBFileName |
const char * | GeoIPLocationADBFileName |
const char * | GeoIPAccuracyRadiusFileName |
const char * | GeoIPCityConfidenceFileName |
char * | GeoIP_custom_directory |
const char | GeoIP_country_code [256][3] |
const char | GeoIP_country_code3 [256][4] |
const char * | GeoIP_country_name [256] |
const char * | GeoIP_utf8_country_name [256] |
const char | GeoIP_country_continent [256][3] |
#define GEOIP_CHKBIT_V6 | ( | bit, | |
ptr | |||
) | (ptr[((127UL - bit) >> 3)] & (1UL << (~(127 - bit) & 7))) |
typedef struct GeoIPLookup GeoIPLookup |
typedef struct GeoIPRegionTag GeoIPRegion |
enum GeoIPCharset |
enum GeoIPDBTypes |
enum GeoIPExtFlags |
enum GeoIPNetspeedValues |
enum GeoIPOptions |
enum GeoIPProxyTypes |
char* _GeoIP_iso_8859_1__utf8 | ( | const char * | iso | ) |
Definition at line 980 of file GeoIP.c.
Referenced by _extract_record(), _get_name_gl(), and _get_name_v6_gl().
unsigned long GeoIP_addr_to_num | ( | const char * | addr | ) |
Definition at line 1545 of file GeoIP.c.
Referenced by GeoIP_id_by_addr_gl(), GeoIP_is_private_v4(), GeoIP_name_by_addr_gl(), GeoIP_range_by_ip_gl(), GeoIP_record_by_addr(), GeoIP_record_id_by_addr(), and GeoIP_region_by_addr_gl().
void GeoIP_assign_region_by_inetaddr | ( | GeoIP * | gi, |
unsigned long | inetaddr, | ||
GeoIPRegion * | gir | ||
) |
Definition at line 177 of file GeoIP_deprecated.c.
References GeoIP_assign_region_by_inetaddr_gl().
void GeoIP_assign_region_by_inetaddr_gl | ( | GeoIP * | gi, |
unsigned long | inetaddr, | ||
GeoIPRegion * | gir, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 2171 of file GeoIP.c.
References _GeoIP_seek_record_gl(), CANADA_OFFSET, GeoIPRegionTag::country_code, GeoIPTag::databaseType, FIPS_RANGE, GeoIP_code_by_id(), GEOIP_REGION_EDITION_REV0, GEOIP_REGION_EDITION_REV1, GeoIPRegionTag::region, STATE_BEGIN_REV0, STATE_BEGIN_REV1, US_OFFSET, and WORLD_OFFSET.
Referenced by _get_region_gl(), and GeoIP_assign_region_by_inetaddr().
void GeoIP_assign_region_by_inetaddr_v6 | ( | GeoIP * | gi, |
geoipv6_t | inetaddr, | ||
GeoIPRegion * | gir | ||
) |
Definition at line 184 of file GeoIP_deprecated.c.
References GeoIP_assign_region_by_inetaddr_v6_gl().
void GeoIP_assign_region_by_inetaddr_v6_gl | ( | GeoIP * | gi, |
geoipv6_t | inetaddr, | ||
GeoIPRegion * | gir, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 2227 of file GeoIP.c.
References _GeoIP_seek_record_v6_gl(), CANADA_OFFSET, GeoIPRegionTag::country_code, GeoIPTag::databaseType, FIPS_RANGE, GeoIP_code_by_id(), GEOIP_REGION_EDITION_REV0, GEOIP_REGION_EDITION_REV1, GeoIPRegionTag::region, STATE_BEGIN_REV0, STATE_BEGIN_REV1, US_OFFSET, and WORLD_OFFSET.
Referenced by _get_region_v6_gl(), and GeoIP_assign_region_by_inetaddr_v6().
int GeoIP_charset | ( | GeoIP * | gi | ) |
Definition at line 2677 of file GeoIP.c.
References GeoIPTag::charset.
int GeoIP_cleanup | ( | void | ) |
Definition at line 2748 of file GeoIP.c.
References GeoIPDBFileName, and NUM_DB_TYPES.
const char* GeoIP_code3_by_id | ( | int | id | ) |
return three letter country code
Definition at line 2695 of file GeoIP.c.
References GeoIP_country_code3, and num_GeoIP_countries.
Referenced by GeoIP_country_code3_by_addr_gl(), GeoIP_country_code3_by_addr_v6_gl(), GeoIP_country_code3_by_ipnum_gl(), GeoIP_country_code3_by_ipnum_v6_gl(), GeoIP_country_code3_by_name_gl(), and GeoIP_country_code3_by_name_v6_gl().
const char* GeoIP_code_by_id | ( | int | id | ) |
return two letter country code
Definition at line 2686 of file GeoIP.c.
References GeoIP_country_code, and num_GeoIP_countries.
Referenced by GeoIP_assign_region_by_inetaddr_gl(), GeoIP_assign_region_by_inetaddr_v6_gl(), GeoIP_country_code_by_addr_gl(), GeoIP_country_code_by_addr_v6_gl(), GeoIP_country_code_by_ipnum_gl(), GeoIP_country_code_by_ipnum_v6_gl(), GeoIP_country_code_by_name_gl(), and GeoIP_country_code_by_name_v6_gl().
const char* GeoIP_continent_by_id | ( | int | id | ) |
return continent of country
Definition at line 2723 of file GeoIP.c.
References GeoIP_country_continent, and num_GeoIP_countries.
const char* GeoIP_country_code3_by_addr | ( | GeoIP * | gi, |
const char * | addr | ||
) |
Definition at line 99 of file GeoIP_deprecated.c.
References GeoIP_country_code3_by_addr_gl().
const char* GeoIP_country_code3_by_addr_gl | ( | GeoIP * | gi, |
const char * | addr, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 1946 of file GeoIP.c.
References GeoIP_code3_by_id(), and GeoIP_id_by_addr_gl().
Referenced by GeoIP_country_code3_by_addr().
const char* GeoIP_country_code3_by_addr_v6 | ( | GeoIP * | gi, |
const char * | addr | ||
) |
Definition at line 94 of file GeoIP_deprecated.c.
References GeoIP_country_code3_by_addr_v6_gl().
const char* GeoIP_country_code3_by_addr_v6_gl | ( | GeoIP * | gi, |
const char * | addr, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 1937 of file GeoIP.c.
References GeoIP_code3_by_id(), and GeoIP_id_by_addr_v6_gl().
Referenced by GeoIP_country_code3_by_addr_v6().
const char* GeoIP_country_code3_by_ipnum | ( | GeoIP * | gi, |
unsigned long | ipnum | ||
) |
Definition at line 133 of file GeoIP_deprecated.c.
References GeoIP_country_code3_by_ipnum_gl().
const char* GeoIP_country_code3_by_ipnum_gl | ( | GeoIP * | gi, |
unsigned long | ipnum, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 1996 of file GeoIP.c.
References GeoIP_code3_by_id(), and GeoIP_id_by_ipnum_gl().
Referenced by GeoIP_country_code3_by_ipnum().
Definition at line 138 of file GeoIP_deprecated.c.
References GeoIP_country_code3_by_ipnum_v6_gl().
const char* GeoIP_country_code3_by_ipnum_v6_gl | ( | GeoIP * | gi, |
geoipv6_t | ipnum, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 2004 of file GeoIP.c.
References GeoIP_code3_by_id(), and GeoIP_id_by_ipnum_v6_gl().
Referenced by GeoIP_country_code3_by_ipnum_v6().
const char* GeoIP_country_code3_by_name | ( | GeoIP * | gi, |
const char * | host | ||
) |
Definition at line 61 of file GeoIP_deprecated.c.
References GeoIP_country_code3_by_name_gl().
const char* GeoIP_country_code3_by_name_gl | ( | GeoIP * | gi, |
const char * | host, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 1783 of file GeoIP.c.
References GeoIP_code3_by_id(), and GeoIP_id_by_name_gl().
Referenced by GeoIP_country_code3_by_name().
const char* GeoIP_country_code3_by_name_v6 | ( | GeoIP * | gi, |
const char * | host | ||
) |
Definition at line 56 of file GeoIP_deprecated.c.
References GeoIP_country_code3_by_name_v6_gl().
const char* GeoIP_country_code3_by_name_v6_gl | ( | GeoIP * | gi, |
const char * | host, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 1774 of file GeoIP.c.
References GeoIP_code3_by_id(), and GeoIP_id_by_name_v6_gl().
Referenced by GeoIP_country_code3_by_name_v6().
const char* GeoIP_country_code_by_addr | ( | GeoIP * | gi, |
const char * | addr | ||
) |
Definition at line 89 of file GeoIP_deprecated.c.
References GeoIP_country_code_by_addr_gl().
const char* GeoIP_country_code_by_addr_gl | ( | GeoIP * | gi, |
const char * | addr, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 1932 of file GeoIP.c.
References GeoIP_code_by_id(), and GeoIP_id_by_addr_gl().
Referenced by GeoIP_country_code_by_addr().
const char* GeoIP_country_code_by_addr_v6 | ( | GeoIP * | gi, |
const char * | addr | ||
) |
Definition at line 85 of file GeoIP_deprecated.c.
References GeoIP_country_code_by_addr_v6_gl().
const char* GeoIP_country_code_by_addr_v6_gl | ( | GeoIP * | gi, |
const char * | addr, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 1925 of file GeoIP.c.
References GeoIP_code_by_id(), and GeoIP_id_by_addr_v6_gl().
Referenced by GeoIP_country_code_by_addr_v6().
const char* GeoIP_country_code_by_ipnum | ( | GeoIP * | gi, |
unsigned long | ipnum | ||
) |
Definition at line 128 of file GeoIP_deprecated.c.
References GeoIP_country_code_by_ipnum_gl().
const char* GeoIP_country_code_by_ipnum_gl | ( | GeoIP * | gi, |
unsigned long | ipnum, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 1981 of file GeoIP.c.
References GeoIP_code_by_id(), and GeoIP_id_by_ipnum_gl().
Referenced by GeoIP_country_code_by_ipnum().
Definition at line 123 of file GeoIP_deprecated.c.
References GeoIP_country_code_by_ipnum_v6_gl().
const char* GeoIP_country_code_by_ipnum_v6_gl | ( | GeoIP * | gi, |
geoipv6_t | ipnum, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 1990 of file GeoIP.c.
References GeoIP_code_by_id(), and GeoIP_id_by_ipnum_v6_gl().
Referenced by GeoIP_country_code_by_ipnum_v6().
const char* GeoIP_country_code_by_name | ( | GeoIP * | gi, |
const char * | host | ||
) |
Definition at line 51 of file GeoIP_deprecated.c.
References GeoIP_country_code_by_name_gl().
const char* GeoIP_country_code_by_name_gl | ( | GeoIP * | gi, |
const char * | host, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 1768 of file GeoIP.c.
References GeoIP_code_by_id(), and GeoIP_id_by_name_gl().
Referenced by GeoIP_country_code_by_name().
const char* GeoIP_country_code_by_name_v6 | ( | GeoIP * | gi, |
const char * | host | ||
) |
Definition at line 46 of file GeoIP_deprecated.c.
References GeoIP_country_code_by_name_v6_gl().
const char* GeoIP_country_code_by_name_v6_gl | ( | GeoIP * | gi, |
const char * | host, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 1761 of file GeoIP.c.
References GeoIP_code_by_id(), and GeoIP_id_by_name_v6_gl().
Referenced by GeoIP_country_code_by_name_v6().
int GeoIP_country_id_by_addr | ( | GeoIP * | gi, |
const char * | addr | ||
) |
Definition at line 148 of file GeoIP_deprecated.c.
References GeoIP_id_by_addr_gl().
int GeoIP_country_id_by_addr_v6 | ( | GeoIP * | gi, |
const char * | addr | ||
) |
Definition at line 143 of file GeoIP_deprecated.c.
References GeoIP_id_by_addr_v6_gl().
int GeoIP_country_id_by_name | ( | GeoIP * | gi, |
const char * | host | ||
) |
Definition at line 156 of file GeoIP_deprecated.c.
References GeoIP_id_by_name_gl().
const char* GeoIP_country_name_by_addr | ( | GeoIP * | gi, |
const char * | addr | ||
) |
Definition at line 108 of file GeoIP_deprecated.c.
References GeoIP_country_name_by_addr_gl().
const char* GeoIP_country_name_by_addr_gl | ( | GeoIP * | gi, |
const char * | addr, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 1960 of file GeoIP.c.
References GeoIP_country_name_by_id(), and GeoIP_id_by_addr_gl().
Referenced by GeoIP_country_name_by_addr().
const char* GeoIP_country_name_by_addr_v6 | ( | GeoIP * | gi, |
const char * | addr | ||
) |
Definition at line 104 of file GeoIP_deprecated.c.
References GeoIP_country_name_by_addr_v6_gl().
const char* GeoIP_country_name_by_addr_v6_gl | ( | GeoIP * | gi, |
const char * | addr, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 1953 of file GeoIP.c.
References GeoIP_country_name_by_id(), and GeoIP_id_by_addr_v6_gl().
Referenced by GeoIP_country_name_by_addr_v6().
const char* GeoIP_country_name_by_id | ( | GeoIP * | gi, |
int | id | ||
) |
return full name of country in utf8 or iso-8859-1
Definition at line 2704 of file GeoIP.c.
References GeoIPTag::charset, GEOIP_CHARSET_UTF8, GeoIP_country_name, GeoIP_utf8_country_name, and num_GeoIP_countries.
Referenced by _extract_record(), GeoIP_country_name_by_addr_gl(), GeoIP_country_name_by_addr_v6_gl(), GeoIP_country_name_by_ipnum_gl(), GeoIP_country_name_by_ipnum_v6_gl(), GeoIP_country_name_by_name_gl(), and GeoIP_country_name_by_name_v6_gl().
const char* GeoIP_country_name_by_ipnum | ( | GeoIP * | gi, |
unsigned long | ipnum | ||
) |
Definition at line 113 of file GeoIP_deprecated.c.
References GeoIP_country_name_by_ipnum_gl().
const char* GeoIP_country_name_by_ipnum_gl | ( | GeoIP * | gi, |
unsigned long | ipnum, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 1966 of file GeoIP.c.
References GeoIP_country_name_by_id(), and GeoIP_id_by_ipnum_gl().
Referenced by GeoIP_country_name_by_ipnum().
Definition at line 118 of file GeoIP_deprecated.c.
References GeoIP_country_name_by_ipnum_v6_gl().
const char* GeoIP_country_name_by_ipnum_v6_gl | ( | GeoIP * | gi, |
geoipv6_t | ipnum, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 1975 of file GeoIP.c.
References GeoIP_country_name_by_id(), and GeoIP_id_by_ipnum_v6_gl().
Referenced by GeoIP_country_name_by_ipnum_v6().
const char* GeoIP_country_name_by_name | ( | GeoIP * | gi, |
const char * | host | ||
) |
Definition at line 71 of file GeoIP_deprecated.c.
References GeoIP_country_name_by_name_gl().
const char* GeoIP_country_name_by_name_gl | ( | GeoIP * | gi, |
const char * | host, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 1797 of file GeoIP.c.
References GeoIP_country_name_by_id(), and GeoIP_id_by_name_gl().
Referenced by GeoIP_country_name_by_name().
const char* GeoIP_country_name_by_name_v6 | ( | GeoIP * | gi, |
const char * | host | ||
) |
Definition at line 66 of file GeoIP_deprecated.c.
References GeoIP_country_name_by_name_v6_gl().
const char* GeoIP_country_name_by_name_v6_gl | ( | GeoIP * | gi, |
const char * | host, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 1790 of file GeoIP.c.
References GeoIP_country_name_by_id(), and GeoIP_id_by_name_v6_gl().
Referenced by GeoIP_country_name_by_name_v6().
unsigned char GeoIP_database_edition | ( | GeoIP * | gi | ) |
char* GeoIP_database_info | ( | GeoIP * | gi | ) |
Definition at line 2101 of file GeoIP.c.
References _check_mtime(), DATABASE_INFO_MAX_SIZE, GeoIPTag::GeoIPDatabase, pread, GeoIPTag::size, and STRUCTURE_INFO_MAX_SIZE.
Referenced by main().
int GeoIP_db_avail | ( | int | type | ) |
Definition at line 1026 of file GeoIP.c.
References _file_exists(), _GeoIP_setup_dbfilename(), GeoIPDBFileName, and NUM_DB_TYPES.
Referenced by main().
void GeoIP_delete | ( | GeoIP * | gi | ) |
Definition at line 1735 of file GeoIP.c.
References GeoIPTag::cache, GeoIPTag::databaseSegments, GeoIPTag::file_path, GeoIPTag::flags, GEOIP_MMAP_CACHE, GeoIPTag::GeoIPDatabase, GeoIPTag::index_cache, and GeoIPTag::size.
Referenced by GeoIP_open(), GeoIP_open_type(), and main().
int GeoIP_enable_teredo | ( | GeoIP * | gi, |
int | true_false | ||
) |
Definition at line 2662 of file GeoIP.c.
References GeoIPTag::ext_flags, and GEOIP_TEREDO_BIT.
int GeoIP_id_by_addr | ( | GeoIP * | gi, |
const char * | addr | ||
) |
Definition at line 164 of file GeoIP_deprecated.c.
References GeoIP_id_by_addr_gl().
int GeoIP_id_by_addr_gl | ( | GeoIP * | gi, |
const char * | addr, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 2050 of file GeoIP.c.
References _GeoIP_seek_record_gl(), GeoIPTag::databaseSegments, GeoIPTag::databaseType, GeoIP_addr_to_num(), GEOIP_COUNTRY_EDITION, GEOIP_LARGE_COUNTRY_EDITION, GEOIP_NETSPEED_EDITION, GEOIP_PROXY_EDITION, and get_db_description().
Referenced by GeoIP_country_code3_by_addr_gl(), GeoIP_country_code_by_addr_gl(), GeoIP_country_id_by_addr(), GeoIP_country_id_by_addr_gl(), GeoIP_country_name_by_addr_gl(), and GeoIP_id_by_addr().
int GeoIP_id_by_addr_v6 | ( | GeoIP * | gi, |
const char * | addr | ||
) |
Definition at line 160 of file GeoIP_deprecated.c.
References GeoIP_id_by_addr_v6_gl().
int GeoIP_id_by_addr_v6_gl | ( | GeoIP * | gi, |
const char * | addr, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 2032 of file GeoIP.c.
References _GeoIP_addr_to_num_v6(), _GeoIP_seek_record_v6_gl(), GeoIPTag::databaseSegments, GeoIPTag::databaseType, GEOIP_COUNTRY_EDITION_V6, GEOIP_LARGE_COUNTRY_EDITION_V6, and get_db_description().
Referenced by GeoIP_country_code3_by_addr_v6_gl(), GeoIP_country_code_by_addr_v6_gl(), GeoIP_country_id_by_addr_v6(), GeoIP_country_id_by_addr_v6_gl(), GeoIP_country_name_by_addr_v6_gl(), and GeoIP_id_by_addr_v6().
int GeoIP_id_by_code | ( | const char * | country | ) |
return id by country code
Definition at line 2732 of file GeoIP.c.
References GeoIP_country_code, and num_GeoIP_countries.
int GeoIP_id_by_ipnum | ( | GeoIP * | gi, |
unsigned long | ipnum | ||
) |
Definition at line 173 of file GeoIP_deprecated.c.
References GeoIP_id_by_ipnum_gl().
Referenced by geoiplookup().
int GeoIP_id_by_ipnum_gl | ( | GeoIP * | gi, |
unsigned long | ipnum, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 2083 of file GeoIP.c.
References _GeoIP_seek_record_gl(), GeoIPTag::databaseSegments, GeoIPTag::databaseType, GEOIP_COUNTRY_EDITION, GEOIP_LARGE_COUNTRY_EDITION, GEOIP_NETSPEED_EDITION, GEOIP_PROXY_EDITION, and get_db_description().
Referenced by GeoIP_country_code3_by_ipnum_gl(), GeoIP_country_code_by_ipnum_gl(), GeoIP_country_name_by_ipnum_gl(), and GeoIP_id_by_ipnum().
Definition at line 169 of file GeoIP_deprecated.c.
References GeoIP_id_by_ipnum_v6_gl().
Referenced by geoiplookup().
int GeoIP_id_by_ipnum_v6_gl | ( | GeoIP * | gi, |
geoipv6_t | ipnum, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 2070 of file GeoIP.c.
References _GeoIP_seek_record_v6_gl(), GeoIPTag::databaseSegments, GeoIPTag::databaseType, GEOIP_COUNTRY_EDITION_V6, GEOIP_LARGE_COUNTRY_EDITION_V6, and get_db_description().
Referenced by GeoIP_country_code3_by_ipnum_v6_gl(), GeoIP_country_code_by_ipnum_v6_gl(), GeoIP_country_name_by_ipnum_v6_gl(), and GeoIP_id_by_ipnum_v6().
int GeoIP_id_by_name | ( | GeoIP * | gi, |
const char * | host | ||
) |
Definition at line 76 of file GeoIP_deprecated.c.
References GeoIP_id_by_name_gl().
int GeoIP_id_by_name_gl | ( | GeoIP * | gi, |
const char * | host, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 1880 of file GeoIP.c.
References _GeoIP_lookupaddress(), _GeoIP_seek_record_gl(), GeoIPTag::databaseSegments, GeoIPTag::databaseType, GEOIP_COUNTRY_EDITION, GEOIP_LARGE_COUNTRY_EDITION, GEOIP_NETSPEED_EDITION, GEOIP_PROXY_EDITION, and get_db_description().
Referenced by GeoIP_country_code3_by_name_gl(), GeoIP_country_code_by_name_gl(), GeoIP_country_id_by_name(), GeoIP_country_id_by_name_gl(), GeoIP_country_name_by_name_gl(), and GeoIP_id_by_name().
int GeoIP_id_by_name_v6 | ( | GeoIP * | gi, |
const char * | host | ||
) |
Definition at line 80 of file GeoIP_deprecated.c.
References GeoIP_id_by_name_v6_gl().
int GeoIP_id_by_name_v6_gl | ( | GeoIP * | gi, |
const char * | host, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 1902 of file GeoIP.c.
References __GEOIP_V6_IS_NULL(), _GeoIP_lookupaddress_v6(), _GeoIP_seek_record_v6_gl(), GeoIPTag::databaseSegments, GeoIPTag::databaseType, GEOIP_COUNTRY_EDITION_V6, GEOIP_LARGE_COUNTRY_EDITION_V6, and get_db_description().
Referenced by GeoIP_country_code3_by_name_v6_gl(), GeoIP_country_code_by_name_v6_gl(), GeoIP_country_id_by_name_v6(), GeoIP_country_id_by_name_v6_gl(), GeoIP_country_name_by_name_v6_gl(), and GeoIP_id_by_name_v6().
int GeoIP_last_netmask | ( | GeoIP * | gi | ) |
GeoIP_last_netmask is deprecated - it is not thread safe
Definition at line 34 of file GeoIP_deprecated.c.
References GeoIPTag::netmask.
Referenced by _say_range_by_ip().
char* GeoIP_name_by_addr | ( | GeoIP * | gi, |
const char * | addr | ||
) |
Definition at line 231 of file GeoIP_deprecated.c.
References GeoIP_name_by_addr_gl().
char* GeoIP_name_by_addr_gl | ( | GeoIP * | gi, |
const char * | addr, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 2619 of file GeoIP.c.
References _get_name_gl(), and GeoIP_addr_to_num().
Referenced by GeoIP_name_by_addr(), and GeoIP_org_by_addr().
char* GeoIP_name_by_addr_v6 | ( | GeoIP * | gi, |
const char * | addr | ||
) |
Definition at line 235 of file GeoIP_deprecated.c.
References GeoIP_name_by_addr_v6_gl().
char* GeoIP_name_by_addr_v6_gl | ( | GeoIP * | gi, |
const char * | addr, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 2628 of file GeoIP.c.
References _GeoIP_addr_to_num_v6(), and _get_name_v6_gl().
Referenced by GeoIP_name_by_addr_v6(), and GeoIP_org_by_addr_v6().
const char* GeoIP_name_by_id | ( | int | id | ) |
return full name of country
return full name of country in iso-8859-1
Definition at line 2714 of file GeoIP.c.
References GeoIP_country_name, and num_GeoIP_countries.
char* GeoIP_name_by_ipnum | ( | GeoIP * | gi, |
unsigned long | ipnum | ||
) |
Definition at line 223 of file GeoIP_deprecated.c.
References GeoIP_name_by_ipnum_gl().
Referenced by geoiplookup().
char* GeoIP_name_by_ipnum_gl | ( | GeoIP * | gi, |
unsigned long | ipnum, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 2611 of file GeoIP.c.
References _get_name_gl().
Referenced by GeoIP_name_by_ipnum(), and GeoIP_org_by_ipnum().
Definition at line 227 of file GeoIP_deprecated.c.
References GeoIP_name_by_ipnum_v6_gl().
Referenced by geoiplookup().
char* GeoIP_name_by_ipnum_v6_gl | ( | GeoIP * | gi, |
geoipv6_t | ipnum, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 2615 of file GeoIP.c.
References _get_name_v6_gl().
Referenced by GeoIP_name_by_ipnum_v6(), and GeoIP_org_by_ipnum_v6().
char* GeoIP_name_by_name | ( | GeoIP * | gi, |
const char * | host | ||
) |
Definition at line 240 of file GeoIP_deprecated.c.
References GeoIP_name_by_name_gl().
char* GeoIP_name_by_name_gl | ( | GeoIP * | gi, |
const char * | host, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 2637 of file GeoIP.c.
References _GeoIP_lookupaddress(), and _get_name_gl().
Referenced by GeoIP_name_by_name(), and GeoIP_org_by_name().
char* GeoIP_name_by_name_v6 | ( | GeoIP * | gi, |
const char * | name | ||
) |
Definition at line 245 of file GeoIP_deprecated.c.
References GeoIP_name_by_name_v6_gl().
char* GeoIP_name_by_name_v6_gl | ( | GeoIP * | gi, |
const char * | name, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 2648 of file GeoIP.c.
References __GEOIP_V6_IS_NULL(), _GeoIP_lookupaddress_v6(), and _get_name_v6_gl().
Referenced by GeoIP_name_by_name_v6(), and GeoIP_org_by_name_v6().
GeoIP* GeoIP_new | ( | int | flags | ) |
Definition at line 1614 of file GeoIP.c.
References _GeoIP_setup_dbfilename(), GEOIP_COUNTRY_EDITION, GeoIP_open(), and GeoIPDBFileName.
unsigned GeoIP_num_countries | ( | void | ) |
return return number of known countries
Definition at line 2744 of file GeoIP.c.
References num_GeoIP_countries.
Referenced by geoiplookup().
char* GeoIP_num_to_addr | ( | unsigned long | ipnum | ) |
Definition at line 2526 of file GeoIP.c.
Referenced by GeoIP_range_by_ip_gl().
GeoIP* GeoIP_open | ( | const char * | filename, |
int | flags | ||
) |
Definition at line 1621 of file GeoIP.c.
References _setup_segments(), GeoIPTag::cache, GeoIPTag::charset, GeoIPTag::databaseSegments, DEBUG_MSGF, GeoIPTag::ext_flags, GeoIPTag::file_path, GeoIPTag::flags, GEOIP_CHARSET_ISO_8859_1, GEOIP_CHECK_CACHE, GeoIP_delete(), GEOIP_INDEX_CACHE, GEOIP_MEMORY_CACHE, GEOIP_MMAP_CACHE, GEOIP_TEREDO_BIT, GeoIPTag::GeoIPDatabase, get_index_size(), GeoIPTag::index_cache, GeoIPTag::last_mtime_check, GeoIPTag::mtime, pread, and GeoIPTag::size.
Referenced by GeoIP_new(), GeoIP_open_type(), and main().
GeoIP* GeoIP_open_type | ( | int | type, |
int | flags | ||
) |
Definition at line 1579 of file GeoIP.c.
References _GeoIP_setup_dbfilename(), GeoIPTag::databaseType, GEOIP_ASNUM_EDITION, GeoIP_delete(), GeoIP_open(), GEOIP_ORG_EDITION, GeoIPDBFileName, and NUM_DB_TYPES.
Referenced by main().
char* GeoIP_org_by_addr | ( | GeoIP * | gi, |
const char * | addr | ||
) |
Definition at line 14 of file GeoIP_deprecated.c.
References GeoIP_name_by_addr_gl().
char* GeoIP_org_by_addr_v6 | ( | GeoIP * | gi, |
const char * | addr | ||
) |
Definition at line 19 of file GeoIP_deprecated.c.
References GeoIP_name_by_addr_v6_gl().
char* GeoIP_org_by_ipnum | ( | GeoIP * | gi, |
unsigned long | ipnum | ||
) |
Definition at line 4 of file GeoIP_deprecated.c.
References GeoIP_name_by_ipnum_gl().
Referenced by geoiplookup().
Definition at line 9 of file GeoIP_deprecated.c.
References GeoIP_name_by_ipnum_v6_gl().
char* GeoIP_org_by_name | ( | GeoIP * | gi, |
const char * | host | ||
) |
Definition at line 24 of file GeoIP_deprecated.c.
References GeoIP_name_by_name_gl().
char* GeoIP_org_by_name_v6 | ( | GeoIP * | gi, |
const char * | name | ||
) |
Definition at line 29 of file GeoIP_deprecated.c.
References GeoIP_name_by_name_v6_gl().
char** GeoIP_range_by_ip | ( | GeoIP * | gi, |
const char * | addr | ||
) |
Definition at line 218 of file GeoIP_deprecated.c.
References GeoIP_range_by_ip_gl().
Referenced by _say_range_by_ip().
void GeoIP_range_by_ip_delete | ( | char ** | ptr | ) |
Definition at line 2599 of file GeoIP.c.
Referenced by _say_range_by_ip().
char** GeoIP_range_by_ip_gl | ( | GeoIP * | gi, |
const char * | addr, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 2553 of file GeoIP.c.
References _GeoIP_seek_record_gl(), GeoIP_addr_to_num(), GeoIP_num_to_addr(), GeoIPTag::netmask, and GeoIPLookup::netmask.
Referenced by GeoIP_range_by_ip().
GeoIPRegion* GeoIP_region_by_addr | ( | GeoIP * | gi, |
const char * | addr | ||
) |
Definition at line 191 of file GeoIP_deprecated.c.
References GeoIP_region_by_addr_gl().
GeoIPRegion* GeoIP_region_by_addr_gl | ( | GeoIP * | gi, |
const char * | addr, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 2307 of file GeoIP.c.
References _get_region_gl(), GeoIPTag::databaseType, GeoIP_addr_to_num(), GEOIP_REGION_EDITION_REV0, GEOIP_REGION_EDITION_REV1, and get_db_description().
Referenced by GeoIP_region_by_addr().
GeoIPRegion* GeoIP_region_by_addr_v6 | ( | GeoIP * | gi, |
const char * | addr | ||
) |
Definition at line 195 of file GeoIP_deprecated.c.
References GeoIP_region_by_addr_v6_gl().
GeoIPRegion* GeoIP_region_by_addr_v6_gl | ( | GeoIP * | gi, |
const char * | addr, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 2324 of file GeoIP.c.
References _GeoIP_addr_to_num_v6(), _get_region_v6_gl(), GeoIPTag::databaseType, GEOIP_REGION_EDITION_REV0, GEOIP_REGION_EDITION_REV1, and get_db_description().
Referenced by GeoIP_region_by_addr_v6().
GeoIPRegion* GeoIP_region_by_ipnum | ( | GeoIP * | gi, |
unsigned long | ipnum | ||
) |
Definition at line 209 of file GeoIP_deprecated.c.
References GeoIP_region_by_ipnum_gl().
Referenced by geoiplookup().
GeoIPRegion* GeoIP_region_by_ipnum_gl | ( | GeoIP * | gi, |
unsigned long | ipnum, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 2381 of file GeoIP.c.
References _get_region_gl(), GeoIPTag::databaseType, GEOIP_REGION_EDITION_REV0, GEOIP_REGION_EDITION_REV1, and get_db_description().
Referenced by GeoIP_region_by_ipnum().
GeoIPRegion* GeoIP_region_by_ipnum_v6 | ( | GeoIP * | gi, |
geoipv6_t | ipnum | ||
) |
Definition at line 213 of file GeoIP_deprecated.c.
References GeoIP_region_by_ipnum_v6_gl().
GeoIPRegion* GeoIP_region_by_ipnum_v6_gl | ( | GeoIP * | gi, |
geoipv6_t | ipnum, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 2393 of file GeoIP.c.
References _get_region_v6_gl(), GeoIPTag::databaseType, GEOIP_REGION_EDITION_REV0, GEOIP_REGION_EDITION_REV1, and get_db_description().
Referenced by GeoIP_region_by_ipnum_v6().
GeoIPRegion* GeoIP_region_by_name | ( | GeoIP * | gi, |
const char * | host | ||
) |
Definition at line 200 of file GeoIP_deprecated.c.
References GeoIP_region_by_name_gl().
GeoIPRegion* GeoIP_region_by_name_gl | ( | GeoIP * | gi, |
const char * | host, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 2341 of file GeoIP.c.
References _GeoIP_lookupaddress(), _get_region_gl(), GeoIPTag::databaseType, GEOIP_REGION_EDITION_REV0, GEOIP_REGION_EDITION_REV1, and get_db_description().
Referenced by GeoIP_region_by_name().
GeoIPRegion* GeoIP_region_by_name_v6 | ( | GeoIP * | gi, |
const char * | host | ||
) |
Definition at line 204 of file GeoIP_deprecated.c.
References GeoIP_region_by_name_v6_gl().
GeoIPRegion* GeoIP_region_by_name_v6_gl | ( | GeoIP * | gi, |
const char * | host, | ||
GeoIPLookup * | gl | ||
) |
Definition at line 2360 of file GeoIP.c.
References __GEOIP_V6_IS_NULL(), _GeoIP_lookupaddress_v6(), _get_region_v6_gl(), GeoIPTag::databaseType, GEOIP_REGION_EDITION_REV0, GEOIP_REGION_EDITION_REV1, and get_db_description().
Referenced by GeoIP_region_by_name_v6().
const char* GeoIP_region_name_by_code | ( | const char * | country_code, |
const char * | region_code | ||
) |
Definition at line 9584 of file regionName.c.
References get_region_name_AD(), get_region_name_AE(), get_region_name_AF(), get_region_name_AG(), get_region_name_AL(), get_region_name_AM(), get_region_name_AO(), get_region_name_AR(), get_region_name_AT(), get_region_name_AU(), get_region_name_AZ(), get_region_name_BA(), get_region_name_BB(), get_region_name_BD(), get_region_name_BE(), get_region_name_BF(), get_region_name_BG(), get_region_name_BH(), get_region_name_BI(), get_region_name_BJ(), get_region_name_BM(), get_region_name_BN(), get_region_name_BO(), get_region_name_BR(), get_region_name_BS(), get_region_name_BT(), get_region_name_BW(), get_region_name_BY(), get_region_name_BZ(), get_region_name_CA(), get_region_name_CD(), get_region_name_CF(), get_region_name_CG(), get_region_name_CH(), get_region_name_CI(), get_region_name_CL(), get_region_name_CM(), get_region_name_CN(), get_region_name_CO(), get_region_name_CR(), get_region_name_CU(), get_region_name_CV(), get_region_name_CY(), get_region_name_CZ(), get_region_name_DE(), get_region_name_DJ(), get_region_name_DK(), get_region_name_DM(), get_region_name_DO(), get_region_name_DZ(), get_region_name_EC(), get_region_name_EE(), get_region_name_EG(), get_region_name_ER(), get_region_name_ES(), get_region_name_ET(), get_region_name_FI(), get_region_name_FJ(), get_region_name_FM(), get_region_name_FR(), get_region_name_GA(), get_region_name_GB(), get_region_name_GD(), get_region_name_GE(), get_region_name_GH(), get_region_name_GL(), get_region_name_GM(), get_region_name_GN(), get_region_name_GQ(), get_region_name_GR(), get_region_name_GT(), get_region_name_GW(), get_region_name_GY(), get_region_name_HN(), get_region_name_HR(), get_region_name_HT(), get_region_name_HU(), get_region_name_ID(), get_region_name_IE(), get_region_name_IL(), get_region_name_IN(), get_region_name_IQ(), get_region_name_IR(), get_region_name_IS(), get_region_name_IT(), get_region_name_JM(), get_region_name_JO(), get_region_name_JP(), get_region_name_KE(), get_region_name_KG(), get_region_name_KH(), get_region_name_KI(), get_region_name_KM(), get_region_name_KN(), get_region_name_KP(), get_region_name_KR(), get_region_name_KW(), get_region_name_KY(), get_region_name_KZ(), get_region_name_LA(), get_region_name_LB(), get_region_name_LC(), get_region_name_LI(), get_region_name_LK(), get_region_name_LR(), get_region_name_LS(), get_region_name_LT(), get_region_name_LU(), get_region_name_LV(), get_region_name_LY(), get_region_name_MA(), get_region_name_MC(), get_region_name_MD(), get_region_name_MG(), get_region_name_MK(), get_region_name_ML(), get_region_name_MM(), get_region_name_MN(), get_region_name_MO(), get_region_name_MR(), get_region_name_MS(), get_region_name_MU(), get_region_name_MV(), get_region_name_MW(), get_region_name_MX(), get_region_name_MY(), get_region_name_MZ(), get_region_name_NA(), get_region_name_NE(), get_region_name_NG(), get_region_name_NI(), get_region_name_NL(), get_region_name_NO(), get_region_name_NP(), get_region_name_NR(), get_region_name_NZ(), get_region_name_OM(), get_region_name_PA(), get_region_name_PE(), get_region_name_PG(), get_region_name_PH(), get_region_name_PK(), get_region_name_PL(), get_region_name_PS(), get_region_name_PT(), get_region_name_PY(), get_region_name_QA(), get_region_name_RO(), get_region_name_RS(), get_region_name_RU(), get_region_name_RW(), get_region_name_SA(), get_region_name_SB(), get_region_name_SC(), get_region_name_SD(), get_region_name_SE(), get_region_name_SH(), get_region_name_SI(), get_region_name_SK(), get_region_name_SL(), get_region_name_SM(), get_region_name_SN(), get_region_name_SO(), get_region_name_SR(), get_region_name_SS(), get_region_name_ST(), get_region_name_SV(), get_region_name_SY(), get_region_name_SZ(), get_region_name_TD(), get_region_name_TG(), get_region_name_TH(), get_region_name_TJ(), get_region_name_TL(), get_region_name_TM(), get_region_name_TN(), get_region_name_TO(), get_region_name_TR(), get_region_name_TT(), get_region_name_TW(), get_region_name_TZ(), get_region_name_UA(), get_region_name_UG(), get_region_name_US(), get_region_name_UY(), get_region_name_UZ(), get_region_name_VC(), get_region_name_VE(), get_region_name_VN(), get_region_name_VU(), get_region_name_WS(), get_region_name_YE(), get_region_name_ZA(), get_region_name_ZM(), and get_region_name_ZW().
Referenced by geoiplookup().
int GeoIP_set_charset | ( | GeoIP * | gi, |
int | charset | ||
) |
Definition at line 2679 of file GeoIP.c.
References GeoIPTag::charset.
void GeoIP_setup_custom_directory | ( | char * | dir | ) |
int GeoIP_teredo | ( | GeoIP * | gi | ) |
Definition at line 2672 of file GeoIP.c.
References GeoIPTag::ext_flags, and GEOIP_TEREDO_BIT.
Referenced by _GeoIP_seek_record_v6_gl().
const char* GeoIP_time_zone_by_country_and_region | ( | const char * | country_code, |
const char * | region_code | ||
) |
Definition at line 2 of file timeZone.c.
void GeoIPRegion_delete | ( | GeoIPRegion * | gir | ) |
Definition at line 2404 of file GeoIP.c.
Referenced by geoiplookup().
const char GeoIP_country_code[256][3] |
Definition at line 100 of file GeoIP.c.
Referenced by _extract_record(), GeoIP_code_by_id(), GeoIP_id_by_code(), and geoiplookup().
const char GeoIP_country_code3[256][4] |
Definition at line 127 of file GeoIP.c.
Referenced by _extract_record(), and GeoIP_code3_by_id().
const char GeoIP_country_continent[256][3] |
Definition at line 675 of file GeoIP.c.
Referenced by _extract_record(), and GeoIP_continent_by_id().
const char* GeoIP_country_name[256] |
Definition at line 413 of file GeoIP.c.
Referenced by GeoIP_country_name_by_id(), GeoIP_name_by_id(), and geoiplookup().
char* GeoIP_custom_directory |
Definition at line 848 of file GeoIP.c.
Referenced by _GeoIP_full_path_to(), and GeoIP_setup_custom_directory().
const char* GeoIP_utf8_country_name[256] |
Definition at line 153 of file GeoIP.c.
Referenced by GeoIP_country_name_by_id().
const char* GeoIPAccuracyRadiusFileName |
const char* GeoIPCityConfidenceFileName |
const char* GeoIPCityDBFileName |
const char* GeoIPCountryDBFileName |
const char* GeoIPDBDescription[(38+1)] |
Definition at line 807 of file GeoIP.c.
Referenced by _get_record_gl(), _get_record_v6_gl(), GeoIP_record_id_by_addr(), GeoIP_record_id_by_addr_v6(), geoiplookup(), get_db_description(), and main().
char** GeoIPDBFileName |
Definition at line 897 of file GeoIP.c.
Referenced by _GeoIP_setup_dbfilename(), GeoIP_cleanup(), GeoIP_db_avail(), GeoIP_new(), and GeoIP_open_type().
const char* GeoIPISPDBFileName |
const char* GeoIPLocationADBFileName |
const char* GeoIPOrgDBFileName |
const char* GeoIPRegionDBFileName |