aboutsummaryrefslogtreecommitdiff
path: root/src/common/compat.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-05-29 17:31:13 +0000
committerNick Mathewson <nickm@torproject.org>2007-05-29 17:31:13 +0000
commitf89a3b14488ddfa5f7c11cb76fc73471835c00cf (patch)
tree8b7bfaf46afbbd0819ef5fcf850de7b6b0f4b015 /src/common/compat.c
parent69c712f1899d3e42fd563136e78af4cb62472b56 (diff)
downloadtor-f89a3b14488ddfa5f7c11cb76fc73471835c00cf.tar
tor-f89a3b14488ddfa5f7c11cb76fc73471835c00cf.tar.gz
r13050@catbus: nickm | 2007-05-29 13:31:11 -0400
Resolve all but 3 DOCDOCs. svn:r10393
Diffstat (limited to 'src/common/compat.c')
-rw-r--r--src/common/compat.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/common/compat.c b/src/common/compat.c
index 852cfffae..ed06701ab 100644
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@ -807,7 +807,14 @@ tor_inet_aton(const char *c, struct in_addr* addr)
#endif
}
-/** DOCDOC */
+/** Given <b>af</b>==AF_INET and <b>src</b> a struct in_addr, or
+ * <b>af</b>==AF_INET6 and <b>src</b> a struct in6_addr, try to format the
+ * address and store it in the <b>len</b>-byte buffer <b>dst</b>. Returns
+ * <b>dst</b> on success, NULL on failure.
+ *
+ * (Like inet_ntop(af,src,dst,len), but works on platforms that don't have it:
+ * Tor sometimes needs to format ipv6 addresses even on platforms without ipv6
+ * support.) */
const char *
tor_inet_ntop(int af, const void *src, char *dst, size_t len)
{
@@ -881,7 +888,15 @@ tor_inet_ntop(int af, const void *src, char *dst, size_t len)
#endif
}
-/** DOCDOC */
+/** Given <b>af</b>==AF_INET or <b>af</b>==AF_INET6, and a string <b>src</b>
+ * encoding an IPv4 address or IPv6 address correspondingly, try to parse the
+ * address and store the result in <b>dst</b> (which must have space for a
+ * struct in_addr or a struct in6_addr, as appropriate). Return 1 on success,
+ * 0 on a bad parse, and -1 on a bad <b>af</b>.
+ *
+ * (Like inet_pton(af,src,dst) but works on platforms that don't have it: Tor
+ * sometimes needs to format ipv6 addresses even on platforms without ipv6
+ * support.) */
int
tor_inet_pton(int af, const char *src, void *dst)
{