summaryrefslogtreecommitdiff
path: root/geoip.c
diff options
context:
space:
mode:
Diffstat (limited to 'geoip.c')
-rw-r--r--geoip.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/geoip.c b/geoip.c
index 8d879a6..b1ddeeb 100644
--- a/geoip.c
+++ b/geoip.c
@@ -256,86 +256,86 @@ again:
return 0;
}
-static GeoIPRecord *geoip4_get_record(struct sockaddr_in sa)
+static GeoIPRecord *geoip4_get_record(struct sockaddr_in *sa)
{
bug_on(gi4_city == NULL);
- return GeoIP_record_by_ipnum(gi4_city, ntohl(sa.sin_addr.s_addr)) ? : ∅
+ return GeoIP_record_by_ipnum(gi4_city, ntohl(sa->sin_addr.s_addr)) ? : ∅
}
-static GeoIPRecord *geoip6_get_record(struct sockaddr_in6 sa)
+static GeoIPRecord *geoip6_get_record(struct sockaddr_in6 *sa)
{
bug_on(gi6_city == NULL);
- return GeoIP_record_by_ipnum_v6(gi6_city, sa.sin6_addr) ? : ∅
+ return GeoIP_record_by_ipnum_v6(gi6_city, sa->sin6_addr) ? : ∅
}
-const char *geoip4_as_name(struct sockaddr_in sa)
+const char *geoip4_as_name(struct sockaddr_in *sa)
{
bug_on(gi4_asname == NULL);
- return GeoIP_name_by_ipnum(gi4_asname, ntohl(sa.sin_addr.s_addr));
+ return GeoIP_name_by_ipnum(gi4_asname, ntohl(sa->sin_addr.s_addr));
}
-const char *geoip6_as_name(struct sockaddr_in6 sa)
+const char *geoip6_as_name(struct sockaddr_in6 *sa)
{
bug_on(gi6_asname == NULL);
- return GeoIP_name_by_ipnum_v6(gi6_asname, sa.sin6_addr);
+ return GeoIP_name_by_ipnum_v6(gi6_asname, sa->sin6_addr);
}
-float geoip4_longitude(struct sockaddr_in sa)
+float geoip4_longitude(struct sockaddr_in *sa)
{
return geoip4_get_record(sa)->longitude;
}
-float geoip4_latitude(struct sockaddr_in sa)
+float geoip4_latitude(struct sockaddr_in *sa)
{
return geoip4_get_record(sa)->latitude;
}
-float geoip6_longitude(struct sockaddr_in6 sa)
+float geoip6_longitude(struct sockaddr_in6 *sa)
{
return geoip6_get_record(sa)->longitude;
}
-float geoip6_latitude(struct sockaddr_in6 sa)
+float geoip6_latitude(struct sockaddr_in6 *sa)
{
return geoip6_get_record(sa)->latitude;
}
-const char *geoip4_city_name(struct sockaddr_in sa)
+const char *geoip4_city_name(struct sockaddr_in *sa)
{
return geoip4_get_record(sa)->city;
}
-const char *geoip6_city_name(struct sockaddr_in6 sa)
+const char *geoip6_city_name(struct sockaddr_in6 *sa)
{
return geoip6_get_record(sa)->city;
}
-const char *geoip4_region_name(struct sockaddr_in sa)
+const char *geoip4_region_name(struct sockaddr_in *sa)
{
return geoip4_get_record(sa)->region;
}
-const char *geoip6_region_name(struct sockaddr_in6 sa)
+const char *geoip6_region_name(struct sockaddr_in6 *sa)
{
return geoip6_get_record(sa)->region;
}
-const char *geoip4_country_name(struct sockaddr_in sa)
+const char *geoip4_country_name(struct sockaddr_in *sa)
{
bug_on(gi4_country == NULL);
- return GeoIP_country_name_by_ipnum(gi4_country, ntohl(sa.sin_addr.s_addr));
+ return GeoIP_country_name_by_ipnum(gi4_country, ntohl(sa->sin_addr.s_addr));
}
-const char *geoip6_country_name(struct sockaddr_in6 sa)
+const char *geoip6_country_name(struct sockaddr_in6 *sa)
{
bug_on(gi6_country == NULL);
- return GeoIP_country_name_by_ipnum_v6(gi6_country, sa.sin6_addr);
+ return GeoIP_country_name_by_ipnum_v6(gi6_country, sa->sin6_addr);
}
static int fdout, fderr;