2 * Copyright (C) 2021 Zebediah Figura for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef __WINE_WS2_32_PRIVATE_H
20 #define __WINE_WS2_32_PRIVATE_H
25 #include <sys/types.h>
30 #ifdef HAVE_SYS_IOCTL_H
31 # include <sys/ioctl.h>
33 #ifdef HAVE_SYS_FILIO_H
34 # include <sys/filio.h>
36 #ifdef HAVE_SYS_SOCKIO_H
37 # include <sys/sockio.h>
41 # include <sys/so_ioctl.h>
44 #ifdef HAVE_SYS_PARAM_H
45 # include <sys/param.h>
51 #ifdef HAVE_SYS_WAIT_H
52 # include <sys/wait.h>
57 #ifdef HAVE_SYS_SOCKET_H
58 #include <sys/socket.h>
60 #ifdef HAVE_NETINET_IN_H
61 # include <netinet/in.h>
63 #ifdef HAVE_NETINET_TCP_H
64 # include <netinet/tcp.h>
66 #ifdef HAVE_ARPA_INET_H
67 # include <arpa/inet.h>
79 #ifdef HAVE_ARPA_NAMESER_H
80 # include <arpa/nameser.h>
86 # define if_indextoname unix_if_indextoname
87 # define if_nametoindex unix_if_nametoindex
89 # undef if_indextoname
90 # undef if_nametoindex
96 #ifdef HAVE_NETIPX_IPX_H
97 # include <netipx/ipx.h>
98 #elif defined(HAVE_LINUX_IPX_H)
99 # ifdef HAVE_ASM_TYPES_H
100 # include <asm/types.h>
102 # ifdef HAVE_LINUX_TYPES_H
103 # include <linux/types.h>
105 # include <linux/ipx.h>
107 #if defined(SOL_IPX) || defined(SO_DEFAULT_HEADERS)
111 #ifdef HAVE_LINUX_IRDA_H
112 # ifdef HAVE_LINUX_TYPES_H
113 # include <linux/types.h>
115 # include <linux/irda.h>
122 #ifdef HAVE_SYS_POLL_H
123 # include <sys/poll.h>
125 #ifdef HAVE_SYS_TIME_H
126 # include <sys/time.h>
129 #define NONAMELESSUNION
130 #define NONAMELESSSTRUCT
131 #include "ntstatus.h"
132 #define WIN32_NO_STATUS
137 #include "winerror.h"
139 #include "winsock2.h"
141 #include "ws2tcpip.h"
144 #include "wsnwlink.h"
145 #include "wshisotp.h"
149 #define USE_WC_PREFIX /* For CMSG_DATA */
150 #include "iphlpapi.h"
151 #include "ip2string.h"
152 #include "wine/afd.h"
153 #include "wine/server.h"
154 #include "wine/debug.h"
155 #include "wine/exception.h"
156 #include "wine/unicode.h"
157 #include "wine/heap.h"
159 #define DECLARE_CRITICAL_SECTION(cs) \
160 static CRITICAL_SECTION cs; \
161 static CRITICAL_SECTION_DEBUG cs##_debug = \
162 { 0, 0, &cs, { &cs##_debug.ProcessLocksList, &cs##_debug.ProcessLocksList }, \
163 0, 0, { (DWORD_PTR)(__FILE__ ": " # cs) }}; \
164 static CRITICAL_SECTION cs = { &cs##_debug, -1, 0, 0, 0, 0 }
166 static const char magic_loopback_addr
[] = {127, 12, 34, 56};
168 const char *debugstr_sockaddr( const struct WS_sockaddr
*addr
) DECLSPEC_HIDDEN
;
170 struct per_thread_data
172 HANDLE sync_event
; /* event to wait on for synchronous ioctls */
174 struct WS_hostent
*he_buffer
;
175 struct WS_servent
*se_buffer
;
176 struct WS_protoent
*pe_buffer
;
180 char ntoa_buffer
[16]; /* 4*3 digits + 3 '.' + 1 '\0' */
183 extern int num_startup
;
185 struct per_thread_data
*get_per_thread_data(void) DECLSPEC_HIDDEN
;
189 int (CDECL
*getaddrinfo
)( const char *node
, const char *service
, const struct WS(addrinfo
) *hints
,
190 struct WS(addrinfo
) *info
, unsigned int *size
);
191 int (CDECL
*gethostbyaddr
)( const void *addr
, int len
, int family
,
192 struct WS(hostent
) *host
, unsigned int *size
);
193 int (CDECL
*gethostbyname
)( const char *name
, struct WS(hostent
) *host
, unsigned int *size
);
194 int (CDECL
*gethostname
)( char *name
, int len
);
195 int (CDECL
*getnameinfo
)( const struct WS(sockaddr
) *addr
, int addr_len
, char *host
,
196 DWORD host_len
, char *serv
, DWORD serv_len
, int flags
);
199 extern const struct unix_funcs
*unix_funcs
;