Changeset 3199 for trunk/src/wsock32/wsock32.h
- Timestamp:
- Mar 22, 2000, 9:07:30 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wsock32/wsock32.h
r3195 r3199 1 /* $Id: wsock32.h,v 1.11 2000-03-22 18:46:20 sandervl Exp $ */ 1 ; $Id: wsock32.h,v 1.12 2000-03-22 20:07:30 sandervl Exp $ 2 2 3 3 /* WSOCK32.H--definitions & conversions for Odin's wsock32.dll. … … 16 16 #define _WINSOCK32CONST_ 17 17 18 #include <sys\socket.h>19 #include <sys\ioctl.h>20 #include <netdb.h>21 #include <netinet\in.h>22 #include <netinet\tcp.h>23 #include <nerrno.h>24 #include <sys\time.h>25 26 /*27 * Socket state bits.28 */29 #define SS_NOFDREF 0x0001 /* no file table ref any more */30 #define SS_ISCONNECTED 0x0002 /* socket connected to a peer */31 #define SS_ISCONNECTING 0x0004 /* in process of connecting to peer */32 #define SS_ISDISCONNECTING 0x0008 /* in process of disconnecting */33 #define SS_CANTSENDMORE 0x0010 /* can't send more data to peer */34 #define SS_CANTRCVMORE 0x0020 /* can't receive more data from peer */35 #define SS_RCVATMARK 0x0040 /* at mark on input */36 37 #define SS_NBIO 0x0100 /* non-blocking ops */38 #define SS_ASYNC 0x0200 /* async i/o notify */39 #define SS_ISCONFIRMING 0x0400 /* deciding to accept connection req */40 41 #define SS_INCOMP 0x0800 /* unaccepted, incomplete connection */42 #define SS_COMP 0x1000 /* unaccepted, complete connection */43 #define SS_ISDISCONNECTED 0x2000 /* socket disconnected from peer */44 45 //socketopt options46 #define SO_DONTLINGER (u_int)(~SO_LINGER)47 48 // WSAAsyncSelect flags49 #define FD_READ 0x0150 #define FD_WRITE 0x0251 #define FD_OOB 0x0452 #define FD_ACCEPT 0x0853 #define FD_CONNECT 0x1054 #define FD_CLOSE 0x2055 56 #define SOCKET_ERROR -157 #define NO_ERROR 058 59 #define WSABASEERR 1000060 61 #define WSAEINTR (WSABASEERR+4)62 #define WSAEBADF (WSABASEERR+9)63 #define WSAEACCES (WSABASEERR+13)64 #define WSAEFAULT (WSABASEERR+14)65 #define WSAEINVAL (WSABASEERR+22)66 #define WSAEMFILE (WSABASEERR+24)67 68 #define WSAEWOULDBLOCK (WSABASEERR+35)69 #define WSAEINPROGRESS (WSABASEERR+36)70 #define WSAEALREADY (WSABASEERR+37)71 #define WSAENOTSOCK (WSABASEERR+38)72 #define WSAEDESTADDRREQ (WSABASEERR+39)73 #define WSAEMSGSIZE (WSABASEERR+40)74 #define WSAEPROTOTYPE (WSABASEERR+41)75 #define WSAENOPROTOOPT (WSABASEERR+42)76 #define WSAEPROTONOSUPPORT (WSABASEERR+43)77 #define WSAESOCKTNOSUPPORT (WSABASEERR+44)78 #define WSAEOPNOTSUPP (WSABASEERR+45)79 #define WSAEPFNOSUPPORT (WSABASEERR+46)80 #define WSAEAFNOSUPPORT (WSABASEERR+47)81 #define WSAEADDRINUSE (WSABASEERR+48)82 #define WSAEADDRNOTAVAIL (WSABASEERR+49)83 #define WSAENETDOWN (WSABASEERR+50)84 #define WSAENETUNREACH (WSABASEERR+51)85 #define WSAENETRESET (WSABASEERR+52)86 #define WSAECONNABORTED (WSABASEERR+53)87 #define WSAECONNRESET (WSABASEERR+54)88 #define WSAENOBUFS (WSABASEERR+55)89 #define WSAEISCONN (WSABASEERR+56)90 #define WSAENOTCONN (WSABASEERR+57)91 #define WSAESHUTDOWN (WSABASEERR+58)92 #define WSAETOOMANYREFS (WSABASEERR+59)93 #define WSAETIMEDOUT (WSABASEERR+60)94 #define WSAECONNREFUSED (WSABASEERR+61)95 #define WSAELOOP (WSABASEERR+62)96 #define WSAENAMETOOLONG (WSABASEERR+63)97 #define WSAEHOSTDOWN (WSABASEERR+64)98 #define WSAEHOSTUNREACH (WSABASEERR+65)99 #define WSAENOTEMPTY (WSABASEERR+66)100 #define WSAEPROCLIM (WSABASEERR+67)101 #define WSAEUSERS (WSABASEERR+68)102 #define WSAEDQUOT (WSABASEERR+69)103 #define WSAESTALE (WSABASEERR+70)104 #define WSAEREMOTE (WSABASEERR+71)105 #define WSASYSNOTREADY (WSABASEERR+91)106 #define WSAVERNOTSUPPORTED (WSABASEERR+92)107 #define WSANOTINITIALISED (WSABASEERR+93)108 #define WSAHOST_NOT_FOUND (WSABASEERR+1001)109 #define WSATRY_AGAIN (WSABASEERR+1002)110 #define WSANO_RECOVERY (WSABASEERR+1003)111 #define WSANO_DATA (WSABASEERR+1004)112 #define WSANO_ADDRESS WSANO_DATA113 114 typedef u_int SOCKET;115 116 #define FD_SETSIZE 64117 118 #pragma pack(1)119 120 #define WSADESCRIPTION_LEN 256121 #define WSASYS_STATUS_LEN 128122 123 typedef struct WSAData {124 USHORT wVersion;125 USHORT wHighVersion;126 char szDescription[WSADESCRIPTION_LEN+1];127 char szSystemStatus[WSASYS_STATUS_LEN+1];128 unsigned short iMaxSockets;129 unsigned short iMaxUdpDg;130 char * lpVendorInfo;131 } WSADATA;132 typedef WSADATA *PWSADATA;133 typedef WSADATA *LPWSADATA;134 135 typedef struct ws_fd_set {136 u_int fd_count;137 SOCKET fd_array[FD_SETSIZE];138 } _ws_fd_set;139 18 140 19 /* 141 20 * Structure used for manipulating linger option. 142 21 */ 143 typedef struct ws_linger {22 struct Wlinger { 144 23 u_short l_onoff; /* option on/off */ 145 24 u_short l_linger; /* linger time */ 146 } _ws_linger; 25 }; 26 147 27 148 28 /* … … 152 32 */ 153 33 154 typedef struct ws_hostent 34 struct Whostent { 35 char * h_name; /* official name of host */ 36 char * * h_aliases; /* alias list */ 37 short h_addrtype; /* host address type */ 38 short h_length; /* length of address */ 39 char * * h_addr_list; /* list of addresses */ 40 #define h_addr h_addr_list[0] /* address, for backward compat */ 41 }; 42 43 /* 44 * It is assumed here that a network number 45 * fits in 32 bits. 46 */ 47 struct Wnetent { 48 char * n_name; /* official name of net */ 49 char * * n_aliases; /* alias list */ 50 short n_addrtype; /* net address type */ 51 u_long n_net; /* network # */ 52 }; 53 typedef struct Whostent WHOSTENT; 54 typedef WHOSTENT *PWHOSTENT; 55 56 struct Wservent { 57 char * s_name; /* official service name */ 58 char * * s_aliases; /* alias list */ 59 short s_port; /* port # */ 60 char * s_proto; /* protocol to use */ 61 }; 62 typedef struct Wservent WSERVENT; 63 typedef WSERVENT *PWSERVENT; 64 65 struct Wprotoent { 66 char * p_name; /* official protocol name */ 67 char * * p_aliases; /* alias list */ 68 short p_proto; /* protocol # */ 69 }; 70 typedef struct Wprotoent WPROTOENT; 71 typedef WPROTOENT *PWPROTOENT; 72 73 typedef struct tagWsockThreadData 155 74 { 156 char * h_name; /* official name of host */ 157 char ** h_aliases; /* alias list */ 158 INT16 h_addrtype; /* host address type */ 159 INT16 h_length; /* length of address */ 160 char ** h_addr_list; /* list of addresses from name server */ 161 } _ws_hostent; 75 int dwLastError; // Get/SetLastError 76 struct Whostent whsnt; // database conversion buffers 77 struct Wservent wsvnt; 78 struct Wprotoent wptnt; 79 struct Wnetent wntnt; 80 struct Wlinger wlinger; 81 } WSOCKTHREADDATA, *PWSOCKTHREADDATA; 162 82 163 typedef struct ws_protoent 164 { 165 char * p_name; /* official protocol name */ 166 char ** p_aliases; /* alias list */ 167 INT16 p_proto; /* protocol # */ 168 } _ws_protoent; 83 // internal prototype 84 PWSOCKTHREADDATA iQueryWsockThreadData(void); 169 85 170 typedef struct ws_servent171 {172 char * s_name; /* official service name */173 char ** s_aliases; /* alias list */174 INT16 s_port; /* port # */175 char * s_proto; /* protocol to use */176 } _ws_servent;177 178 typedef struct ws_netent179 {180 char * n_name; /* official name of net */181 char ** n_aliases; /* alias list */182 INT16 n_addrtype; /* net address type */183 INT n_net; /* network # */184 } _ws_netent;185 186 #pragma pack()187 188 #define WS_MAX_SOCKETS_PER_PROCESS 128 /* reasonable guess */189 #define WS_MAX_UDP_DATAGRAM 1024190 191 #define WSI_BLOCKINGCALL 0x00000001 /* per-thread info flags */192 #define WSI_BLOCKINGHOOK 0x00000002 /* 32-bit callback */193 194 typedef struct _WSINFO195 {196 DWORD dwThisThread;197 struct _WSINFO *lpNextIData;198 199 unsigned flags;200 INT16 num_startup; /* reference counter */201 INT16 num_async_rq;202 INT16 last_free; /* entry in the socket table */203 USHORT buflen;204 char* buffer; /* allocated from char * heap */205 struct ws_hostent *he;206 int helen;207 struct ws_servent *se;208 int selen;209 struct ws_protoent *pe;210 int pelen;211 char* dbuffer; /* buffer for dummies (32 bytes) */212 213 DWORD blocking_hook;214 } WSINFO, *LPWSINFO;215 216 void WIN32API WSASetLastError(int iError);217 int WIN32API WSAGetLastError(void);218 BOOL WIN32API WSAIsBlocking(void);219 int WIN32API WSAAsyncSelect(SOCKET s, HWND hWnd, u_int wMsg, long lEvent);220 86 221 87 extern BOOL fWSAInitialized; 222 88 223 UINT wsaErrno(); 224 UINT wsaHerrno(); 89 void WIN32API OS2WSASetLastError(int iError); 225 90 226 #define CURRENT_THREAD -1 227 void WSASetBlocking(BOOL fBlock, HANDLE tid = CURRENT_THREAD); 91 int WIN32API OS2WSAGetLastError(void); 228 92 229 void WINSOCK_DeleteIData(void); 230 BOOL WINSOCK_CreateIData(void); 231 LPWSINFO WINSOCK_GetIData(HANDLE tid = CURRENT_THREAD); 93 BOOL WIN32API OS2WSAIsBlocking(void); 232 94 233 95 #endif /* _WINSOCK32CONST_ */
Note:
See TracChangeset
for help on using the changeset viewer.