diff options
Diffstat (limited to 'tests/server/sockfilt.c')
-rw-r--r-- | tests/server/sockfilt.c | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c index 0a1b21b46..a4ddd225a 100644 --- a/tests/server/sockfilt.c +++ b/tests/server/sockfilt.c @@ -83,33 +83,6 @@ #include "inet_pton.h" #include "util.h" -#ifndef FALSE -#define FALSE 0 -#endif -#ifndef TRUE -#define TRUE 1 -#endif - -#if defined(WIN32) && !defined(__CYGWIN__) -#include <windows.h> -#include <winsock2.h> -#include <process.h> - -#define sleep(sec) Sleep ((sec)*1000) - -#define EINPROGRESS WSAEINPROGRESS -#define EWOULDBLOCK WSAEWOULDBLOCK -#define EISCONN WSAEISCONN -#define ENOTSOCK WSAENOTSOCK -#define ECONNREFUSED WSAECONNREFUSED - -static void win32_cleanup(void); - -#if defined(ENABLE_IPV6) && defined(__MINGW32__) -const struct in6_addr in6addr_any = {{ IN6ADDR_ANY_INIT }}; -#endif -#endif - /* include memdebug.h last */ #include "memdebug.h" @@ -157,55 +130,6 @@ static void sigpipe_handler(int sig) } #endif -#if defined(WIN32) && !defined(__CYGWIN__) -#undef perror -#define perror(m) win32_perror(m) - -static void win32_perror(const char *msg) -{ - char buf[256]; - DWORD err = WSAGetLastError(); - - if (!FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, - LANG_NEUTRAL, buf, sizeof(buf), NULL)) - snprintf(buf, sizeof(buf), "Unknown error %lu (%#lx)", err, err); - if (msg) - fprintf(stderr, "%s: ", msg); - fprintf(stderr, "%s\n", buf); -} -#endif - -#if defined(WIN32) && !defined(__CYGWIN__) -static void win32_init(void) -{ - WORD wVersionRequested; - WSADATA wsaData; - int err; - wVersionRequested = MAKEWORD(2, 0); - - err = WSAStartup(wVersionRequested, &wsaData); - - if (err != 0) { - perror("Winsock init failed"); - logmsg("Error initialising winsock -- aborting\n"); - exit(1); - } - - if ( LOBYTE( wsaData.wVersion ) != 2 || - HIBYTE( wsaData.wVersion ) != 0 ) { - - WSACleanup(); - perror("Winsock init failed"); - logmsg("No suitable winsock.dll found -- aborting\n"); - exit(1); - } -} -static void win32_cleanup(void) -{ - WSACleanup(); -} -#endif - char use_ipv6=FALSE; unsigned short port = DEFAULT_PORT; unsigned short connectport = 0; /* if non-zero, we activate this mode */ |