/[pkgs]/devel/GeoIP/geoip-1.4.6-ipv6.patch
ViewVC logotype

Contents of /devel/GeoIP/geoip-1.4.6-ipv6.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download) (as text)
Tue Sep 1 13:04:09 2009 UTC (2 months, 3 weeks ago) by mdomsch
Branch: MAIN
CVS Tags: GeoIP-1_4_7-0_1_20090931cvs_fc12, F-12-split, HEAD
File MIME type: text/x-patch
add IPv6 functions from CVS HEAD, do prerelease
1 Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/: aclocal.m4
2 Only in c/apps: CVS
3 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
4 --- /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/apps/geoiplookup.c 2009-02-24 10:03:23.000000000 -0600
5 +++ c/apps/geoiplookup.c 2009-05-08 12:01:21.000000000 -0500
6 @@ -31,9 +31,12 @@ typedef unsigned int uint32_t;
7 void geoiplookup(GeoIP* gi,char *hostname,int i);
8
9 void usage() {
10 - fprintf(stderr,"Usage: geoiplookup [-d custom_dir] [-f custom_file] [-v] <ipaddress|hostname>\n");
11 + fprintf(stderr,"Usage: geoiplookup [-d custom_dir] [-f custom_file] [-v] [-i] <ipaddress|hostname>\n");
12 }
13
14 +/* extra info used in _say_range_ip */
15 +int info_flag = 0;
16 +
17 int main (int argc, char *argv[]) {
18 char * hostname = NULL;
19 char * db_info;
20 @@ -51,7 +54,9 @@ int main (int argc, char *argv[]) {
21 while (i < argc) {
22 if (strcmp(argv[i],"-v") == 0) {
23 version_flag = 1;
24 - } else if (strcmp(argv[i],"-f") == 0) {
25 + } else if (strcmp(argv[i],"-i") == 0) {
26 + info_flag = 1;
27 + } else if (strcmp(argv[i],"-f") == 0) {
28 if ((i+1) < argc){
29 i++;
30 custom_file = argv[i];
31 @@ -119,12 +124,106 @@ static const char * _mk_NA( const char *
32 return p ? p : "N/A";
33 }
34
35 +static unsigned long
36 +__addr_to_num(const char *addr)
37 +{
38 + unsigned int c, octet, t;
39 + unsigned long ipnum;
40 + int i = 3;
41 +
42 + octet = ipnum = 0;
43 + while ((c = *addr++)) {
44 + if (c == '.') {
45 + if (octet > 255)
46 + return 0;
47 + ipnum <<= 8;
48 + ipnum += octet;
49 + i--;
50 + octet = 0;
51 + } else {
52 + t = octet;
53 + octet <<= 3;
54 + octet += t;
55 + octet += t;
56 + c -= '0';
57 + if (c > 9)
58 + return 0;
59 + octet += c;
60 + }
61 + }
62 + if ((octet > 255) || (i != 0))
63 + return 0;
64 + ipnum <<= 8;
65 + return ipnum + octet;
66 +}
67 +
68 +
69 +
70 +/* ptr must be a memory area with at least 16 bytes */
71 +static char *__num_to_addr_r (unsigned long ipnum, char * ptr) {
72 + char *cur_str;
73 + int octet[4];
74 + int num_chars_written, i;
75 +
76 + cur_str = ptr;
77 +
78 + for (i = 0; i<4; i++) {
79 + octet[3 - i] = ipnum % 256;
80 + ipnum >>= 8;
81 + }
82 +
83 + for (i = 0; i<4; i++) {
84 + num_chars_written = sprintf(cur_str, "%d", octet[i]);
85 + cur_str += num_chars_written;
86 +
87 + if (i < 3) {
88 + cur_str[0] = '.';
89 + cur_str++;
90 + }
91 + }
92 +
93 + return ptr;
94 +}
95 +
96 +void _say_range_by_ip(GeoIP * gi, uint32_t ipnum ) {
97 + unsigned long last_nm, mask, low, hi;
98 + char ipaddr[16];
99 + char tmp[16];
100 + char ** range;
101 +
102 + if ( info_flag == 0 )
103 + return; /* noop unless extra information is requested */
104 +
105 + range = GeoIP_range_by_ip( gi, __num_to_addr_r( ipnum, ipaddr ) );
106 + if ( range == NULL )
107 + return;
108 +
109 + printf ( " ipaddr: %s\n", ipaddr );
110 +
111 + printf( " range_by_ip: %s - %s\n", range[0], range[1] );
112 + last_nm = GeoIP_last_netmask(gi);
113 + mask = 0xffffffff << ( 32 - last_nm );
114 + low = ipnum & mask;
115 + hi = low + ( 0xffffffff & ~mask );
116 + printf( " network: %s - %s ::%ld\n",
117 + __num_to_addr_r( low, ipaddr ),
118 + __num_to_addr_r( hi, tmp ),
119 + last_nm
120 + );
121 + printf( " ipnum: %u\n", ipnum );
122 + printf( " range_by_num: %lu - %lu\n", __addr_to_num(range[0]), __addr_to_num(range[1]) );
123 + printf( " network num: %lu - %lu ::%lu\n", low, hi, last_nm );
124 +
125 + GeoIP_range_by_ip_delete(range);
126 +}
127 +
128 void
129 geoiplookup(GeoIP * gi, char *hostname, int i)
130 {
131 const char *country_code;
132 const char *country_name;
133 const char *domain_name;
134 + const char *asnum_name;
135 int netspeed;
136 int country_id;
137 GeoIPRegion *region;
138 @@ -146,6 +245,17 @@ geoiplookup(GeoIP * gi, char *hostname,
139 }
140 else {
141 printf("%s: %s\n", GeoIPDBDescription[i], domain_name);
142 + _say_range_by_ip(gi, ipnum);
143 + }
144 + }
145 + else if (GEOIP_ASNUM_EDITION == i) {
146 + asnum_name = GeoIP_name_by_ipnum(gi, ipnum);
147 + if (asnum_name == NULL) {
148 + printf("%s: IP Address not found\n", GeoIPDBDescription[i]);
149 + }
150 + else {
151 + printf("%s: %s\n", GeoIPDBDescription[i], asnum_name);
152 + _say_range_by_ip(gi, ipnum);
153 }
154 }
155 else if (GEOIP_COUNTRY_EDITION == i) {
156 @@ -157,6 +267,7 @@ geoiplookup(GeoIP * gi, char *hostname,
157 }
158 else {
159 printf("%s: %s, %s\n", GeoIPDBDescription[i], country_code, country_name);
160 + _say_range_by_ip(gi, ipnum);
161 }
162 }
163 else if (GEOIP_REGION_EDITION_REV0 == i || GEOIP_REGION_EDITION_REV1 == i) {
164 @@ -166,6 +277,7 @@ geoiplookup(GeoIP * gi, char *hostname,
165 }
166 else {
167 printf("%s: %s, %s\n", GeoIPDBDescription[i], region->country_code, region->region);
168 + _say_range_by_ip(gi, ipnum);
169 GeoIPRegion_delete(region);
170 }
171 }
172 @@ -177,6 +289,7 @@ geoiplookup(GeoIP * gi, char *hostname,
173 else {
174 printf("%s: %s, %s, %s, %s, %f, %f\n", GeoIPDBDescription[i], gir->country_code, _mk_NA(gir->region),
175 _mk_NA(gir->city), _mk_NA(gir->postal_code), gir->latitude, gir->longitude);
176 + _say_range_by_ip(gi, ipnum);
177 }
178 }
179 else if (GEOIP_CITY_EDITION_REV1 == i) {
180 @@ -187,6 +300,7 @@ geoiplookup(GeoIP * gi, char *hostname,
181 else {
182 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),
183 gir->latitude, gir->longitude, gir->metro_code, gir->area_code);
184 + _say_range_by_ip(gi, ipnum);
185 }
186 }
187 else if (GEOIP_ORG_EDITION == i || GEOIP_ISP_EDITION == i) {
188 @@ -196,6 +310,7 @@ geoiplookup(GeoIP * gi, char *hostname,
189 }
190 else {
191 printf("%s: %s\n", GeoIPDBDescription[i], org);
192 + _say_range_by_ip(gi, ipnum);
193 }
194 }
195 else if (GEOIP_NETSPEED_EDITION == i) {
196 @@ -212,6 +327,7 @@ geoiplookup(GeoIP * gi, char *hostname,
197 else if (netspeed == GEOIP_CORPORATE_SPEED) {
198 printf("%s: Corporate\n", GeoIPDBDescription[i]);
199 }
200 + _say_range_by_ip(gi, ipnum);
201 }
202 else {
203
204 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
205 --- /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/apps/geoipupdate.c 2009-02-24 14:01:41.000000000 -0600
206 +++ c/apps/geoipupdate.c 2009-05-29 03:55:00.000000000 -0500
207 @@ -97,6 +97,7 @@ int main (int argc, char *argv[]) {
208 exit(0);
209 case 'v':
210 verbose = 1;
211 + break;
212 case 'f':
213 license_file = optarg;
214 break;
215 @@ -279,5 +280,5 @@ int main (int argc, char *argv[]) {
216 if (client_ipaddr) {
217 free(client_ipaddr);
218 }
219 - exit(0);
220 + exit(err);
221 }
222 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
223 --- /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/apps/geoipupdate-pureperl.pl 2009-02-24 10:04:39.000000000 -0600
224 +++ c/apps/geoipupdate-pureperl.pl 2009-03-22 09:40:33.000000000 -0500
225 @@ -40,7 +40,7 @@ https
226 use strict;
227 use warnings;
228
229 -our $VERSION = '0.03';
230 +our $VERSION = '0.04';
231
232 use 5.008;
233 use Data::Dumper;
234 @@ -220,7 +220,7 @@ sub _gunzip_and_replace {
235 {
236 local $_;
237 open my $gin, '<:gzip', \$content or die $!;
238 - open my $gout, '>', $geoip_filename . '.test' or die $!;
239 + open my $gout, '>:raw', $geoip_filename . '.test' or die $!;
240 print {$gout} $_ while (<$gin>);
241 }
242
243 Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/apps: Makefile.in
244 diff -urp --exclude=from=/home/mdomsch/excludes --minimal /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/ChangeLog c/ChangeLog
245 --- /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/ChangeLog 2009-02-24 19:44:38.000000000 -0600
246 +++ c/ChangeLog 2009-08-30 21:15:04.000000000 -0500
247 @@ -1,3 +1,20 @@
248 + * Add more IPv6 functions ( Boris Zentner )
249 + const char *GeoIP_country_code_by_addr_v6 (GeoIP* gi, const char *addr);
250 + const char *GeoIP_country_code_by_name_v6 (GeoIP* gi, const char *host);
251 + const char *GeoIP_country_code3_by_addr_v6 (GeoIP* gi, const char *addr);
252 + const char *GeoIP_country_code3_by_name_v6 (GeoIP* gi, const char *host);
253 + const char *GeoIP_country_name_by_addr_v6 (GeoIP* gi, const char *addr);
254 + const char *GeoIP_country_name_by_name_v6 (GeoIP* gi, const char *host);
255 + * Make sure that GeoIP_*_v6 functions refuse GEOIP_PROXY_EDITION and
256 + GEOIP_NETSPEED_EDITION databases ( Boris Zentner )
257 + * Update libGeoIP/regionName.c with FIPS codes from 20090723 ( Boris Zentner )
258 + * Fix geoipupdate's -v option to not change the license filename ( Thom May )
259 + * Fix geoipupdate's exit code ( Thom May )
260 + * Add support for ASNUM_EDITION ( Boris Zentner )
261 + * Fix -i output for larger values, sign issue ( Boris Zentner )
262 + * Add -i flag for more information on netmask, range_by_ip and the current network range ( Boris Zentner )
263 + * Add support for DOMAIN_EDITION database type ( Boris Zentner )
264 + * Fix apps/geoipupdate-pureperl.pl output layer on W32 ( Boris Zentner )
265 1.4.6 2009-02-25
266 * Fix geoipupdate's my_printf function ( Boris Zentner )
267 * Fix typo in apps/geoipupdate-pureperl.pl replace PerlIO::Gzip with PerlIO::gzip ( Boris Zentner )
268 Only in c/conf: CVS
269 Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/conf: Makefile.in
270 Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/: config.guess
271 Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/: config.sub
272 Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/: configure
273 diff -urp --exclude=from=/home/mdomsch/excludes --minimal /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/configure.in c/configure.in
274 --- /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/configure.in 2009-02-24 10:03:23.000000000 -0600
275 +++ c/configure.in 2009-08-30 21:15:04.000000000 -0500
276 @@ -1,6 +1,6 @@
277 dnl AM_CONFIG_HEADER(config.h)
278
279 -AC_INIT([GeoIP], [1.4.6],[support@maxmind.com],[GeoIP])
280 +AC_INIT([GeoIP], [1.4.7],[support@maxmind.com],[GeoIP])
281 AC_GNU_SOURCE
282 AM_INIT_AUTOMAKE
283 AC_CONFIG_SRCDIR([libGeoIP/GeoIP.c])
284 Only in c/: CVS
285 Only in c/data: CVS
286 Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/data: GeoIP.dat
287 Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/data: Makefile.in
288 Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/: fetch-geoipdata-city.pl
289 Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/: fetch-geoipdata.pl
290 Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/: GeoIP.spec
291 Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/: install-sh
292 Only in c/libGeoIP: CVS
293 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
294 --- /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/libGeoIP/GeoIP.c 2009-02-24 10:03:23.000000000 -0600
295 +++ c/libGeoIP/GeoIP.c 2009-08-30 21:15:04.000000000 -0500
296 @@ -366,10 +366,11 @@ void _setup_segments(GeoIP * gi) {
297 gi->databaseSegments = malloc(sizeof(int));
298 gi->databaseSegments[0] = STATE_BEGIN_REV1;
299 } else if (gi->databaseType == GEOIP_CITY_EDITION_REV0 ||
300 - gi->databaseType == GEOIP_CITY_EDITION_REV1 ||
301 - gi->databaseType == GEOIP_ORG_EDITION ||
302 - gi->databaseType == GEOIP_ISP_EDITION ||
303 - gi->databaseType == GEOIP_ASNUM_EDITION) {
304 + gi->databaseType == GEOIP_CITY_EDITION_REV1 ||
305 + gi->databaseType == GEOIP_ORG_EDITION ||
306 + gi->databaseType == GEOIP_DOMAIN_EDITION ||
307 + gi->databaseType == GEOIP_ISP_EDITION ||
308 + gi->databaseType == GEOIP_ASNUM_EDITION) {
309 /* City/Org Editions have two segments, read offset of second segment */
310 gi->databaseSegments = malloc(sizeof(int));
311 gi->databaseSegments[0] = 0;
312 @@ -377,8 +378,9 @@ void _setup_segments(GeoIP * gi) {
313 for (j = 0; j < SEGMENT_RECORD_LENGTH; j++) {
314 gi->databaseSegments[0] += (buf[j] << (j * 8));
315 }
316 - if (gi->databaseType == GEOIP_ORG_EDITION ||
317 - gi->databaseType == GEOIP_ISP_EDITION)
318 + if (gi->databaseType == GEOIP_ORG_EDITION ||
319 + gi->databaseType == GEOIP_DOMAIN_EDITION ||
320 + gi->databaseType == GEOIP_ISP_EDITION)
321 gi->record_length = ORG_RECORD_LENGTH;
322 }
323 break;
324 @@ -831,18 +833,36 @@ void GeoIP_delete (GeoIP *gi) {
325 free(gi);
326 }
327
328 +const char *GeoIP_country_code_by_name_v6 (GeoIP* gi, const char *name) {
329 + int country_id;
330 + country_id = GeoIP_id_by_name_v6(gi, name);
331 + return (country_id > 0) ? GeoIP_country_code[country_id] : NULL;
332 +}
333 +
334 const char *GeoIP_country_code_by_name (GeoIP* gi, const char *name) {
335 int country_id;
336 country_id = GeoIP_id_by_name(gi, name);
337 return (country_id > 0) ? GeoIP_country_code[country_id] : NULL;
338 }
339
340 +const char *GeoIP_country_code3_by_name_v6 (GeoIP* gi, const char *name) {
341 + int country_id;
342 + country_id = GeoIP_id_by_name_v6(gi, name);
343 + return (country_id > 0) ? GeoIP_country_code3[country_id] : NULL;
344 +}
345 +
346 const char *GeoIP_country_code3_by_name (GeoIP* gi, const char *name) {
347 int country_id;
348 country_id = GeoIP_id_by_name(gi, name);
349 return (country_id > 0) ? GeoIP_country_code3[country_id] : NULL;
350 }
351
352 +const char *GeoIP_country_name_by_name_v6 (GeoIP* gi, const char *name) {
353 + int country_id;
354 + country_id = GeoIP_id_by_name_v6(gi, name);
355 + return (country_id > 0) ? GeoIP_country_name[country_id] : NULL;
356 +}
357 +
358 const char *GeoIP_country_name_by_name (GeoIP* gi, const char *name) {
359 int country_id;
360 country_id = GeoIP_id_by_name(gi, name);
361 @@ -945,7 +965,7 @@ int GeoIP_id_by_name_v6 (GeoIP* gi, cons
362 if (name == NULL) {
363 return 0;
364 }
365 - if (gi->databaseType != GEOIP_COUNTRY_EDITION_V6 && gi->databaseType != GEOIP_PROXY_EDITION && gi->databaseType != GEOIP_NETSPEED_EDITION) {
366 + if (gi->databaseType != GEOIP_COUNTRY_EDITION_V6) {
367 printf("Invalid database type %s, expected %s\n", GeoIPDBDescription[(int)gi->databaseType], GeoIPDBDescription[GEOIP_COUNTRY_EDITION_V6]);
368 return 0;
369 }
370 @@ -956,18 +976,36 @@ int GeoIP_id_by_name_v6 (GeoIP* gi, cons
371 return ret;
372 }
373
374 +const char *GeoIP_country_code_by_addr_v6 (GeoIP* gi, const char *addr) {
375 + int country_id;
376 + country_id = GeoIP_id_by_addr_v6(gi, addr);
377 + return (country_id > 0) ? GeoIP_country_code[country_id] : NULL;
378 +}
379 +
380 const char *GeoIP_country_code_by_addr (GeoIP* gi, const char *addr) {
381 int country_id;
382 country_id = GeoIP_id_by_addr(gi, addr);
383 return (country_id > 0) ? GeoIP_country_code[country_id] : NULL;
384 }
385
386 +const char *GeoIP_country_code3_by_addr_v6 (GeoIP* gi, const char *addr) {
387 + int country_id;
388 + country_id = GeoIP_id_by_addr_v6(gi, addr);
389 + return (country_id > 0) ? GeoIP_country_code3[country_id] : NULL;
390 +}
391 +
392 const char *GeoIP_country_code3_by_addr (GeoIP* gi, const char *addr) {
393 int country_id;
394 country_id = GeoIP_id_by_addr(gi, addr);
395 return (country_id > 0) ? GeoIP_country_code3[country_id] : NULL;
396 }
397
398 +const char *GeoIP_country_name_by_addr_v6 (GeoIP* gi, const char *addr) {
399 + int country_id;
400 + country_id = GeoIP_id_by_addr_v6(gi, addr);
401 + return (country_id > 0) ? GeoIP_country_name[country_id] : NULL;
402 +}
403 +
404 const char *GeoIP_country_name_by_addr (GeoIP* gi, const char *addr) {
405 int country_id;
406 country_id = GeoIP_id_by_addr(gi, addr);
407 @@ -1010,10 +1048,18 @@ const char *GeoIP_country_code3_by_ipnum
408 return (country_id > 0) ? GeoIP_country_code3[country_id] : NULL;
409 }
410
411 +int GeoIP_country_id_by_addr_v6 (GeoIP* gi, const char *addr) {
412 + return GeoIP_id_by_addr_v6(gi, addr);
413 +}
414 +
415 int GeoIP_country_id_by_addr (GeoIP* gi, const char *addr) {
416 return GeoIP_id_by_addr(gi, addr);
417 }
418
419 +int GeoIP_country_id_by_name_v6 (GeoIP* gi, const char *host) {
420 + return GeoIP_id_by_name_v6(gi, host);
421 +}
422 +
423 int GeoIP_country_id_by_name (GeoIP* gi, const char *host) {
424 return GeoIP_id_by_name(gi, host);
425 }
426 @@ -1024,9 +1070,7 @@ int GeoIP_id_by_addr_v6 (GeoIP* gi, cons
427 if (addr == NULL) {
428 return 0;
429 }
430 - if (gi->databaseType != GEOIP_COUNTRY_EDITION_V6 &&
431 - gi->databaseType != GEOIP_PROXY_EDITION &&
432 - gi->databaseType != GEOIP_NETSPEED_EDITION) {
433 + if (gi->databaseType != GEOIP_COUNTRY_EDITION_V6) {
434 printf("Invalid database type %s, expected %s\n",
435 GeoIPDBDescription[(int)gi->databaseType],
436 GeoIPDBDescription[GEOIP_COUNTRY_EDITION_V6]);
437 @@ -1062,9 +1106,7 @@ int GeoIP_id_by_ipnum_v6 (GeoIP* gi, geo
438 return 0;
439 }
440 */
441 - if (gi->databaseType != GEOIP_COUNTRY_EDITION_V6 &&
442 - gi->databaseType != GEOIP_PROXY_EDITION &&
443 - gi->databaseType != GEOIP_NETSPEED_EDITION) {
444 + if (gi->databaseType != GEOIP_COUNTRY_EDITION_V6) {
445 printf("Invalid database type %s, expected %s\n",
446 GeoIPDBDescription[(int)gi->databaseType],
447 GeoIPDBDescription[GEOIP_COUNTRY_EDITION_V6]);
448 @@ -1346,6 +1388,7 @@ char *_get_name (GeoIP* gi, unsigned lon
449
450 if (gi->databaseType != GEOIP_ORG_EDITION &&
451 gi->databaseType != GEOIP_ISP_EDITION &&
452 + gi->databaseType != GEOIP_DOMAIN_EDITION &&
453 gi->databaseType != GEOIP_ASNUM_EDITION) {
454 printf("Invalid database type %s, expected %s\n", GeoIPDBDescription[(int)gi->databaseType], GeoIPDBDescription[GEOIP_ORG_EDITION]);
455 return NULL;
456 @@ -1382,6 +1425,7 @@ char *_get_name_v6 (GeoIP* gi, geoipv6_t
457
458 if (gi->databaseType != GEOIP_ORG_EDITION &&
459 gi->databaseType != GEOIP_ISP_EDITION &&
460 + gi->databaseType != GEOIP_DOMAIN_EDITION &&
461 gi->databaseType != GEOIP_ASNUM_EDITION) {
462 printf("Invalid database type %s, expected %s\n", GeoIPDBDescription[(int)gi->databaseType], GeoIPDBDescription[GEOIP_ORG_EDITION]);
463 return NULL;
464 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
465 --- /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/libGeoIP/GeoIP.h 2009-02-24 10:03:23.000000000 -0600
466 +++ c/libGeoIP/GeoIP.h 2009-08-30 21:15:04.000000000 -0500
467 @@ -162,6 +162,13 @@ GEOIP_API const char *GeoIP_country_name
468 GEOIP_API const char *GeoIP_country_code_by_ipnum_v6 (GeoIP* gi, geoipv6_t ipnum);
469 GEOIP_API const char *GeoIP_country_code3_by_ipnum_v6 (GeoIP* gi, geoipv6_t ipnum);
470
471 +GEOIP_API const char *GeoIP_country_code_by_addr_v6 (GeoIP* gi, const char *addr);
472 +GEOIP_API const char *GeoIP_country_code_by_name_v6 (GeoIP* gi, const char *host);
473 +GEOIP_API const char *GeoIP_country_code3_by_addr_v6 (GeoIP* gi, const char *addr);
474 +GEOIP_API const char *GeoIP_country_code3_by_name_v6 (GeoIP* gi, const char *host);
475 +GEOIP_API const char *GeoIP_country_name_by_addr_v6 (GeoIP* gi, const char *addr);
476 +GEOIP_API const char *GeoIP_country_name_by_name_v6 (GeoIP* gi, const char *host);
477 +
478 /* Deprecated - for backwards compatibility only */
479 GEOIP_API int GeoIP_country_id_by_addr (GeoIP* gi, const char *addr);
480 GEOIP_API int GeoIP_country_id_by_name (GeoIP* gi, const char *host);
481 Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/libGeoIP: Makefile.in
482 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
483 --- /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/libGeoIP/regionName.c 2009-02-24 10:03:23.000000000 -0600
484 +++ c/libGeoIP/regionName.c 2009-07-23 15:48:20.000000000 -0500
485 @@ -2249,6 +2249,12 @@ const char * GeoIP_region_name_by_code(c
486 }
487 if (strcmp(country_code,"CI") == 0) {
488 switch (region_code2) {
489 + case 5:
490 + name = "Atacama";
491 + break;
492 + case 6:
493 + name = "Biobio";
494 + break;
495 case 51:
496 name = "Sassandra";
497 break;
498 @@ -6102,6 +6108,9 @@ const char * GeoIP_region_name_by_code(c
499 case 29:
500 name = "Snafellsnes- og Hnappadalssysla";
501 break;
502 + case 30:
503 + name = "Strandasysla";
504 + break;
505 case 31:
506 name = "Sudur-Mulasysla";
507 break;
508 @@ -6875,6 +6884,9 @@ const char * GeoIP_region_name_by_code(c
509 case 1:
510 name = "Beqaa";
511 break;
512 + case 2:
513 + name = "Al Janub";
514 + break;
515 case 3:
516 name = "Liban-Nord";
517 break;
518 @@ -7092,6 +7104,9 @@ const char * GeoIP_region_name_by_code(c
519 case 4:
520 name = "Grand Cape Mount";
521 break;
522 + case 5:
523 + name = "Lofa";
524 + break;
525 case 6:
526 name = "Maryland";
527 break;
528 @@ -7107,15 +7122,33 @@ const char * GeoIP_region_name_by_code(c
529 case 11:
530 name = "Grand Bassa";
531 break;
532 + case 12:
533 + name = "Grand Cape Mount";
534 + break;
535 + case 13:
536 + name = "Maryland";
537 + break;
538 case 14:
539 name = "Montserrado";
540 break;
541 + case 17:
542 + name = "Margibi";
543 + break;
544 + case 18:
545 + name = "River Cess";
546 + break;
547 case 19:
548 name = "Grand Gedeh";
549 break;
550 case 20:
551 name = "Lofa";
552 break;
553 + case 21:
554 + name = "Gbarpolu";
555 + break;
556 + case 22:
557 + name = "River Gee";
558 + break;
559 }
560 }
561 if (strcmp(country_code,"LS") == 0) {
562 @@ -8848,12 +8881,18 @@ const char * GeoIP_region_name_by_code(c
563 case 11:
564 name = "Federal Capital Territory";
565 break;
566 + case 12:
567 + name = "Gongola";
568 + break;
569 case 16:
570 name = "Ogun";
571 break;
572 case 17:
573 name = "Ondo";
574 break;
575 + case 18:
576 + name = "Oyo";
577 + break;
578 case 21:
579 name = "Akwa Ibom";
580 break;
581 @@ -9271,6 +9310,9 @@ const char * GeoIP_region_name_by_code(c
582 case 1092:
583 name = "West Coast";
584 break;
585 + case 85:
586 + name = "Waikato";
587 + break;
588 }
589 }
590 if (strcmp(country_code,"OM") == 0) {
591 @@ -9612,6 +9654,9 @@ const char * GeoIP_region_name_by_code(c
592 case 44:
593 name = "Mountain";
594 break;
595 + case 45:
596 + name = "Negros Occidental";
597 + break;
598 case 46:
599 name = "Negros Oriental";
600 break;
601 @@ -10711,6 +10756,9 @@ const char * GeoIP_region_name_by_code(c
602 case 6:
603 name = "Gitarama";
604 break;
605 + case 7:
606 + name = "Kibungo";
607 + break;
608 case 9:
609 name = "Kigali";
610 break;
611 @@ -11532,6 +11580,9 @@ const char * GeoIP_region_name_by_code(c
612 case 7:
613 name = "Thies";
614 break;
615 + case 8:
616 + name = "Louga";
617 + break;
618 case 9:
619 name = "Fatick";
620 break;
621 @@ -12075,6 +12126,12 @@ const char * GeoIP_region_name_by_code(c
622 case 78:
623 name = "Mukdahan";
624 break;
625 + case 79:
626 + name = "Nong Bua Lamphu";
627 + break;
628 + case 80:
629 + name = "Sa Kaeo";
630 + break;
631 }
632 }
633 if (strcmp(country_code,"TJ") == 0) {
634 @@ -12112,22 +12169,19 @@ const char * GeoIP_region_name_by_code(c
635 if (strcmp(country_code,"TN") == 0) {
636 switch (region_code2) {
637 case 2:
638 - name = "Al Qasrayn";
639 + name = "Kasserine";
640 break;
641 case 3:
642 - name = "Al Qayrawan";
643 + name = "Kairouan";
644 break;
645 case 6:
646 - name = "Jundubah";
647 - break;
648 - case 10:
649 - name = "Qafsah";
650 + name = "Jendouba";
651 break;
652 case 14:
653 - name = "Kef";
654 + name = "El Kef";
655 break;
656 case 15:
657 - name = "Al Mahdiyah";
658 + name = "Al Mahdia";
659 break;
660 case 16:
661 name = "Al Munastir";
662 @@ -12136,58 +12190,52 @@ const char * GeoIP_region_name_by_code(c
663 name = "Bajah";
664 break;
665 case 18:
666 - name = "Banzart";
667 + name = "Bizerte";
668 break;
669 case 19:
670 - name = "Nabul";
671 + name = "Nabeul";
672 break;
673 case 22:
674 - name = "Silyanah";
675 + name = "Siliana";
676 break;
677 case 23:
678 - name = "Susah";
679 + name = "Sousse";
680 break;
681 case 26:
682 - name = "Chaiyaphum Province";
683 + name = "Ariana";
684 break;
685 case 27:
686 - name = "Bin";
687 + name = "Ben Arous";
688 break;
689 case 28:
690 name = "Madanin";
691 break;
692 case 29:
693 - name = "Qabis";
694 + name = "Gabes";
695 break;
696 case 30:
697 - name = "Qafsah";
698 + name = "Gafsa";
699 break;
700 case 31:
701 - name = "Qibili";
702 + name = "Kebili";
703 break;
704 case 32:
705 - name = "Safaqis";
706 + name = "Sfax";
707 break;
708 case 33:
709 - name = "Sidi Bu Zayd";
710 + name = "Sidi Bou Zid";
711 break;
712 case 34:
713 - name = "Tatawin";
714 + name = "Tataouine";
715 break;
716 case 35:
717 - name = "Tawzar";
718 + name = "Tozeur";
719 break;
720 case 36:
721 name = "Tunis";
722 break;
723 case 37:
724 - name = "Zaghwan";
725 - break;
726 - case 38:
727 - name = "Ariana";
728 - break;
729 - case 39:
730 - name = "Manouba";
731 + name = "Zaghouan";
732 break;
733 }
734 }
735 @@ -13035,6 +13083,9 @@ const char * GeoIP_region_name_by_code(c
736 case 5:
737 name = "Cao Bang";
738 break;
739 + case 6:
740 + name = "Cuu Long";
741 + break;
742 case 7:
743 name = "Dac Lac";
744 break;
745 @@ -13053,6 +13104,9 @@ const char * GeoIP_region_name_by_code(c
746 case 14:
747 name = "Ha Nam Ninh";
748 break;
749 + case 15:
750 + name = "Ha Noi";
751 + break;
752 case 16:
753 name = "Ha Son Binh";
754 break;
755 @@ -13377,6 +13431,9 @@ const char * GeoIP_region_name_by_code(c
756 case 5:
757 name = "Shabwah";
758 break;
759 + case 6:
760 + name = "Al Ghaydah";
761 + break;
762 case 8:
763 name = "Al Hudaydah";
764 break;
765 Only in c/: LICENSE
766 Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/: LICENSE.txt
767 Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/: Makefile.in
768 Only in c/man: CVS
769 Only in c/man: geoiplookup.1
770 Only in c/man: geoiplookup6.1
771 Only in c/man: geoipupdate.1
772 Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/man: Makefile.in
773 Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/: missing
774 diff -urp --exclude=from=/home/mdomsch/excludes --minimal /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/README c/README
775 --- /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/README 2009-02-24 10:03:24.000000000 -0600
776 +++ c/README 2009-06-10 07:35:19.000000000 -0500
777 @@ -182,4 +182,27 @@ from XORG X-Server). It happens at least
778 If GEOIP_MMAP_CACHE doesn't work on a 64bit machine, try adding
779 the flag "MAP_32BIT" to the mmap call.
780
781 +If you get a "passing argument 3 of 'gethostbyname_r' from incompatible pointer type"
782 +error on AIX, download and/or untar a fresh copy of GeoIP. ( To avoid cached
783 +results from a previous ./configure run )
784 +
785 +cd ./GeoIP-1.4.6
786 +then edit the file ./configure
787 +
788 +and delete these two lines:
789 +
790 +#define HAVE_GETHOSTBYNAME_R 1
791 +
792 +#define GETHOSTBYNAME_R_RETURNS_INT 1
793 +
794 +then save the configure script
795 +
796 +and build it as usual
797 +
798 +./configure
799 +make
800 +sudo make install
801 +
802 +
803 +
804 To submit a patch, please contact support@maxmind.com
805 Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/: README.fedora
806 Only in c/: regioncode
807 Only in c/test: CVS
808 Only in c/test: fail_test.txt
809 Only in /home/mdomsch/cvs/fedora-extras/GeoIP/devel/GeoIP-1.4.6/test: Makefile.in
810 Only in c/test: proxy_test.txt
811 Only in c/: timezone

admin@fedoraproject.org
ViewVC Help
Powered by ViewVC 1.1.2