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). Fossies Dox: GeoIP-1.6.12.tar.gz ("inofficial" and yet experimental doxygen-generated source code documentation) 
|
Go to the documentation of this file. 28 #include <sys/types.h> 30 #include <arpa/inet.h> 31 #include <netinet/in.h> 32 #include <sys/socket.h> 36 #define FILETIME_TO_USEC(ft) \ 37 (((unsigned __int64)ft.dwHighDateTime << 32 | ft.dwLowDateTime) / 10) 44 #include <sys/types.h> 46 #define SEGMENT_RECORD_LENGTH 3 47 #define LARGE_SEGMENT_RECORD_LENGTH 4 48 #define STANDARD_RECORD_LENGTH 3 49 #define ORG_RECORD_LENGTH 4 50 #define MAX_RECORD_LENGTH 4 51 #define NUM_DB_TYPES (38 + 1) 56 #define GEOIP_CHKBIT_V6(bit, ptr) \ 57 (ptr[((127UL - bit) >> 3)] & (1UL << (~(127 - bit) & 7))) 157 #if defined(_WIN32) && !defined(__MINGW32__) 159 #define GEOIP_API __declspec(dllexport) 160 #define GEOIP_DATA __declspec(dllexport) 162 #define GEOIP_DATA __declspec(dllimport) 276 unsigned long inetaddr,
334 const char *region_code);
339 const char *region_code);
364 unsigned long ipnum);
366 unsigned long ipnum);
368 unsigned long ipnum);
407 unsigned long inetaddr,
unsigned int * databaseSegments
int GeoIP_id_by_addr_v6(GeoIP *gi, const char *addr)
char * GeoIP_name_by_ipnum_gl(GeoIP *gi, unsigned long ipnum, GeoIPLookup *gl)
const char * GeoIP_country_code3_by_ipnum(GeoIP *gi, unsigned long ipnum)
const char * GeoIP_country_code3_by_ipnum_gl(GeoIP *gi, unsigned long ipnum, GeoIPLookup *gl)
void GeoIP_assign_region_by_inetaddr_gl(GeoIP *gi, unsigned long inetaddr, GeoIPRegion *gir, GeoIPLookup *gl)
const char * GeoIP_country_name_by_ipnum_v6(GeoIP *gi, geoipv6_t ipnum)
const char * GeoIP_country_code_by_name_gl(GeoIP *gi, const char *host, GeoIPLookup *gl)
const char GeoIP_country_continent[256][3]
int GeoIP_teredo(GeoIP *gi)
const char * GeoIP_region_name_by_code(const char *country_code, const char *region_code)
const char * GeoIP_continent_by_id(int id)
char * GeoIP_org_by_ipnum_v6(GeoIP *gi, geoipv6_t ipnum)
const char * GeoIP_country_code3_by_name_v6(GeoIP *gi, const char *host)
char * GeoIP_name_by_ipnum_v6(GeoIP *gi, geoipv6_t ipnum)
GeoIPRegion * GeoIP_region_by_ipnum_v6(GeoIP *gi, geoipv6_t ipnum)
char * GeoIP_org_by_addr_v6(GeoIP *gi, const char *addr)
void GeoIPRegion_delete(GeoIPRegion *gir)
void GeoIP_setup_custom_directory(char *dir)
char * GeoIP_num_to_addr(unsigned long ipnum)
const char * GeoIP_time_zone_by_country_and_region(const char *country_code, const char *region_code)
const char * GeoIPDBDescription[(38+1)]
const char * GeoIP_country_code3_by_name_v6_gl(GeoIP *gi, const char *host, GeoIPLookup *gl)
GeoIPRegion * GeoIP_region_by_name(GeoIP *gi, const char *host)
const char * GeoIP_country_name_by_ipnum_v6_gl(GeoIP *gi, geoipv6_t ipnum, GeoIPLookup *gl)
void GeoIP_delete(GeoIP *gi)
int GeoIP_id_by_ipnum_v6_gl(GeoIP *gi, geoipv6_t ipnum, GeoIPLookup *gl)
char * GeoIP_name_by_name_v6(GeoIP *gi, const char *name)
GeoIPRegion * GeoIP_region_by_name_gl(GeoIP *gi, const char *host, GeoIPLookup *gl)
int GeoIP_country_id_by_addr(GeoIP *gi, const char *addr)
char * GeoIP_org_by_ipnum(GeoIP *gi, unsigned long ipnum)
const char * GeoIP_country_name_by_addr_v6_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl)
const char * GeoIP_country_code_by_addr_v6_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl)
const char * GeoIP_country_code3_by_addr_v6(GeoIP *gi, const char *addr)
const char * GeoIP_country_code_by_ipnum(GeoIP *gi, unsigned long ipnum)
int GeoIP_id_by_addr_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl)
char * GeoIP_name_by_addr(GeoIP *gi, const char *addr)
unsigned char * index_cache
char * GeoIP_name_by_name(GeoIP *gi, const char *host)
int GeoIP_country_id_by_addr_v6(GeoIP *gi, const char *addr)
int GeoIP_set_charset(GeoIP *gi, int charset)
int GeoIP_id_by_code(const char *country)
char * GeoIP_name_by_addr_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl)
const char * GeoIP_country_name[256]
const char * GeoIPOrgDBFileName
const char * GeoIPCityDBFileName
const char * GeoIP_country_name_by_name_v6(GeoIP *gi, const char *host)
void GeoIP_assign_region_by_inetaddr_v6_gl(GeoIP *gi, geoipv6_t inetaddr, GeoIPRegion *gir, GeoIPLookup *gl)
int GeoIP_enable_teredo(GeoIP *gi, int true_false)
char ** GeoIP_range_by_ip_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl)
char * GeoIP_database_info(GeoIP *gi)
GeoIP * GeoIP_new(int flags)
int GeoIP_country_id_by_name(GeoIP *gi, const char *host)
const char * GeoIP_country_code3_by_ipnum_v6(GeoIP *gi, geoipv6_t ipnum)
const char * GeoIP_country_code3_by_addr_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl)
GeoIP * GeoIP_open(const char *filename, int flags)
char ** GeoIP_range_by_ip(GeoIP *gi, const char *addr)
struct GeoIPRegionTag GeoIPRegion
const char * GeoIP_country_code_by_name_v6(GeoIP *gi, const char *host)
struct GeoIPLookup GeoIPLookup
const char * GeoIP_country_code3_by_addr_v6_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl)
GeoIPRegion * GeoIP_region_by_ipnum(GeoIP *gi, unsigned long ipnum)
const char * GeoIPCountryDBFileName
void GeoIP_assign_region_by_inetaddr_v6(GeoIP *gi, geoipv6_t inetaddr, GeoIPRegion *gir)
int GeoIP_charset(GeoIP *gi)
int GeoIP_db_avail(int type)
unsigned long GeoIP_addr_to_num(const char *addr)
const char * GeoIP_country_code3_by_ipnum_v6_gl(GeoIP *gi, geoipv6_t ipnum, GeoIPLookup *gl)
const char * GeoIP_country_name_by_addr_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl)
const char * GeoIP_country_name_by_name_v6_gl(GeoIP *gi, const char *host, GeoIPLookup *gl)
const char * GeoIP_country_code3_by_name_gl(GeoIP *gi, const char *host, GeoIPLookup *gl)
char * GeoIP_custom_directory
char * _GeoIP_iso_8859_1__utf8(const char *iso)
GeoIP * GeoIP_open_type(int type, int flags)
GeoIPRegion * GeoIP_region_by_name_v6(GeoIP *gi, const char *host)
int GeoIP_id_by_ipnum_v6(GeoIP *gi, geoipv6_t ipnum)
const char * GeoIP_country_code_by_addr(GeoIP *gi, const char *addr)
const char * GeoIP_code3_by_id(int id)
char * GeoIP_name_by_ipnum_v6_gl(GeoIP *gi, geoipv6_t ipnum, GeoIPLookup *gl)
int GeoIP_id_by_name_gl(GeoIP *gi, const char *host, GeoIPLookup *gl)
const char * GeoIP_lib_version(void)
int GeoIP_last_netmask(GeoIP *gi)
int GeoIP_id_by_name(GeoIP *gi, const char *host)
void GeoIP_range_by_ip_delete(char **ptr)
unsigned char GeoIP_database_edition(GeoIP *gi)
const char * GeoIP_name_by_id(int id)
const char * GeoIP_country_name_by_id(GeoIP *gi, int id)
const char * GeoIPAccuracyRadiusFileName
const char * GeoIP_country_code_by_ipnum_v6_gl(GeoIP *gi, geoipv6_t ipnum, GeoIPLookup *gl)
char * GeoIP_org_by_addr(GeoIP *gi, const char *addr)
GeoIPRegion * GeoIP_region_by_ipnum_v6_gl(GeoIP *gi, geoipv6_t ipnum, GeoIPLookup *gl)
GeoIPRegion * GeoIP_region_by_addr_v6(GeoIP *gi, const char *addr)
int GeoIP_id_by_ipnum(GeoIP *gi, unsigned long ipnum)
GeoIPRegion * GeoIP_region_by_addr_v6_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl)
int GeoIP_id_by_name_v6_gl(GeoIP *gi, const char *host, GeoIPLookup *gl)
const char * GeoIP_country_name_by_addr_v6(GeoIP *gi, const char *addr)
char * GeoIP_name_by_addr_v6(GeoIP *gi, const char *addr)
const char * GeoIP_country_name_by_name_gl(GeoIP *gi, const char *host, GeoIPLookup *gl)
const char GeoIP_country_code3[256][4]
GeoIPRegion * GeoIP_region_by_addr_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl)
const char * GeoIPCityConfidenceFileName
const char GeoIP_country_code[256][3]
const char * GeoIP_country_code_by_name(GeoIP *gi, const char *host)
const char * GeoIP_country_name_by_ipnum_gl(GeoIP *gi, unsigned long ipnum, GeoIPLookup *gl)
const char * GeoIP_country_code3_by_addr(GeoIP *gi, const char *addr)
char * GeoIP_org_by_name_v6(GeoIP *gi, const char *name)
unsigned GeoIP_num_countries(void)
int GeoIP_id_by_name_v6(GeoIP *gi, const char *host)
char * GeoIP_name_by_name_gl(GeoIP *gi, const char *host, GeoIPLookup *gl)
const char * GeoIP_country_code_by_ipnum_v6(GeoIP *gi, geoipv6_t ipnum)
char * GeoIP_name_by_ipnum(GeoIP *gi, unsigned long ipnum)
const char * GeoIP_country_name_by_addr(GeoIP *gi, const char *addr)
const char * GeoIP_country_name_by_ipnum(GeoIP *gi, unsigned long ipnum)
const char * GeoIPLocationADBFileName
void GeoIP_assign_region_by_inetaddr(GeoIP *gi, unsigned long inetaddr, GeoIPRegion *gir)
char * GeoIP_org_by_name(GeoIP *gi, const char *host)
const char * GeoIPISPDBFileName
struct in6_addr geoipv6_t
int GeoIP_id_by_addr(GeoIP *gi, const char *addr)
int GeoIP_id_by_ipnum_gl(GeoIP *gi, unsigned long ipnum, GeoIPLookup *gl)
const char * GeoIPRegionDBFileName
GeoIPRegion * GeoIP_region_by_ipnum_gl(GeoIP *gi, unsigned long ipnum, GeoIPLookup *gl)
const char * GeoIP_country_code3_by_name(GeoIP *gi, const char *host)
GeoIPRegion * GeoIP_region_by_addr(GeoIP *gi, const char *addr)
const char * GeoIP_utf8_country_name[256]
const char * GeoIP_country_code_by_addr_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl)
char * GeoIP_name_by_name_v6_gl(GeoIP *gi, const char *name, GeoIPLookup *gl)
const char * GeoIP_country_code_by_name_v6_gl(GeoIP *gi, const char *host, GeoIPLookup *gl)
char * GeoIP_name_by_addr_v6_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl)
int GeoIP_id_by_addr_v6_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl)
const char * GeoIP_country_code_by_addr_v6(GeoIP *gi, const char *addr)
const char * GeoIP_code_by_id(int id)
GeoIPRegion * GeoIP_region_by_name_v6_gl(GeoIP *gi, const char *host, GeoIPLookup *gl)
const char * GeoIP_country_code_by_ipnum_gl(GeoIP *gi, unsigned long ipnum, GeoIPLookup *gl)
const char * GeoIP_country_name_by_name(GeoIP *gi, const char *host)