• Home
  • History
  • Annotate
  • only in this directory
NameDateSize

..16-May-201756

aclocal.m4H A D07-Jun-2016336.2 KiB

apps/H16-May-201711

AUTHORSH A D07-Jun-201635

bootstrapH A D07-Jun-2016426

ChangeLogH A D07-Jun-201633.4 KiB

conf/H16-May-20176

config.guessH A D07-Jun-201643.8 KiB

config.statusH A D07-Jun-201663.9 KiB

config.subH A D07-Jun-201634.6 KiB

configureH A D07-Jun-2016426.4 KiB

configure.acH A D07-Jun-20162 KiB

COPYINGH A D07-Jun-201626 KiB

data/H16-May-20176

depcompH A D07-Jun-201619.9 KiB

geoip.icoH A D07-Jun-20163 KiB

geoip.pcH A D07-Jun-2016345

geoip.pc.inH A D07-Jun-2016245

GeoIP.specH A D07-Jun-20162 KiB

GeoIP.spec.inH A D07-Jun-20162 KiB

GeoIPWinDLL.patchH A D07-Jun-20166 KiB

get_ver.awkH A D07-Jun-2016410

INSTALLH A D07-Jun-201615.4 KiB

install-shH A D07-Jun-201613.7 KiB

libGeoIP/H16-May-201723

libtoolH A D07-Jun-2016287.8 KiB

ltmain.shH A D07-Jun-2016277 KiB

Makefile.amH A D07-Jun-2016375

Makefile.inH A D07-Jun-201625 KiB

Makefile.netwareH A D07-Jun-20167.9 KiB

Makefile.vcH A D07-Jun-20161.9 KiB

Makefile.win32H A D07-Jun-20166 KiB

man/H16-May-20178

missingH A D07-Jun-201610.1 KiB

NEWSH A D07-Jun-20160

READMEH A D07-Jun-20167.4 KiB

README.MinGWH A D07-Jun-2016373

README.OSXH A D07-Jun-20161.7 KiB

READMEwin32.txtH A D07-Jun-20161.4 KiB

READMEwin32static.txtH A D07-Jun-2016736

test/H16-May-201721

TODOH A D07-Jun-20162.5 KiB

README

