aboutsummaryrefslogtreecommitdiff
path: root/src/vmod_geoip.vcc
diff options
context:
space:
mode:
Diffstat (limited to 'src/vmod_geoip.vcc')
-rw-r--r--src/vmod_geoip.vcc14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/vmod_geoip.vcc b/src/vmod_geoip.vcc
index ffe024e..d96dc09 100644
--- a/src/vmod_geoip.vcc
+++ b/src/vmod_geoip.vcc
@@ -17,7 +17,7 @@ Description
must exist. If the pathname refers to a directory, **/GeoLite2-City.mmdb**
will be appended to it.
-$Function STRING get(PRIV_VCL, STRING ip, STRING path)
+$Function STRING get(PRIV_VCL, IP ip, STRING path)
Description
Look up in the database a value described by **path** corresponding to the
@@ -44,30 +44,26 @@ Description
where *X.X.X.X* stands for IP address, *A.B.C* for lookup path, and
*N* for the data type in decimal.
-
- Note that the function takes as its argument the IP address in string
- representation. Care should be taken to ensure proper conversion when
- passing IP addresses, as shown in the example below.
Example
::
- set req.http.X-Country-Code = geoip.get("" + client.ip,
+ set req.http.X-Country-Code = geoip.get(client.ip,
"country.name.en");
-$Function STRING country_code(PRIV_VCL, STRING ip)
+$Function STRING country_code(PRIV_VCL, IP ip)
Description
Returns the ISO 3166-1 alpha-2 country code corresponding to the **ip**.
Equivalent to geoip.get(ip, "country.iso_code").
-$Function STRING country_name(PRIV_VCL, STRING ip)
+$Function STRING country_name(PRIV_VCL, IP ip)
Description
Returns the English name of the country corresponding to **ip**.
Equivalent to geoip.get(ip, "country.names.en"),
-$Function STRING city_name(PRIV_VCL, STRING ip)
+$Function STRING city_name(PRIV_VCL, IP ip)
Description
Returns the name of the city where **ip** is located.

Return to:

Send suggestions and report system problems to the System administrator.