Permalink
Browse files

re-added GeoIP 1.4.8

  • Loading branch information...
1 parent 9e28a38 commit b94b799b460461034658ce6ad73a5b42d392e7e3 kuno committed Jul 28, 2012
Showing with 64,014 additions and 26 deletions.
  1. +18 −26 binding.gyp
  2. +1 −0 deps/GeoIP-1.4.8/AUTHORS
  3. +509 −0 deps/GeoIP-1.4.8/COPYING
  4. +628 −0 deps/GeoIP-1.4.8/ChangeLog
  5. +80 −0 deps/GeoIP-1.4.8/GeoIP.spec.in
  6. +183 −0 deps/GeoIP-1.4.8/GeoIPWinDLL.patch
  7. +365 −0 deps/GeoIP-1.4.8/INSTALL
  8. +11 −0 deps/GeoIP-1.4.8/Makefile.am
  9. +707 −0 deps/GeoIP-1.4.8/Makefile.in
  10. +301 −0 deps/GeoIP-1.4.8/Makefile.netware
  11. +84 −0 deps/GeoIP-1.4.8/Makefile.vc
  12. +232 −0 deps/GeoIP-1.4.8/Makefile.win32
  13. 0 deps/GeoIP-1.4.8/NEWS
  14. +208 −0 deps/GeoIP-1.4.8/README
  15. +13 −0 deps/GeoIP-1.4.8/README.MinGW
  16. +35 −0 deps/GeoIP-1.4.8/README.OSX
  17. +44 −0 deps/GeoIP-1.4.8/READMEwin32.txt
  18. +17 −0 deps/GeoIP-1.4.8/READMEwin32static.txt
  19. +54 −0 deps/GeoIP-1.4.8/TODO
  20. +8,917 −0 deps/GeoIP-1.4.8/aclocal.m4
  21. +26 −0 deps/GeoIP-1.4.8/apps/Makefile.am
  22. +544 −0 deps/GeoIP-1.4.8/apps/Makefile.in
  23. +25 −0 deps/GeoIP-1.4.8/apps/Makefile.vc
  24. +401 −0 deps/GeoIP-1.4.8/apps/geoiplookup.c
  25. +255 −0 deps/GeoIP-1.4.8/apps/geoiplookup6.c
  26. +260 −0 deps/GeoIP-1.4.8/apps/geoipupdate-pureperl.pl
  27. +283 −0 deps/GeoIP-1.4.8/apps/geoipupdate.c
  28. +8 −0 deps/GeoIP-1.4.8/bootstrap
  29. +19 −0 deps/GeoIP-1.4.8/conf/GeoIP.conf.default
  30. +16 −0 deps/GeoIP-1.4.8/conf/Makefile.am
  31. +414 −0 deps/GeoIP-1.4.8/conf/Makefile.in
  32. +1,533 −0 deps/GeoIP-1.4.8/config.guess
  33. +1,693 −0 deps/GeoIP-1.4.8/config.sub
  34. +13,633 −0 deps/GeoIP-1.4.8/configure
  35. +50 −0 deps/GeoIP-1.4.8/configure.in
  36. +19 −0 deps/GeoIP-1.4.8/data/Makefile.am
  37. +437 −0 deps/GeoIP-1.4.8/data/Makefile.in
  38. +630 −0 deps/GeoIP-1.4.8/depcomp
  39. BIN deps/GeoIP-1.4.8/geoip.ico
  40. +14 −0 deps/GeoIP-1.4.8/get_ver.awk
  41. +520 −0 deps/GeoIP-1.4.8/install-sh
  42. +1,955 −0 deps/GeoIP-1.4.8/libGeoIP/GeoIP.c
  43. +307 −0 deps/GeoIP-1.4.8/libGeoIP/GeoIP.h
  44. +392 −0 deps/GeoIP-1.4.8/libGeoIP/GeoIPCity.c
  45. +78 −0 deps/GeoIP-1.4.8/libGeoIP/GeoIPCity.h
  46. +974 −0 deps/GeoIP-1.4.8/libGeoIP/GeoIPUpdate.c
  47. +69 −0 deps/GeoIP-1.4.8/libGeoIP/GeoIPUpdate.h
  48. +18 −0 deps/GeoIP-1.4.8/libGeoIP/GeoIP_internal.h
  49. +27 −0 deps/GeoIP-1.4.8/libGeoIP/Makefile.am
  50. +567 −0 deps/GeoIP-1.4.8/libGeoIP/Makefile.in
  51. +34 −0 deps/GeoIP-1.4.8/libGeoIP/Makefile.vc
  52. +32 −0 deps/GeoIP-1.4.8/libGeoIP/global.h
  53. +326 −0 deps/GeoIP-1.4.8/libGeoIP/md5.c
  54. +40 −0 deps/GeoIP-1.4.8/libGeoIP/md5.h
  55. +12,780 −0 deps/GeoIP-1.4.8/libGeoIP/regionName.c
  56. +2,077 −0 deps/GeoIP-1.4.8/libGeoIP/timeZone.c
  57. +140 −0 deps/GeoIP-1.4.8/libGeoIP/types.h
  58. +8,413 −0 deps/GeoIP-1.4.8/ltmain.sh
  59. +29 −0 deps/GeoIP-1.4.8/man/Makefile.am
  60. +455 −0 deps/GeoIP-1.4.8/man/Makefile.in
  61. +37 −0 deps/GeoIP-1.4.8/man/geoiplookup.1.in
  62. +42 −0 deps/GeoIP-1.4.8/man/geoiplookup6.1.in
  63. +68 −0 deps/GeoIP-1.4.8/man/geoipupdate.1.in
  64. +376 −0 deps/GeoIP-1.4.8/missing
  65. +37 −0 deps/GeoIP-1.4.8/test/Makefile.am
  66. +657 −0 deps/GeoIP-1.4.8/test/Makefile.in
  67. +29 −0 deps/GeoIP-1.4.8/test/Makefile.vc
  68. +135 −0 deps/GeoIP-1.4.8/test/benchmark.c
  69. +2 −0 deps/GeoIP-1.4.8/test/city_test.txt
  70. +69 −0 deps/GeoIP-1.4.8/test/country_test.txt
  71. +29 −0 deps/GeoIP-1.4.8/test/country_test2.txt
  72. +1 −0 deps/GeoIP-1.4.8/test/country_test_name.txt
  73. +24 −0 deps/GeoIP-1.4.8/test/region_test.txt
  74. +63 −0 deps/GeoIP-1.4.8/test/test-geoip-asnum.c
  75. +83 −0 deps/GeoIP-1.4.8/test/test-geoip-city.c
  76. +65 −0 deps/GeoIP-1.4.8/test/test-geoip-isp.c
  77. +59 −0 deps/GeoIP-1.4.8/test/test-geoip-netspeed.c
  78. +71 −0 deps/GeoIP-1.4.8/test/test-geoip-org.c
  79. +114 −0 deps/GeoIP-1.4.8/test/test-geoip-region.c
  80. +113 −0 deps/GeoIP-1.4.8/test/test-geoip.c
  81. +40 −0 wscript
