newlib-cygwin/winsup/w32api/include/mswsock.h

114 lines
2.9 KiB
C
Raw Normal View History

* include/mswsock.h: New file. * include/ws2tcpip.h: New file. * include/winsock.h (IPPROTO_IGMP): New define. (IPPROTO_GGP): Correct value. (SO_* macros): Remove mswsock defines. (TCP_BSDURGENT): Likewise. (IP_* macros): Add comment warning of WinSock2 incompatibility (WSARecvEx): Remove mswsock prototype. (TransmitFile): Likewise. (AcceptEx): Likewise. (GetAcceptExSockaddrs): Likewise. (struct _TRANSMIT_FILE_BUFFERS): Remove mswsock definition. (#include <mswsock.h>): Add directive and explanatory comment * include/winsock2.h (header guard): add guard for _WINSOCK_H (_WINSOCK_H): Define to prevent later inclusion of winsock.h (#include <winsock.h>): Replace directive with winsock.h file content The following changes apply to the merged file: (FD_SET): Keep winsock2.h definition, delete winsock.h definition (SOMAXCONN): Likewise (#include <nspapi.h>): Move - don't include until LPSOCKADDR defined (IP_* macros): Delete WinSock1 definitions (WinSock2 definitions now in ws2tcpip.h) (struct ip_mreq): Delete (now defined in ws2tcpip.h for WinSock2) (FD_*_BIT and FD_* defines): Place together and extend to FD_MAX_EVENTS 10 (AF* defines): Extend to AF_MAX 10 (WSAIsBlocking): #if 0 out prototype (N/A in WinSock2) (WSAUnhookBlockingHook): Likewise. (WSASetBlockingHook): Likewise. (WSACancelBlockingCall): Likewise. (WSAEINPROGRESS): Comment as not raised in WinSock2. (#include <mswsock.h>): Delete directive inherited from winsock.h (WSA_QOS* defines): Add QualityOfService error codes. (SIO_* defines): Add new macros * include/ipexport.h (IP_STATUS flags): Add definitions. (IP_FLAG_DF): Likewise. (IP_OPT_* ): Likewise. (struct ip_option_information): Likewise. (struct icmp_echo_reply): Likewise.
2001-02-22 04:40:47 +08:00
/*
* mswsock.h
* MS-specific extensions to Windows Sockets, exported from mswsock.dll.
* include/mswsock.h: New file. * include/ws2tcpip.h: New file. * include/winsock.h (IPPROTO_IGMP): New define. (IPPROTO_GGP): Correct value. (SO_* macros): Remove mswsock defines. (TCP_BSDURGENT): Likewise. (IP_* macros): Add comment warning of WinSock2 incompatibility (WSARecvEx): Remove mswsock prototype. (TransmitFile): Likewise. (AcceptEx): Likewise. (GetAcceptExSockaddrs): Likewise. (struct _TRANSMIT_FILE_BUFFERS): Remove mswsock definition. (#include <mswsock.h>): Add directive and explanatory comment * include/winsock2.h (header guard): add guard for _WINSOCK_H (_WINSOCK_H): Define to prevent later inclusion of winsock.h (#include <winsock.h>): Replace directive with winsock.h file content The following changes apply to the merged file: (FD_SET): Keep winsock2.h definition, delete winsock.h definition (SOMAXCONN): Likewise (#include <nspapi.h>): Move - don't include until LPSOCKADDR defined (IP_* macros): Delete WinSock1 definitions (WinSock2 definitions now in ws2tcpip.h) (struct ip_mreq): Delete (now defined in ws2tcpip.h for WinSock2) (FD_*_BIT and FD_* defines): Place together and extend to FD_MAX_EVENTS 10 (AF* defines): Extend to AF_MAX 10 (WSAIsBlocking): #if 0 out prototype (N/A in WinSock2) (WSAUnhookBlockingHook): Likewise. (WSASetBlockingHook): Likewise. (WSACancelBlockingCall): Likewise. (WSAEINPROGRESS): Comment as not raised in WinSock2. (#include <mswsock.h>): Delete directive inherited from winsock.h (WSA_QOS* defines): Add QualityOfService error codes. (SIO_* defines): Add new macros * include/ipexport.h (IP_STATUS flags): Add definitions. (IP_FLAG_DF): Likewise. (IP_OPT_* ): Likewise. (struct ip_option_information): Likewise. (struct icmp_echo_reply): Likewise.
2001-02-22 04:40:47 +08:00
* These functions are N/A on Windows9x.
*
* This file is part of a free library for the Win32 API.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
#ifndef _MSWSOCK_H
#define _MSWSOCK_H
* include/accctrl.h, aclapi.h, basetsd.h, basetyps.h, cderr.h, cguid.h, commctrl.h, commdlg.h, cpl.h, cplext.h, custcntl.h, dbt.h, dde.h, ddeml.h, dlgs.h, excpt.h, httpext.h, imagehlp.h, imm.h, initguid.h, intshcut.h, ipexport.h, iphlpapi.h, ipifcons.h, iprtrmib.h, iptypes.h, isguids.h, largeint.h, lm.h, lmaccess.h, lmalert.h, lmapibuf.h, lmat.h, lmaudit.h, lmbrowsr.h, lmchdev.h, lmconfig.h, lmcons.h, lmerr.h, lmerrlog.h, lmmsg.h, lmremutl.h, lmrepl.h, lmserver.h, lmshare.h, lmsname.h, lmstats.h, lmsvc.h, lmuse.h, lmuseflg.h, lmwksta.h, lzexpand.h, mapi.h, mciavi.h, mcx.h, mmsystem.h, mswsock.h, nb30.h, nddeapi.h, nspapi.h, ntdef.h, ntsecapi.h, ntsecpkg.h, oaidl.h, objbase.h, objfwd.h, objidl.h, odbcinst.h, ole.h, ole2.h, ole2ver.h, oleauto.h, olectl.h, olectlid.h, oledlg.h, oleidl.h, pbt.h, prsht.h, psapi.h, rapi.h, ras.h, raserror.h, rassapi.h, regstr.h, richedit.h, richole.h, rpc.h, rpcdce.h, rpcdce2.h, rpcdcep.h, rpcndr.h, rpcnsi.h, rpcnsip.h, rpcnterr.h, rpcproxy.h, schannel.h, schnlsp.h, scrnsave.h, security.h, setupapi.h, shellapi.h, shlguid.h, shlobj.h, sql.h, sqlext.h, sqltypes.h, sqlucode.h, sspi.h, subauth.h, tlhelp32.h, unknwn.h, userenv.h, w32api.h, winbase.h, wincon.h, wincrypt.h, windef.h, windows.h, windowsx.h, winerror.h, wingdi.h, wininet.h, winioctl.h, winnetwk.h, winnls.h, winnt.h, winperf.h, winreg.h, winresrc.h, winsock.h, winsock2.h, winspool.h, winsvc.h, winuser.h, winver.h, ws2tcpip.h, wsnetbs.h, wtypes.h, zmouse.h: Add #pragma GCC system_header if __GNUC__ >= 3. * include/mapi.h: Change header guard name to _MAPI_H for consistency.
2002-03-09 17:04:10 +08:00
#if __GNUC__ >=3
#pragma GCC system_header
#endif
* include/mswsock.h: New file. * include/ws2tcpip.h: New file. * include/winsock.h (IPPROTO_IGMP): New define. (IPPROTO_GGP): Correct value. (SO_* macros): Remove mswsock defines. (TCP_BSDURGENT): Likewise. (IP_* macros): Add comment warning of WinSock2 incompatibility (WSARecvEx): Remove mswsock prototype. (TransmitFile): Likewise. (AcceptEx): Likewise. (GetAcceptExSockaddrs): Likewise. (struct _TRANSMIT_FILE_BUFFERS): Remove mswsock definition. (#include <mswsock.h>): Add directive and explanatory comment * include/winsock2.h (header guard): add guard for _WINSOCK_H (_WINSOCK_H): Define to prevent later inclusion of winsock.h (#include <winsock.h>): Replace directive with winsock.h file content The following changes apply to the merged file: (FD_SET): Keep winsock2.h definition, delete winsock.h definition (SOMAXCONN): Likewise (#include <nspapi.h>): Move - don't include until LPSOCKADDR defined (IP_* macros): Delete WinSock1 definitions (WinSock2 definitions now in ws2tcpip.h) (struct ip_mreq): Delete (now defined in ws2tcpip.h for WinSock2) (FD_*_BIT and FD_* defines): Place together and extend to FD_MAX_EVENTS 10 (AF* defines): Extend to AF_MAX 10 (WSAIsBlocking): #if 0 out prototype (N/A in WinSock2) (WSAUnhookBlockingHook): Likewise. (WSASetBlockingHook): Likewise. (WSACancelBlockingCall): Likewise. (WSAEINPROGRESS): Comment as not raised in WinSock2. (#include <mswsock.h>): Delete directive inherited from winsock.h (WSA_QOS* defines): Add QualityOfService error codes. (SIO_* defines): Add new macros * include/ipexport.h (IP_STATUS flags): Add definitions. (IP_FLAG_DF): Likewise. (IP_OPT_* ): Likewise. (struct ip_option_information): Likewise. (struct icmp_echo_reply): Likewise.
2001-02-22 04:40:47 +08:00
#ifdef __cplusplus
extern "C" {
#endif
#define SO_CONNDATA 0x7000
#define SO_CONNOPT 0x7001
#define SO_DISCDATA 0x7002
#define SO_DISCOPT 0x7003
#define SO_CONNDATALEN 0x7004
#define SO_CONNOPTLEN 0x7005
#define SO_DISCDATALEN 0x7006
#define SO_DISCOPTLEN 0x7007
#define SO_OPENTYPE 0x7008
#define SO_SYNCHRONOUS_ALERT 0x10
#define SO_SYNCHRONOUS_NONALERT 0x20
#define SO_MAXDG 0x7009
#define SO_MAXPATHDG 0x700A
#define SO_UPDATE_ACCEPT_CONTEXT 0x700B
#define SO_CONNECT_TIME 0x700C
#define TCP_BSDURGENT 0x7000
#define TF_DISCONNECT 1
#define TF_REUSE_SOCKET 2
#define TF_WRITE_BEHIND 4
#define TF_USE_DEFAULT_WORKER 0
#define TF_USE_SYSTEM_THREAD 16
#define TF_USE_KERNEL_APC 32
typedef struct _TRANSMIT_FILE_BUFFERS {
PVOID Head;
DWORD HeadLength;
PVOID Tail;
DWORD TailLength;
} TRANSMIT_FILE_BUFFERS, *PTRANSMIT_FILE_BUFFERS, *LPTRANSMIT_FILE_BUFFERS;
int PASCAL WSARecvEx(SOCKET,char*,int,int*);
BOOL PASCAL TransmitFile(SOCKET,HANDLE,DWORD,DWORD,LPOVERLAPPED,LPTRANSMIT_FILE_BUFFERS,DWORD);
BOOL PASCAL AcceptEx(SOCKET,SOCKET,PVOID,DWORD,DWORD,DWORD,LPDWORD,LPOVERLAPPED);
VOID PASCAL GetAcceptExSockaddrs(PVOID,DWORD,DWORD,DWORD,struct sockaddr**, LPINT, struct sockaddr**, LPINT);
#ifdef WINSOCK2_H /* These require the winsock2 interface. */
#define TP_ELEMENT_FILE 1
#define TP_ELEMENT_MEMORY 2
#define TP_ELEMENT_EOP 4
typedef struct _TRANSMIT_PACKETS_ELEMENT {
ULONG dwElFlags;
ULONG cLength;
_ANONYMOUS_UNION
union {
struct {
LARGE_INTEGER nFileOffset;
HANDLE hFile;
};
PVOID pBuffer;
};
} TRANSMIT_PACKETS_ELEMENT;
typedef struct _WSAMSG {
LPSOCKADDR name;
INT namelen;
LPWSABUF lpBuffers;
DWORD dwBufferCount;
WSABUF Control;
DWORD dwFlags;
} WSAMSG, *PWSAMSG, *LPWSAMSG;
/* According to MSDN docs, the WSAMSG.Control buffer starts with a
cmsghdr header of the following form. See also RFC 2292. */
typedef struct wsacmsghdr {
UINT cmsg_len;
INT cmsg_level;
INT cmsg_type;
/* followed by UCHAR cmsg_data[]; */
} WSACMSGHDR;
/* TODO: Standard Posix.1g macros as per RFC 2292, with WSA_uglification. */
#if 0
#define WSA_CMSG_FIRSTHDR(mhdr)
#define WSA_CMSG_NXTHDR(mhdr, cmsg)
#define WSA_CMSG_SPACE(length)
#define WSA_CMSG_LEN(length)
#endif
BOOL PASCAL DisconnectEx(SOCKET,LPOVERLAPPED,DWORD,DWORD);
int PASCAL WSARecvMsg(SOCKET,LPWSAMSG,LPDWORD,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
* include/mswsock.h: New file. * include/ws2tcpip.h: New file. * include/winsock.h (IPPROTO_IGMP): New define. (IPPROTO_GGP): Correct value. (SO_* macros): Remove mswsock defines. (TCP_BSDURGENT): Likewise. (IP_* macros): Add comment warning of WinSock2 incompatibility (WSARecvEx): Remove mswsock prototype. (TransmitFile): Likewise. (AcceptEx): Likewise. (GetAcceptExSockaddrs): Likewise. (struct _TRANSMIT_FILE_BUFFERS): Remove mswsock definition. (#include <mswsock.h>): Add directive and explanatory comment * include/winsock2.h (header guard): add guard for _WINSOCK_H (_WINSOCK_H): Define to prevent later inclusion of winsock.h (#include <winsock.h>): Replace directive with winsock.h file content The following changes apply to the merged file: (FD_SET): Keep winsock2.h definition, delete winsock.h definition (SOMAXCONN): Likewise (#include <nspapi.h>): Move - don't include until LPSOCKADDR defined (IP_* macros): Delete WinSock1 definitions (WinSock2 definitions now in ws2tcpip.h) (struct ip_mreq): Delete (now defined in ws2tcpip.h for WinSock2) (FD_*_BIT and FD_* defines): Place together and extend to FD_MAX_EVENTS 10 (AF* defines): Extend to AF_MAX 10 (WSAIsBlocking): #if 0 out prototype (N/A in WinSock2) (WSAUnhookBlockingHook): Likewise. (WSASetBlockingHook): Likewise. (WSACancelBlockingCall): Likewise. (WSAEINPROGRESS): Comment as not raised in WinSock2. (#include <mswsock.h>): Delete directive inherited from winsock.h (WSA_QOS* defines): Add QualityOfService error codes. (SIO_* defines): Add new macros * include/ipexport.h (IP_STATUS flags): Add definitions. (IP_FLAG_DF): Likewise. (IP_OPT_* ): Likewise. (struct ip_option_information): Likewise. (struct icmp_echo_reply): Likewise.
2001-02-22 04:40:47 +08:00
#endif /* WINSOCK2_H */
* include/mswsock.h: New file. * include/ws2tcpip.h: New file. * include/winsock.h (IPPROTO_IGMP): New define. (IPPROTO_GGP): Correct value. (SO_* macros): Remove mswsock defines. (TCP_BSDURGENT): Likewise. (IP_* macros): Add comment warning of WinSock2 incompatibility (WSARecvEx): Remove mswsock prototype. (TransmitFile): Likewise. (AcceptEx): Likewise. (GetAcceptExSockaddrs): Likewise. (struct _TRANSMIT_FILE_BUFFERS): Remove mswsock definition. (#include <mswsock.h>): Add directive and explanatory comment * include/winsock2.h (header guard): add guard for _WINSOCK_H (_WINSOCK_H): Define to prevent later inclusion of winsock.h (#include <winsock.h>): Replace directive with winsock.h file content The following changes apply to the merged file: (FD_SET): Keep winsock2.h definition, delete winsock.h definition (SOMAXCONN): Likewise (#include <nspapi.h>): Move - don't include until LPSOCKADDR defined (IP_* macros): Delete WinSock1 definitions (WinSock2 definitions now in ws2tcpip.h) (struct ip_mreq): Delete (now defined in ws2tcpip.h for WinSock2) (FD_*_BIT and FD_* defines): Place together and extend to FD_MAX_EVENTS 10 (AF* defines): Extend to AF_MAX 10 (WSAIsBlocking): #if 0 out prototype (N/A in WinSock2) (WSAUnhookBlockingHook): Likewise. (WSASetBlockingHook): Likewise. (WSACancelBlockingCall): Likewise. (WSAEINPROGRESS): Comment as not raised in WinSock2. (#include <mswsock.h>): Delete directive inherited from winsock.h (WSA_QOS* defines): Add QualityOfService error codes. (SIO_* defines): Add new macros * include/ipexport.h (IP_STATUS flags): Add definitions. (IP_FLAG_DF): Likewise. (IP_OPT_* ): Likewise. (struct ip_option_information): Likewise. (struct icmp_echo_reply): Likewise.
2001-02-22 04:40:47 +08:00
#ifdef __cplusplus
}
#endif
#endif /* _MSWSOCK_H */