1				GeoIP 1.5.0
2				-----------
3
4*** Experimental IPv6 notice ***
5
6- the experimental IPv6 part of libGeoIP may change in the future.
7- It is possible, that geoiplookup and geoiplookup6 will merged.
8
9***
10
11The new perl script geoipupdate-pureperl.pl is a drop in replacement for
12geoipupdate. Useful, if you like to customize, pre or postprocess new or
13old databases. To archive the databases or signal apache whatever.
14Another advantage is, that geoipupdate-pureperl.pl is able to handle proxy
15requests even with authentication.
16
17IMPORTANT API Change for 1.3.x and above users for GeoIP Region database
18GeoIPRegion.region is no longer a pointer but an in-structure
19array so test the first byte of region == 0 rather testing if the region
20pointer is NULL.
21
22IMPORTANT API Change for 1.1.x and above users - as of GeoIP 1.1.0 the
23GeoIP_country_xxx_by_xxx functions return NULL if a country can not
24be found (it used to return '--' or 'N/A'. Be sure to check the
25return value for NULL, to avoid segmentation faults!
26
27GeoIP is a C library that enables the user to find geographical and
28network information of an IP address.
29Included is a free GeoLite Country database
30that is updated at the beginning of every month.
31To download the latest free GeoLite Country database, go to:
32http://dev.maxmind.com/geoip/geolite
33
34There is also a free city-level geolocation database, GeoLite City,
35available from:
36http://dev.maxmind.com/geoip/geolite
37
38We also offer commercial GeoIP databases with greater accuracy and
39additional network information, for more details, see:
40https://www.maxmind.com/en/geolocation_landing
41
42As of version 1.4.5 geoipupdate can handle updates via  HTTP Proxy Server.
43If the environ variable http_proxy="http://proxy-host:port" is set.
44The username:password (as in FTP URLs) is not supported! 
45Thanks to Andrew Droffner for the patch!
46
47As of version 1.3.6, the GeoIP C library is thread safe, as long as
48GEOIP_CHECK_CACHE is not used.
49
50If you use GeoIP to block access from high risk countries in order
51to reduce fraud or abuse, you may want to also block access from known
52proxy servers. For more details on our proxy detection service, please visit:
53https://www.maxmind.com/en/proxy
54
55To install, run:
56
57./configure
58make
59make check
60make install
61
62The GeoIP C library relies on GNU make, not on BSD make
63
64MEMORY CACHING AND OTHER OPTIONS
65
66There are four options available:
67
68GEOIP_STANDARD - read database from filesystem, uses least memory.
69
70GEOIP_MEMORY_CACHE - load database into memory, faster performance
71	but uses more memory
72
73GEOIP_CHECK_CACHE - check for updated database. If database has been updated,
74	reload filehandle and/or memory cache.
75
76GEOIP_INDEX_CACHE - just cache
77        the most frequently accessed index portion of the database, resulting
78        in faster lookups than GEOIP_STANDARD, but less memory usage than
79        GEOIP_MEMORY_CACHE - useful for larger databases such as
80	GeoIP Organization and GeoIP City. Note, for GeoIP Country, Region
81	and Netspeed databases, GEOIP_INDEX_CACHE is equivalent to GEOIP_MEMORY_CACHE
82
83GEOIP_MMAP_CACHE - load database into mmap shared memory ( MMAP is not avail for WIN32 )
84
85The options can be combined using bit operators. For example you can
86use both GEOIP_MEMORY_CACHE and GEOIP_CHECK_CACHE by calling:
87
88    GeoIP_open("/path/to/GeoIP.dat", GEOIP_MEMORY_CACHE | GEOIP_CHECK_CACHE);
89
90By default, the city name is returned in iso-8859-1 charset. To obtain the
91city name in utf8 instead, run:
92
93    GeoIP_set_charset(gi, GEOIP_CHARSET_UTF8);
94
95To get the netmask of the netblock of the last lookup, use GeoIP_last_netblock(gi).
96
97EXAMPLES
98
99See
100test/
101     test-geoip.c
102     test-geoip-region.c
103     test-geoip-city.c
104     test-geoip-isp.c
105     test-geoip-org.c
106     test-geoip-netspeed.c
107
108for examples of how to use the API. The test-geoip.c program works with both the GeoLite and
109GeoIP Country databases. The test-geoip-city.c program works with both the GeoLite and
110GeoIP City databases. The other example programs require the paid databases available
111https://www.maxmind.com/en/geolocation_landing
112
113
114AUTOMATIC UPDATES
115
116MaxMind offers a service where you can have your database updated
117automically each week. For more details see:
118
119http://www.maxmind.com/en/license_key
120
121RESOURCES Mailinglists
122
123Please join the very low traffic mailinglists you are interested in.
124
125http://sourceforge.net/mail/?group_id=66844
126
127Preformance Patches.
128
129Patrick McManus provide a patch to enhance the lookupspeed in MEMORY_CACHE mode. If you feel, that the current MEMORY_CACHE mode is to slow try the patch:
130
131http://sourceforge.net/mailarchive/forum.php?forum_name=geoip-c-discuss&max_rows=25&style=nested&viewmonth=200803
132
133RESOURCES Development version
134
135Please find the latest version of the CAPI on github.
136
137https://github.com/maxmind/geoip-api-c
138
139TROUBLESHOOTING
140
141In case of trouble building from source with libtool or autotools, run
142./bootstrap or autoreconf -vfi or aclocal && autoconf && automake --add-missing
143to update the generated configuration files.
144
145The Windows build is not thread-safe in STANDARD mode b/c the pread is not
146thread-safe.
147
148If you run into trouble building your application with GeoIP support, try adding -fms-extensions to your CFLAGS. If you use Solaris and there C-Compiler use -features=extensions instead. These options enable unnamed union support and fix problems like: 'improper member use: dma_code' or 'GeoIPRecord' has no member named 'dma_code'.
149
150Note that it is recommended that you use GNU make. Also, if you are using
151OpenBSD, GeoIP requires OpenBSD 3.1 or greater.
152
153if you get "cannot load shared object file: No such file or directory"
154error, add the directory libGeoIP.so was installed to to /etc/ld.so.conf
155and run ldconfig
156
157On Solaris, if you get a
158ld: fatal: relocations remain against allocatable but non-writable sections
159error, try running
160
161# make clean
162# ./configure --disable-shared
163# make
164
165If you get a "ar : command not found" error, make sure that ar is
166in your path. On Solaris, ar is typically found in /usr/ccs/bin
167
168If you get a "geoipupdate.c:24: getopt.h: No such file or directory"
169error, run
170
171# export CPPFLAGS="-I/usr/local/include"
172
173(assuming that getopt.h is in /usr/local/include)
174
175If you get a "zlib.h: No such file or directory" error, make sure
176that the zlib development libraries are installed on your server.
177These are typically included in a "zlib-devel" package.
178
179If you get a "bad interpreter: No such file or directory" error
180when running ./configure, make sure that there are no DOS
181returns in the configure script. To remove DOS returns,
182run perl -pi -e 's!\r!!g' configure.
183
184If gcc fails while consuming a large amount of memory, try
185compiling with CFLAGS=-O1 (or -O0) instead of the default -O2.
186It seems that some
187versions of gcc have a bug and consume 1 GB of memory when optimizing
188certain source files (the other source file where this was reported is
189from XORG X-Server). It happens at least with gcc 3.3.1 and with gcc
1904.2(.0). Thanks to Kai Schaetzl for the report.
191
192If GEOIP_MMAP_CACHE doesn't work on a 64bit machine, try adding
193the flag "MAP_32BIT" to the mmap call.
194
195If you get a "passing argument 3 of 'gethostbyname_r' from incompatible pointer type"
196error on AIX, download and/or untar a fresh copy of GeoIP. ( To avoid cached
197results from a previous ./configure run )
198
199cd ./GeoIP-1.4.6
200then edit the file ./configure
201
202and delete these two lines:
203
204#define HAVE_GETHOSTBYNAME_R 1
205
206#define GETHOSTBYNAME_R_RETURNS_INT 1
207
208then save the configure script
209
210and build it as usual
211
212./configure
213make
214sudo make install
215
216
217
218To submit a patch, please contact support@maxmind.com 
219

README.MinGW

1# how to build under MinGW/MSYS:
2# (first you need to build & "install" zlib)
3
4export "CFLAGS=-O3 -I/usr/local/include"
5export "LDFLAGS=-L/usr/local/lib -lwsock32 -lws2_32"
6./configure
7make
8cp data/GeoIP.dat test/
9make check
10
11# note that GeoIP.dat file should be placed in the
12# same place as GeoIP-enabled executable modules!
13# there's NO DEFAULT PATH concept on Win32 :)
14

README.OSX

1#!/bin/sh
2#
3# Building OSX fat binaries is easy.
4#
5# - start in a clean directory.
6# - copy the shell script below to a file and edit the file to your needs.
7#
8# 1.) modify export GEOIP_ARCH='-arch i386 -arch x86_64 -arch ppc -arch ppc64'
9# to include all architectures you need.
10# 2.) add whatever you want to the ./configure line.
11# 3.) execute the script.
12# 4.) do a 'make install'
13#
14#
15# make clean or make distclean before building this
16#
17# tell systems before leopard that we like to build for 10.5 or higher
18# with MACOSX_DEPLOYMENT_TARGET=10.5
19# starting with leopard we have to add -mmacosx-version-min=10.5
20# to the CFLAGS and export MACOSX_DEPLOYMENT_TARGET!?
21
22##  for tiger, leopard and snow leopard you might use this
23## export GEOIP_ARCH='-arch i386 -arch x86_64 -arch ppc -arch ppc64'
24## export MACOSX_DEPLOYMENT_TARGET=10.4
25## export LDFLAGS=$GEOIP_ARCH
26## export CFLAGS="-mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk $GEOIP_ARCH"
27
28# here we go for leopard and snow leopard
29#export GEOIP_ARCH='-arch i386 -arch x86_64 -arch ppc'
30#export MACOSX_DEPLOYMENT_TARGET=10.5
31#export LDFLAGS=$GEOIP_ARCH
32#export CFLAGS="-g -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk $GEOIP_ARCH"
33#./configure --disable-dependency-tracking
34#perl -i.bak -pe'/^archive_cmds=/ and !/\bGEOIP_ARCH\b/ and s/-dynamiclib\b/-dynamiclib \\\$(GEOIP_ARCH)/' ./libtool
35#make
36
37# and this is lion with the new xcode
38P=`xcode-select -print-path`
39export GEOIP_ARCH='-arch i386 -arch x86_64'
40export MACOSX_DEPLOYMENT_TARGET=10.7
41export LDFLAGS=$GEOIP_ARCH
42export CFLAGS="-g -mmacosx-version-min=10.7 -isysroot $P/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk $GEOIP_ARCH"
43./configure --disable-dependency-tracking
44make
45

READMEwin32.txt

1=======================================================
2
3Environmental variables:
4
51. GeoIPDBFileName is hardcoded to "\\windows\\system32\\GeoIP.dat" on
6windows in GeoIP.c
72. #ifdef DLL is used to determine whether you want to have a DLL built
8in GeoIP.h
9
10You may want to change these depending on your system configuration
11and compiler.
12
13=======================================================
14Thanks to Chris Gibbs for supplying these instructions.
15
16The GeoIP C library should work under windows.  Note that it requires the zlib
17DLL.
18
19To install zlib with GeoIP:
20
21i) Downloda the zlib prebuilt DLL and static library from
22http://www.winimage.com/zLibDll/ look for "pre-built zlib DLL".
23
24Unzip it to some location on your hard drive, and in Project-->Settings ,
25go to the Link tab, and add the following 3 libraries:
26
27ws2_32.lib
28zlib.lib
29zlibstat.lib
30
31iii) Go to Tools-->Options, then the Directories tab, and add library paths to
32the locations of the zlib static libraries. You will also need to add the
33include path to zlib.h to the include paths.
34
35iv) NOTE: These instructions are for MS VC++ 6.0, but should be similar for
36previous versions, and for VC .NET.
37
38=======================================================
39Building GeoIP as a DLL
40
41Stanislaw Pusep has contributed a patch for building GeoIP as a DLL.
42You can find the patch in GeoIPWinDLL.patch
43
44Note a modified version of this patch is now merged into the main code.
45

READMEwin32static.txt

1To make a static GeoIP.lib, edit the top level
2Makefile.vc to reflect where the GeoIP.dat database
3file should be placed, as well as the locations
4of the lib, include, and bin directories for installation.
5Then give the command
6   nmake /f Makefile.vc
7This will build the GeoIP.lib library, as well as available
8application and test programs. The command
9   nmake /f Makefile.vc test
10will run available tests in the test/ subdirectory.
11   nmake /f Makefile.vc install
12will then copy the lib and header files to the locations
13specified in the top-level Makefile.vc, as well as
14available application programs in the apps/ subdirectory.
15   nmake /f Makefile.vc clean
16will remove intermediate object and executable files.
17
18