diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-05-25 18:22:37 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-05-25 18:22:37 +0000 |
commit | bb524e99c9dd9555b0f77275bbb5574d47689fc8 (patch) | |
tree | 699a0e8d7597094186ec21b0a3305b81506a2690 /src/common/compat.h | |
parent | 39fe91b9a281a3ec8504bf7933a63918038a9b5a (diff) | |
download | tor-bb524e99c9dd9555b0f77275bbb5574d47689fc8.tar.gz tor-bb524e99c9dd9555b0f77275bbb5574d47689fc8.zip |
r12955@catbus: nickm | 2007-05-25 13:17:30 -0400
First bare stubs of ipv6 work: commit some (untested, hence doublessly broken) implementations of inet_ntop/pton for systems that lack them.
svn:r10326
Diffstat (limited to 'src/common/compat.h')
-rw-r--r-- | src/common/compat.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/common/compat.h b/src/common/compat.h index cd36437407..be8e19eeea 100644 --- a/src/common/compat.h +++ b/src/common/compat.h @@ -32,6 +32,9 @@ #ifdef HAVE_STRING_H #include <string.h> #endif +#ifdef HAVE_CTYPE_H +#include <ctype.h> +#endif #include <stdarg.h> #ifndef NULL_REP_IS_ZERO_BYTES @@ -241,8 +244,17 @@ int get_n_open_sockets(void); typedef int socklen_t; #endif +#ifndef HAVE_STRUCT_IN6_ADDR +struct in6_addr +{ + uint8_t s6_addr[16]; +}; +#endif + struct in_addr; int tor_inet_aton(const char *cp, struct in_addr *addr) ATTR_NONNULL((1,2)); +const char *tor_inet_ntop(int af, const void *src, char *dst, size_t len); +int tor_inet_pton(int af, const char *src, void *dst); int tor_lookup_hostname(const char *name, uint32_t *addr) ATTR_NONNULL((1,2)); void set_socket_nonblocking(int socket); int tor_socketpair(int family, int type, int protocol, int fd[2]); |