View
@@ -3,36 +3,28 @@
{
'target_name': 'geoip',
'sources': [
- 'deps/geoip/libGeoIP/GeoIP.h',
- 'deps/geoip/libGeoIP/GeoIPCity.h',
- 'src/global.h', 'src/global.cc'
- ,'src/node_geoip.h', 'src/init.cc'
- , 'src/country.h', 'src/country.cc'
- , 'src/country6.h' ,'src/country6.cc'
- , 'src/city.h', 'src/city.cc'
- , 'src/city6.h', 'src/city6.cc'
- , 'src/org.h', 'src/org.cc'
- , 'src/region.h', 'src/region.cc'
- , 'src/netspeed.h', 'src/netspeed.cc'
- , 'src/utils.h', 'src/utils.cc'
+ 'src/global.cc'
+ , 'src/init.cc'
+ , 'src/country.cc'
+ , 'src/country6.cc'
+ , 'src/city.cc'
+ , 'src/city6.cc'
+ , 'src/org.cc'
+ , 'src/region.cc'
+ , 'src/netspeed.cc'
+ , 'src/utils.cc'
],
+ 'link_settings': {
+ 'libraries': [
+ '-lGeoIP'
+ ],
+ },
'include_dirs': [
- 'deps/geoip/libGeoIP'
+ '<(node_root_dir)/src',
+ '<(node_root_dir)/deps/geoip/libGeoIP'
],
'conditions': [
- ['OS=="win"', {
- # no Windows support yet...
- }
- ],
- ['OS=="mac"', {
- 'xcode_settings': {
- 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
- 'MACOSX_DEPLOYMENT_TARGET': '10.5',
- 'OTHER_CFLAGS': [
- '<!@(xml2-config --cflags)'
- ]
- },
- }]
+ # TODO
]
},
]
View
@@ -0,0 +1 @@
+T.J. Mather <tjmather@maxmind.com>
View

