From 5fbcfd632a7446da946a8b1e27004a401b8d74f3 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 25 Jan 2017 22:20:07 -0800 Subject: Clean up some UN*X-vs-Windows socket issues. Have a wsutil/socket.h file, for inclusion by everything that uses sockets, that contains the UN*X-vs-Windows #includes and #defines to hide some UN*X-sockets vs. Winsock API differences. That stuff mostly comes from from extcap/extcap-base.h; have that file just include wsutil/socket.h rather than defining that stuff itself. Include it in sharkd_daemon.c. Use socklen_t for the size of things to pass to bind() as the last argument; wsutil/socket.h defines it as int on Windows. Ignore sharkd in Git. Change-Id: I3f2171b7aa613717f52305f62bfd7d43e0172dc6 Reviewed-on: https://code.wireshark.org/review/19796 Petri-Dish: Guy Harris Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris --- extcap/extcap-base.h | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) (limited to 'extcap') diff --git a/extcap/extcap-base.h b/extcap/extcap-base.h index 36348f8e66..e8fc229216 100644 --- a/extcap/extcap-base.h +++ b/extcap/extcap-base.h @@ -43,33 +43,7 @@ #include #endif -#if defined(_WIN32) && !defined(__CYGWIN__) - #ifdef HAVE_WINDOWS_H - #include - #endif - - #include - - #ifdef HAVE_WINSOCK2_H - #include - #endif - - #include - - #define socket_handle_t SOCKET -#else - /* - * UN*X, or Windows pretending to be UN*X with the aid of Cygwin. - */ - #define closesocket(socket) close(socket) - #define socket_handle_t int - #define INVALID_SOCKET (-1) - #define SOCKET_ERROR (-1) -#endif - -#ifdef HAVE_ARPA_INET_H - #include -#endif +#include #define EXTCAP_BASE_OPTIONS_ENUM \ EXTCAP_OPT_LIST_INTERFACES, \ -- cgit v1.2.1