1 #ifndef TCPIP_DEFINITIONS_GROUP
2 #define TCPIP_DEFINITIONS_GROUP
4 /*****************************************************************************\
6 * Name : tcpip_definitions *
7 * Author : Chris Koeritz *
11 * Provides some variables that make porting between Unix and W32 easier. *
13 *******************************************************************************
14 * Copyright (c) 2001-$now By Author. This program is free software; you can *
15 * redistribute it and/or modify it under the terms of the GNU General Public *
16 * License as published by the Free Software Foundation; either version 2 of *
17 * the License or (at your option) any later version. This is online at: *
18 * http://www.fsf.org/copyleft/gpl.html *
19 * Please send any updates to: fred@gruntose.com *
20 \*****************************************************************************/
22 ///#include "sockets_dll.h"
25 // provide some unifying definitions.
26 #define INVALID_SOCKET -1
27 #define SOCKET_ERROR -1
28 typedef void sock_hop;
30 // provide synonyms for errors so we don't conflict with the windows
31 // brain-deadness. they define error values like EACCESS but they're not
32 // the real values you need to use with tcp/ip. french fried gates time.
33 #define SOCK_EACCES EACCES
34 #define SOCK_EADDRINUSE EADDRINUSE
35 #define SOCK_EADDRNOTAVAIL EADDRNOTAVAIL
36 #define SOCK_EAFNOSUPPORT EAFNOSUPPORT
37 #define SOCK_EALREADY EALREADY
38 #define SOCK_EBADF EBADF
39 #define SOCK_ECONNABORTED ECONNABORTED
40 #define SOCK_ECONNREFUSED ECONNREFUSED
41 #define SOCK_ECONNRESET ECONNRESET
42 #define SOCK_EDESTADDRREQ EDESTADDRREQ
43 #define SOCK_EDQUOT EDQUOT
44 #define SOCK_EFAULT EFAULT
45 #define SOCK_EHOSTDOWN EHOSTDOWN
46 #define SOCK_EHOSTUNREACH EHOSTUNREACH
47 #define SOCK_EINPROGRESS EINPROGRESS
48 #define SOCK_EINTR EINTR
49 #define SOCK_EINVAL EINVAL
50 #define SOCK_EISCONN EISCONN
51 #define SOCK_ELOOP ELOOP
52 #define SOCK_EMFILE EMFILE
53 #define SOCK_EMSGSIZE EMSGSIZE
54 #define SOCK_ENAMETOOLONG ENAMETOOLONG
55 #define SOCK_ENETDOWN ENETDOWN
56 #define SOCK_ENETUNREACH ENETUNREACH
57 #define SOCK_ENETRESET ENETRESET
58 #define SOCK_ENOBUFS ENOBUFS
59 #define SOCK_ENOPROTOOPT ENOPROTOOPT
60 #define SOCK_ENOTCONN ENOTCONN
61 #define SOCK_ENOTEMPTY ENOTEMPTY
62 #define SOCK_ENOTSOCK ENOTSOCK
63 #define SOCK_EOPNOTSUPP EOPNOTSUPP
64 #define SOCK_EPFNOSUPPORT EPFNOSUPPORT
65 #define SOCK_EPROCLIM EPROCLIM
66 #define SOCK_EPROTOTYPE EPROTOTYPE
67 #define SOCK_EPROTONOSUPPORT EPROTONOSUPPORT
68 #define SOCK_EREMOTE EREMOTE
69 #define SOCK_ESHUTDOWN ESHUTDOWN
70 #define SOCK_ESOCKTNOSUPPORT ESOCKTNOSUPPORT
71 #define SOCK_ESTALE ESTALE
72 #define SOCK_ETIMEDOUT ETIMEDOUT
73 #define SOCK_ETOOMANYREFS ETOOMANYREFS
74 #define SOCK_EWOULDBLOCK EWOULDBLOCK
75 #define SOCK_EUSERS EUSERS
79 #include <application/windoze_helper.h>
81 // provide some aliases for w32.
82 #if COMPILER_VERSION==6
83 #define hostent HOSTENT
85 typedef char sock_hop;
86 typedef int socklen_t;
88 // provide close to the real BSD error names using windows values.
89 #define SOCK_EACCES WSAEACCES
90 #define SOCK_EADDRINUSE WSAEADDRINUSE
91 #define SOCK_EADDRNOTAVAIL WSAEADDRNOTAVAIL
92 #define SOCK_EAFNOSUPPORT WSAEAFNOSUPPORT
93 #define SOCK_EALREADY WSAEALREADY
94 #define SOCK_EBADF WSAEBADF
95 #define SOCK_ECONNABORTED WSAECONNABORTED
96 #define SOCK_ECONNREFUSED WSAECONNREFUSED
97 #define SOCK_ECONNRESET WSAECONNRESET
98 #define SOCK_EDESTADDRREQ WSAEDESTADDRREQ
99 #define SOCK_EDQUOT WSAEDQUOT
100 #define SOCK_EFAULT WSAEFAULT
101 #define SOCK_EHOSTDOWN WSAEHOSTDOWN
102 #define SOCK_EHOSTUNREACH WSAEHOSTUNREACH
103 #define SOCK_EINPROGRESS WSAEINPROGRESS
104 #define SOCK_EINTR WSAEINTR
105 #define SOCK_EINVAL WSAEINVAL
106 #define SOCK_EISCONN WSAEISCONN
107 #define SOCK_ELOOP WSAELOOP
108 #define SOCK_EMFILE WSAEMFILE
109 #define SOCK_EMSGSIZE WSAEMSGSIZE
110 #define SOCK_ENAMETOOLONG WSAENAMETOOLONG
111 #define SOCK_ENETDOWN WSAENETDOWN
112 #define SOCK_ENETUNREACH WSAENETUNREACH
113 #define SOCK_ENETRESET WSAENETRESET
114 #define SOCK_ENOBUFS WSAENOBUFS
115 #define SOCK_ENOPROTOOPT WSAENOPROTOOPT
116 #define SOCK_ENOTCONN WSAENOTCONN
117 #define SOCK_ENOTEMPTY WSAENOTEMPTY
118 #define SOCK_ENOTSOCK WSAENOTSOCK
119 #define SOCK_EOPNOTSUPP WSAEOPNOTSUPP
120 #define SOCK_EPFNOSUPPORT WSAEPFNOSUPPORT
121 #define SOCK_EPROCLIM WSAEPROCLIM
122 #define SOCK_EPROTOTYPE WSAEPROTOTYPE
123 #define SOCK_EPROTONOSUPPORT WSAEPROTONOSUPPORT
124 #define SOCK_EREMOTE WSAEREMOTE
125 #define SOCK_ESHUTDOWN WSAESHUTDOWN
126 #define SOCK_ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
127 #define SOCK_ESTALE WSAESTALE
128 #define SOCK_ETIMEDOUT WSAETIMEDOUT
129 #define SOCK_ETOOMANYREFS WSAETOOMANYREFS
130 #define SOCK_EUSERS WSAEUSERS
132 // windows specific names.
133 #define SOCK_EWOULDBLOCK WSAEWOULDBLOCK
134 #define SOCK_HOST_NOT_FOUND WSAHOST_NOT_FOUND
135 #define SOCK_NO_DATA WSANO_DATA
136 #define SOCK_NO_RECOVERY WSANO_RECOVERY
137 #define SOCK_NOTINITIALISED WSANOTINITIALISED
138 #define SOCK_SYSNOTREADY WSASYSNOTREADY
139 #define SOCK_TRY_AGAIN WSATRY_AGAIN
140 #define SOCK_VERNOTSUPPORTED WSAVERNOTSUPPORTED