2 * ModSecurity for Apache 2.x, http://www.modsecurity.org/
3 * Copyright (c) 2004-2009 Breach Security, Inc. (http://www.breach.com/)
5 * This product is released under the terms of the General Public Licence,
6 * version 2 (GPLv2). Please refer to the file LICENSE (included with this
7 * distribution) which contains the complete text of the licence.
9 * There are special exceptions to the terms and conditions of the GPL
10 * as it is applied to this software. View the full text of the exception in
11 * file MODSECURITY_LICENSING_EXCEPTION in the directory of this software
14 * If any of the files related to licensing are missing or if you have any
15 * other questions related to licensing please contact Breach Security, Inc.
16 * directly using the email address support@breach.com.
22 #define GEO_STRUCT_INFO_MAX_SIZE 20
23 #define GEO_DB_INFO_MAX_SIZE 100
24 #define GEO_COUNTRY_OFFSET 0xffff00
25 #define GEO_MAX_RECORD_LEN 4
26 #define GEO_COUNTRY_UNKNOWN "Unknown"
27 #define GEO_CITY_UNKNOWN "Unknown"
28 #define GEO_CITY_RECORD_LEN 50
29 #define GEO_COUNTRY_DATABASE 1
30 #define GEO_CITY_DATABASE_0 6
31 #define GEO_CITY_DATABASE_1 2
32 #define GEO_COUNTRY_LAST 250
35 typedef struct geo_rec geo_rec;
36 typedef struct geo_db geo_db;
38 #include <apr_file_io.h>
39 #include "modsecurity.h"
44 const char *country_code;
45 const char *country_code3;
46 const char *country_name;
47 const char *country_continent;
50 const char *postal_code;
61 unsigned int ctry_offset;
66 int DSOLOCAL geo_init(directory_config *dcfg, const char *dbfn, char **error_msg);
68 int DSOLOCAL geo_lookup(modsec_rec *msr, geo_rec *rec, const char *target, char **error_msg);
70 apr_status_t DSOLOCAL geo_cleanup(modsec_rec *msr);