コード例 #1
0
ファイル: GeoIPCity.c プロジェクト: Asinox/sinatra-geoip
int GeoIP_next_record (GeoIP* gi, GeoIPRecord **gir, int *record_iter) {
	if (gi->cache != NULL) {
		printf("GeoIP_next_record not supported in memory cache mode\n");
		return 1;
	}
	*gir = _extract_record(gi, *record_iter, record_iter);
	return 0;
}
コード例 #2
0
ファイル: GeoIPCity.c プロジェクト: DarkSpiritNET/NeoStats
GeoIPRecord * _get_record(GeoIP* gi, unsigned long ipnum) {
	unsigned int seek_record;

	if (gi->databaseType != GEOIP_CITY_EDITION_REV0 &&
			gi->databaseType != GEOIP_CITY_EDITION_REV1) {
		printf("Invalid database type %s, expected %s\n", GeoIPDBDescription[(int)gi->databaseType], GeoIPDBDescription[GEOIP_CITY_EDITION_REV1]);
		return 0;
	}

	seek_record = _seek_record(gi, ipnum);
	return _extract_record(gi, seek_record, NULL);
}
コード例 #3
0
ファイル: GeoIPCity.c プロジェクト: silv3rm00n/Turbotrace
static
GeoIPRecord    *
_get_record_v6(GeoIP * gi, geoipv6_t ipnum)
{
  unsigned int    seek_record;
  if (gi->databaseType != GEOIP_CITY_EDITION_REV0_V6 &&
      gi->databaseType != GEOIP_CITY_EDITION_REV1_V6) {
    printf("Invalid database type %s, expected %s\n", GeoIPDBDescription[(int) gi->databaseType], GeoIPDBDescription[GEOIP_CITY_EDITION_REV1_V6]);
    return 0;
  }

  seek_record = _GeoIP_seek_record_v6(gi, ipnum);
  return _extract_record(gi, seek_record, NULL);
}