Geoip: Add geoip_city() native.

This commit is contained in:
Arkshine
2014-07-30 16:02:32 +02:00
parent 0d59209e4c
commit 95bc1703a6
2 changed files with 37 additions and 0 deletions

View File

@ -80,3 +80,21 @@ native geoip_code3(const ip[], result[4]);
* @param len The maximum length of the result buffer.
*/
native geoip_country(const ip[], result[], len=45);
/**
* The following natives require GeoIP City database, which can be retrieved from:
* http://dev.maxmind.com/geoip/geoip2/geolite2/ (MaxMind DB binary)
*/
/**
* Look up the full city name for the given IP address.
*
* @param ip The IP address to look up.
* @param result The result of the geoip look up.
* @param len The maximum length of the result buffer.
*
* @return The result length on successful lookup, 0 otherwise.
*/
native geoip_city(const ip[], result[], len);