20 const char *question,
char **answer,
28 question += strlen(
"ip-to-country/");
30 if (!strcmp(question,
"ipv4-available") ||
31 !strcmp(question,
"ipv6-available")) {
32 family = !strcmp(question,
"ipv4-available") ? AF_INET : AF_INET6;
39 if (family != AF_INET && family != AF_INET6) {
40 *errmsg =
"Invalid address family";
44 *errmsg =
"GeoIP data not loaded";
int tor_addr_parse(tor_addr_t *addr, const char *src)
Header file for connection.c.
Header file for control.c.
int geoip_is_loaded(sa_family_t family)
int geoip_get_country_by_addr(const tor_addr_t *addr)
const char * geoip_get_country_name(country_t num)
int getinfo_helper_geoip(control_connection_t *control_conn, const char *question, char **answer, const char **errmsg)
Header for getinfo_geoip.c.
Master header file for Tor-specific functionality.
int tor_asprintf(char **strp, const char *fmt,...)
int strcmpstart(const char *s1, const char *s2)