From d0f5ad34ae2cb88e921cf6f6d829d611b5ea2152 Mon Sep 17 00:00:00 2001 From: "Coren[m]" Date: Wed, 11 Sep 2013 16:57:26 +0200 Subject: cleanup TravisCI warnings (missing exports/extraneous args to printf) --- toxcore/network.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'toxcore/network.h') diff --git a/toxcore/network.h b/toxcore/network.h index e804379d..aa0c4661 100644 --- a/toxcore/network.h +++ b/toxcore/network.h @@ -136,6 +136,14 @@ typedef IP4_Port IP_Port; */ const char *ip_ntoa(IP *ip); +/* ip_equal + * compares two IPAny structures + * unset means unequal + * + * returns 0 when not equal or when uninitialized + */ +int ip_equal(IP *a, IP *b); + /* ipport_equal * compares two IPAny_Port structures * unset means unequal @@ -157,6 +165,24 @@ void ip_copy(IP *target, IP *source); /* copies an ip_port structure */ void ipport_copy(IP_Port *target, IP_Port *source); +/* + * addr_resolve(): + * uses getaddrinfo to resolve an address into an IP address + * uses the first IPv4/IPv6 addresses returned by getaddrinfo + * + * input + * address: a hostname (or something parseable to an IP address) + * ip: ip.family MUST be initialized, either set to a specific IP version + * (AF_INET/AF_INET6) or to the unspecified AF_UNSPEC (= 0), if both + * IP versions are acceptable + * + * returns in ip a valid IPAny (v4/v6), + * prefers v6 if ip.family was AF_UNSPEC and both available + * returns 0 on failure + */ + +int addr_resolve(const char *address, IP *to); + /* * addr_resolve_or_parse_ip * resolves string into an IP address -- cgit v1.2.3