rpms/GeoIP/devel geoip-1.4.6-ipv6.patch, NONE, 1.1 GeoIP.spec, 1.19, 1.20

Matt Domsch mdomsch at fedoraproject.org
Tue Sep 1 13:04:09 UTC 2009


Author: mdomsch

Update of /cvs/extras/rpms/GeoIP/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv12803

Modified Files:
	GeoIP.spec 
Added Files:
	geoip-1.4.6-ipv6.patch 
Log Message:
add IPv6 functions from CVS HEAD, do prerelease

geoip-1.4.6-ipv6.patch:
 /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6//GeoIP.spec              |only
 /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6//LICENSE.txt             |only
 /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6//Makefile.in             |only
 /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6//README.fedora           |only
 /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6//aclocal.m4              |only
 /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6//config.guess            |only
 /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6//config.sub              |only
 /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6//configure               |only
 /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6//fetch-geoipdata-city.pl |only
 /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6//fetch-geoipdata.pl      |only
 /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6//install-sh              |only
 /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6//missing                 |only
 /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/apps/Makefile.in         |only
 /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/conf/Makefile.in         |only
 /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/data/GeoIP.dat           |only
 /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/data/Makefile.in         |only
 /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/libGeoIP/Makefile.in     |only
 /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/man/Makefile.in          |only
 /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/test/Makefile.in         |only
 c//CVS                                                                           |only
 c//LICENSE                                                                       |only
 c//regioncode                                                                    |only
 c//timezone                                                                      |only
 c/ChangeLog                                                                      |   17 +
 c/README                                                                         |   23 +
 c/apps/CVS                                                                       |only
 c/apps/geoiplookup.c                                                             |  120 +++++++++-
 c/apps/geoipupdate-pureperl.pl                                                   |    4 
 c/apps/geoipupdate.c                                                             |    3 
 c/conf/CVS                                                                       |only
 c/configure.in                                                                   |    2 
 c/data/CVS                                                                       |only
 c/libGeoIP/CVS                                                                   |only
 c/libGeoIP/GeoIP.c                                                               |   70 ++++-
 c/libGeoIP/GeoIP.h                                                               |    7 
 c/libGeoIP/regionName.c                                                          |  113 +++++++--
 c/man/CVS                                                                        |only
 c/man/geoiplookup.1                                                              |only
 c/man/geoiplookup6.1                                                             |only
 c/man/geoipupdate.1                                                              |only
 c/test/CVS                                                                       |only
 c/test/fail_test.txt                                                             |only
 c/test/proxy_test.txt                                                            |only
 43 files changed, 312 insertions(+), 47 deletions(-)

--- NEW FILE geoip-1.4.6-ipv6.patch ---
Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/: aclocal.m4
Only in c/apps: CVS
diff -urp --exclude=from=/home/mdomsch/excludes --minimal /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/apps/geoiplookup.c c/apps/geoiplookup.c
--- /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/apps/geoiplookup.c	2009-02-24 10:03:23.000000000 -0600
+++ c/apps/geoiplookup.c	2009-05-08 12:01:21.000000000 -0500
@@ -31,9 +31,12 @@ typedef unsigned int uint32_t; 
 void geoiplookup(GeoIP* gi,char *hostname,int i);
 
 void usage() {
-	fprintf(stderr,"Usage: geoiplookup [-d custom_dir] [-f custom_file] [-v] <ipaddress|hostname>\n");
+	fprintf(stderr,"Usage: geoiplookup [-d custom_dir] [-f custom_file] [-v] [-i] <ipaddress|hostname>\n");
 }
 
