1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- /* Copyright (c) 2003-2004, Roger Dingledine
- * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
- * Copyright (c) 2007-2018, The Tor Project, Inc. */
- /* See LICENSE for licensing information */
- #ifndef TOR_COMPAT_H
- #define TOR_COMPAT_H
- #include "orconfig.h"
- #ifdef _WIN32
- #include <winsock2.h>
- #include <ws2tcpip.h>
- #ifndef SIO_IDEAL_SEND_BACKLOG_QUERY
- #define SIO_IDEAL_SEND_BACKLOG_QUERY 0x4004747b
- #endif
- #endif
- #include "lib/cc/torint.h"
- #include "lib/testsupport/testsupport.h"
- #ifdef HAVE_SYS_PARAM_H
- #include <sys/param.h>
- #endif
- #ifdef HAVE_SYS_TYPES_H
- #include <sys/types.h>
- #endif
- #ifdef HAVE_SYS_TIME_H
- #include <sys/time.h>
- #endif
- #ifdef HAVE_TIME_H
- #include <time.h>
- #endif
- #ifdef HAVE_STRING_H
- #include <string.h>
- #endif
- #include <stdarg.h>
- #ifdef HAVE_SYS_RESOURCE_H
- #include <sys/resource.h>
- #endif
- #ifdef HAVE_SYS_SOCKET_H
- #include <sys/socket.h>
- #endif
- #ifdef HAVE_NETINET_IN_H
- #include <netinet/in.h>
- #endif
- #ifdef HAVE_NETINET6_IN6_H
- #include <netinet6/in6.h>
- #endif
- #include "lib/cc/compat_compiler.h"
- #include "lib/arch/bytes.h"
- #include "lib/time/compat_time.h"
- #include "lib/string/compat_ctype.h"
- #include "lib/string/compat_string.h"
- #include "lib/string/printf.h"
- #include "lib/log/win32err.h"
- #include "lib/net/socket.h"
- #include "lib/net/ipv4.h"
- #include "lib/net/ipv6.h"
- #include "lib/net/resolve.h"
- #include "lib/fs/files.h"
- #include "lib/fs/mmap.h"
- #include "lib/fs/userdb.h"
- #include "lib/wallclock/timeval.h"
- #include "lib/intmath/cmp.h"
- #include <stdio.h>
- #include <errno.h>
- /* ===== Time compatibility */
- /* ===== File compatibility */
- /* ===== Net compatibility */
- /** Specified SOCKS5 status codes. */
- typedef enum {
- SOCKS5_SUCCEEDED = 0x00,
- SOCKS5_GENERAL_ERROR = 0x01,
- SOCKS5_NOT_ALLOWED = 0x02,
- SOCKS5_NET_UNREACHABLE = 0x03,
- SOCKS5_HOST_UNREACHABLE = 0x04,
- SOCKS5_CONNECTION_REFUSED = 0x05,
- SOCKS5_TTL_EXPIRED = 0x06,
- SOCKS5_COMMAND_NOT_SUPPORTED = 0x07,
- SOCKS5_ADDRESS_TYPE_NOT_SUPPORTED = 0x08,
- } socks5_reply_status_t;
- /* ===== OS compatibility */
- MOCK_DECL(const char *, get_uname, (void));
- ssize_t tor_getpass(const char *prompt, char *output, size_t buflen);
- /* This needs some of the declarations above so we include it here. */
- #include "lib/thread/threads.h"
- #endif /* !defined(TOR_COMPAT_H) */
|