Large diffs are not rendered by default.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,80 @@
+Name: @PACKAGE@
+Version: @VERSION@
+Summary: GeoIP is a C library finds the location of an IP address.
+Release: 1
+Group: System Environment/Libraries
+URL: http://www.maxmind.com/app/c
+Vendor: MaxMind LLC
+Source0: http://www.maxmind.com/download/geoip/api/c/GeoIP-%{version}.tar.gz
+License: GPL
+BuildRoot: %{_tmppath}/%{name}-%{version}-root
+
+%description
+GeoIP is a C library that enables the user to find geographical and
+network information of an IP address.
+Included is a free GeoLite Country database
+that is updated at the beginning of every month.
+To download the latest free GeoLite Country database, go to:
+http://www.maxmind.com/app/geoip_country
+
+There is also a free city-level geolocation database, GeoLite City,
+available from:
+http://www.maxmind.com/app/geolitecity
+
+%package devel
+Summary: GeoIP headers, libraries
+Group: Development/Libraries
+Requires: %name = %{version}
+
+%description devel
+This package contain the devel files for GeoIP.
+
+%prep
+%setup -q
+
+%build
+%configure
+make
+make check
+
+%install
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
+%makeinstall
+# Fixup permissions on shared libraries so that findreqs will work right.
+chmod 755 $RPM_BUILD_ROOT/%{_libdir}/*
+
+%clean
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(-,root,root)
+%doc AUTHORS COPYING ChangeLog README TODO
+%attr(0755,root,root) %{_libdir}/*.so.*.*
+%{_bindir}/*
+%{_sysconfdir}/*
+%dir %{_datadir}/GeoIP
+%{_datadir}/GeoIP/*
+%{_libdir}/*.so
+%{_mandir}/*/*
+
+%files devel
+%{_includedir}/*
+%{_libdir}/*.a
+%{_libdir}/*.la
+
+%changelog
+* Fri Apr 14 2006 Thomas Mather <tjmather@maxmind.com>
+- Updated description to reference free GeoLite City database
+
+* Thu Jul 7 2005 Thomas Mather <tjmather@maxmind.com>
+- Updated description to reflect monthly updates for free country database.
+
+* Mon Sep 8 2003 Dr. Peter Bieringer
+- Fix for RHL 9, created a new devel package definition.
+
+* Thu Feb 27 2003 Ryan Weaver <ryanw@falsehope.com>
+- Initial RPM Build
@@ -0,0 +1,183 @@
+Index: GeoIP.c
+===================================================================
+RCS file: /home/maxmind/geoip/c/libGeoIP/GeoIP.c,v
+retrieving revision 1.32
+retrieving revision 1.33
+diff -u -r1.32 -r1.33
+--- GeoIP.c 25 Aug 2002 22:42:48 -0000 1.32
++++ GeoIP.c 27 Aug 2002 06:50:02 -0000 1.33
+@@ -23,16 +23,24 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#ifndef _WIN32
+ #include <netdb.h>
++#endif /* _WIN32 */
+ #include <assert.h>
+ #include <sys/types.h> /* for fstat */
+ #include <sys/stat.h> /* for fstat */
+ #include "zlib.h"
+ #include "time.h"
+
++#ifndef _WIN32
++#include <unistd.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+ #include <sys/socket.h>
++#else
++#include <io.h>
++#include <windows.h>
++#endif /* _WIN32 */
+
+ #define COUNTRY_BEGIN 16776960;
+ const int RECORD_LENGTH = 3;
+@@ -57,9 +65,66 @@
+ const char *GeoIPUpdateHost = "updates.maxmind.com";
+ const char *GeoIPHTTPRequest = "GET /app/update?license_key=%s HTTP/1.0\nHost: updates.maxmind.com\n\n";
+
++#ifdef _WIN32
++char * _dat_in_module_path () {
++ HMODULE GeoIPdll;
++ struct _stat st;
++ int i;
++ char * buf;
++
++ buf = (char *) malloc(MAX_PATH);
++
++ GeoIPdll = GetModuleHandle("GeoIP.dll");
++ if (!GeoIPdll)
++ {
++ GeoIPdll = GetModuleHandle(NULL);
++ if (!GeoIPdll)
++ return NULL;
++ }
++ GetModuleFileName(GeoIPdll, buf, MAX_PATH);
++ for (i = strlen(buf); (i >= 0) && (buf[i] != '\\'); i--);
++ if (i)
++ {
++ buf[i] = '\0';
++ strcat(buf, "\\");
++ strcat(buf, GeoIPDBFileName);
++ if (_stat(buf, &st) == 0)
++ return buf;
++ }
++
++ free(buf);
++ return NULL;
++}
++
++char * _dat_path_in_regkey () {
++ DWORD lpdwDisposition, type, size = MAX_PATH;
++ HKEY hkGeoIP;
++ char * buf, * filename;
++
++ buf = (char *) malloc(MAX_PATH);
++ filename = (char *) malloc(MAX_PATH);
++
++ if (RegCreateKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\MaxMind\\GeoIP", 0, NULL, 0, KEY_ALL_ACCESS, NULL, &hkGeoIP, &lpdwDisposition) != ERROR_SUCCESS)
++ return NULL;
++ if (RegQueryValueEx(hkGeoIP, "DATADIR", 0, &type, buf, &size) != ERROR_SUCCESS)
++ strcpy(buf, "%SystemRoot%\\SYSTEM32");
++ if (RegSetValueEx(hkGeoIP, "DATADIR", 0, REG_EXPAND_SZ, buf, strlen(buf)) != ERROR_SUCCESS)
++ return NULL;
++ ExpandEnvironmentStrings(buf, filename, MAX_PATH);
++
++ free(buf);
++ strcat(filename, "\\");
++ strcat(filename, GeoIPDBFileName);
++
++ return filename;
++}
++#endif /* _WIN32 */
++
+ GeoIP* GeoIP_new (int flags) {
+ char * filename;
+ GeoIP * gi;
++
++#ifndef _WIN32
+ filename = malloc(sizeof(char) * (strlen(DATADIR)+strlen(GeoIPDBFileName)+2));
+ if (filename == NULL)
+ return NULL;
+@@ -67,6 +132,17 @@
+ strcat(filename, DATADIR);
+ strcat(filename, "/");
+ strcat(filename, GeoIPDBFileName);
++#else
++ filename = _dat_in_module_path();
++ if (filename == NULL)
++ filename = _dat_path_in_regkey();
++ if (filename == NULL)
++ {
++ fprintf(stderr,"Unable to query registry for database location\n");
++ return NULL;
++ }
++#endif /* _WIN32 */
++
+ gi = GeoIP_open (filename, flags);
+ free(filename);
+ return gi;
+@@ -96,7 +172,7 @@
+ }
+ gi->cache = (unsigned char *) malloc(sizeof(unsigned char) * buf.st_size);
+ if (gi->cache != NULL) {
+- if (fread(gi->cache, sizeof(unsigned char), buf.st_size, gi->GeoIPDatabase) != buf.st_size) {
++ if (fread(gi->cache, sizeof(unsigned char), buf.st_size, gi->GeoIPDatabase) != (unsigned) buf.st_size) {
+ fprintf(stderr,"Error reading file %s\n",filename);
+ free(gi->cache);
+ free(gi);
+Index: GeoIP.h
+===================================================================
+RCS file: /home/maxmind/geoip/c/libGeoIP/GeoIP.h,v
+retrieving revision 1.19
+retrieving revision 1.20
+diff -u -r1.19 -r1.20
+--- GeoIP.h 20 Aug 2002 00:52:00 -0000 1.19
++++ GeoIP.h 27 Aug 2002 06:50:02 -0000 1.20
+@@ -45,25 +45,31 @@
+ extern const char * GeoIP_country_name[246];
+ extern const char * GeoIPConfFile;
+
+-GeoIP* GeoIP_new(int flags);
+-GeoIP* GeoIP_open(char * filename, int flags);
+-void GeoIP_delete(GeoIP* gi);
+-const char *GeoIP_country_code_by_addr (GeoIP* gi, const char *addr);
+-const char *GeoIP_country_code_by_name (GeoIP* gi, const char *host);
+-const char *GeoIP_country_code3_by_addr (GeoIP* gi, const char *addr);
+-const char *GeoIP_country_code3_by_name (GeoIP* gi, const char *host);
+-const char *GeoIP_country_name_by_addr (GeoIP* gi, const char *addr);
+-const char *GeoIP_country_name_by_name (GeoIP* gi, const char *host);
+-short int GeoIP_country_id_by_addr (GeoIP* gi, const char *addr);
+-short int GeoIP_country_id_by_name (GeoIP* gi, const char *host);
++#ifdef _WIN32
++#define GEOIP_API __declspec(dllexport)
++#else
++#define GEOIP_API
++#endif /* _WIN32 */
+
+-char *GeoIP_database_info (GeoIP* gi);
+-short int GeoIP_update_database (GeoIP* gi, char * license_key, int verbose);
++GEOIP_API GeoIP* GeoIP_new(int flags);
++GEOIP_API GeoIP* GeoIP_open(char * filename, int flags);
++GEOIP_API void GeoIP_delete(GeoIP* gi);
++GEOIP_API const char *GeoIP_country_code_by_addr (GeoIP* gi, const char *addr);
++GEOIP_API const char *GeoIP_country_code_by_name (GeoIP* gi, const char *host);
++GEOIP_API const char *GeoIP_country_code3_by_addr (GeoIP* gi, const char *addr);
++GEOIP_API const char *GeoIP_country_code3_by_name (GeoIP* gi, const char *host);
++GEOIP_API const char *GeoIP_country_name_by_addr (GeoIP* gi, const char *addr);
++GEOIP_API const char *GeoIP_country_name_by_name (GeoIP* gi, const char *host);
++GEOIP_API short int GeoIP_country_id_by_addr (GeoIP* gi, const char *addr);
++GEOIP_API short int GeoIP_country_id_by_name (GeoIP* gi, const char *host);
+
+-int _seek_country (GeoIP* gi, const int offset, unsigned long ipnum, int depth);
+-unsigned long _addr_to_num (const char *addr);
+-unsigned long _h_addr_to_num (unsigned char *addr);
+-short int _is_ipaddr (const char *name);
++GEOIP_API char *GeoIP_database_info (GeoIP* gi);
++GEOIP_API short int GeoIP_update_database (GeoIP* gi, char * license_key, int verbose);
++
++GEOIP_API int _seek_country (GeoIP* gi, const int offset, unsigned long ipnum, int depth);
++GEOIP_API unsigned long _addr_to_num (const char *addr);
++GEOIP_API unsigned long _h_addr_to_num (unsigned char *addr);
+
+ #ifdef __cplusplus
+ }
Oops, something went wrong.

0 comments on commit b94b799

Please sign in to comment.