+/* extra info used in _say_range_ip */
+int info_flag = 0;
+
 int main (int argc, char *argv[]) {
 	char * hostname = NULL;
 	char * db_info;
@@ -51,7 +54,9 @@ int main (int argc, char *argv[]) {
 	while (i < argc) {
 		if (strcmp(argv[i],"-v") == 0) {
 			version_flag = 1;
-		} else if (strcmp(argv[i],"-f") == 0) {
+		} else if (strcmp(argv[i],"-i") == 0) {
+			info_flag = 1;
+                } else if (strcmp(argv[i],"-f") == 0) {
 			if ((i+1) < argc){
 				i++;
 				custom_file = argv[i];
@@ -119,12 +124,106 @@ static const char * _mk_NA( const char *
  return p ? p : "N/A";
 }
 
+static unsigned long
+__addr_to_num(const char *addr)
+{
+	unsigned int    c, octet, t;
+	unsigned long   ipnum;
+	int             i = 3;
+
+	octet = ipnum = 0;
+	while ((c = *addr++)) {
+		if (c == '.') {
+			if (octet > 255)
+				return 0;
+			ipnum <<= 8;
+			ipnum += octet;
+			i--;
+			octet = 0;
+		} else {
+			t = octet;
+			octet <<= 3;
+			octet += t;
+			octet += t;
+			c -= '0';
+			if (c > 9)
+				return 0;
+			octet += c;
+		}
+	}
+	if ((octet > 255) || (i != 0))
+		return 0;
+	ipnum <<= 8;
+	return ipnum + octet;
+}
+
+
+
+/* ptr must be a memory area with at least 16 bytes */
+static char *__num_to_addr_r (unsigned long ipnum, char * ptr) {
+	char *cur_str;
+	int octet[4];
+	int num_chars_written, i;
+
+	cur_str = ptr;
+
+	for (i = 0; i<4; i++) {
+		octet[3 - i] = ipnum % 256;
+		ipnum >>= 8;
+	}
+
+	for (i = 0; i<4; i++) {
+		num_chars_written = sprintf(cur_str, "%d", octet[i]);
+		cur_str += num_chars_written;
+
+		if (i < 3) {
+			cur_str[0] = '.';
+			cur_str++;
+		}
+	}
+
+	return ptr;
+}
+
+void _say_range_by_ip(GeoIP * gi, uint32_t ipnum ) {
+  unsigned long last_nm, mask, low, hi;
+  char ipaddr[16];
+  char tmp[16];
+  char ** range;
+
+  if ( info_flag == 0 )
+    return; /* noop unless extra information is requested */
+
+  range = GeoIP_range_by_ip( gi, __num_to_addr_r( ipnum, ipaddr ) );
+  if ( range == NULL )
+    return;
+
+  printf ( "  ipaddr: %s\n", ipaddr );
+
+  printf( "  range_by_ip:  %s - %s\n", range[0], range[1] );
+  last_nm = GeoIP_last_netmask(gi);
+  mask    = 0xffffffff << ( 32 - last_nm );
+  low     = ipnum & mask;
+  hi      = low + ( 0xffffffff & ~mask );
+  printf( "  network:      %s - %s ::%ld\n",
+    __num_to_addr_r( low, ipaddr ),
+    __num_to_addr_r( hi,  tmp ),
+    last_nm
+  );
+  printf( "  ipnum: %u\n", ipnum );
+  printf( "  range_by_num: %lu - %lu\n", __addr_to_num(range[0]), __addr_to_num(range[1]) );
+  printf( "  network num:  %lu - %lu ::%lu\n", low, hi, last_nm );
+
+  GeoIP_range_by_ip_delete(range);
+}
+
 void
 geoiplookup(GeoIP * gi, char *hostname, int i)
 {
 	const char     *country_code;
 	const char     *country_name;
 	const char     *domain_name;
+        const char     *asnum_name;
 	int             netspeed;
 	int             country_id;
 	GeoIPRegion    *region;
@@ -146,6 +245,17 @@ geoiplookup(GeoIP * gi, char *hostname, 
 			}
 			else {
 				printf("%s: %s\n", GeoIPDBDescription[i], domain_name);
+                                _say_range_by_ip(gi, ipnum);
+			}
+		}
+		else if (GEOIP_ASNUM_EDITION == i) {
+			asnum_name = GeoIP_name_by_ipnum(gi, ipnum);
+			if (asnum_name == NULL) {
+				printf("%s: IP Address not found\n", GeoIPDBDescription[i]);
+			}
+			else {
+				printf("%s: %s\n", GeoIPDBDescription[i], asnum_name);
+                                _say_range_by_ip(gi, ipnum);
 			}
 		}
 		else if (GEOIP_COUNTRY_EDITION == i) {
@@ -157,6 +267,7 @@ geoiplookup(GeoIP * gi, char *hostname, 
 			}
 			else {
 				printf("%s: %s, %s\n", GeoIPDBDescription[i], country_code, country_name);
+                                _say_range_by_ip(gi, ipnum);
 			}
 		}
 		else if (GEOIP_REGION_EDITION_REV0 == i || GEOIP_REGION_EDITION_REV1 == i) {
@@ -166,6 +277,7 @@ geoiplookup(GeoIP * gi, char *hostname, 
 			}
 			else {
 				printf("%s: %s, %s\n", GeoIPDBDescription[i], region->country_code, region->region);
+                                _say_range_by_ip(gi, ipnum);
 				GeoIPRegion_delete(region);
 			}
 		}
@@ -177,6 +289,7 @@ geoiplookup(GeoIP * gi, char *hostname, 
 			else {
 				printf("%s: %s, %s, %s, %s, %f, %f\n", GeoIPDBDescription[i], gir->country_code, _mk_NA(gir->region),
 				       _mk_NA(gir->city), _mk_NA(gir->postal_code), gir->latitude, gir->longitude);
+                                _say_range_by_ip(gi, ipnum);
 			}
 		}
 		else if (GEOIP_CITY_EDITION_REV1 == i) {
@@ -187,6 +300,7 @@ geoiplookup(GeoIP * gi, char *hostname, 
 			else {
 				printf("%s: %s, %s, %s, %s, %f, %f, %d, %d\n", GeoIPDBDescription[i], gir->country_code, _mk_NA(gir->region), _mk_NA(gir->city), _mk_NA(gir->postal_code),
 				       gir->latitude, gir->longitude, gir->metro_code, gir->area_code);
+                                _say_range_by_ip(gi, ipnum);
 			}
 		}
 		else if (GEOIP_ORG_EDITION == i || GEOIP_ISP_EDITION == i) {
@@ -196,6 +310,7 @@ geoiplookup(GeoIP * gi, char *hostname, 
 			}
 			else {
 				printf("%s: %s\n", GeoIPDBDescription[i], org);
+                                _say_range_by_ip(gi, ipnum);
 			}
 		}
 		else if (GEOIP_NETSPEED_EDITION == i) {
@@ -212,6 +327,7 @@ geoiplookup(GeoIP * gi, char *hostname, 
 			else if (netspeed == GEOIP_CORPORATE_SPEED) {
 				printf("%s: Corporate\n", GeoIPDBDescription[i]);
 			}
+                        _say_range_by_ip(gi, ipnum);
 		}
 		else {
 
diff -urp --exclude=from=/home/mdomsch/excludes --minimal /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/apps/geoipupdate.c c/apps/geoipupdate.c
--- /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/apps/geoipupdate.c	2009-02-24 14:01:41.000000000 -0600
+++ c/apps/geoipupdate.c	2009-05-29 03:55:00.000000000 -0500
@@ -97,6 +97,7 @@ int main (int argc, char *argv[]) {
 			exit(0);
 		case 'v':
 			verbose = 1;
+                        break;
 		case 'f':
 			license_file = optarg;
 			break;
@@ -279,5 +280,5 @@ int main (int argc, char *argv[]) {
 	if (client_ipaddr) {
 		free(client_ipaddr);
 	}
-	exit(0);
+	exit(err);
 }
diff -urp --exclude=from=/home/mdomsch/excludes --minimal /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/apps/geoipupdate-pureperl.pl c/apps/geoipupdate-pureperl.pl
--- /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/apps/geoipupdate-pureperl.pl	2009-02-24 10:04:39.000000000 -0600
+++ c/apps/geoipupdate-pureperl.pl	2009-03-22 09:40:33.000000000 -0500
@@ -40,7 +40,7 @@ https
 use strict;
 use warnings;
 
-our $VERSION = '0.03';
+our $VERSION = '0.04';
 
 use 5.008;
 use Data::Dumper;
@@ -220,7 +220,7 @@ sub _gunzip_and_replace {
   {
     local $_;
     open my $gin, '<:gzip', \$content or die $!;
-    open my $gout, '>', $geoip_filename . '.test' or die $!;
+    open my $gout, '>:raw', $geoip_filename . '.test' or die $!;
     print {$gout} $_ while (<$gin>);
   }
 
Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/apps: Makefile.in
diff -urp --exclude=from=/home/mdomsch/excludes --minimal /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/ChangeLog c/ChangeLog
--- /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/ChangeLog	2009-02-24 19:44:38.000000000 -0600
+++ c/ChangeLog	2009-08-30 21:15:04.000000000 -0500
@@ -1,3 +1,20 @@
+	* Add more IPv6 functions ( Boris Zentner )
+	    const char *GeoIP_country_code_by_addr_v6 (GeoIP* gi, const char *addr);
+	    const char *GeoIP_country_code_by_name_v6 (GeoIP* gi, const char *host);
+	    const char *GeoIP_country_code3_by_addr_v6 (GeoIP* gi, const char *addr);
+	    const char *GeoIP_country_code3_by_name_v6 (GeoIP* gi, const char *host);
+	    const char *GeoIP_country_name_by_addr_v6 (GeoIP* gi, const char *addr);
+	    const char *GeoIP_country_name_by_name_v6 (GeoIP* gi, const char *host);
+	* Make sure that GeoIP_*_v6 functions refuse GEOIP_PROXY_EDITION and
+	    GEOIP_NETSPEED_EDITION databases ( Boris Zentner ) 
+	* Update libGeoIP/regionName.c with FIPS codes from 20090723 ( Boris Zentner )
+	* Fix geoipupdate's -v option to not change the license filename ( Thom May )
+	* Fix geoipupdate's exit code ( Thom May )
+	* Add support for ASNUM_EDITION ( Boris Zentner )
+	* Fix -i output for larger values, sign issue ( Boris Zentner )
+	* Add -i flag for more information on netmask, range_by_ip and the current network range ( Boris Zentner )
+	* Add support for DOMAIN_EDITION database type ( Boris Zentner )
+	* Fix apps/geoipupdate-pureperl.pl output layer on W32 ( Boris Zentner )
 1.4.6	2009-02-25
 	* Fix geoipupdate's my_printf function ( Boris Zentner )
 	* Fix typo in apps/geoipupdate-pureperl.pl replace PerlIO::Gzip with PerlIO::gzip ( Boris Zentner ) 
Only in c/conf: CVS
Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/conf: Makefile.in
Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/: config.guess
Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/: config.sub
Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/: configure
diff -urp --exclude=from=/home/mdomsch/excludes --minimal /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/configure.in c/configure.in
--- /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/configure.in	2009-02-24 10:03:23.000000000 -0600
+++ c/configure.in	2009-08-30 21:15:04.000000000 -0500
@@ -1,6 +1,6 @@
 dnl AM_CONFIG_HEADER(config.h)
 
-AC_INIT([GeoIP], [1.4.6],[support at maxmind.com],[GeoIP])
+AC_INIT([GeoIP], [1.4.7],[support at maxmind.com],[GeoIP])
 AC_GNU_SOURCE
 AM_INIT_AUTOMAKE
 AC_CONFIG_SRCDIR([libGeoIP/GeoIP.c])
Only in c/: CVS
Only in c/data: CVS
Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/data: GeoIP.dat
Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/data: Makefile.in
Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/: fetch-geoipdata-city.pl
Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/: fetch-geoipdata.pl
Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/: GeoIP.spec
Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/: install-sh
Only in c/libGeoIP: CVS
diff -urp --exclude=from=/home/mdomsch/excludes --minimal /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/libGeoIP/GeoIP.c c/libGeoIP/GeoIP.c
--- /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/libGeoIP/GeoIP.c	2009-02-24 10:03:23.000000000 -0600
+++ c/libGeoIP/GeoIP.c	2009-08-30 21:15:04.000000000 -0500
@@ -366,10 +366,11 @@ void _setup_segments(GeoIP * gi) {
 				gi->databaseSegments = malloc(sizeof(int));
 				gi->databaseSegments[0] = STATE_BEGIN_REV1;
 			} else if (gi->databaseType == GEOIP_CITY_EDITION_REV0 ||
-								 gi->databaseType == GEOIP_CITY_EDITION_REV1 ||
-								 gi->databaseType == GEOIP_ORG_EDITION ||
-								 gi->databaseType == GEOIP_ISP_EDITION ||
-								 gi->databaseType == GEOIP_ASNUM_EDITION) {
+				   gi->databaseType == GEOIP_CITY_EDITION_REV1 ||
+		                   gi->databaseType == GEOIP_ORG_EDITION ||
+		                   gi->databaseType == GEOIP_DOMAIN_EDITION ||
+		 		   gi->databaseType == GEOIP_ISP_EDITION ||
+			  	   gi->databaseType == GEOIP_ASNUM_EDITION) {
 				/* City/Org Editions have two segments, read offset of second segment */
 				gi->databaseSegments = malloc(sizeof(int));
 				gi->databaseSegments[0] = 0;
@@ -377,8 +378,9 @@ void _setup_segments(GeoIP * gi) {
 				for (j = 0; j < SEGMENT_RECORD_LENGTH; j++) {
 					gi->databaseSegments[0] += (buf[j] << (j * 8));
 				}
-				if (gi->databaseType == GEOIP_ORG_EDITION ||
-						gi->databaseType == GEOIP_ISP_EDITION)
+				if (gi->databaseType == GEOIP_ORG_EDITION    ||
+		                    gi->databaseType == GEOIP_DOMAIN_EDITION ||                                  
+			 	    gi->databaseType == GEOIP_ISP_EDITION)
 					gi->record_length = ORG_RECORD_LENGTH;
 			}
 			break;
@@ -831,18 +833,36 @@ void GeoIP_delete (GeoIP *gi) {
 	free(gi);
 }
 
+const char *GeoIP_country_code_by_name_v6 (GeoIP* gi, const char *name) {
+	int country_id;
+	country_id = GeoIP_id_by_name_v6(gi, name);
+	return (country_id > 0) ? GeoIP_country_code[country_id] : NULL;
+}
+
 const char *GeoIP_country_code_by_name (GeoIP* gi, const char *name) {
 	int country_id;
 	country_id = GeoIP_id_by_name(gi, name);
 	return (country_id > 0) ? GeoIP_country_code[country_id] : NULL;
 }
 
+const char *GeoIP_country_code3_by_name_v6 (GeoIP* gi, const char *name) {
+	int country_id;
+	country_id = GeoIP_id_by_name_v6(gi, name);
+	return (country_id > 0) ? GeoIP_country_code3[country_id] : NULL;
+}
+
 const char *GeoIP_country_code3_by_name (GeoIP* gi, const char *name) {
 	int country_id;
 	country_id = GeoIP_id_by_name(gi, name);
 	return (country_id > 0) ? GeoIP_country_code3[country_id] : NULL;
 }
 
+const char *GeoIP_country_name_by_name_v6 (GeoIP* gi, const char *name) {
+	int country_id;
+	country_id = GeoIP_id_by_name_v6(gi, name);
+	return (country_id > 0) ? GeoIP_country_name[country_id] : NULL;
+}
+
 const char *GeoIP_country_name_by_name (GeoIP* gi, const char *name) {
 	int country_id;
 	country_id = GeoIP_id_by_name(gi, name);
@@ -945,7 +965,7 @@ int GeoIP_id_by_name_v6 (GeoIP* gi, cons
        if (name == NULL) {
                return 0;
        }
-       if (gi->databaseType != GEOIP_COUNTRY_EDITION_V6 && gi->databaseType != GEOIP_PROXY_EDITION && gi->databaseType != GEOIP_NETSPEED_EDITION) {
+       if (gi->databaseType != GEOIP_COUNTRY_EDITION_V6) {
                printf("Invalid database type %s, expected %s\n", GeoIPDBDescription[(int)gi->databaseType], GeoIPDBDescription[GEOIP_COUNTRY_EDITION_V6]);
                return 0;
        }
@@ -956,18 +976,36 @@ int GeoIP_id_by_name_v6 (GeoIP* gi, cons
        return ret;
 }
 
+const char *GeoIP_country_code_by_addr_v6 (GeoIP* gi, const char *addr) {
+	int country_id;
+	country_id = GeoIP_id_by_addr_v6(gi, addr);
+	return (country_id > 0) ? GeoIP_country_code[country_id] : NULL;
+}
+
 const char *GeoIP_country_code_by_addr (GeoIP* gi, const char *addr) {
 	int country_id;
 	country_id = GeoIP_id_by_addr(gi, addr);
 	return (country_id > 0) ? GeoIP_country_code[country_id] : NULL;
 }
 
+const char *GeoIP_country_code3_by_addr_v6 (GeoIP* gi, const char *addr) {
+	int country_id;
+	country_id = GeoIP_id_by_addr_v6(gi, addr);
+	return (country_id > 0) ? GeoIP_country_code3[country_id] : NULL;
+}
+
 const char *GeoIP_country_code3_by_addr (GeoIP* gi, const char *addr) {
 	int country_id;
 	country_id = GeoIP_id_by_addr(gi, addr);
 	return (country_id > 0) ? GeoIP_country_code3[country_id] : NULL;
 }
 
+const char *GeoIP_country_name_by_addr_v6 (GeoIP* gi, const char *addr) {
+	int country_id;
+	country_id = GeoIP_id_by_addr_v6(gi, addr);
+	return (country_id > 0) ? GeoIP_country_name[country_id] : NULL;
+}
+
 const char *GeoIP_country_name_by_addr (GeoIP* gi, const char *addr) {
 	int country_id;
 	country_id = GeoIP_id_by_addr(gi, addr);
@@ -1010,10 +1048,18 @@ const char *GeoIP_country_code3_by_ipnum
        return (country_id > 0) ? GeoIP_country_code3[country_id] : NULL;
 }
 
+int GeoIP_country_id_by_addr_v6 (GeoIP* gi, const char *addr) {
+	return GeoIP_id_by_addr_v6(gi, addr);
+}
+
 int GeoIP_country_id_by_addr (GeoIP* gi, const char *addr) {
 	return GeoIP_id_by_addr(gi, addr);
 }
 
+int GeoIP_country_id_by_name_v6 (GeoIP* gi, const char *host) {
+	return GeoIP_id_by_name_v6(gi, host);
+}
+
 int GeoIP_country_id_by_name (GeoIP* gi, const char *host) {
 	return GeoIP_id_by_name(gi, host);
 }
@@ -1024,9 +1070,7 @@ int GeoIP_id_by_addr_v6 (GeoIP* gi, cons
        if (addr == NULL) {
                return 0;
        }
-       if (gi->databaseType != GEOIP_COUNTRY_EDITION_V6 &&
-                       gi->databaseType != GEOIP_PROXY_EDITION &&
-                       gi->databaseType != GEOIP_NETSPEED_EDITION) {
+       if (gi->databaseType != GEOIP_COUNTRY_EDITION_V6) {
                printf("Invalid database type %s, expected %s\n",
                                         GeoIPDBDescription[(int)gi->databaseType],
                                         GeoIPDBDescription[GEOIP_COUNTRY_EDITION_V6]);
@@ -1062,9 +1106,7 @@ int GeoIP_id_by_ipnum_v6 (GeoIP* gi, geo
                return 0;
        }
 */     
-       if (gi->databaseType != GEOIP_COUNTRY_EDITION_V6 && 
-                       gi->databaseType != GEOIP_PROXY_EDITION &&
-                       gi->databaseType != GEOIP_NETSPEED_EDITION) {
+       if (gi->databaseType != GEOIP_COUNTRY_EDITION_V6) {
                printf("Invalid database type %s, expected %s\n",
                                         GeoIPDBDescription[(int)gi->databaseType],
                                         GeoIPDBDescription[GEOIP_COUNTRY_EDITION_V6]);
@@ -1346,6 +1388,7 @@ char *_get_name (GeoIP* gi, unsigned lon
 
 	if (gi->databaseType != GEOIP_ORG_EDITION &&
 			gi->databaseType != GEOIP_ISP_EDITION &&
+			gi->databaseType != GEOIP_DOMAIN_EDITION &&
 			gi->databaseType != GEOIP_ASNUM_EDITION) {
 		printf("Invalid database type %s, expected %s\n", GeoIPDBDescription[(int)gi->databaseType], GeoIPDBDescription[GEOIP_ORG_EDITION]);
 		return NULL;
@@ -1382,6 +1425,7 @@ char *_get_name_v6 (GeoIP* gi, geoipv6_t
 
   if (gi->databaseType != GEOIP_ORG_EDITION &&
       gi->databaseType != GEOIP_ISP_EDITION &&
+      gi->databaseType != GEOIP_DOMAIN_EDITION &&
       gi->databaseType != GEOIP_ASNUM_EDITION) {
     printf("Invalid database type %s, expected %s\n", GeoIPDBDescription[(int)gi->databaseType], GeoIPDBDescription[GEOIP_ORG_EDITION]);
     return NULL;
diff -urp --exclude=from=/home/mdomsch/excludes --minimal /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/libGeoIP/GeoIP.h c/libGeoIP/GeoIP.h
--- /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/libGeoIP/GeoIP.h	2009-02-24 10:03:23.000000000 -0600
+++ c/libGeoIP/GeoIP.h	2009-08-30 21:15:04.000000000 -0500
@@ -162,6 +162,13 @@ GEOIP_API const char *GeoIP_country_name
 GEOIP_API const char *GeoIP_country_code_by_ipnum_v6 (GeoIP* gi, geoipv6_t ipnum);
 GEOIP_API const char *GeoIP_country_code3_by_ipnum_v6 (GeoIP* gi, geoipv6_t ipnum);
 
+GEOIP_API const char *GeoIP_country_code_by_addr_v6 (GeoIP* gi, const char *addr);
+GEOIP_API const char *GeoIP_country_code_by_name_v6 (GeoIP* gi, const char *host);
+GEOIP_API const char *GeoIP_country_code3_by_addr_v6 (GeoIP* gi, const char *addr);
+GEOIP_API const char *GeoIP_country_code3_by_name_v6 (GeoIP* gi, const char *host);
+GEOIP_API const char *GeoIP_country_name_by_addr_v6 (GeoIP* gi, const char *addr);
+GEOIP_API const char *GeoIP_country_name_by_name_v6 (GeoIP* gi, const char *host);
+
 /* Deprecated - for backwards compatibility only */
 GEOIP_API int GeoIP_country_id_by_addr (GeoIP* gi, const char *addr);
 GEOIP_API int GeoIP_country_id_by_name (GeoIP* gi, const char *host);
Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/libGeoIP: Makefile.in
diff -urp --exclude=from=/home/mdomsch/excludes --minimal /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/libGeoIP/regionName.c c/libGeoIP/regionName.c
--- /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/libGeoIP/regionName.c	2009-02-24 10:03:23.000000000 -0600
+++ c/libGeoIP/regionName.c	2009-07-23 15:48:20.000000000 -0500
@@ -2249,6 +2249,12 @@ const char * GeoIP_region_name_by_code(c
   }
   if (strcmp(country_code,"CI") == 0) {
     switch (region_code2) {
+      case 5:
+      name = "Atacama";
+      break;
+      case 6:
+      name = "Biobio";
+      break;
       case 51:
       name = "Sassandra";
       break;
@@ -6102,6 +6108,9 @@ const char * GeoIP_region_name_by_code(c
       case 29:
       name = "Snafellsnes- og Hnappadalssysla";
       break;
+      case 30:
+      name = "Strandasysla";
+      break;
       case 31:
       name = "Sudur-Mulasysla";
       break;
@@ -6875,6 +6884,9 @@ const char * GeoIP_region_name_by_code(c
       case 1:
       name = "Beqaa";
       break;
+      case 2:
+      name = "Al Janub";
+      break;
       case 3:
       name = "Liban-Nord";
       break;
@@ -7092,6 +7104,9 @@ const char * GeoIP_region_name_by_code(c
       case 4:
       name = "Grand Cape Mount";
       break;
+      case 5:
+      name = "Lofa";
+      break;
       case 6:
       name = "Maryland";
       break;
@@ -7107,15 +7122,33 @@ const char * GeoIP_region_name_by_code(c
       case 11:
       name = "Grand Bassa";
       break;
+      case 12:
+      name = "Grand Cape Mount";
+      break;
+      case 13:
+      name = "Maryland";
+      break;
       case 14:
       name = "Montserrado";
       break;
+      case 17:
+      name = "Margibi";
+      break;
+      case 18:
+      name = "River Cess";
+      break;
       case 19:
       name = "Grand Gedeh";
       break;
       case 20:
       name = "Lofa";
       break;
+      case 21:
+      name = "Gbarpolu";
+      break;
+      case 22:
+      name = "River Gee";
+      break;
     }
   }
   if (strcmp(country_code,"LS") == 0) {
@@ -8848,12 +8881,18 @@ const char * GeoIP_region_name_by_code(c
       case 11:
       name = "Federal Capital Territory";
       break;
+      case 12:
+      name = "Gongola";
+      break;
       case 16:
       name = "Ogun";
       break;
       case 17:
       name = "Ondo";
       break;
+      case 18:
+      name = "Oyo";
+      break;
       case 21:
       name = "Akwa Ibom";
       break;
@@ -9271,6 +9310,9 @@ const char * GeoIP_region_name_by_code(c
       case 1092:
       name = "West Coast";
       break;
+      case 85:
+      name = "Waikato";
+      break;
     }
   }
   if (strcmp(country_code,"OM") == 0) {
@@ -9612,6 +9654,9 @@ const char * GeoIP_region_name_by_code(c
       case 44:
       name = "Mountain";
       break;
+      case 45:
+      name = "Negros Occidental";
+      break;
       case 46:
       name = "Negros Oriental";
       break;
@@ -10711,6 +10756,9 @@ const char * GeoIP_region_name_by_code(c
       case 6:
       name = "Gitarama";
       break;
+      case 7:
+      name = "Kibungo";
+      break;
       case 9:
       name = "Kigali";
       break;
@@ -11532,6 +11580,9 @@ const char * GeoIP_region_name_by_code(c
       case 7:
       name = "Thies";
       break;
+      case 8:
+      name = "Louga";
+      break;
       case 9:
       name = "Fatick";
       break;
@@ -12075,6 +12126,12 @@ const char * GeoIP_region_name_by_code(c
       case 78:
       name = "Mukdahan";
       break;
+      case 79:
+      name = "Nong Bua Lamphu";
+      break;
+      case 80:
+      name = "Sa Kaeo";
+      break;
     }
   }
   if (strcmp(country_code,"TJ") == 0) {
@@ -12112,22 +12169,19 @@ const char * GeoIP_region_name_by_code(c
   if (strcmp(country_code,"TN") == 0) {
     switch (region_code2) {
       case 2:
-      name = "Al Qasrayn";
+      name = "Kasserine";
       break;
       case 3:
-      name = "Al Qayrawan";
+      name = "Kairouan";
       break;
       case 6:
-      name = "Jundubah";
-      break;
-      case 10:
-      name = "Qafsah";
+      name = "Jendouba";
       break;
       case 14:
-      name = "Kef";
+      name = "El Kef";
       break;
       case 15:
-      name = "Al Mahdiyah";
+      name = "Al Mahdia";
       break;
       case 16:
       name = "Al Munastir";
@@ -12136,58 +12190,52 @@ const char * GeoIP_region_name_by_code(c
       name = "Bajah";
       break;
       case 18:
-      name = "Banzart";
+      name = "Bizerte";
       break;
       case 19:
-      name = "Nabul";
+      name = "Nabeul";
       break;
       case 22:
-      name = "Silyanah";
+      name = "Siliana";
       break;
       case 23:
-      name = "Susah";
+      name = "Sousse";
       break;
       case 26:
-      name = "Chaiyaphum Province";
+      name = "Ariana";
       break;
       case 27:
-      name = "Bin";
+      name = "Ben Arous";
       break;
       case 28:
       name = "Madanin";
       break;
       case 29:
-      name = "Qabis";
+      name = "Gabes";
       break;
       case 30:
-      name = "Qafsah";
+      name = "Gafsa";
       break;
       case 31:
-      name = "Qibili";
+      name = "Kebili";
       break;
       case 32:
-      name = "Safaqis";
+      name = "Sfax";
       break;
       case 33:
-      name = "Sidi Bu Zayd";
+      name = "Sidi Bou Zid";
       break;
       case 34:
-      name = "Tatawin";
+      name = "Tataouine";
       break;
       case 35:
-      name = "Tawzar";
+      name = "Tozeur";
       break;
       case 36:
       name = "Tunis";
       break;
       case 37:
-      name = "Zaghwan";
-      break;
-      case 38:
-      name = "Ariana";
-      break;
-      case 39:
-      name = "Manouba";
+      name = "Zaghouan";
       break;
     }
   }
@@ -13035,6 +13083,9 @@ const char * GeoIP_region_name_by_code(c
       case 5:
       name = "Cao Bang";
       break;
+      case 6:
+      name = "Cuu Long";
+      break;
       case 7:
       name = "Dac Lac";
       break;
@@ -13053,6 +13104,9 @@ const char * GeoIP_region_name_by_code(c
       case 14:
       name = "Ha Nam Ninh";
       break;
+      case 15:
+      name = "Ha Noi";
+      break;
       case 16:
       name = "Ha Son Binh";
       break;
@@ -13377,6 +13431,9 @@ const char * GeoIP_region_name_by_code(c
       case 5:
       name = "Shabwah";
       break;
+      case 6:
+      name = "Al Ghaydah";
+      break;
       case 8:
       name = "Al Hudaydah";
       break;
Only in c/: LICENSE
Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/: LICENSE.txt
Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/: Makefile.in
Only in c/man: CVS
Only in c/man: geoiplookup.1
Only in c/man: geoiplookup6.1
Only in c/man: geoipupdate.1
Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/man: Makefile.in
Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/: missing
diff -urp --exclude=from=/home/mdomsch/excludes --minimal /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/README c/README
--- /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/README	2009-02-24 10:03:24.000000000 -0600
+++ c/README	2009-06-10 07:35:19.000000000 -0500
@@ -182,4 +182,27 @@ from XORG X-Server). It happens at least
 If GEOIP_MMAP_CACHE doesn't work on a 64bit machine, try adding
 the flag "MAP_32BIT" to the mmap call.
 
+If you get a "passing argument 3 of 'gethostbyname_r' from incompatible pointer type"
+error on AIX, download and/or untar a fresh copy of GeoIP.  ( To avoid cached
+results from a previous ./configure run )
+
+cd ./GeoIP-1.4.6
+then edit the file ./configure
+
+and delete these two lines:
+
+#define HAVE_GETHOSTBYNAME_R 1
+
+#define GETHOSTBYNAME_R_RETURNS_INT 1
+
+then save the configure script
+
+and build it as usual
+
+./configure
+make
+sudo make install
+
+
+
 To submit a patch, please contact support at maxmind.com 
Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/: README.fedora
Only in c/: regioncode
Only in c/test: CVS
Only in c/test: fail_test.txt
Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/test: Makefile.in
Only in c/test: proxy_test.txt
Only in c/: timezone


Index: GeoIP.spec
===================================================================
RCS file: /cvs/extras/rpms/GeoIP/devel/GeoIP.spec,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -p -r1.19 -r1.20
--- GeoIP.spec	24 Jul 2009 15:30:21 -0000	1.19
+++ GeoIP.spec	1 Sep 2009 13:04:09 -0000	1.20
@@ -1,15 +1,17 @@
+%define tarballversion 1.4.6
 Name: GeoIP           
-Version: 1.4.6
-Release: 2%{?dist}
+Version: 1.4.7
+Release: 0.1.20090931cvs%{?dist}
 Summary: C library for country/city/organization to IP address or hostname mapping     
 Group: Development/Libraries         
 License: LGPLv2+
 URL: http://www.maxmind.com/app/c            
-Source0: http://www.maxmind.com/download/geoip/api/c/GeoIP-%{version}.tar.gz 
+Source0: http://www.maxmind.com/download/geoip/api/c/GeoIP-%{tarballversion}.tar.gz 
 Source1: LICENSE.txt
 Source2: fetch-geoipdata-city.pl
 Source3: fetch-geoipdata.pl
 Source4: README.Fedora
+Patch0: geoip-1.4.6-ipv6.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Obsoletes: geoip < %{version}-%{release}
 Provides: geoip = %{version}-%{release}
@@ -33,7 +35,8 @@ Obsoletes: geoip-devel < %{version}-%{re
 Development headers and static libraries for building GeoIP-based applications
 
 %prep
-%setup -q 
+%setup -q -n %{name}-%{tarballversion}
+%patch0 -p1
 install -D -m644 %{SOURCE1} LICENSE.txt
 install -D -m644 %{SOURCE2} fetch-geoipdata-city.pl
 install -D -m644 %{SOURCE3} fetch-geoipdata.pl
@@ -81,6 +84,9 @@ rm -rf %{buildroot}
 %{_libdir}/libGeoIPUpdate.so
 
 %changelog
+* Mon Aug 31 2009 Matt Domsch <mdomsch at fedoraproject.org> - 1.4.7.0.1.20090931
+- apply CVS HEAD 20090931 which includes IPv6 functions
+
 * Fri Jul 24 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.4.6-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
 




More information about the fedora-extras-commits mailing list