source: trunk/include/win/winsock.h

Last change on this file was 21456, checked in by dmik, 15 years ago

WinSock2: IPPROTO_IP option constants have different values than in Winsock1.1 (closes ticket:10).

File size: 20.4 KB
Line 
1/* $Id: winsock.h,v 1.5 2001-07-03 14:46:00 achimha Exp $ */
2
3/* WINSOCK.H--definitions to be used with the WINSOCK.DLL
4 *
5 * This header file corresponds to version 1.1 of the Windows Sockets
6 * specification.
7 */
8
9#ifndef _WINSOCKAPI_
10#define _WINSOCKAPI_
11
12#ifndef __WINE_WINDOWS_H
13#include <windows.h>
14#endif // __WINE_WINDOWS_H
15
16typedef unsigned char u_char;
17typedef unsigned short u_short;
18typedef unsigned int u_int;
19typedef unsigned long u_long;
20typedef u_int SOCKET;
21
22#ifndef FD_SETSIZE
23#define FD_SETSIZE 64
24#endif /* FD_SETSIZE */
25
26typedef struct fd_set {
27 u_int fd_count;
28 SOCKET fd_array[FD_SETSIZE];
29} fd_set;
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35extern int WIN32API __WSAFDIsSet(SOCKET, fd_set *);
36
37#ifdef __cplusplus
38}
39#endif
40
41
42#define FD_CLR(fd, set) do { \
43 u_int __i; \
44 for (__i = 0; __i < ((fd_set *)(set))->fd_count ; __i++) { \
45 if (((fd_set *)(set))->fd_array[__i] == fd) { \
46 while (__i < ((fd_set *)(set))->fd_count-1) { \
47 ((fd_set *)(set))->fd_array[__i] = \
48 ((fd_set *)(set))->fd_array[__i+1]; \
49 __i++; \
50 } \
51 ((fd_set *)(set))->fd_count--; \
52 break; \
53 } \
54 } \
55} while(0)
56
57#define FD_SET(fd, set) do { \
58 if (((fd_set *)(set))->fd_count < FD_SETSIZE) \
59 ((fd_set *)(set))->fd_array[((fd_set *)(set))->fd_count++]=(fd);\
60} while(0)
61
62#define FD_ZERO(set) (((fd_set *)(set))->fd_count=0)
63
64#define FD_ISSET(fd, set) __WSAFDIsSet((SOCKET)(fd), (fd_set *)(set))
65
66struct timeval {
67 long tv_sec; /* seconds */
68 long tv_usec; /* and microseconds */
69};
70
71#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
72#define timercmp(tvp, uvp, cmp) \
73 ((tvp)->tv_sec cmp (uvp)->tv_sec || \
74 (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec)
75#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
76
77#define IOCPARM_MASK 0x7f /* parameters must be < 128 bytes */
78#define IOC_VOID 0x20000000 /* no parameters */
79#define IOC_OUT 0x40000000 /* copy out parameters */
80#define IOC_IN 0x80000000 /* copy in parameters */
81#define IOC_INOUT (IOC_IN|IOC_OUT)
82 /* 0x20000000 distinguishes new &
83 old ioctl's */
84#define _IO(x,y) (IOC_VOID|((x)<<8)|(y))
85
86#define _IOR(x,y,t) (IOC_OUT|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
87
88#define _IOW(x,y,t) (IOC_IN|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
89
90#define FIONREAD _IOR('f', 127, u_long) /* get # bytes to read */
91#define FIONBIO _IOW('f', 126, u_long) /* set/clear non-blocking i/o */
92#define FIOASYNC _IOW('f', 125, u_long) /* set/clear async i/o */
93
94#define SIOCSHIWAT _IOW('s', 0, u_long) /* set high watermark */
95#define SIOCGHIWAT _IOR('s', 1, u_long) /* get high watermark */
96#define SIOCSLOWAT _IOW('s', 2, u_long) /* set low watermark */
97#define SIOCGLOWAT _IOR('s', 3, u_long) /* get low watermark */
98#define SIOCATMARK _IOR('s', 7, u_long) /* at oob mark? */
99
100struct hostent {
101 char * h_name;
102 char * * h_aliases;
103 short h_addrtype;
104 short h_length;
105 char * * h_addr_list;
106#define h_addr h_addr_list[0]
107};
108
109struct netent {
110 char * n_name;
111 char * * n_aliases;
112 short n_addrtype;
113 u_long n_net;
114};
115
116struct servent {
117 char * s_name;
118 char * * s_aliases;
119 short s_port;
120 char * s_proto;
121};
122
123struct protoent {
124 char * p_name;
125 char * * p_aliases;
126 short p_proto;
127};
128
129#define IPPROTO_IP 0
130#define IPPROTO_ICMP 1
131#define IPPROTO_IGMP 2
132#define IPPROTO_GGP 3
133#define IPPROTO_TCP 6
134#define IPPROTO_PUP 12
135#define IPPROTO_UDP 17
136#define IPPROTO_IDP 22
137#define IPPROTO_ND 77
138
139#define IPPROTO_RAW 255
140#define IPPROTO_MAX 256
141
142#define IPPORT_ECHO 7
143#define IPPORT_DISCARD 9
144#define IPPORT_SYSTAT 11
145#define IPPORT_DAYTIME 13
146#define IPPORT_NETSTAT 15
147#define IPPORT_FTP 21
148#define IPPORT_TELNET 23
149#define IPPORT_SMTP 25
150#define IPPORT_TIMESERVER 37
151#define IPPORT_NAMESERVER 42
152#define IPPORT_WHOIS 43
153#define IPPORT_MTP 57
154
155#define IPPORT_TFTP 69
156#define IPPORT_RJE 77
157#define IPPORT_FINGER 79
158#define IPPORT_TTYLINK 87
159#define IPPORT_SUPDUP 95
160
161#define IPPORT_EXECSERVER 512
162#define IPPORT_LOGINSERVER 513
163#define IPPORT_CMDSERVER 514
164#define IPPORT_EFSSERVER 520
165
166#define IPPORT_BIFFUDP 512
167#define IPPORT_WHOSERVER 513
168#define IPPORT_ROUTESERVER 520
169
170#define IPPORT_RESERVED 1024
171
172#define IMPLINK_IP 155
173#define IMPLINK_LOWEXPER 156
174#define IMPLINK_HIGHEXPER 158
175
176struct in_addr {
177 union {
178 struct { u_char s_b1,s_b2,s_b3,s_b4; } S_un_b;
179 struct { u_short s_w1,s_w2; } S_un_w;
180 u_long S_addr;
181 } S_un;
182
183#define s_addr S_un.S_addr
184#define s_host S_un.S_un_b.s_b2
185#define s_net S_un.S_un_b.s_b1
186#define s_imp S_un.S_un_w.s_w2
187#define s_impno S_un.S_un_b.s_b4
188#define s_lh S_un.S_un_b.s_b3
189};
190
191#define IN_CLASSA(i) (((long)(i) & 0x80000000) == 0)
192#define IN_CLASSA_NET 0xff000000
193#define IN_CLASSA_NSHIFT 24
194#define IN_CLASSA_HOST 0x00ffffff
195#define IN_CLASSA_MAX 128
196
197#define IN_CLASSB(i) (((long)(i) & 0xc0000000) == 0x80000000)
198#define IN_CLASSB_NET 0xffff0000
199#define IN_CLASSB_NSHIFT 16
200#define IN_CLASSB_HOST 0x0000ffff
201#define IN_CLASSB_MAX 65536
202
203#define IN_CLASSC(i) (((long)(i) & 0xe0000000) == 0xc0000000)
204#define IN_CLASSC_NET 0xffffff00
205#define IN_CLASSC_NSHIFT 8
206#define IN_CLASSC_HOST 0x000000ff
207
208#define INADDR_ANY (u_long)0x00000000
209#define INADDR_LOOPBACK 0x7f000001
210#define INADDR_BROADCAST (u_long)0xffffffff
211#define INADDR_NONE 0xffffffff
212
213struct sockaddr_in {
214 short sin_family;
215 u_short sin_port;
216 struct in_addr sin_addr;
217 char sin_zero[8];
218};
219
220#define WSADESCRIPTION_LEN 256
221#define WSASYS_STATUS_LEN 128
222
223typedef struct WSAData {
224 WORD wVersion;
225 WORD wHighVersion;
226 char szDescription[WSADESCRIPTION_LEN+1];
227 char szSystemStatus[WSASYS_STATUS_LEN+1];
228 unsigned short iMaxSockets;
229 unsigned short iMaxUdpDg;
230 char * lpVendorInfo;
231} WSADATA;
232
233typedef WSADATA *LPWSADATA;
234
235#ifndef __WINSOCK2API__
236#define IP_OPTIONS 1
237#define IP_MULTICAST_IF 2
238#define IP_MULTICAST_TTL 3
239#define IP_MULTICAST_LOOP 4
240#define IP_ADD_MEMBERSHIP 5
241#define IP_DROP_MEMBERSHIP 6
242#define IP_TTL 7
243#define IP_TOS 8
244#define IP_DONTFRAGMENT 9
245#endif
246
247#define IP_DEFAULT_MULTICAST_TTL 1
248#define IP_DEFAULT_MULTICAST_LOOP 1
249#define IP_MAX_MEMBERSHIPS 20
250
251struct ip_mreq {
252 struct in_addr imr_multiaddr;
253 struct in_addr imr_interface;
254};
255
256#define INVALID_SOCKET (SOCKET)(~0)
257#define SOCKET_ERROR (-1)
258
259#define SOCK_STREAM 1
260#define SOCK_DGRAM 2
261#define SOCK_RAW 3
262#define SOCK_RDM 4
263#define SOCK_SEQPACKET 5
264
265#define SO_DEBUG 0x0001
266#define SO_ACCEPTCONN 0x0002
267#define SO_REUSEADDR 0x0004
268#define SO_KEEPALIVE 0x0008
269#define SO_DONTROUTE 0x0010
270#define SO_BROADCAST 0x0020
271#define SO_USELOOPBACK 0x0040
272#define SO_LINGER 0x0080
273#define SO_OOBINLINE 0x0100
274
275#define SO_DONTLINGER (u_int)(~SO_LINGER)
276
277#define SO_SNDBUF 0x1001
278#define SO_RCVBUF 0x1002
279#define SO_SNDLOWAT 0x1003
280#define SO_RCVLOWAT 0x1004
281#define SO_SNDTIMEO 0x1005
282#define SO_RCVTIMEO 0x1006
283#define SO_ERROR 0x1007
284#define SO_TYPE 0x1008
285
286#define SO_CONNDATA 0x7000
287#define SO_CONNOPT 0x7001
288#define SO_DISCDATA 0x7002
289#define SO_DISCOPT 0x7003
290#define SO_CONNDATALEN 0x7004
291#define SO_CONNOPTLEN 0x7005
292#define SO_DISCDATALEN 0x7006
293#define SO_DISCOPTLEN 0x7007
294
295#define SO_OPENTYPE 0x7008
296
297#define SO_SYNCHRONOUS_ALERT 0x10
298#define SO_SYNCHRONOUS_NONALERT 0x20
299
300#define SO_MAXDG 0x7009
301#define SO_MAXPATHDG 0x700A
302#define SO_UPDATE_ACCEPT_CONTEXT 0x700B
303#define SO_CONNECT_TIME 0x700C
304
305#define TCP_NODELAY 0x0001
306#define TCP_BSDURGENT 0x7000
307
308#define AF_UNSPEC 0
309#define AF_UNIX 1
310#define AF_INET 2
311#define AF_IMPLINK 3
312#define AF_PUP 4
313#define AF_CHAOS 5
314#define AF_IPX 6
315#define AF_NS 6
316#define AF_ISO 7
317#define AF_OSI AF_ISO
318#define AF_ECMA 8
319#define AF_DATAKIT 9
320#define AF_CCITT 10
321#define AF_SNA 11
322#define AF_DECnet 12
323#define AF_DLI 13
324#define AF_LAT 14
325#define AF_HYLINK 15
326#define AF_APPLETALK 16
327#define AF_NETBIOS 17
328#define AF_VOICEVIEW 18
329#define AF_FIREFOX 19
330#define AF_UNKNOWN1 20
331#define AF_BAN 21
332
333#define AF_MAX 22
334
335struct sockaddr {
336 u_short sa_family;
337 char sa_data[14];
338};
339
340struct sockproto {
341 u_short sp_family; /* address family */
342 u_short sp_protocol; /* protocol */
343};
344
345#define PF_UNSPEC AF_UNSPEC
346#define PF_UNIX AF_UNIX
347#define PF_INET AF_INET
348#define PF_IMPLINK AF_IMPLINK
349#define PF_PUP AF_PUP
350#define PF_CHAOS AF_CHAOS
351#define PF_NS AF_NS
352#define PF_IPX AF_IPX
353#define PF_ISO AF_ISO
354#define PF_OSI AF_OSI
355#define PF_ECMA AF_ECMA
356#define PF_DATAKIT AF_DATAKIT
357#define PF_CCITT AF_CCITT
358#define PF_SNA AF_SNA
359#define PF_DECnet AF_DECnet
360#define PF_DLI AF_DLI
361#define PF_LAT AF_LAT
362#define PF_HYLINK AF_HYLINK
363#define PF_APPLETALK AF_APPLETALK
364#define PF_VOICEVIEW AF_VOICEVIEW
365#define PF_FIREFOX AF_FIREFOX
366#define PF_UNKNOWN1 AF_UNKNOWN1
367#define PF_BAN AF_BAN
368
369#define PF_MAX AF_MAX
370
371struct linger {
372 u_short l_onoff; /* option on/off */
373 u_short l_linger; /* linger time */
374};
375
376#define SOL_SOCKET 0xffff /* options for socket level */
377
378#define SOMAXCONN 5
379
380#define MSG_OOB 0x1 /* process out-of-band data */
381#define MSG_PEEK 0x2 /* peek at incoming message */
382#define MSG_DONTROUTE 0x4 /* send without using routing tables */
383
384#define MSG_MAXIOVLEN 16
385
386#define MSG_PARTIAL 0x8000 /* partial send or recv for message xport */
387
388#define MAXGETHOSTSTRUCT 1024
389
390#ifndef __WINSOCK2API__
391#define FD_READ 0x01
392#define FD_WRITE 0x02
393#define FD_OOB 0x04
394#define FD_ACCEPT 0x08
395#define FD_CONNECT 0x10
396#define FD_CLOSE 0x20
397#endif
398
399#define WSABASEERR 10000
400
401#define WSAEINTR (WSABASEERR+4)
402#define WSAEBADF (WSABASEERR+9)
403#define WSAEACCES (WSABASEERR+13)
404#define WSAEFAULT (WSABASEERR+14)
405#define WSAEINVAL (WSABASEERR+22)
406#define WSAEMFILE (WSABASEERR+24)
407
408#define WSAEWOULDBLOCK (WSABASEERR+35)
409#define WSAEINPROGRESS (WSABASEERR+36)
410#define WSAEALREADY (WSABASEERR+37)
411#define WSAENOTSOCK (WSABASEERR+38)
412#define WSAEDESTADDRREQ (WSABASEERR+39)
413#define WSAEMSGSIZE (WSABASEERR+40)
414#define WSAEPROTOTYPE (WSABASEERR+41)
415#define WSAENOPROTOOPT (WSABASEERR+42)
416#define WSAEPROTONOSUPPORT (WSABASEERR+43)
417#define WSAESOCKTNOSUPPORT (WSABASEERR+44)
418#define WSAEOPNOTSUPP (WSABASEERR+45)
419#define WSAEPFNOSUPPORT (WSABASEERR+46)
420#define WSAEAFNOSUPPORT (WSABASEERR+47)
421#define WSAEADDRINUSE (WSABASEERR+48)
422#define WSAEADDRNOTAVAIL (WSABASEERR+49)
423#define WSAENETDOWN (WSABASEERR+50)
424#define WSAENETUNREACH (WSABASEERR+51)
425#define WSAENETRESET (WSABASEERR+52)
426#define WSAECONNABORTED (WSABASEERR+53)
427#define WSAECONNRESET (WSABASEERR+54)
428#define WSAENOBUFS (WSABASEERR+55)
429#define WSAEISCONN (WSABASEERR+56)
430#define WSAENOTCONN (WSABASEERR+57)
431#define WSAESHUTDOWN (WSABASEERR+58)
432#define WSAETOOMANYREFS (WSABASEERR+59)
433#define WSAETIMEDOUT (WSABASEERR+60)
434#define WSAECONNREFUSED (WSABASEERR+61)
435#define WSAELOOP (WSABASEERR+62)
436#define WSAENAMETOOLONG (WSABASEERR+63)
437#define WSAEHOSTDOWN (WSABASEERR+64)
438#define WSAEHOSTUNREACH (WSABASEERR+65)
439#define WSAENOTEMPTY (WSABASEERR+66)
440#define WSAEPROCLIM (WSABASEERR+67)
441#define WSAEUSERS (WSABASEERR+68)
442#define WSAEDQUOT (WSABASEERR+69)
443#define WSAESTALE (WSABASEERR+70)
444#define WSAEREMOTE (WSABASEERR+71)
445
446#define WSASYSNOTREADY (WSABASEERR+91)
447#define WSAVERNOTSUPPORTED (WSABASEERR+92)
448#define WSANOTINITIALISED (WSABASEERR+93)
449
450#define WSAEDISCON (WSABASEERR+101)
451
452#define WSATYPE_NOT_FOUND (WSABASEERR+109)
453
454#define h_errno WSAGetLastError()
455
456#define WSAHOST_NOT_FOUND (WSABASEERR+1001)
457#define HOST_NOT_FOUND WSAHOST_NOT_FOUND
458
459#define WSATRY_AGAIN (WSABASEERR+1002)
460#define TRY_AGAIN WSATRY_AGAIN
461
462#define WSANO_RECOVERY (WSABASEERR+1003)
463#define NO_RECOVERY WSANO_RECOVERY
464
465#define WSANO_DATA (WSABASEERR+1004)
466#define NO_DATA WSANO_DATA
467
468#define WSANO_ADDRESS WSANO_DATA
469#define NO_ADDRESS WSANO_ADDRESS
470
471#ifdef __cplusplus
472extern "C" {
473#endif
474
475SOCKET WIN32API accept (SOCKET s, struct sockaddr *addr,
476 int *addrlen);
477
478int WIN32API bind (SOCKET s, const struct sockaddr *addr, int namelen);
479
480int WIN32API closesocket (SOCKET s);
481
482int WIN32API connect (SOCKET s, const struct sockaddr *name, int namelen);
483
484int WIN32API ioctlsocket (SOCKET s, long cmd, u_long *argp);
485
486int WIN32API getpeername (SOCKET s, struct sockaddr *name,
487 int * namelen);
488
489int WIN32API getsockname (SOCKET s, struct sockaddr *name,
490 int * namelen);
491
492int WIN32API getsockopt (SOCKET s, int level, int optname,
493 char * optval, int *optlen);
494
495u_long WIN32API htonl (u_long hostlong);
496
497u_short WIN32API htons (u_short hostshort);
498
499unsigned long WIN32API inet_addr (const char * cp);
500
501char * WIN32API inet_ntoa (struct in_addr in);
502
503int WIN32API listen (SOCKET s, int backlog);
504
505u_long WIN32API ntohl (u_long netlong);
506
507u_short WIN32API ntohs (u_short netshort);
508
509int WIN32API recv (SOCKET s, char * buf, int len, int flags);
510
511int WIN32API recvfrom (SOCKET s, char * buf, int len, int flags,
512 struct sockaddr *from, int * fromlen);
513
514int WIN32API select (int nfds, fd_set *readfds, fd_set *writefds,
515 fd_set *exceptfds, const struct timeval *timeout);
516
517int WIN32API send (SOCKET s, const char * buf, int len, int flags);
518
519int WIN32API sendto (SOCKET s, const char * buf, int len, int flags,
520 const struct sockaddr *to, int tolen);
521
522int WIN32API setsockopt (SOCKET s, int level, int optname,
523 const char * optval, int optlen);
524
525int WIN32API shutdown (SOCKET s, int how);
526
527SOCKET WIN32API socket (int af, int type, int protocol);
528
529/* Database function prototypes */
530
531struct hostent * WIN32API gethostbyaddr(const char * addr,
532 int len, int type);
533
534struct hostent * WIN32API gethostbyname(const char * name);
535
536int WIN32API gethostname (char * name, int namelen);
537
538struct servent * WIN32API getservbyport(int port, const char * proto);
539
540struct servent * WIN32API getservbyname(const char * name,
541 const char * proto);
542
543struct protoent * WIN32API getprotobynumber(int proto);
544
545struct protoent * WIN32API getprotobyname(const char * name);
546
547/* Microsoft Windows Extension function prototypes */
548
549int WIN32API WSAStartup(WORD wVersionRequired, LPWSADATA lpWSAData);
550
551int WIN32API WSACleanup(void);
552
553void WIN32API WSASetLastError(int iError);
554
555int WIN32API WSAGetLastError(void);
556
557BOOL WIN32API WSAIsBlocking(void);
558
559int WIN32API WSAUnhookBlockingHook(void);
560
561FARPROC WIN32API WSASetBlockingHook(FARPROC lpBlockFunc);
562
563int WIN32API WSACancelBlockingCall(void);
564
565HANDLE WIN32API WSAAsyncGetServByName(HWND hWnd, u_int wMsg,
566 const char * name,
567 const char * proto,
568 char * buf, int buflen);
569
570HANDLE WIN32API WSAAsyncGetServByPort(HWND hWnd, u_int wMsg, int port,
571 const char * proto, char * buf,
572 int buflen);
573
574HANDLE WIN32API WSAAsyncGetProtoByName(HWND hWnd, u_int wMsg,
575 const char * name, char * buf,
576 int buflen);
577
578HANDLE WIN32API WSAAsyncGetProtoByNumber(HWND hWnd, u_int wMsg,
579 int number, char * buf,
580 int buflen);
581
582HANDLE WIN32API WSAAsyncGetHostByName(HWND hWnd, u_int wMsg,
583 const char * name, char * buf,
584 int buflen);
585
586HANDLE WIN32API WSAAsyncGetHostByAddr(HWND hWnd, u_int wMsg,
587 const char * addr, int len, int type,
588 char * buf, int buflen);
589
590int WIN32API WSACancelAsyncRequest(HANDLE hAsyncTaskHandle);
591
592int WIN32API WSAAsyncSelect(SOCKET s, HWND hWnd, u_int wMsg,
593 long lEvent);
594
595int WIN32API WSARecvEx (SOCKET s, char * buf, int len, int *flags);
596
597typedef struct _TRANSMIT_FILE_BUFFERS {
598 PVOID Head;
599 DWORD HeadLength;
600 PVOID Tail;
601 DWORD TailLength;
602} TRANSMIT_FILE_BUFFERS, *PTRANSMIT_FILE_BUFFERS, *LPTRANSMIT_FILE_BUFFERS;
603
604#define TF_DISCONNECT 0x01
605#define TF_REUSE_SOCKET 0x02
606#define TF_WRITE_BEHIND 0x04
607
608BOOL WIN32API TransmitFile (
609 SOCKET hSocket,
610 HANDLE hFile,
611 DWORD nNumberOfBytesToWrite,
612 DWORD nNumberOfBytesPerSend,
613 LPOVERLAPPED lpOverlapped,
614 LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers,
615 DWORD dwReserved
616 );
617
618BOOL WIN32API AcceptEx (
619 SOCKET sListenSocket,
620 SOCKET sAcceptSocket,
621 PVOID lpOutputBuffer,
622 DWORD dwReceiveDataLength,
623 DWORD dwLocalAddressLength,
624 DWORD dwRemoteAddressLength,
625 LPDWORD lpdwBytesReceived,
626 LPOVERLAPPED lpOverlapped
627 );
628
629VOID WIN32API GetAcceptExSockaddrs (
630 PVOID lpOutputBuffer,
631 DWORD dwReceiveDataLength,
632 DWORD dwLocalAddressLength,
633 DWORD dwRemoteAddressLength,
634 struct sockaddr **LocalSockaddr,
635 LPINT LocalSockaddrLength,
636 struct sockaddr **RemoteSockaddr,
637 LPINT RemoteSockaddrLength
638 );
639
640#ifdef __cplusplus
641}
642#endif
643
644typedef struct sockaddr SOCKADDR;
645typedef struct sockaddr *PSOCKADDR;
646typedef struct sockaddr *LPSOCKADDR;
647
648typedef struct sockaddr_in SOCKADDR_IN;
649typedef struct sockaddr_in *PSOCKADDR_IN;
650typedef struct sockaddr_in *LPSOCKADDR_IN;
651
652typedef struct linger LINGER;
653typedef struct linger *PLINGER;
654typedef struct linger *LPLINGER;
655
656typedef struct in_addr IN_ADDR;
657typedef struct in_addr *PIN_ADDR;
658typedef struct in_addr *LPIN_ADDR;
659
660typedef struct fd_set FD_SET;
661typedef struct fd_set *PFD_SET;
662typedef struct fd_set *LPFD_SET;
663
664typedef struct hostent HOSTENT;
665typedef struct hostent *PHOSTENT;
666typedef struct hostent *LPHOSTENT;
667
668typedef struct servent SERVENT;
669typedef struct servent *PSERVENT;
670typedef struct servent *LPSERVENT;
671
672typedef struct protoent PROTOENT;
673typedef struct protoent *PPROTOENT;
674typedef struct protoent *LPPROTOENT;
675
676typedef struct timeval TIMEVAL;
677typedef struct timeval *PTIMEVAL;
678typedef struct timeval *LPTIMEVAL;
679
680#define WSAMAKEASYNCREPLY(buflen,error) MAKELONG(buflen,error)
681#define WSAMAKESELECTREPLY(event,error) MAKELONG(event,error)
682#define WSAGETASYNCBUFLEN(lParam) LOWORD(lParam)
683#define WSAGETASYNCERROR(lParam) HIWORD(lParam)
684#define WSAGETSELECTEVENT(lParam) LOWORD(lParam)
685#define WSAGETSELECTERROR(lParam) HIWORD(lParam)
686
687#endif // _WINSOCKAPI_
688
689
Note: See TracBrowser for help on using the repository browser.