maxmind / geoip-api-c

DEPRECATED GeoIP Legacy C API
Other
371 stars 129 forks source link

Migration: Need to iterate over all IPs #114

Closed yaitskov closed 3 years ago

yaitskov commented 3 years ago

Hi,

I am doing migration to GeoIP2 and need to make sure that ISO 3166 subdivisions maps correctly to FIPS regions. Existing csv file with mapping is far from perfect. E.g. It doesn't handle multilevel subdivisions (GB, IT, FR etc). So I wrote kind of ML code which matches old/new region for every IP. IPv4 address space is pretty big. So for each iteration is slow. It would be nice to have function list of all network submasks in the file.

oschwald commented 3 years ago

As mentioned in the README, this library is only receiving fixes for critical bugs and security issues.

That said, I think you can achieve what you want using GeoIP_last_netmask, which will return the prefix length of the network associated with the last lookup.

yaitskov commented 3 years ago

Maybe somebody need https://github.com/maxmind/geoip-api-c/pull/115