mirror of
https://github.com/reactos/reactos.git
synced 2025-07-13 21:44:13 +00:00
[PSDK]
inaddr.h : Fix formatting. qos.h : Introduce pragma once along with several missing definitions. winsock(2).h : Introduce pragma once, apply consistent formatting, add so many missing definitions and remove several unrelated ones. svn path=/branches/header-work/; revision=46577
This commit is contained in:
parent
fd317aa03e
commit
f7e10df004
4 changed files with 3514 additions and 1566 deletions
|
@ -1,9 +1,9 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
#ifndef s_addr
|
#ifndef s_addr
|
||||||
|
|
||||||
typedef struct in_addr
|
typedef struct in_addr {
|
||||||
{
|
union {
|
||||||
union
|
|
||||||
{
|
|
||||||
struct {UCHAR s_b1,s_b2,s_b3,s_b4;} S_un_b;
|
struct {UCHAR s_b1,s_b2,s_b3,s_b4;} S_un_b;
|
||||||
struct {USHORT s_w1,s_w2;} S_un_w;
|
struct {USHORT s_w1,s_w2;} S_un_w;
|
||||||
ULONG S_addr;
|
ULONG S_addr;
|
||||||
|
@ -17,5 +17,5 @@ typedef struct in_addr
|
||||||
#define s_impno S_un.S_un_b.s_b4
|
#define s_impno S_un.S_un_b.s_b4
|
||||||
#define s_lh S_un.S_un_b.s_b3
|
#define s_lh S_un.S_un_b.s_b3
|
||||||
|
|
||||||
#endif
|
#endif /* s_addr */
|
||||||
|
|
||||||
|
|
|
@ -1,26 +1,4 @@
|
||||||
/*
|
#pragma once
|
||||||
* qos.h
|
|
||||||
*
|
|
||||||
* Structures and definitions for QoS data types.
|
|
||||||
*
|
|
||||||
* This file is part of the w32api package.
|
|
||||||
*
|
|
||||||
* Contributors:
|
|
||||||
* Created by Alex Ionescu <alex@relsoft.net>
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
|
||||||
*
|
|
||||||
* This source code is offered for use in the public domain. You may
|
|
||||||
* use, modify or distribute it freely.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful but
|
|
||||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
|
||||||
* DISCLAIMED. This includes but is not limited to warranties of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef __QOS_H
|
|
||||||
#define __QOS_H
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -28,8 +6,43 @@ extern "C" {
|
||||||
|
|
||||||
typedef ULONG SERVICETYPE;
|
typedef ULONG SERVICETYPE;
|
||||||
|
|
||||||
typedef struct _flowspec
|
#define SERVICETYPE_NOTRAFFIC 0x00000000
|
||||||
{
|
#define SERVICETYPE_BESTEFFORT 0x00000001
|
||||||
|
#define SERVICETYPE_CONTROLLEDLOAD 0x00000002
|
||||||
|
#define SERVICETYPE_GUARANTEED 0x00000003
|
||||||
|
#define SERVICETYPE_NETWORK_UNAVAILABLE 0x00000004
|
||||||
|
#define SERVICETYPE_GENERAL_INFORMATION 0x00000005
|
||||||
|
#define SERVICETYPE_NOCHANGE 0x00000006
|
||||||
|
#define SERVICETYPE_NONCONFORMING 0x00000009
|
||||||
|
#define SERVICETYPE_NETWORK_CONTROL 0x0000000A
|
||||||
|
#define SERVICETYPE_QUALITATIVE 0x0000000D
|
||||||
|
|
||||||
|
#define SERVICE_BESTEFFORT 0x80010000
|
||||||
|
#define SERVICE_CONTROLLEDLOAD 0x80020000
|
||||||
|
#define SERVICE_GUARANTEED 0x80040000
|
||||||
|
#define SERVICE_QUALITATIVE 0x80200000
|
||||||
|
|
||||||
|
#define SERVICE_NO_TRAFFIC_CONTROL 0x81000000
|
||||||
|
|
||||||
|
#define SERVICE_NO_QOS_SIGNALING 0x40000000
|
||||||
|
|
||||||
|
#define QOS_NOT_SPECIFIED 0xFFFFFFFF
|
||||||
|
|
||||||
|
#define POSITIVE_INFINITY_RATE 0xFFFFFFFE
|
||||||
|
|
||||||
|
#define QOS_GENERAL_ID_BASE 2000
|
||||||
|
|
||||||
|
#define QOS_OBJECT_END_OF_LIST (0x00000001 + QOS_GENERAL_ID_BASE)
|
||||||
|
#define QOS_OBJECT_SD_MODE (0x00000002 + QOS_GENERAL_ID_BASE)
|
||||||
|
#define QOS_OBJECT_SHAPING_RATE (0x00000003 + QOS_GENERAL_ID_BASE)
|
||||||
|
#define QOS_OBJECT_DESTADDR (0x00000004 + QOS_GENERAL_ID_BASE)
|
||||||
|
|
||||||
|
#define TC_NONCONF_BORROW 0
|
||||||
|
#define TC_NONCONF_SHAPE 1
|
||||||
|
#define TC_NONCONF_DISCARD 2
|
||||||
|
#define TC_NONCONF_BORROW_PLUS 3
|
||||||
|
|
||||||
|
typedef struct _flowspec {
|
||||||
ULONG TokenRate;
|
ULONG TokenRate;
|
||||||
ULONG TokenBucketSize;
|
ULONG TokenBucketSize;
|
||||||
ULONG PeakBandwidth;
|
ULONG PeakBandwidth;
|
||||||
|
@ -40,8 +53,21 @@ typedef struct _flowspec
|
||||||
ULONG MinimumPolicedSize;
|
ULONG MinimumPolicedSize;
|
||||||
} FLOWSPEC, *PFLOWSPEC, *LPFLOWSPEC;
|
} FLOWSPEC, *PFLOWSPEC, *LPFLOWSPEC;
|
||||||
|
|
||||||
|
typedef struct _QOS_OBJECT_HDR {
|
||||||
|
ULONG ObjectType;
|
||||||
|
ULONG ObjectLength;
|
||||||
|
} QOS_OBJECT_HDR, *LPQOS_OBJECT_HDR;
|
||||||
|
|
||||||
|
typedef struct _QOS_SD_MODE {
|
||||||
|
QOS_OBJECT_HDR ObjectHdr;
|
||||||
|
ULONG ShapeDiscardMode;
|
||||||
|
} QOS_SD_MODE, *LPQOS_SD_MODE;
|
||||||
|
|
||||||
|
typedef struct _QOS_SHAPING_RATE {
|
||||||
|
QOS_OBJECT_HDR ObjectHdr;
|
||||||
|
ULONG ShapingRate;
|
||||||
|
} QOS_SHAPING_RATE, *LPQOS_SHAPING_RATE;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/*
|
||||||
|
|
||||||
Definitions for winsock 1.1
|
Definitions for winsock 1.1
|
||||||
|
|
||||||
Portions Copyright (c) 1980, 1983, 1988, 1993
|
Portions Copyright (c) 1980, 1983, 1988, 1993
|
||||||
|
@ -8,8 +7,13 @@
|
||||||
Portions Copyright (c) 1993 by Digital Equipment Corporation.
|
Portions Copyright (c) 1993 by Digital Equipment Corporation.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _WINSOCK_H
|
#pragma once
|
||||||
#define _WINSOCK_H
|
|
||||||
|
#define _WINSOCKAPI_
|
||||||
|
|
||||||
|
#ifndef _INC_WINDOWS
|
||||||
|
#include <windows.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef _M_AMD64
|
#ifndef _M_AMD64
|
||||||
#if !defined(__ROS_LONG64__)
|
#if !defined(__ROS_LONG64__)
|
||||||
|
@ -20,25 +24,30 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define _GNU_H_WINDOWS32_SOCKETS
|
#define _GNU_H_WINDOWS32_SOCKETS
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined ( _BSDTYPES_DEFINED )
|
#if !defined ( _BSDTYPES_DEFINED )
|
||||||
|
|
||||||
/* also defined in gmon.h and in cygwin's sys/types */
|
/* also defined in gmon.h and in cygwin's sys/types */
|
||||||
typedef unsigned char u_char;
|
typedef unsigned char u_char;
|
||||||
typedef unsigned short u_short;
|
typedef unsigned short u_short;
|
||||||
typedef unsigned int u_int;
|
typedef unsigned int u_int;
|
||||||
|
|
||||||
#ifndef __ROS_LONG64__
|
#ifndef __ROS_LONG64__
|
||||||
typedef unsigned long u_long;
|
typedef unsigned long u_long;
|
||||||
#else
|
#else
|
||||||
typedef unsigned int u_long;
|
typedef unsigned int u_long;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define _BSDTYPES_DEFINED
|
#define _BSDTYPES_DEFINED
|
||||||
#endif /* !defined _BSDTYPES_DEFINED */
|
|
||||||
|
#endif /* !defined ( _BSDTYPES_DEFINED ) */
|
||||||
|
|
||||||
typedef UINT_PTR SOCKET;
|
typedef UINT_PTR SOCKET;
|
||||||
|
|
||||||
#ifndef FD_SETSIZE
|
#ifndef FD_SETSIZE
|
||||||
#define FD_SETSIZE 64
|
#define FD_SETSIZE 64
|
||||||
#endif
|
#endif
|
||||||
|
@ -49,6 +58,7 @@ typedef UINT_PTR SOCKET;
|
||||||
#define SD_BOTH 0x02
|
#define SD_BOTH 0x02
|
||||||
|
|
||||||
#ifndef _SYS_TYPES_FD_SET
|
#ifndef _SYS_TYPES_FD_SET
|
||||||
|
|
||||||
/* fd_set may have be defined by the newlib <sys/types.h>
|
/* fd_set may have be defined by the newlib <sys/types.h>
|
||||||
* if __USE_W32_SOCKETS not defined.
|
* if __USE_W32_SOCKETS not defined.
|
||||||
*/
|
*/
|
||||||
|
@ -59,78 +69,182 @@ typedef struct fd_set {
|
||||||
u_int fd_count;
|
u_int fd_count;
|
||||||
SOCKET fd_array[FD_SETSIZE];
|
SOCKET fd_array[FD_SETSIZE];
|
||||||
} fd_set;
|
} fd_set;
|
||||||
int PASCAL __WSAFDIsSet(SOCKET,fd_set*);
|
|
||||||
|
extern int PASCAL __WSAFDIsSet(SOCKET,fd_set FAR*);
|
||||||
|
|
||||||
#ifndef FD_CLR
|
#ifndef FD_CLR
|
||||||
#define FD_CLR(fd,set) do { u_int __i;\
|
#define FD_CLR(fd,set) do { u_int __i;\
|
||||||
for (__i = 0; __i < ((fd_set *)(set))->fd_count ; __i++) {\
|
for (__i = 0; __i < ((fd_set FAR*)(set))->fd_count ; __i++) {\
|
||||||
if (((fd_set *)(set))->fd_array[__i] == (fd)) {\
|
if (((fd_set FAR*)(set))->fd_array[__i] == (fd)) {\
|
||||||
while (__i < ((fd_set *)(set))->fd_count-1) {\
|
while (__i < ((fd_set FAR*)(set))->fd_count-1) {\
|
||||||
((fd_set*)(set))->fd_array[__i] = ((fd_set*)(set))->fd_array[__i+1];\
|
((fd_set FAR*)(set))->fd_array[__i] = ((fd_set FAR*)(set))->fd_array[__i+1];\
|
||||||
__i++;\
|
__i++;\
|
||||||
}\
|
}\
|
||||||
((fd_set*)(set))->fd_count--;\
|
((fd_set FAR*)(set))->fd_count--;\
|
||||||
break;\
|
break;\
|
||||||
}\
|
}\
|
||||||
}\
|
}\
|
||||||
} while (0)
|
} while (0)
|
||||||
#endif
|
#endif /* FD_CLR */
|
||||||
|
|
||||||
#ifndef FD_SET
|
#ifndef FD_SET
|
||||||
#define FD_SET(fd, set) do { \
|
#define FD_SET(fd, set) do { \
|
||||||
if (((fd_set *)(set))->fd_count < FD_SETSIZE) \
|
if (((fd_set FAR*)(set))->fd_count < FD_SETSIZE) \
|
||||||
((fd_set *)(set))->fd_array[((fd_set *)(set))->fd_count++]=(fd);\
|
((fd_set FAR*)(set))->fd_array[((fd_set FAR*)(set))->fd_count++]=(fd);\
|
||||||
}while (0)
|
}while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef FD_ZERO
|
#ifndef FD_ZERO
|
||||||
#define FD_ZERO(set) (((fd_set *)(set))->fd_count=0)
|
#define FD_ZERO(set) (((fd_set FAR*)(set))->fd_count=0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef FD_ISSET
|
#ifndef FD_ISSET
|
||||||
#define FD_ISSET(fd, set) __WSAFDIsSet((SOCKET)(fd), (fd_set *)(set))
|
#define FD_ISSET(fd, set) __WSAFDIsSet((SOCKET)(fd), (fd_set FAR*)(set))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#elif !defined(USE_SYS_TYPES_FD_SET)
|
#elif !defined(USE_SYS_TYPES_FD_SET)
|
||||||
#warning "fd_set and associated macros have been defined in sys/types. \
|
#warning "fd_set and associated macros have been defined in sys/types. \
|
||||||
This can cause runtime problems with W32 sockets"
|
This can cause runtime problems with W32 sockets"
|
||||||
#endif /* ndef _SYS_TYPES_FD_SET */
|
#endif /* ndef _SYS_TYPES_FD_SET */
|
||||||
|
|
||||||
#if !(defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__))
|
#if !(defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__))
|
||||||
|
|
||||||
#ifndef _TIMEVAL_DEFINED /* also in sys/time.h */
|
#ifndef _TIMEVAL_DEFINED /* also in sys/time.h */
|
||||||
#define _TIMEVAL_DEFINED
|
#define _TIMEVAL_DEFINED
|
||||||
|
|
||||||
struct timeval {
|
struct timeval {
|
||||||
LONG tv_sec;
|
LONG tv_sec;
|
||||||
LONG tv_usec;
|
LONG tv_usec;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
|
#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
|
||||||
|
|
||||||
#define timercmp(tvp, uvp, cmp) \
|
#define timercmp(tvp, uvp, cmp) \
|
||||||
(((tvp)->tv_sec != (uvp)->tv_sec) ? \
|
(((tvp)->tv_sec != (uvp)->tv_sec) ? \
|
||||||
((tvp)->tv_sec cmp (uvp)->tv_sec) : \
|
((tvp)->tv_sec cmp (uvp)->tv_sec) : \
|
||||||
((tvp)->tv_usec cmp (uvp)->tv_usec))
|
((tvp)->tv_usec cmp (uvp)->tv_usec))
|
||||||
|
|
||||||
#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
|
#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
|
||||||
|
|
||||||
#endif /* _TIMEVAL_DEFINED */
|
#endif /* _TIMEVAL_DEFINED */
|
||||||
|
|
||||||
|
#define h_addr h_addr_list[0]
|
||||||
|
|
||||||
struct hostent {
|
struct hostent {
|
||||||
char *h_name;
|
char *h_name;
|
||||||
char **h_aliases;
|
char **h_aliases;
|
||||||
short h_addrtype;
|
short h_addrtype;
|
||||||
short h_length;
|
short h_length;
|
||||||
char **h_addr_list;
|
char **h_addr_list;
|
||||||
#define h_addr h_addr_list[0]
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct linger {
|
struct linger {
|
||||||
u_short l_onoff;
|
u_short l_onoff;
|
||||||
u_short l_linger;
|
u_short l_linger;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define _IO(x,y) (IOC_VOID|((x)<<8)|(y))
|
||||||
|
#define _IOR(x,y,t) (IOC_OUT|(((LONG)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
|
||||||
|
#define _IOW(x,y,t) (IOC_IN|(((LONG)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
|
||||||
|
#define FIONBIO _IOW('f', 126, u_long)
|
||||||
|
|
||||||
|
struct netent {
|
||||||
|
char * n_name;
|
||||||
|
char **n_aliases;
|
||||||
|
short n_addrtype;
|
||||||
|
u_long n_net;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct servent {
|
||||||
|
char *s_name;
|
||||||
|
char **s_aliases;
|
||||||
|
#ifdef _WIN64
|
||||||
|
char *s_proto;
|
||||||
|
short s_port;
|
||||||
|
#else
|
||||||
|
short s_port;
|
||||||
|
char *s_proto;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct protoent {
|
||||||
|
char *p_name;
|
||||||
|
char **p_aliases;
|
||||||
|
short p_proto;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define IP_OPTIONS 1
|
||||||
|
|
||||||
|
#define SO_DEBUG 1
|
||||||
|
#define SO_ACCEPTCONN 2
|
||||||
|
#define SO_REUSEADDR 4
|
||||||
|
#define SO_KEEPALIVE 8
|
||||||
|
#define SO_DONTROUTE 16
|
||||||
|
#define SO_BROADCAST 32
|
||||||
|
#define SO_USELOOPBACK 64
|
||||||
|
#define SO_LINGER 128
|
||||||
|
#define SO_OOBINLINE 256
|
||||||
|
#define SO_DONTLINGER (u_int)(~SO_LINGER)
|
||||||
|
#define SO_SNDBUF 0x1001
|
||||||
|
#define SO_RCVBUF 0x1002
|
||||||
|
#define SO_SNDLOWAT 0x1003
|
||||||
|
#define SO_RCVLOWAT 0x1004
|
||||||
|
#define SO_SNDTIMEO 0x1005
|
||||||
|
#define SO_RCVTIMEO 0x1006
|
||||||
|
#define SO_ERROR 0x1007
|
||||||
|
#define SO_TYPE 0x1008
|
||||||
|
|
||||||
|
#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_MAXDG 0x7009
|
||||||
|
#define SO_MAXPATHDG 0x700A
|
||||||
|
#define SO_UPDATE_ACCEPT_CONTEXT 0x700B
|
||||||
|
#define SO_CONNECT_TIME 0x700C
|
||||||
|
|
||||||
|
#define SO_SYNCHRONOUS_ALERT 0x10
|
||||||
|
#define SO_SYNCHRONOUS_NONALERT 0x20
|
||||||
|
|
||||||
|
#define AF_MAX 24
|
||||||
|
|
||||||
|
struct sockaddr {
|
||||||
|
u_short sa_family;
|
||||||
|
char sa_data[14];
|
||||||
|
};
|
||||||
|
|
||||||
|
#define MSG_OOB 1
|
||||||
|
#define MSG_PEEK 2
|
||||||
|
#define MSG_DONTROUTE 4
|
||||||
|
|
||||||
|
#define h_errno WSAGetLastError()
|
||||||
|
#define HOST_NOT_FOUND WSAHOST_NOT_FOUND
|
||||||
|
#define TRY_AGAIN WSATRY_AGAIN
|
||||||
|
#define NO_RECOVERY WSANO_RECOVERY
|
||||||
|
#define NO_DATA WSANO_DATA
|
||||||
|
#define NO_ADDRES WSANO_ADDRESS
|
||||||
|
|
||||||
|
u_long PASCAL htonl(u_long);
|
||||||
|
u_long PASCAL ntohl(u_long);
|
||||||
|
u_short PASCAL htons(u_short);
|
||||||
|
u_short PASCAL ntohs(u_short);
|
||||||
|
int PASCAL select(int nfds,fd_set*,fd_set*,fd_set*,const struct timeval*);
|
||||||
|
int PASCAL gethostname(char*,int);
|
||||||
|
|
||||||
#endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */
|
#endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */
|
||||||
|
|
||||||
#define IOCPARM_MASK 0x7f
|
#define IOCPARM_MASK 0x7f
|
||||||
#define IOC_VOID 0x20000000
|
#define IOC_VOID 0x20000000
|
||||||
#define IOC_OUT 0x40000000
|
#define IOC_OUT 0x40000000
|
||||||
#define IOC_IN 0x80000000
|
#define IOC_IN 0x80000000
|
||||||
#define IOC_INOUT (IOC_IN|IOC_OUT)
|
#define IOC_INOUT (IOC_IN|IOC_OUT)
|
||||||
|
|
||||||
#if !(defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__))
|
|
||||||
#define _IO(x,y) (IOC_VOID|((x)<<8)|(y))
|
|
||||||
#define _IOR(x,y,t) (IOC_OUT|(((LONG)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
|
|
||||||
#define _IOW(x,y,t) (IOC_IN|(((LONG)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
|
|
||||||
#define FIONBIO _IOW('f', 126, u_long)
|
|
||||||
#endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */
|
|
||||||
|
|
||||||
#define FIONREAD _IOR('f', 127, u_long)
|
#define FIONREAD _IOR('f', 127, u_long)
|
||||||
#define FIOASYNC _IOW('f', 125, u_long)
|
#define FIOASYNC _IOW('f', 125, u_long)
|
||||||
#define SIOCSHIWAT _IOW('s', 0, u_long)
|
#define SIOCSHIWAT _IOW('s', 0, u_long)
|
||||||
|
@ -139,26 +253,6 @@ struct linger {
|
||||||
#define SIOCGLOWAT _IOR('s', 3, u_long)
|
#define SIOCGLOWAT _IOR('s', 3, u_long)
|
||||||
#define SIOCATMARK _IOR('s', 7, u_long)
|
#define SIOCATMARK _IOR('s', 7, u_long)
|
||||||
|
|
||||||
#if !(defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__))
|
|
||||||
struct netent {
|
|
||||||
char * n_name;
|
|
||||||
char **n_aliases;
|
|
||||||
short n_addrtype;
|
|
||||||
u_long n_net;
|
|
||||||
};
|
|
||||||
struct servent {
|
|
||||||
char *s_name;
|
|
||||||
char **s_aliases;
|
|
||||||
short s_port;
|
|
||||||
char *s_proto;
|
|
||||||
};
|
|
||||||
struct protoent {
|
|
||||||
char *p_name;
|
|
||||||
char **p_aliases;
|
|
||||||
short p_proto;
|
|
||||||
};
|
|
||||||
#endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */
|
|
||||||
|
|
||||||
#define IPPROTO_IP 0
|
#define IPPROTO_IP 0
|
||||||
#define IPPROTO_ICMP 1
|
#define IPPROTO_ICMP 1
|
||||||
#define IPPROTO_IGMP 2
|
#define IPPROTO_IGMP 2
|
||||||
|
@ -198,19 +292,9 @@ struct protoent {
|
||||||
#define IMPLINK_IP 155
|
#define IMPLINK_IP 155
|
||||||
#define IMPLINK_LOWEXPER 156
|
#define IMPLINK_LOWEXPER 156
|
||||||
#define IMPLINK_HIGHEXPER 158
|
#define IMPLINK_HIGHEXPER 158
|
||||||
struct in_addr {
|
|
||||||
union {
|
#include <inaddr.h>
|
||||||
struct { u_char s_b1,s_b2,s_b3,s_b4; } S_un_b;
|
|
||||||
struct { u_short s_w1,s_w2; } S_un_w;
|
|
||||||
u_long S_addr;
|
|
||||||
} S_un;
|
|
||||||
#define s_addr S_un.S_addr
|
|
||||||
#define s_host S_un.S_un_b.s_b2
|
|
||||||
#define s_net S_un.S_un_b.s_b1
|
|
||||||
#define s_imp S_un.S_un_w.s_w2
|
|
||||||
#define s_impno S_un.S_un_b.s_b4
|
|
||||||
#define s_lh S_un.S_un_b.s_b3
|
|
||||||
};
|
|
||||||
#define IN_CLASSA(i) ((LONG)(i)&0x80000000)
|
#define IN_CLASSA(i) ((LONG)(i)&0x80000000)
|
||||||
#define IN_CLASSA_NET 0xff000000
|
#define IN_CLASSA_NET 0xff000000
|
||||||
#define IN_CLASSA_NSHIFT 24
|
#define IN_CLASSA_NSHIFT 24
|
||||||
|
@ -229,46 +313,34 @@ struct in_addr {
|
||||||
#define INADDR_LOOPBACK 0x7f000001
|
#define INADDR_LOOPBACK 0x7f000001
|
||||||
#define INADDR_BROADCAST (u_long)0xffffffff
|
#define INADDR_BROADCAST (u_long)0xffffffff
|
||||||
#define INADDR_NONE 0xffffffff
|
#define INADDR_NONE 0xffffffff
|
||||||
|
|
||||||
struct sockaddr_in {
|
struct sockaddr_in {
|
||||||
short sin_family;
|
short sin_family;
|
||||||
u_short sin_port;
|
u_short sin_port;
|
||||||
struct in_addr sin_addr;
|
struct in_addr sin_addr;
|
||||||
char sin_zero[8];
|
char sin_zero[8];
|
||||||
};
|
};
|
||||||
|
|
||||||
#define WSADESCRIPTION_LEN 256
|
#define WSADESCRIPTION_LEN 256
|
||||||
#define WSASYS_STATUS_LEN 128
|
#define WSASYS_STATUS_LEN 128
|
||||||
|
|
||||||
typedef struct WSAData {
|
typedef struct WSAData {
|
||||||
WORD wVersion;
|
WORD wVersion;
|
||||||
WORD wHighVersion;
|
WORD wHighVersion;
|
||||||
|
#ifdef _WIN64
|
||||||
|
unsigned short iMaxSockets;
|
||||||
|
unsigned short iMaxUdpDg;
|
||||||
|
char *lpVendorInfo;
|
||||||
|
char szDescription[WSADESCRIPTION_LEN+1];
|
||||||
|
char szSystemStatus[WSASYS_STATUS_LEN+1];
|
||||||
|
#else
|
||||||
char szDescription[WSADESCRIPTION_LEN+1];
|
char szDescription[WSADESCRIPTION_LEN+1];
|
||||||
char szSystemStatus[WSASYS_STATUS_LEN+1];
|
char szSystemStatus[WSASYS_STATUS_LEN+1];
|
||||||
unsigned short iMaxSockets;
|
unsigned short iMaxSockets;
|
||||||
unsigned short iMaxUdpDg;
|
unsigned short iMaxUdpDg;
|
||||||
char * lpVendorInfo;
|
char *lpVendorInfo;
|
||||||
} WSADATA;
|
} WSADATA, FAR *LPWSADATA;
|
||||||
typedef WSADATA *LPWSADATA;
|
|
||||||
|
|
||||||
#if !(defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__))
|
|
||||||
#define IP_OPTIONS 1
|
|
||||||
#define SO_DEBUG 1
|
|
||||||
#define SO_ACCEPTCONN 2
|
|
||||||
#define SO_REUSEADDR 4
|
|
||||||
#define SO_KEEPALIVE 8
|
|
||||||
#define SO_DONTROUTE 16
|
|
||||||
#define SO_BROADCAST 32
|
|
||||||
#define SO_USELOOPBACK 64
|
|
||||||
#define SO_LINGER 128
|
|
||||||
#define SO_OOBINLINE 256
|
|
||||||
#define SO_DONTLINGER (u_int)(~SO_LINGER)
|
|
||||||
#define SO_SNDBUF 0x1001
|
|
||||||
#define SO_RCVBUF 0x1002
|
|
||||||
#define SO_SNDLOWAT 0x1003
|
|
||||||
#define SO_RCVLOWAT 0x1004
|
|
||||||
#define SO_SNDTIMEO 0x1005
|
|
||||||
#define SO_RCVTIMEO 0x1006
|
|
||||||
#define SO_ERROR 0x1007
|
|
||||||
#define SO_TYPE 0x1008
|
|
||||||
#endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */
|
|
||||||
/*
|
/*
|
||||||
* Note that the next 5 IP defines are specific to WinSock 1.1 (wsock32.dll).
|
* Note that the next 5 IP defines are specific to WinSock 1.1 (wsock32.dll).
|
||||||
* They will cause errors or unexpected results if used with the
|
* They will cause errors or unexpected results if used with the
|
||||||
|
@ -279,22 +351,31 @@ typedef WSADATA *LPWSADATA;
|
||||||
#define IP_MULTICAST_LOOP 4
|
#define IP_MULTICAST_LOOP 4
|
||||||
#define IP_ADD_MEMBERSHIP 5
|
#define IP_ADD_MEMBERSHIP 5
|
||||||
#define IP_DROP_MEMBERSHIP 6
|
#define IP_DROP_MEMBERSHIP 6
|
||||||
|
#define IP_TTL 7
|
||||||
|
#define IP_TOS 8
|
||||||
|
#define IP_DONTFRAGMENT 9
|
||||||
|
|
||||||
#define IP_DEFAULT_MULTICAST_TTL 1
|
#define IP_DEFAULT_MULTICAST_TTL 1
|
||||||
#define IP_DEFAULT_MULTICAST_LOOP 1
|
#define IP_DEFAULT_MULTICAST_LOOP 1
|
||||||
#define IP_MAX_MEMBERSHIPS 20
|
#define IP_MAX_MEMBERSHIPS 20
|
||||||
|
|
||||||
struct ip_mreq {
|
struct ip_mreq {
|
||||||
struct in_addr imr_multiaddr;
|
struct in_addr imr_multiaddr;
|
||||||
struct in_addr imr_interface;
|
struct in_addr imr_interface;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define INVALID_SOCKET (SOCKET)(~0)
|
#define INVALID_SOCKET (SOCKET)(~0)
|
||||||
#define SOCKET_ERROR (-1)
|
#define SOCKET_ERROR (-1)
|
||||||
|
|
||||||
#define SOCK_STREAM 1
|
#define SOCK_STREAM 1
|
||||||
#define SOCK_DGRAM 2
|
#define SOCK_DGRAM 2
|
||||||
#define SOCK_RAW 3
|
#define SOCK_RAW 3
|
||||||
#define SOCK_RDM 4
|
#define SOCK_RDM 4
|
||||||
#define SOCK_SEQPACKET 5
|
#define SOCK_SEQPACKET 5
|
||||||
|
|
||||||
#define TCP_NODELAY 0x0001
|
#define TCP_NODELAY 0x0001
|
||||||
|
#define TCP_BSDURGENT 0x7000
|
||||||
|
|
||||||
#define AF_UNSPEC 0
|
#define AF_UNSPEC 0
|
||||||
#define AF_UNIX 1
|
#define AF_UNIX 1
|
||||||
#define AF_INET 2
|
#define AF_INET 2
|
||||||
|
@ -321,18 +402,12 @@ struct ip_mreq {
|
||||||
#define AF_BAN 21
|
#define AF_BAN 21
|
||||||
#define AF_ATM 22
|
#define AF_ATM 22
|
||||||
#define AF_INET6 23
|
#define AF_INET6 23
|
||||||
#if !(defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__))
|
|
||||||
#define AF_MAX 24
|
|
||||||
struct sockaddr {
|
|
||||||
u_short sa_family;
|
|
||||||
char sa_data[14];
|
|
||||||
};
|
|
||||||
#endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */
|
|
||||||
|
|
||||||
struct sockproto {
|
struct sockproto {
|
||||||
u_short sp_family;
|
u_short sp_family;
|
||||||
u_short sp_protocol;
|
u_short sp_protocol;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define PF_UNSPEC AF_UNSPEC
|
#define PF_UNSPEC AF_UNSPEC
|
||||||
#define PF_UNIX AF_UNIX
|
#define PF_UNIX AF_UNIX
|
||||||
#define PF_INET AF_INET
|
#define PF_INET AF_INET
|
||||||
|
@ -359,23 +434,23 @@ struct sockproto {
|
||||||
#define PF_ATM AF_ATM
|
#define PF_ATM AF_ATM
|
||||||
#define PF_INET6 AF_INET6
|
#define PF_INET6 AF_INET6
|
||||||
#define PF_MAX AF_MAX
|
#define PF_MAX AF_MAX
|
||||||
|
|
||||||
#define SOL_SOCKET 0xffff
|
#define SOL_SOCKET 0xffff
|
||||||
#define SOMAXCONN 5
|
#define SOMAXCONN 5
|
||||||
#if !(defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__))
|
|
||||||
#define MSG_OOB 1
|
|
||||||
#define MSG_PEEK 2
|
|
||||||
#define MSG_DONTROUTE 4
|
|
||||||
#endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */
|
|
||||||
#define MSG_MAXIOVLEN 16
|
#define MSG_MAXIOVLEN 16
|
||||||
#define MSG_PARTIAL 0x8000
|
#define MSG_PARTIAL 0x8000
|
||||||
#define MAXGETHOSTSTRUCT 1024
|
#define MAXGETHOSTSTRUCT 1024
|
||||||
|
|
||||||
#define FD_READ 1
|
#define FD_READ 1
|
||||||
#define FD_WRITE 2
|
#define FD_WRITE 2
|
||||||
#define FD_OOB 4
|
#define FD_OOB 4
|
||||||
#define FD_ACCEPT 8
|
#define FD_ACCEPT 8
|
||||||
#define FD_CONNECT 16
|
#define FD_CONNECT 16
|
||||||
#define FD_CLOSE 32
|
#define FD_CLOSE 32
|
||||||
|
|
||||||
#ifndef WSABASEERR
|
#ifndef WSABASEERR
|
||||||
|
|
||||||
#define WSABASEERR 10000
|
#define WSABASEERR 10000
|
||||||
#define WSAEINTR (WSABASEERR+4)
|
#define WSAEINTR (WSABASEERR+4)
|
||||||
#define WSAEBADF (WSABASEERR+9)
|
#define WSAEBADF (WSABASEERR+9)
|
||||||
|
@ -420,73 +495,380 @@ struct sockproto {
|
||||||
#define WSAEDQUOT (WSABASEERR+69)
|
#define WSAEDQUOT (WSABASEERR+69)
|
||||||
#define WSAESTALE (WSABASEERR+70)
|
#define WSAESTALE (WSABASEERR+70)
|
||||||
#define WSAEREMOTE (WSABASEERR+71)
|
#define WSAEREMOTE (WSABASEERR+71)
|
||||||
#define WSAEDISCON (WSABASEERR+101)
|
|
||||||
#define WSASYSNOTREADY (WSABASEERR+91)
|
#define WSASYSNOTREADY (WSABASEERR+91)
|
||||||
#define WSAVERNOTSUPPORTED (WSABASEERR+92)
|
#define WSAVERNOTSUPPORTED (WSABASEERR+92)
|
||||||
#define WSANOTINITIALISED (WSABASEERR+93)
|
#define WSANOTINITIALISED (WSABASEERR+93)
|
||||||
|
#define WSAEDISCON (WSABASEERR+101)
|
||||||
#define WSAHOST_NOT_FOUND (WSABASEERR+1001)
|
#define WSAHOST_NOT_FOUND (WSABASEERR+1001)
|
||||||
#define WSATRY_AGAIN (WSABASEERR+1002)
|
#define WSATRY_AGAIN (WSABASEERR+1002)
|
||||||
#define WSANO_RECOVERY (WSABASEERR+1003)
|
#define WSANO_RECOVERY (WSABASEERR+1003)
|
||||||
#define WSANO_DATA (WSABASEERR+1004)
|
#define WSANO_DATA (WSABASEERR+1004)
|
||||||
|
#define WSA_SECURE_HOST_NOT_FOUND (WSABASEERR+1032)
|
||||||
|
#define WSA_IPSEC_NAME_POLICY_ERROR (WSABASEERR+1033)
|
||||||
|
|
||||||
#endif /* !WSABASEERR */
|
#endif /* !WSABASEERR */
|
||||||
|
|
||||||
#define WSANO_ADDRESS WSANO_DATA
|
#define WSANO_ADDRESS WSANO_DATA
|
||||||
#if !(defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__))
|
|
||||||
#define h_errno WSAGetLastError()
|
SOCKET
|
||||||
#define HOST_NOT_FOUND WSAHOST_NOT_FOUND
|
PASCAL FAR
|
||||||
#define TRY_AGAIN WSATRY_AGAIN
|
accept(
|
||||||
#define NO_RECOVERY WSANO_RECOVERY
|
IN SOCKET s,
|
||||||
#define NO_DATA WSANO_DATA
|
OUT struct sockaddr FAR *addr OPTIONAL,
|
||||||
#define NO_ADDRESS WSANO_ADDRESS
|
IN OUT int FAR *addrlen OPTIONAL);
|
||||||
#endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */
|
|
||||||
SOCKET PASCAL accept(SOCKET,struct sockaddr*,int*);
|
int
|
||||||
int PASCAL bind(SOCKET,const struct sockaddr*,int);
|
PASCAL FAR
|
||||||
int PASCAL closesocket(SOCKET);
|
bind(
|
||||||
int PASCAL connect(SOCKET,const struct sockaddr*,int);
|
IN SOCKET s,
|
||||||
int PASCAL ioctlsocket(SOCKET,LONG,u_long *);
|
IN const struct sockaddr FAR *addr,
|
||||||
int PASCAL getpeername(SOCKET,struct sockaddr*,int*);
|
IN int namelen);
|
||||||
int PASCAL getsockname(SOCKET,struct sockaddr*,int*);
|
|
||||||
int PASCAL getsockopt(SOCKET,int,int,char*,int*);
|
int
|
||||||
u_long PASCAL inet_addr(const char*);
|
PASCAL FAR
|
||||||
DECLARE_STDCALL_P(char *) inet_ntoa(struct in_addr);
|
closesocket(
|
||||||
int PASCAL listen(SOCKET,int);
|
IN SOCKET s);
|
||||||
int PASCAL recv(SOCKET,char*,int,int);
|
|
||||||
int PASCAL recvfrom(SOCKET,char*,int,int,struct sockaddr*,int*);
|
int
|
||||||
int PASCAL send(SOCKET,const char*,int,int);
|
PASCAL FAR
|
||||||
int PASCAL sendto(SOCKET,const char*,int,int,const struct sockaddr*,int);
|
connect(
|
||||||
int PASCAL setsockopt(SOCKET,int,int,const char*,int);
|
IN SOCKET s,
|
||||||
int PASCAL shutdown(SOCKET,int);
|
IN const struct sockaddr FAR *name,
|
||||||
SOCKET PASCAL socket(int,int,int);
|
IN int namelen);
|
||||||
DECLARE_STDCALL_P(struct hostent *) gethostbyaddr(const char*,int,int);
|
|
||||||
DECLARE_STDCALL_P(struct hostent *) gethostbyname(const char*);
|
int
|
||||||
DECLARE_STDCALL_P(struct servent *) getservbyport(int,const char*);
|
PASCAL FAR
|
||||||
DECLARE_STDCALL_P(struct servent *) getservbyname(const char*,const char*);
|
ioctlsocket(
|
||||||
DECLARE_STDCALL_P(struct protoent *) getprotobynumber(int);
|
IN SOCKET s,
|
||||||
DECLARE_STDCALL_P(struct protoent *) getprotobyname(const char*);
|
IN long cmd,
|
||||||
int PASCAL WSAStartup(WORD,LPWSADATA);
|
IN OUT u_long FAR *argp);
|
||||||
int PASCAL WSACleanup(void);
|
|
||||||
void PASCAL WSASetLastError(int);
|
int
|
||||||
int PASCAL WSAGetLastError(void);
|
PASCAL FAR
|
||||||
BOOL PASCAL WSAIsBlocking(void);
|
getpeername(
|
||||||
int PASCAL WSAUnhookBlockingHook(void);
|
IN SOCKET s,
|
||||||
FARPROC PASCAL WSASetBlockingHook(FARPROC);
|
OUT struct sockaddr FAR *name,
|
||||||
int PASCAL WSACancelBlockingCall(void);
|
IN OUT int FAR *namelen);
|
||||||
HANDLE PASCAL WSAAsyncGetServByName(HWND,u_int,const char*,const char*,char*,int);
|
|
||||||
HANDLE PASCAL WSAAsyncGetServByPort(HWND,u_int,int,const char*,char*,int);
|
int
|
||||||
HANDLE PASCAL WSAAsyncGetProtoByName(HWND,u_int,const char*,char*,int);
|
PASCAL FAR
|
||||||
HANDLE PASCAL WSAAsyncGetProtoByNumber(HWND,u_int,int,char*,int);
|
getsockname(
|
||||||
HANDLE PASCAL WSAAsyncGetHostByName(HWND,u_int,const char*,char*,int);
|
IN SOCKET s,
|
||||||
HANDLE PASCAL WSAAsyncGetHostByAddr(HWND,u_int,const char*,int,int,char*,int);
|
OUT struct sockaddr FAR *name,
|
||||||
int PASCAL WSACancelAsyncRequest(HANDLE);
|
IN OUT int FAR *namelen);
|
||||||
int PASCAL WSAAsyncSelect(SOCKET,HWND,u_int,LONG);
|
|
||||||
#if !(defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__))
|
int
|
||||||
u_long PASCAL htonl(u_long);
|
PASCAL FAR
|
||||||
u_long PASCAL ntohl(u_long);
|
getsockopt(
|
||||||
u_short PASCAL htons(u_short);
|
IN SOCKET s,
|
||||||
u_short PASCAL ntohs(u_short);
|
IN int level,
|
||||||
int PASCAL select(int nfds,fd_set*,fd_set*,fd_set*,const struct timeval*);
|
IN int optname,
|
||||||
int PASCAL gethostname(char*,int);
|
OUT char FAR *optval,
|
||||||
#endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */
|
IN OUT int FAR *optlen);
|
||||||
|
|
||||||
|
u_long
|
||||||
|
PASCAL FAR
|
||||||
|
htonl(
|
||||||
|
IN u_long hostlong);
|
||||||
|
|
||||||
|
u_short
|
||||||
|
PASCAL FAR
|
||||||
|
htons(
|
||||||
|
IN u_short hostshort);
|
||||||
|
|
||||||
|
unsigned long
|
||||||
|
PASCAL FAR
|
||||||
|
inet_addr(
|
||||||
|
IN const char FAR *cp);
|
||||||
|
|
||||||
|
char FAR
|
||||||
|
*PASCAL FAR
|
||||||
|
inet_ntoa(
|
||||||
|
IN struct in_addr in);
|
||||||
|
|
||||||
|
int
|
||||||
|
PASCAL FAR
|
||||||
|
listen(
|
||||||
|
IN SOCKET s,
|
||||||
|
IN int backlog);
|
||||||
|
|
||||||
|
u_long
|
||||||
|
PASCAL FAR
|
||||||
|
ntohl(
|
||||||
|
IN u_long netlong);
|
||||||
|
|
||||||
|
u_short
|
||||||
|
PASCAL FAR
|
||||||
|
ntohs(
|
||||||
|
IN u_short netshort);
|
||||||
|
|
||||||
|
int
|
||||||
|
PASCAL FAR
|
||||||
|
recv(
|
||||||
|
IN SOCKET s,
|
||||||
|
OUT char FAR *buf,
|
||||||
|
IN int len,
|
||||||
|
IN int flags);
|
||||||
|
|
||||||
|
int
|
||||||
|
PASCAL FAR
|
||||||
|
recvfrom(
|
||||||
|
IN SOCKET s,
|
||||||
|
OUT char FAR *buf,
|
||||||
|
IN int len,
|
||||||
|
IN int flags,
|
||||||
|
OUT struct sockaddr FAR *from OPTIONAL,
|
||||||
|
IN OUY int FAR * fromlen OPTIONAL);
|
||||||
|
|
||||||
|
int
|
||||||
|
PASCAL FAR
|
||||||
|
select(
|
||||||
|
IN int nfds,
|
||||||
|
IN OUT fd_set FAR *readfds OPTIONAL,
|
||||||
|
IN OUT fd_set FAR *writefds OPTIONAL,
|
||||||
|
IN OUT fd_set FAR *exceptfds OPTIONAL,
|
||||||
|
IN const struct timeval FAR *timeout OPTIONAL);
|
||||||
|
|
||||||
|
int
|
||||||
|
PASCAL FAR
|
||||||
|
send(
|
||||||
|
IN SOCKET s,
|
||||||
|
IN const char FAR *buf,
|
||||||
|
IN int len,
|
||||||
|
IN int flags);
|
||||||
|
|
||||||
|
int
|
||||||
|
PASCAL FAR
|
||||||
|
sendto(
|
||||||
|
IN SOCKET s,
|
||||||
|
IN const char FAR *buf,
|
||||||
|
IN int len,
|
||||||
|
IN int flags,
|
||||||
|
IN const struct sockaddr FAR *to OPTIONAL,
|
||||||
|
IN int tolen);
|
||||||
|
|
||||||
|
int
|
||||||
|
PASCAL FAR
|
||||||
|
setsockopt(
|
||||||
|
IN SOCKET s,
|
||||||
|
IN int level,
|
||||||
|
IN int optname,
|
||||||
|
IN const char FAR *optval OPTIONAL,
|
||||||
|
IN int optlen);
|
||||||
|
|
||||||
|
int
|
||||||
|
PASCAL FAR
|
||||||
|
shutdown(
|
||||||
|
IN SOCKET s,
|
||||||
|
IN int how);
|
||||||
|
|
||||||
|
SOCKET
|
||||||
|
PASCAL FAR
|
||||||
|
socket(
|
||||||
|
IN int af,
|
||||||
|
IN int type,
|
||||||
|
IN int protocol);
|
||||||
|
|
||||||
|
struct hostent FAR
|
||||||
|
*PASCAL FAR
|
||||||
|
gethostbyaddr(
|
||||||
|
IN const char FAR *addr,
|
||||||
|
IN int len,
|
||||||
|
IN int type);
|
||||||
|
|
||||||
|
struct hostent FAR
|
||||||
|
*PASCAL FAR
|
||||||
|
gethostbyname(
|
||||||
|
IN const char FAR *name);
|
||||||
|
|
||||||
|
int
|
||||||
|
PASCAL FAR
|
||||||
|
gethostname(
|
||||||
|
OUT char FAR *name,
|
||||||
|
IN int namelen);
|
||||||
|
|
||||||
|
struct servent FAR
|
||||||
|
*PASCAL FAR
|
||||||
|
getservbyport(
|
||||||
|
IN int port,
|
||||||
|
IN const char FAR *proto);
|
||||||
|
|
||||||
|
struct servent FAR
|
||||||
|
*PASCAL FAR
|
||||||
|
getservbyname(
|
||||||
|
IN const char FAR *name,
|
||||||
|
IN const char FAR *proto);
|
||||||
|
|
||||||
|
struct protoent FAR
|
||||||
|
*PASCAL FAR
|
||||||
|
getprotobynumber(
|
||||||
|
IN int number);
|
||||||
|
|
||||||
|
struct protoent FAR
|
||||||
|
*PASCAL FAR
|
||||||
|
getprotobyname(
|
||||||
|
IN const char FAR *name);
|
||||||
|
|
||||||
|
int
|
||||||
|
PASCAL FAR
|
||||||
|
WSAStartup(
|
||||||
|
IN WORD wVersionRequired,
|
||||||
|
OUT LPWSADATA lpWSAData);
|
||||||
|
|
||||||
|
int
|
||||||
|
PASCAL FAR
|
||||||
|
WSACleanup(void);
|
||||||
|
|
||||||
|
void
|
||||||
|
PASCAL FAR
|
||||||
|
WSASetLastError(
|
||||||
|
IN int iError);
|
||||||
|
|
||||||
|
int
|
||||||
|
PASCAL FAR
|
||||||
|
WSAGetLastError(void);
|
||||||
|
|
||||||
|
BOOL
|
||||||
|
PASCAL FAR
|
||||||
|
WSAIsBlocking(void);
|
||||||
|
|
||||||
|
int
|
||||||
|
PASCAL FAR
|
||||||
|
WSAUnhookBlockingHook(void);
|
||||||
|
|
||||||
|
FARPROC
|
||||||
|
PASCAL FAR
|
||||||
|
WSASetBlockingHook(
|
||||||
|
IN FARPROC lpBlockFunc);
|
||||||
|
|
||||||
|
int
|
||||||
|
PASCAL FAR
|
||||||
|
WSACancelBlockingCall(void);
|
||||||
|
|
||||||
|
HANDLE
|
||||||
|
PASCAL FAR
|
||||||
|
WSAAsyncGetServByName(
|
||||||
|
IN HWND hWnd,
|
||||||
|
IN u_int wMsg,
|
||||||
|
IN const char FAR *name,
|
||||||
|
IN const char FAR *proto,
|
||||||
|
OUT char FAR *buf,
|
||||||
|
IN int buflen);
|
||||||
|
|
||||||
|
HANDLE
|
||||||
|
PASCAL FAR
|
||||||
|
WSAAsyncGetServByPort(
|
||||||
|
IN HWND hWnd,
|
||||||
|
IN u_int wMsg,
|
||||||
|
IN int port,
|
||||||
|
IN const char FAR *proto,
|
||||||
|
OUT char FAR *buf,
|
||||||
|
IN int buflen);
|
||||||
|
|
||||||
|
HANDLE
|
||||||
|
PASCAL FAR
|
||||||
|
WSAAsyncGetProtoByName(
|
||||||
|
IN HWND hWnd,
|
||||||
|
IN u_int wMsg,
|
||||||
|
IN const char FAR *name,
|
||||||
|
OUT char FAR *buf,
|
||||||
|
IN int buflen);
|
||||||
|
|
||||||
|
HANDLE
|
||||||
|
PASCAL FAR
|
||||||
|
WSAAsyncGetProtoByNumber(
|
||||||
|
IN HWND hWnd,
|
||||||
|
IN u_int wMsg,
|
||||||
|
IN int number,
|
||||||
|
OUT char FAR *buf,
|
||||||
|
IN int buflen);
|
||||||
|
|
||||||
|
HANDLE
|
||||||
|
PASCAL FAR
|
||||||
|
WSAAsyncGetHostByName(
|
||||||
|
IN HWND hWnd,
|
||||||
|
IN u_int wMsg,
|
||||||
|
IN const char FAR *name,
|
||||||
|
OUT char FAR *buf,
|
||||||
|
IN int buflen);
|
||||||
|
|
||||||
|
HANDLE
|
||||||
|
PASCAL FAR
|
||||||
|
WSAAsyncGetHostByAddr(
|
||||||
|
IN HWND hWnd,
|
||||||
|
IN u_int wMsg,
|
||||||
|
IN const char FAR *addr,
|
||||||
|
IN int len,
|
||||||
|
IN int type,
|
||||||
|
OUT char FAR *buf,
|
||||||
|
IN int buflen);
|
||||||
|
|
||||||
|
int
|
||||||
|
PASCAL FAR
|
||||||
|
WSACancelAsyncRequest(
|
||||||
|
IN HANDLE hAsyncTaskHandle);
|
||||||
|
|
||||||
|
int
|
||||||
|
PASCAL FAR
|
||||||
|
WSAAsyncSelect(
|
||||||
|
IN SOCKET s,
|
||||||
|
IN HWND hWnd,
|
||||||
|
IN u_int wMsg,
|
||||||
|
IN long lEvent);
|
||||||
|
|
||||||
|
int
|
||||||
|
PASCAL FAR
|
||||||
|
WSARecvEx(
|
||||||
|
IN SOCKET s,
|
||||||
|
OUT char FAR *buf,
|
||||||
|
IN int len,
|
||||||
|
IN OUT int FAR *flags);
|
||||||
|
|
||||||
|
typedef struct _TRANSMIT_FILE_BUFFERS {
|
||||||
|
PVOID Head;
|
||||||
|
DWORD HeadLength;
|
||||||
|
PVOID Tail;
|
||||||
|
DWORD TailLength;
|
||||||
|
} TRANSMIT_FILE_BUFFERS, *PTRANSMIT_FILE_BUFFERS, *LPTRANSMIT_FILE_BUFFERS;
|
||||||
|
|
||||||
|
#define TF_DISCONNECT 0x01
|
||||||
|
#define TF_REUSE_SOCKET 0x02
|
||||||
|
#define TF_WRITE_BEHIND 0x04
|
||||||
|
|
||||||
|
BOOL
|
||||||
|
PASCAL FAR
|
||||||
|
TransmitFile(
|
||||||
|
IN SOCKET hSocket,
|
||||||
|
IN HANDLE hFile,
|
||||||
|
IN DWORD nNumberOfBytesToWrite,
|
||||||
|
IN DWORD nNumberOfBytesPerSend,
|
||||||
|
IN OUT LPOVERLAPPED lpOverlapped OPTIONAL,
|
||||||
|
IN LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers OPTIONAL,
|
||||||
|
IN DWORD dwReserved);
|
||||||
|
|
||||||
|
BOOL
|
||||||
|
PASCAL FAR
|
||||||
|
AcceptEx(
|
||||||
|
IN SOCKET sListenSocket,
|
||||||
|
IN SOCKET sAcceptSocket,
|
||||||
|
OUT PVOID lpOutputBuffer,
|
||||||
|
IN DWORD dwReceiveDataLength,
|
||||||
|
IN DWORD dwLocalAddressLength,
|
||||||
|
IN DWORD dwRemoteAddressLength,
|
||||||
|
OUT LPDWORD lpdwBytesReceived,
|
||||||
|
IN OUT LPOVERLAPPED lpOverlapped);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
PASCAL FAR
|
||||||
|
GetAcceptExSockaddrs(
|
||||||
|
IN PVOID lpOutputBuffer,
|
||||||
|
IN DWORD dwReceiveDataLength,
|
||||||
|
IN DWORD dwLocalAddressLength,
|
||||||
|
IN DWORD dwRemoteAddressLength,
|
||||||
|
OUT struct sockaddr **LocalSockaddr,
|
||||||
|
OUT LPINT LocalSockaddrLength,
|
||||||
|
OUT struct sockaddr **RemoteSockaddr,
|
||||||
|
OUT LPINT RemoteSockaddrLength);
|
||||||
|
|
||||||
#define WSAMAKEASYNCREPLY(b,e) MAKELONG(b,e)
|
#define WSAMAKEASYNCREPLY(b,e) MAKELONG(b,e)
|
||||||
#define WSAMAKESELECTREPLY(e,error) MAKELONG(e,error)
|
#define WSAMAKESELECTREPLY(e,error) MAKELONG(e,error)
|
||||||
|
@ -523,22 +905,14 @@ typedef struct timeval TIMEVAL;
|
||||||
typedef struct timeval *PTIMEVAL;
|
typedef struct timeval *PTIMEVAL;
|
||||||
typedef struct timeval *LPTIMEVAL;
|
typedef struct timeval *LPTIMEVAL;
|
||||||
|
|
||||||
|
#if(_WIN32_WINNT >= 0x0501)
|
||||||
|
|
||||||
|
#ifdef IPV6STRICT
|
||||||
|
#error WINSOCK2 required.
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* (_WIN32_WINNT >= 0x0501) */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/*
|
|
||||||
* Recent MSDN docs indicate that the MS-specific extensions exported from
|
|
||||||
* mswsock.dll (AcceptEx, TransmitFile. WSARecEx and GetAcceptExSockaddrs) are
|
|
||||||
* declared in mswsock.h. These extensions are not supported on W9x or WinCE.
|
|
||||||
* However, code using WinSock 1.1 API may expect the declarations and
|
|
||||||
* associated defines to be in this header. Thus we include mswsock.h here.
|
|
||||||
*
|
|
||||||
* When linking against the WinSock 1.1 lib, wsock32.dll, the mswsock functions
|
|
||||||
* are automatically routed to mswsock.dll (on platforms with support).
|
|
||||||
* The WinSock 2 lib, ws2_32.dll, does not contain any references to
|
|
||||||
* the mswsock extensions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <mswsock.h>
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue