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)  

GeoIP.h
Go to the documentation of this file.
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */
2 /* GeoIP.h
3  *
4  * Copyright (C) 2016 MaxMind, Inc.
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef GEOIP_H
22 #define GEOIP_H
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 #include <sys/types.h>
29 #if !defined(_WIN32)
30 #include <arpa/inet.h>
31 #include <netinet/in.h>
32 #include <sys/socket.h>
33 #else /* !defined(_WIN32) */
34 #include <winsock2.h>
35 #include <ws2tcpip.h>
36 #define FILETIME_TO_USEC(ft) \
37  (((unsigned __int64)ft.dwHighDateTime << 32 | ft.dwLowDateTime) / 10)
38 #endif /* !defined(_WIN32) */
39 
40 #include <stdio.h>
41 #include <stdlib.h>
42 #include <string.h>
43 #include <sys/stat.h> /* for fstat */
44 #include <sys/types.h> /* for fstat */
45 
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)
52 
53 /* 128 bit address in network order */
54 typedef struct in6_addr geoipv6_t;
55 
56 #define GEOIP_CHKBIT_V6(bit, ptr) \
57  (ptr[((127UL - bit) >> 3)] & (1UL << (~(127 - bit) & 7)))
58 
59 typedef struct GeoIPTag {
61  char *file_path;
62  unsigned char *cache;
63  unsigned char *index_cache;
64  unsigned int *databaseSegments;
66  time_t mtime;
67  int flags;
68  off_t size;
70  int charset; /* 0 iso-8859-1 1 utf8 */
71  int record_iter; /* used in GeoIP_next_record */
72  int netmask; /* netmask of last lookup - set using depth in
73  _GeoIP_seek_record */
75  off_t dyn_seg_size; /* currently only used by the cityconfidence database */
76  unsigned int ext_flags; /* bit 0 teredo support enabled */
77 } GeoIP;
78 
79 typedef struct GeoIPLookup { int netmask; } GeoIPLookup;
80 
81 typedef enum { GEOIP_TEREDO_BIT = 0 } GeoIPExtFlags;
82 
83 typedef enum {
86 } GeoIPCharset;
87 
88 typedef struct GeoIPRegionTag {
89  char country_code[3];
90  char region[3];
91 } GeoIPRegion;
92 
93 typedef enum {
100 } GeoIPOptions;
101 
102 typedef enum {
117  GEOIP_CITYCONFIDENCE_EDITION = 15, /* unsupported */
118  GEOIP_CITYCONFIDENCEDIST_EDITION = 16, /* unsupported */
122  19, /* unused, but gaps are not allowed */
123  GEOIP_CCM_COUNTRY_EDITION = 20, /* unused, but gaps are not allowed */
142 } GeoIPDBTypes;
143 
144 typedef enum {
149 
150 typedef enum {
156 
157 #if defined(_WIN32) && !defined(__MINGW32__)
158 #ifdef GEOIP_EXPORTS
159 #define GEOIP_API __declspec(dllexport)
160 #define GEOIP_DATA __declspec(dllexport)
161 #else
162 #define GEOIP_DATA __declspec(dllimport)
163 #define GEOIP_API
164 #endif /* GEOIP_EXPORTS */
165 #else
166 #define GEOIP_API
167 #define GEOIP_DATA
168 #endif
169 
170 extern char **GeoIPDBFileName;
171 extern GEOIP_DATA const char *GeoIPDBDescription[NUM_DB_TYPES];
172 extern GEOIP_DATA const char *GeoIPCountryDBFileName;
173 extern GEOIP_DATA const char *GeoIPRegionDBFileName;
174 extern GEOIP_DATA const char *GeoIPCityDBFileName;
175 extern GEOIP_DATA const char *GeoIPOrgDBFileName;
176 extern GEOIP_DATA const char *GeoIPISPDBFileName;
177 extern GEOIP_DATA const char *GeoIPLocationADBFileName;
178 extern GEOIP_DATA const char *GeoIPAccuracyRadiusFileName;
179 extern GEOIP_DATA const char *GeoIPCityConfidenceFileName;
180 extern char *GeoIP_custom_directory;
181 
182 /* Warning: do not use those arrays as doing so may break your
183  * program with newer GeoIP versions */
184 extern GEOIP_DATA const char GeoIP_country_code[256][3];
185 extern GEOIP_DATA const char GeoIP_country_code3[256][4];
186 extern GEOIP_DATA const char *GeoIP_country_name[256];
187 extern GEOIP_DATA const char *GeoIP_utf8_country_name[256];
188 extern GEOIP_DATA const char GeoIP_country_continent[256][3];
189 
191 GEOIP_API GeoIP *GeoIP_open_type(int type, int flags);
192 GEOIP_API GeoIP *GeoIP_new(int flags);
193 GEOIP_API GeoIP *GeoIP_open(const char *filename, int flags);
194 /*
195  * WARNING: GeoIP_db_avail() checks for the existence of a database
196  * file but does not check that it has the requested database revision.
197  * For database types which have more than one revision (including Region,
198  * City, and Cityv6), this can lead to unexpected results. Check the
199  * return value of GeoIP_open_type() to find out whether a particular
200  * database type is really available.
201  */
202 GEOIP_API int GeoIP_db_avail(int type);
203 GEOIP_API void GeoIP_delete(GeoIP *gi);
204 
205 GEOIP_API const char *
206 GeoIP_country_code_by_addr_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl);
207 GEOIP_API const char *
208 GeoIP_country_code_by_name_gl(GeoIP *gi, const char *host, GeoIPLookup *gl);
209 GEOIP_API const char *
210 GeoIP_country_code3_by_addr_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl);
211 GEOIP_API const char *
212 GeoIP_country_code3_by_name_gl(GeoIP *gi, const char *host, GeoIPLookup *gl);
213 GEOIP_API const char *
214 GeoIP_country_name_by_addr_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl);
215 GEOIP_API const char *
216 GeoIP_country_name_by_name_gl(GeoIP *gi, const char *host, GeoIPLookup *gl);
217 GEOIP_API const char *
218 GeoIP_country_name_by_ipnum_gl(GeoIP *gi, unsigned long ipnum, GeoIPLookup *gl);
219 GEOIP_API const char *
220 GeoIP_country_code_by_ipnum_gl(GeoIP *gi, unsigned long ipnum, GeoIPLookup *gl);
222  unsigned long ipnum,
223  GeoIPLookup *gl);
224 
225 /* */
226 GEOIP_API const char *
228 GEOIP_API const char *
230 GEOIP_API const char *
232 
233 GEOIP_API const char *
234 GeoIP_country_code_by_addr_v6_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl);
235 GEOIP_API const char *
236 GeoIP_country_code_by_name_v6_gl(GeoIP *gi, const char *host, GeoIPLookup *gl);
237 GEOIP_API const char *
238 GeoIP_country_code3_by_addr_v6_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl);
239 GEOIP_API const char *
240 GeoIP_country_code3_by_name_v6_gl(GeoIP *gi, const char *host, GeoIPLookup *gl);
241 GEOIP_API const char *
242 GeoIP_country_name_by_addr_v6_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl);
243 GEOIP_API const char *
244 GeoIP_country_name_by_name_v6_gl(GeoIP *gi, const char *host, GeoIPLookup *gl);
245 
246 GEOIP_API int GeoIP_id_by_addr_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl);
247 GEOIP_API int GeoIP_id_by_name_gl(GeoIP *gi, const char *host, GeoIPLookup *gl);
248 GEOIP_API int
249 GeoIP_id_by_ipnum_gl(GeoIP *gi, unsigned long ipnum, GeoIPLookup *gl);
250 
251 GEOIP_API int
252 GeoIP_id_by_addr_v6_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl);
253 GEOIP_API int
254 GeoIP_id_by_name_v6_gl(GeoIP *gi, const char *host, GeoIPLookup *gl);
255 GEOIP_API int
257 
259 GeoIP_region_by_addr_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl);
261 GeoIP_region_by_name_gl(GeoIP *gi, const char *host, GeoIPLookup *gl);
263 GeoIP_region_by_ipnum_gl(GeoIP *gi, unsigned long ipnum, GeoIPLookup *gl);
264 
266 GeoIP_region_by_addr_v6_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl);
268 GeoIP_region_by_name_v6_gl(GeoIP *gi, const char *host, GeoIPLookup *gl);
271 
272 /* Warning - don't call this after GeoIP_assign_region_by_inetaddr calls */
274 
276  unsigned long inetaddr,
277  GeoIPRegion *gir,
278  GeoIPLookup *gl);
280  geoipv6_t inetaddr,
281  GeoIPRegion *gir,
282  GeoIPLookup *gl);
283 
284 /* Used to query GeoIP Organization, ISP and AS Number databases */
285 GEOIP_API char *
286 GeoIP_name_by_ipnum_gl(GeoIP *gi, unsigned long ipnum, GeoIPLookup *gl);
287 GEOIP_API char *
288 GeoIP_name_by_addr_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl);
289 GEOIP_API char *
290 GeoIP_name_by_name_gl(GeoIP *gi, const char *host, GeoIPLookup *gl);
291 
292 GEOIP_API char *
294 GEOIP_API char *
295 GeoIP_name_by_addr_v6_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl);
296 GEOIP_API char *
297 GeoIP_name_by_name_v6_gl(GeoIP *gi, const char *name, GeoIPLookup *gl);
298 
300 GEOIP_API const char *GeoIP_code_by_id(int id);
301 
303 GEOIP_API const char *GeoIP_code3_by_id(int id);
304 
306 GEOIP_API const char *GeoIP_country_name_by_id(GeoIP *gi, int id);
307 
309 GEOIP_API const char *GeoIP_name_by_id(int id);
310 
312 GEOIP_API const char *GeoIP_continent_by_id(int id);
313 
315 GEOIP_API int GeoIP_id_by_code(const char *country);
316 
318 GEOIP_API unsigned GeoIP_num_countries(void);
319 
321 GEOIP_API unsigned char GeoIP_database_edition(GeoIP *gi);
322 
323 GEOIP_API int GeoIP_charset(GeoIP *gi);
324 GEOIP_API int GeoIP_set_charset(GeoIP *gi, int charset);
325 GEOIP_API int GeoIP_enable_teredo(GeoIP *gi, int true_false);
326 GEOIP_API int GeoIP_teredo(GeoIP *gi);
327 
328 GEOIP_API char **
329 GeoIP_range_by_ip_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl);
330 GEOIP_API void GeoIP_range_by_ip_delete(char **ptr);
331 
332 /* Convert region code to region name */
333 GEOIP_API const char *GeoIP_region_name_by_code(const char *country_code,
334  const char *region_code);
335 
336 /* Get timezone from country and region code */
337 GEOIP_API const char *
338 GeoIP_time_zone_by_country_and_region(const char *country_code,
339  const char *region_code);
340 
341 /* some v4 helper functions as of 1.4.7 exported to the public API */
342 GEOIP_API unsigned long GeoIP_addr_to_num(const char *addr);
343 GEOIP_API char *GeoIP_num_to_addr(unsigned long ipnum);
344 
345 /* Internal function -- convert iso to utf8; return a malloced utf8 string. */
346 char *_GeoIP_iso_8859_1__utf8(const char *iso);
347 
348 /* Cleans up memory used to hold file name paths. Returns 1 if successful;
349  * otherwise 0.
350  * */
351 GEOIP_API int GeoIP_cleanup(void);
352 
353 /* Returns the library version in use. Helpful if you're loading dynamically. */
354 GEOIP_API const char *GeoIP_lib_version(void);
355 
356 /* deprecated */
357 GEOIP_API const char *GeoIP_country_code_by_addr(GeoIP *gi, const char *addr);
358 GEOIP_API const char *GeoIP_country_code_by_name(GeoIP *gi, const char *host);
359 GEOIP_API const char *GeoIP_country_code3_by_addr(GeoIP *gi, const char *addr);
360 GEOIP_API const char *GeoIP_country_code3_by_name(GeoIP *gi, const char *host);
361 GEOIP_API const char *GeoIP_country_name_by_addr(GeoIP *gi, const char *addr);
362 GEOIP_API const char *GeoIP_country_name_by_name(GeoIP *gi, const char *host);
364  unsigned long ipnum);
366  unsigned long ipnum);
368  unsigned long ipnum);
369 
371  geoipv6_t ipnum);
373  geoipv6_t ipnum);
375  geoipv6_t ipnum);
376 
378  const char *addr);
380  const char *host);
382  const char *addr);
384  const char *host);
386  const char *addr);
388  const char *host);
389 
390 GEOIP_API int GeoIP_id_by_addr(GeoIP *gi, const char *addr);
391 GEOIP_API int GeoIP_id_by_name(GeoIP *gi, const char *host);
392 GEOIP_API int GeoIP_id_by_ipnum(GeoIP *gi, unsigned long ipnum);
393 
394 GEOIP_API int GeoIP_id_by_addr_v6(GeoIP *gi, const char *addr);
395 GEOIP_API int GeoIP_id_by_name_v6(GeoIP *gi, const char *host);
397 
398 GEOIP_API GeoIPRegion *GeoIP_region_by_addr(GeoIP *gi, const char *addr);
399 GEOIP_API GeoIPRegion *GeoIP_region_by_name(GeoIP *gi, const char *host);
400 GEOIP_API GeoIPRegion *GeoIP_region_by_ipnum(GeoIP *gi, unsigned long ipnum);
401 
402 GEOIP_API GeoIPRegion *GeoIP_region_by_addr_v6(GeoIP *gi, const char *addr);
403 GEOIP_API GeoIPRegion *GeoIP_region_by_name_v6(GeoIP *gi, const char *host);
405 
407  unsigned long inetaddr,
408  GeoIPRegion *gir);
410  geoipv6_t inetaddr,
411  GeoIPRegion *gir);
412 
413 GEOIP_API char *GeoIP_name_by_ipnum(GeoIP *gi, unsigned long ipnum);
414 GEOIP_API char *GeoIP_name_by_addr(GeoIP *gi, const char *addr);
415 GEOIP_API char *GeoIP_name_by_name(GeoIP *gi, const char *host);
416 
418 GEOIP_API char *GeoIP_name_by_addr_v6(GeoIP *gi, const char *addr);
419 GEOIP_API char *GeoIP_name_by_name_v6(GeoIP *gi, const char *name);
420 
423 GEOIP_API char **GeoIP_range_by_ip(GeoIP *gi, const char *addr);
424 
425 /* Deprecated - for backwards compatibility only */
426 GEOIP_API int GeoIP_country_id_by_addr(GeoIP *gi, const char *addr);
427 GEOIP_API int GeoIP_country_id_by_name(GeoIP *gi, const char *host);
428 GEOIP_API char *GeoIP_org_by_addr(GeoIP *gi, const char *addr);
429 GEOIP_API char *GeoIP_org_by_name(GeoIP *gi, const char *host);
430 GEOIP_API char *GeoIP_org_by_ipnum(GeoIP *gi, unsigned long ipnum);
431 
432 GEOIP_API int GeoIP_country_id_by_addr_v6(GeoIP *gi, const char *addr);
434 GEOIP_API char *GeoIP_org_by_addr_v6(GeoIP *gi, const char *addr);
435 GEOIP_API char *GeoIP_org_by_name_v6(GeoIP *gi, const char *name);
436 
437 /* End deprecated */
438 
439 #
440 #ifdef __cplusplus
441 }
442 #endif
443 
444 #endif /* GEOIP_H */
GeoIPTag::databaseSegments
unsigned int * databaseSegments
Definition: GeoIP.h:64
GeoIP_id_by_addr_v6
int GeoIP_id_by_addr_v6(GeoIP *gi, const char *addr)
Definition: GeoIP_deprecated.c:160
GEOIP_USERTYPE_EDITION
Definition: GeoIP.h:131
GeoIPTag::flags
int flags
Definition: GeoIP.h:67
GEOIP_COUNTRYCONF_EDITION
Definition: GeoIP.h:137
GEOIP_CHECK_CACHE
Definition: GeoIP.h:96
GeoIP_name_by_ipnum_gl
char * GeoIP_name_by_ipnum_gl(GeoIP *gi, unsigned long ipnum, GeoIPLookup *gl)
Definition: GeoIP.c:2611
GeoIP_country_code3_by_ipnum
const char * GeoIP_country_code3_by_ipnum(GeoIP *gi, unsigned long ipnum)
Definition: GeoIP_deprecated.c:133
GeoIPTag::record_iter
int record_iter
Definition: GeoIP.h:71
GeoIP_country_code3_by_ipnum_gl
const char * GeoIP_country_code3_by_ipnum_gl(GeoIP *gi, unsigned long ipnum, GeoIPLookup *gl)
Definition: GeoIP.c:1996
GeoIP_assign_region_by_inetaddr_gl
void GeoIP_assign_region_by_inetaddr_gl(GeoIP *gi, unsigned long inetaddr, GeoIPRegion *gir, GeoIPLookup *gl)
Definition: GeoIP.c:2171
GeoIP_country_name_by_ipnum_v6
const char * GeoIP_country_name_by_ipnum_v6(GeoIP *gi, geoipv6_t ipnum)
Definition: GeoIP_deprecated.c:118
GEOIP_MMAP_CACHE
Definition: GeoIP.h:98
GeoIPTag::last_mtime_check
time_t last_mtime_check
Definition: GeoIP.h:74
GeoIP_country_code_by_name_gl
const char * GeoIP_country_code_by_name_gl(GeoIP *gi, const char *host, GeoIPLookup *gl)
Definition: GeoIP.c:1768
GEOIP_ACCURACYRADIUS_EDITION_V6
Definition: GeoIP.h:141
GeoIPDBFileName
char ** GeoIPDBFileName
Definition: GeoIP.c:897
GeoIP_country_continent
const char GeoIP_country_continent[256][3]
Definition: GeoIP.c:675
GeoIP_teredo
int GeoIP_teredo(GeoIP *gi)
Definition: GeoIP.c:2672
GEOIP_DOMAIN_EDITION
Definition: GeoIP.h:113
GeoIP_region_name_by_code
const char * GeoIP_region_name_by_code(const char *country_code, const char *region_code)
Definition: regionName.c:9584
GeoIP_continent_by_id
const char * GeoIP_continent_by_id(int id)
Definition: GeoIP.c:2723
GeoIP_org_by_ipnum_v6
char * GeoIP_org_by_ipnum_v6(GeoIP *gi, geoipv6_t ipnum)
Definition: GeoIP_deprecated.c:9
GEOIP_REGION_EDITION_REV1
Definition: GeoIP.h:109
GeoIP_country_code3_by_name_v6
const char * GeoIP_country_code3_by_name_v6(GeoIP *gi, const char *host)
Definition: GeoIP_deprecated.c:56
GeoIPDBTypes
GeoIPDBTypes
Definition: GeoIP.h:102
GeoIP_name_by_ipnum_v6
char * GeoIP_name_by_ipnum_v6(GeoIP *gi, geoipv6_t ipnum)
Definition: GeoIP_deprecated.c:227
GeoIP
struct GeoIPTag GeoIP
GeoIP_region_by_ipnum_v6
GeoIPRegion * GeoIP_region_by_ipnum_v6(GeoIP *gi, geoipv6_t ipnum)
Definition: GeoIP_deprecated.c:213
GeoIP_org_by_addr_v6
char * GeoIP_org_by_addr_v6(GeoIP *gi, const char *addr)
Definition: GeoIP_deprecated.c:19
GeoIPRegion_delete
void GeoIPRegion_delete(GeoIPRegion *gir)
Definition: GeoIP.c:2404
GEOIP_API
#define GEOIP_API
Definition: GeoIP.h:166
GeoIP_setup_custom_directory
void GeoIP_setup_custom_directory(char *dir)
Definition: GeoIP.c:850
GeoIP_num_to_addr
char * GeoIP_num_to_addr(unsigned long ipnum)
Definition: GeoIP.c:2526
GEOIP_TEREDO_BIT
Definition: GeoIP.h:81
GeoIP_time_zone_by_country_and_region
const char * GeoIP_time_zone_by_country_and_region(const char *country_code, const char *region_code)
Definition: timeZone.c:2
GEOIP_ISP_EDITION
Definition: GeoIP.h:107
GeoIPDBDescription
const char * GeoIPDBDescription[(38+1)]
Definition: GeoIP.c:807
GeoIP_country_code3_by_name_v6_gl
const char * GeoIP_country_code3_by_name_v6_gl(GeoIP *gi, const char *host, GeoIPLookup *gl)
Definition: GeoIP.c:1774
GeoIP_region_by_name
GeoIPRegion * GeoIP_region_by_name(GeoIP *gi, const char *host)
Definition: GeoIP_deprecated.c:200
GEOIP_CORPORATE_SPEED
Definition: GeoIP.h:154
GEOIP_NETSPEED_EDITION_REV1_V6
Definition: GeoIP.h:136
GeoIP_country_name_by_ipnum_v6_gl
const char * GeoIP_country_name_by_ipnum_v6_gl(GeoIP *gi, geoipv6_t ipnum, GeoIPLookup *gl)
Definition: GeoIP.c:1975
GeoIPRegionTag
Definition: GeoIP.h:88
GeoIPTag::dyn_seg_size
off_t dyn_seg_size
Definition: GeoIP.h:75
GeoIPTag::record_length
char record_length
Definition: GeoIP.h:69
GEOIP_HTTP_CLIENT_IP_PROXY
Definition: GeoIP.h:147
GeoIP_delete
void GeoIP_delete(GeoIP *gi)
Definition: GeoIP.c:1735
GEOIP_REGIONCONF_EDITION
Definition: GeoIP.h:139
GeoIP_id_by_ipnum_v6_gl
int GeoIP_id_by_ipnum_v6_gl(GeoIP *gi, geoipv6_t ipnum, GeoIPLookup *gl)
Definition: GeoIP.c:2070
GeoIP_name_by_name_v6
char * GeoIP_name_by_name_v6(GeoIP *gi, const char *name)
Definition: GeoIP_deprecated.c:245
GEOIP_CITYCONFIDENCE_EDITION
Definition: GeoIP.h:117
GEOIP_CITY_EDITION_REV0_V6
Definition: GeoIP.h:134
GeoIP_region_by_name_gl
GeoIPRegion * GeoIP_region_by_name_gl(GeoIP *gi, const char *host, GeoIPLookup *gl)
Definition: GeoIP.c:2341
GeoIP_country_id_by_addr
int GeoIP_country_id_by_addr(GeoIP *gi, const char *addr)
Definition: GeoIP_deprecated.c:148
GeoIP_org_by_ipnum
char * GeoIP_org_by_ipnum(GeoIP *gi, unsigned long ipnum)
Definition: GeoIP_deprecated.c:4
GeoIP_country_name_by_addr_v6_gl
const char * GeoIP_country_name_by_addr_v6_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl)
Definition: GeoIP.c:1953
GeoIPNetspeedValues
GeoIPNetspeedValues
Definition: GeoIP.h:150
GeoIP_country_code_by_addr_v6_gl
const char * GeoIP_country_code_by_addr_v6_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl)
Definition: GeoIP.c:1925
GeoIP_country_code3_by_addr_v6
const char * GeoIP_country_code3_by_addr_v6(GeoIP *gi, const char *addr)
Definition: GeoIP_deprecated.c:94
GeoIP_country_code_by_ipnum
const char * GeoIP_country_code_by_ipnum(GeoIP *gi, unsigned long ipnum)
Definition: GeoIP_deprecated.c:128
GeoIP_id_by_addr_gl
int GeoIP_id_by_addr_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl)
Definition: GeoIP.c:2050
GeoIP_name_by_addr
char * GeoIP_name_by_addr(GeoIP *gi, const char *addr)
Definition: GeoIP_deprecated.c:231
GeoIPTag::ext_flags
unsigned int ext_flags
Definition: GeoIP.h:76
GeoIPLookup::netmask
int netmask
Definition: GeoIP.h:79
GEOIP_LOCATIONA_EDITION_V6
Definition: GeoIP.h:128
GEOIP_REGISTRAR_EDITION_V6
Definition: GeoIP.h:130
GEOIP_ACCURACYRADIUS_EDITION
Definition: GeoIP.h:116
GeoIPRegionTag::region
char region[3]
Definition: GeoIP.h:90
GEOIP_LOCATIONA_EDITION
Definition: GeoIP.h:115
GEOIP_ANON_PROXY
Definition: GeoIP.h:145
GEOIP_INDEX_CACHE
Definition: GeoIP.h:97
GeoIPTag::index_cache
unsigned char * index_cache
Definition: GeoIP.h:63
GeoIPOptions
GeoIPOptions
Definition: GeoIP.h:93
GeoIP_name_by_name
char * GeoIP_name_by_name(GeoIP *gi, const char *host)
Definition: GeoIP_deprecated.c:240
GeoIP_country_id_by_addr_v6
int GeoIP_country_id_by_addr_v6(GeoIP *gi, const char *addr)
Definition: GeoIP_deprecated.c:143
GeoIP_set_charset
int GeoIP_set_charset(GeoIP *gi, int charset)
Definition: GeoIP.c:2679
GeoIP_id_by_code
int GeoIP_id_by_code(const char *country)
Definition: GeoIP.c:2732
GEOIP_CITY_EDITION_REV1_V6
Definition: GeoIP.h:133
GeoIP_name_by_addr_gl
char * GeoIP_name_by_addr_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl)
Definition: GeoIP.c:2619
GEOIP_ASNUM_EDITION
Definition: GeoIP.h:111
GeoIP_country_name
const char * GeoIP_country_name[256]
Definition: GeoIP.c:413
NUM_DB_TYPES
#define NUM_DB_TYPES
Definition: GeoIP.h:51
GeoIPOrgDBFileName
const char * GeoIPOrgDBFileName
GEOIP_NETSPEED_EDITION_REV1
Definition: GeoIP.h:135
GeoIPTag
Definition: GeoIP.h:59
GeoIPCityDBFileName
const char * GeoIPCityDBFileName
GeoIPProxyTypes
GeoIPProxyTypes
Definition: GeoIP.h:144
GeoIP_country_name_by_name_v6
const char * GeoIP_country_name_by_name_v6(GeoIP *gi, const char *host)
Definition: GeoIP_deprecated.c:66
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: GeoIP.c:2227
GEOIP_SILENCE
Definition: GeoIP.h:99
GEOIP_LARGE_COUNTRY_EDITION_V6
Definition: GeoIP.h:120
GeoIP_enable_teredo
int GeoIP_enable_teredo(GeoIP *gi, int true_false)
Definition: GeoIP.c:2662
GeoIP_range_by_ip_gl
char ** GeoIP_range_by_ip_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl)
Definition: GeoIP.c:2553
GEOIP_DOMAIN_EDITION_V6
Definition: GeoIP.h:127
GeoIP_database_info
char * GeoIP_database_info(GeoIP *gi)
Definition: GeoIP.c:2101
GeoIP_new
GeoIP * GeoIP_new(int flags)
Definition: GeoIP.c:1614
GEOIP_DATA
#define GEOIP_DATA
Definition: GeoIP.h:167
GeoIP_country_id_by_name
int GeoIP_country_id_by_name(GeoIP *gi, const char *host)
Definition: GeoIP_deprecated.c:156
GeoIP_country_code3_by_ipnum_v6
const char * GeoIP_country_code3_by_ipnum_v6(GeoIP *gi, geoipv6_t ipnum)
Definition: GeoIP_deprecated.c:138
GeoIP_country_code3_by_addr_gl
const char * GeoIP_country_code3_by_addr_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl)
Definition: GeoIP.c:1946
GeoIPTag::file_path
char * file_path
Definition: GeoIP.h:61
GeoIP_open
GeoIP * GeoIP_open(const char *filename, int flags)
Definition: GeoIP.c:1621
GeoIP_range_by_ip
char ** GeoIP_range_by_ip(GeoIP *gi, const char *addr)
Definition: GeoIP_deprecated.c:218
GeoIPRegion
struct GeoIPRegionTag GeoIPRegion
GeoIP_country_code_by_name_v6
const char * GeoIP_country_code_by_name_v6(GeoIP *gi, const char *host)
Definition: GeoIP_deprecated.c:46
GeoIPLookup
struct GeoIPLookup GeoIPLookup
GeoIP_country_code3_by_addr_v6_gl
const char * GeoIP_country_code3_by_addr_v6_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl)
Definition: GeoIP.c:1937
GeoIP_region_by_ipnum
GeoIPRegion * GeoIP_region_by_ipnum(GeoIP *gi, unsigned long ipnum)
Definition: GeoIP_deprecated.c:209
GeoIPCountryDBFileName
const char * GeoIPCountryDBFileName
GEOIP_CITY_EDITION_REV0
Definition: GeoIP.h:105
GeoIP_assign_region_by_inetaddr_v6
void GeoIP_assign_region_by_inetaddr_v6(GeoIP *gi, geoipv6_t inetaddr, GeoIPRegion *gir)
Definition: GeoIP_deprecated.c:184
GeoIP_charset
int GeoIP_charset(GeoIP *gi)
Definition: GeoIP.c:2677
GeoIP_db_avail
int GeoIP_db_avail(int type)
Definition: GeoIP.c:1026
GeoIP_addr_to_num
unsigned long GeoIP_addr_to_num(const char *addr)
Definition: GeoIP.c:1545
GeoIPTag::cache
unsigned char * cache
Definition: GeoIP.h:62
GeoIP_country_code3_by_ipnum_v6_gl
const char * GeoIP_country_code3_by_ipnum_v6_gl(GeoIP *gi, geoipv6_t ipnum, GeoIPLookup *gl)
Definition: GeoIP.c:2004
GeoIPRegionTag::country_code
char country_code[3]
Definition: GeoIP.h:89
GeoIP_country_name_by_addr_gl
const char * GeoIP_country_name_by_addr_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl)
Definition: GeoIP.c:1960
GEOIP_CCM_COUNTRY_EDITION
Definition: GeoIP.h:123
GeoIP_country_name_by_name_v6_gl
const char * GeoIP_country_name_by_name_v6_gl(GeoIP *gi, const char *host, GeoIPLookup *gl)
Definition: GeoIP.c:1790
GeoIP_cleanup
int GeoIP_cleanup(void)
Definition: GeoIP.c:2748
GeoIPTag::mtime
time_t mtime
Definition: GeoIP.h:66
GeoIP_country_code3_by_name_gl
const char * GeoIP_country_code3_by_name_gl(GeoIP *gi, const char *host, GeoIPLookup *gl)
Definition: GeoIP.c:1783
GEOIP_CABLEDSL_SPEED
Definition: GeoIP.h:153
GeoIP_custom_directory
char * GeoIP_custom_directory
Definition: GeoIP.c:848
_GeoIP_iso_8859_1__utf8
char * _GeoIP_iso_8859_1__utf8(const char *iso)
Definition: GeoIP.c:980
GeoIP_open_type
GeoIP * GeoIP_open_type(int type, int flags)
Definition: GeoIP.c:1579
GeoIP_region_by_name_v6
GeoIPRegion * GeoIP_region_by_name_v6(GeoIP *gi, const char *host)
Definition: GeoIP_deprecated.c:204
GeoIP_id_by_ipnum_v6
int GeoIP_id_by_ipnum_v6(GeoIP *gi, geoipv6_t ipnum)
Definition: GeoIP_deprecated.c:169
GEOIP_ORG_EDITION_V6
Definition: GeoIP.h:126
GeoIP_country_code_by_addr
const char * GeoIP_country_code_by_addr(GeoIP *gi, const char *addr)
Definition: GeoIP_deprecated.c:89
GeoIP_code3_by_id
const char * GeoIP_code3_by_id(int id)
Definition: GeoIP.c:2695
GeoIP_name_by_ipnum_v6_gl
char * GeoIP_name_by_ipnum_v6_gl(GeoIP *gi, geoipv6_t ipnum, GeoIPLookup *gl)
Definition: GeoIP.c:2615
GEOIP_CHARSET_ISO_8859_1
Definition: GeoIP.h:84
GeoIP_id_by_name_gl
int GeoIP_id_by_name_gl(GeoIP *gi, const char *host, GeoIPLookup *gl)
Definition: GeoIP.c:1880
GeoIP_lib_version
const char * GeoIP_lib_version(void)
Definition: GeoIP.c:2746
GeoIP_last_netmask
int GeoIP_last_netmask(GeoIP *gi)
Definition: GeoIP_deprecated.c:34
GeoIPExtFlags
GeoIPExtFlags
Definition: GeoIP.h:81
GeoIP_id_by_name
int GeoIP_id_by_name(GeoIP *gi, const char *host)
Definition: GeoIP_deprecated.c:76
GeoIP_range_by_ip_delete
void GeoIP_range_by_ip_delete(char **ptr)
Definition: GeoIP.c:2599
GeoIP_database_edition
unsigned char GeoIP_database_edition(GeoIP *gi)
Definition: GeoIP.c:2660
GeoIP_name_by_id
const char * GeoIP_name_by_id(int id)
Definition: GeoIP.c:2714
GEOIP_CITYCONFIDENCEDIST_EDITION
Definition: GeoIP.h:118
GeoIP_country_name_by_id
const char * GeoIP_country_name_by_id(GeoIP *gi, int id)
Definition: GeoIP.c:2704
GeoIPAccuracyRadiusFileName
const char * GeoIPAccuracyRadiusFileName
GeoIP_country_code_by_ipnum_v6_gl
const char * GeoIP_country_code_by_ipnum_v6_gl(GeoIP *gi, geoipv6_t ipnum, GeoIPLookup *gl)
Definition: GeoIP.c:1990
GeoIP_org_by_addr
char * GeoIP_org_by_addr(GeoIP *gi, const char *addr)
Definition: GeoIP_deprecated.c:14
GeoIP_region_by_ipnum_v6_gl
GeoIPRegion * GeoIP_region_by_ipnum_v6_gl(GeoIP *gi, geoipv6_t ipnum, GeoIPLookup *gl)
Definition: GeoIP.c:2393
GeoIP_region_by_addr_v6
GeoIPRegion * GeoIP_region_by_addr_v6(GeoIP *gi, const char *addr)
Definition: GeoIP_deprecated.c:195
GeoIP_id_by_ipnum
int GeoIP_id_by_ipnum(GeoIP *gi, unsigned long ipnum)
Definition: GeoIP_deprecated.c:173
GeoIP_region_by_addr_v6_gl
GeoIPRegion * GeoIP_region_by_addr_v6_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl)
Definition: GeoIP.c:2324
GEOIP_POSTALCONF_EDITION
Definition: GeoIP.h:140
GEOIP_ORG_EDITION
Definition: GeoIP.h:106
GeoIP_id_by_name_v6_gl
int GeoIP_id_by_name_v6_gl(GeoIP *gi, const char *host, GeoIPLookup *gl)
Definition: GeoIP.c:1902
GeoIP_country_name_by_addr_v6
const char * GeoIP_country_name_by_addr_v6(GeoIP *gi, const char *addr)
Definition: GeoIP_deprecated.c:104
GeoIPTag::charset
int charset
Definition: GeoIP.h:70
GeoIP_name_by_addr_v6
char * GeoIP_name_by_addr_v6(GeoIP *gi, const char *addr)
Definition: GeoIP_deprecated.c:235
GeoIP_country_name_by_name_gl
const char * GeoIP_country_name_by_name_gl(GeoIP *gi, const char *host, GeoIPLookup *gl)
Definition: GeoIP.c:1797
GEOIP_CITY_EDITION_REV1
Definition: GeoIP.h:108
GeoIPCharset
GeoIPCharset
Definition: GeoIP.h:83
GeoIPLookup
Definition: GeoIP.h:79
GEOIP_HTTP_X_FORWARDED_FOR_PROXY
Definition: GeoIP.h:146
GeoIPTag::size
off_t size
Definition: GeoIP.h:68
GeoIP_country_code3
const char GeoIP_country_code3[256][4]
Definition: GeoIP.c:127
GEOIP_COUNTRY_EDITION
Definition: GeoIP.h:103
GeoIP_region_by_addr_gl
GeoIPRegion * GeoIP_region_by_addr_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl)
Definition: GeoIP.c:2307
GeoIPCityConfidenceFileName
const char * GeoIPCityConfidenceFileName
GEOIP_LARGE_COUNTRY_EDITION
Definition: GeoIP.h:119
GEOIP_MEMORY_CACHE
Definition: GeoIP.h:95
GEOIP_NETSPEED_EDITION
Definition: GeoIP.h:112
GEOIP_CHARSET_UTF8
Definition: GeoIP.h:85
GeoIP_country_code
const char GeoIP_country_code[256][3]
Definition: GeoIP.c:100
GeoIPTag::databaseType
char databaseType
Definition: GeoIP.h:65
GeoIP_country_code_by_name
const char * GeoIP_country_code_by_name(GeoIP *gi, const char *host)
Definition: GeoIP_deprecated.c:51
GeoIP_country_name_by_ipnum_gl
const char * GeoIP_country_name_by_ipnum_gl(GeoIP *gi, unsigned long ipnum, GeoIPLookup *gl)
Definition: GeoIP.c:1966
GeoIP_country_code3_by_addr
const char * GeoIP_country_code3_by_addr(GeoIP *gi, const char *addr)
Definition: GeoIP_deprecated.c:99
GEOIP_ISP_EDITION_V6
Definition: GeoIP.h:125
GeoIP_org_by_name_v6
char * GeoIP_org_by_name_v6(GeoIP *gi, const char *name)
Definition: GeoIP_deprecated.c:29
GeoIP_num_countries
unsigned GeoIP_num_countries(void)
Definition: GeoIP.c:2744
GEOIP_CITYCONF_EDITION
Definition: GeoIP.h:138
GeoIP_id_by_name_v6
int GeoIP_id_by_name_v6(GeoIP *gi, const char *host)
Definition: GeoIP_deprecated.c:80
GeoIP_name_by_name_gl
char * GeoIP_name_by_name_gl(GeoIP *gi, const char *host, GeoIPLookup *gl)
Definition: GeoIP.c:2637
GEOIP_PROXY_EDITION
Definition: GeoIP.h:110
GeoIP_country_code_by_ipnum_v6
const char * GeoIP_country_code_by_ipnum_v6(GeoIP *gi, geoipv6_t ipnum)
Definition: GeoIP_deprecated.c:123
GeoIP_name_by_ipnum
char * GeoIP_name_by_ipnum(GeoIP *gi, unsigned long ipnum)
Definition: GeoIP_deprecated.c:223
GeoIP_country_name_by_addr
const char * GeoIP_country_name_by_addr(GeoIP *gi, const char *addr)
Definition: GeoIP_deprecated.c:108
GEOIP_DIALUP_SPEED
Definition: GeoIP.h:152
GeoIP_country_name_by_ipnum
const char * GeoIP_country_name_by_ipnum(GeoIP *gi, unsigned long ipnum)
Definition: GeoIP_deprecated.c:113
GeoIPLocationADBFileName
const char * GeoIPLocationADBFileName
GeoIP_assign_region_by_inetaddr
void GeoIP_assign_region_by_inetaddr(GeoIP *gi, unsigned long inetaddr, GeoIPRegion *gir)
Definition: GeoIP_deprecated.c:177
GEOIP_CITYCONFIDENCEDIST_ISP_ORG_EDITION
Definition: GeoIP.h:121
GeoIP_org_by_name
char * GeoIP_org_by_name(GeoIP *gi, const char *host)
Definition: GeoIP_deprecated.c:24
GEOIP_STANDARD
Definition: GeoIP.h:94
GeoIPISPDBFileName
const char * GeoIPISPDBFileName
geoipv6_t
struct in6_addr geoipv6_t
Definition: GeoIP.h:54
GeoIP_id_by_addr
int GeoIP_id_by_addr(GeoIP *gi, const char *addr)
Definition: GeoIP_deprecated.c:164
GEOIP_ASNUM_EDITION_V6
Definition: GeoIP.h:124
GeoIP_id_by_ipnum_gl
int GeoIP_id_by_ipnum_gl(GeoIP *gi, unsigned long ipnum, GeoIPLookup *gl)
Definition: GeoIP.c:2083
GEOIP_COUNTRY_EDITION_V6
Definition: GeoIP.h:114
GeoIPRegionDBFileName
const char * GeoIPRegionDBFileName
GeoIP_region_by_ipnum_gl
GeoIPRegion * GeoIP_region_by_ipnum_gl(GeoIP *gi, unsigned long ipnum, GeoIPLookup *gl)
Definition: GeoIP.c:2381
GeoIP_country_code3_by_name
const char * GeoIP_country_code3_by_name(GeoIP *gi, const char *host)
Definition: GeoIP_deprecated.c:61
GEOIP_REGISTRAR_EDITION
Definition: GeoIP.h:129
GEOIP_UNKNOWN_SPEED
Definition: GeoIP.h:151
GeoIP_region_by_addr
GeoIPRegion * GeoIP_region_by_addr(GeoIP *gi, const char *addr)
Definition: GeoIP_deprecated.c:191
GEOIP_REGION_EDITION_REV0
Definition: GeoIP.h:104
GEOIP_USERTYPE_EDITION_V6
Definition: GeoIP.h:132
GeoIP_utf8_country_name
const char * GeoIP_utf8_country_name[256]
Definition: GeoIP.c:153
GeoIP_country_code_by_addr_gl
const char * GeoIP_country_code_by_addr_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl)
Definition: GeoIP.c:1932
GeoIPTag::GeoIPDatabase
FILE * GeoIPDatabase
Definition: GeoIP.h:60
GeoIP_name_by_name_v6_gl
char * GeoIP_name_by_name_v6_gl(GeoIP *gi, const char *name, GeoIPLookup *gl)
Definition: GeoIP.c:2648
GeoIP_country_code_by_name_v6_gl
const char * GeoIP_country_code_by_name_v6_gl(GeoIP *gi, const char *host, GeoIPLookup *gl)
Definition: GeoIP.c:1761
GeoIP_name_by_addr_v6_gl
char * GeoIP_name_by_addr_v6_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl)
Definition: GeoIP.c:2628
GeoIP_id_by_addr_v6_gl
int GeoIP_id_by_addr_v6_gl(GeoIP *gi, const char *addr, GeoIPLookup *gl)
Definition: GeoIP.c:2032
GeoIP_country_code_by_addr_v6
const char * GeoIP_country_code_by_addr_v6(GeoIP *gi, const char *addr)
Definition: GeoIP_deprecated.c:85
GeoIP_code_by_id
const char * GeoIP_code_by_id(int id)
Definition: GeoIP.c:2686
GeoIPTag::netmask
int netmask
Definition: GeoIP.h:72
GeoIP_region_by_name_v6_gl
GeoIPRegion * GeoIP_region_by_name_v6_gl(GeoIP *gi, const char *host, GeoIPLookup *gl)
Definition: GeoIP.c:2360
GeoIP_country_code_by_ipnum_gl
const char * GeoIP_country_code_by_ipnum_gl(GeoIP *gi, unsigned long ipnum, GeoIPLookup *gl)
Definition: GeoIP.c:1981
GeoIP_country_name_by_name
const char * GeoIP_country_name_by_name(GeoIP *gi, const char *host)
Definition: GeoIP_deprecated.c:71