4 * Copyright 2016, Dario Lombardo
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * SPDX-License-Identifier: GPL-2.0-or-later
15 #include <wireshark.h>
17 #if defined(_WIN32) && !defined(__CYGWIN__)
23 #define socket_handle_t SOCKET
27 * UN*X, or Windows pretending to be UN*X with the aid of Cygwin.
35 #ifdef HAVE_SYS_SOCKET_H
36 #include <sys/socket.h>
39 #define closesocket(socket) close(socket)
40 #define socket_handle_t int
41 #ifndef INVALID_SOCKET
42 #define INVALID_SOCKET (-1)
44 #define SOCKET_ERROR (-1)
47 #ifdef HAVE_ARPA_INET_H
48 #include <arpa/inet.h>
51 #ifdef HAVE_NETINET_IN_H
52 #include <netinet/in.h>
62 * Returns NULL on success, a g_malloc()ed error message on failure.
64 WS_DLL_PUBLIC
char *ws_init_sockets(void);
69 WS_DLL_PUBLIC
void ws_cleanup_sockets(void);
72 * Convert the strings ipv4_address:port or [ipv6_address]:port to a
73 * sockaddr object. Ports are optional. Receives default port
77 ws_socket_ptoa(struct sockaddr_storage
*dst
, const char *src
,
84 #endif /* __SOCKET_H__ */
87 * Editor modelines - https://www.wireshark.org/tools/modelines.html
95 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
96 * :indentSize=8:tabSize=8:noTabs=false: