1
我們使用GeoLiteCityv6來檢測我們產品中的ipv6地址。 但是,我們發現無法從數據庫中獲取州/地區/城市數據,而國家/地區數據可用。GeoLiteCityv6.dat中是否包含城市和地區數據?
E.g.當解析IP地址2a02:2b88:2:1 :: 419a:1時,我們得到的國家=捷克共和國,但地區是空的,城市也是空的。我們查了幾個IP地址,但沒有得到任何地區/城市信息。
我們正在使用C API開發和我們使用的API如下:
GeoIPRecord *gir = GeoIP_record_by_addr_v6(gi, ip);
char *state = (char *)GeoIP_region_name_by_code(gir->country_code, gir->region);
printf("DB: state is %s.\n", state); //return NULL
printf("DB: continent_code is %s.\n", gir->continent_code); //right
printf("DB: country name is %s.\n", gir->country_name); //right
printf("DB: country code is %s.\n", gir->country_code); //right
printf("DB: region is %s.\n", gir->region); //return NULL
printf("DB: city is %s.\n", gir->city); //return NULL
所以我的問題是,它的GeoLiteCityv6.dat沒有對區域/城市的相關數據,或者我們錯用了錯誤的API?
非常感謝!