~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Wine Cross Reference
wine/include/ws2tcpip.h

Version: ~ [ wine-1.5.30 ] ~ [ wine-1.5.29 ] ~ [ wine-1.5.28 ] ~ [ wine-1.5.27 ] ~ [ wine-1.5.26 ] ~ [ wine-1.5.25 ] ~ [ wine-1.5.24 ] ~ [ wine-1.5.23 ] ~ [ wine-1.5.22 ] ~ [ wine-1.5.21 ] ~ [ wine-1.5.20 ] ~ [ wine-1.5.19 ] ~ [ wine-1.5.18 ] ~ [ wine-1.5.17 ] ~ [ wine-1.5.16 ] ~ [ wine-1.5.15 ] ~ [ wine-1.5.14 ] ~ [ wine-1.5.13 ] ~ [ wine-1.5.12 ] ~ [ wine-1.5.11 ] ~ [ wine-1.5.10 ] ~ [ wine-1.5.9 ] ~ [ wine-1.5.8 ] ~ [ wine-1.5.7 ] ~ [ wine-1.4.1 ] ~ [ wine-1.5.6 ] ~ [ wine-1.5.5 ] ~ [ wine-1.5.4 ] ~ [ wine-1.5.3 ] ~ [ wine-1.5.2 ] ~ [ wine-1.5.1 ] ~ [ wine-1.5.0 ] ~ [ wine-1.4 ] ~ [ wine-1.4-rc6 ] ~ [ wine-1.4-rc5 ] ~ [ wine-1.4-rc4 ] ~ [ wine-1.4-rc3 ] ~ [ wine-1.4-rc2 ] ~ [ wine-1.4-rc1 ] ~ [ wine-1.3.37 ] ~ [ wine-1.3.36 ] ~ [ wine-1.3.35 ] ~ [ wine-1.3.34 ] ~ [ wine-1.3.33 ] ~ [ wine-1.3.32 ] ~ [ wine-1.3.31 ] ~ [ wine-1.3.30 ] ~ [ wine-1.3.29 ] ~ [ wine-1.3.28 ] ~ [ wine-1.3.27 ] ~ [ wine-1.3.26 ] ~ [ wine-1.3.25 ] ~ [ wine-1.3.24 ] ~ [ wine-1.3.23 ] ~ [ wine-1.3.22 ] ~ [ wine-1.3.21 ] ~ [ wine-1.3.20 ] ~ [ wine-1.3.19 ] ~ [ wine-1.3.18 ] ~ [ wine-1.2.3 ] ~ [ wine-1.3.17 ] ~ [ wine-1.3.16 ] ~ [ wine-1.3.15 ] ~ [ wine-1.3.14 ] ~ [ wine-1.3.13 ] ~ [ wine-1.3.12 ] ~ [ wine-1.3.11 ] ~ [ wine-1.3.10 ] ~ [ wine-1.3.9 ] ~ [ wine-1.2.2 ] ~ [ wine-1.3.8 ] ~ [ wine-1.3.7 ] ~ [ wine-1.3.6 ] ~ [ wine-1.3.5 ] ~ [ wine-1.2.1 ] ~ [ wine-1.3.4 ] ~ [ wine-1.3.3 ] ~ [ wine-1.3.2 ] ~ [ wine-1.3.1 ] ~ [ wine-1.3.0 ] ~ [ wine-1.2 ] ~ [ wine-1.2-rc7 ] ~ [ wine-1.2-rc6 ] ~ [ wine-1.2-rc5 ] ~ [ wine-1.2-rc4 ] ~ [ wine-1.2-rc3 ] ~ [ wine-1.2-rc2 ] ~ [ wine-1.2-rc1 ] ~ [ wine-1.1.44 ] ~ [ wine-1.1.43 ] ~ [ wine-1.1.42 ] ~ [ wine-1.1.41 ] ~ [ wine-1.1.40 ] ~ [ wine-1.1.39 ] ~ [ wine-1.1.38 ] ~ [ wine-1.1.37 ] ~ [ wine-1.1.36 ] ~ [ wine-1.1.35 ] ~ [ wine-1.1.34 ] ~ [ wine-1.1.33 ] ~ [ wine-1.1.32 ] ~ [ wine-1.1.31 ] ~ [ wine-1.1.30 ] ~ [ wine-1.1.29 ] ~ [ wine-1.1.28 ] ~ [ wine-1.1.27 ] ~ [ wine-1.1.26 ] ~ [ wine-1.1.25 ] ~ [ wine-1.1.24 ] ~ [ wine-1.1.23 ] ~ [ wine-1.1.22 ] ~ [ wine-1.1.21 ] ~ [ wine-1.1.20 ] ~ [ wine-1.1.19 ] ~ [ wine-1.1.18 ] ~ [ wine-1.1.17 ] ~ [ wine-1.1.16 ] ~ [ wine-1.1.15 ] ~ [ wine-1.1.14 ] ~ [ wine-1.1.13 ] ~ [ wine-1.1.12 ] ~ [ wine-1.1.11 ] ~ [ wine-1.1.10 ] ~ [ wine-1.1.9 ] ~ [ wine-1.1.8 ] ~ [ wine-1.1.7 ] ~ [ wine-1.0.1 ] ~ [ wine-1.1.6 ] ~ [ wine-1.1.5 ] ~ [ wine-1.1.4 ] ~ [ wine-1.1.3 ] ~ [ wine-1.1.2 ] ~ [ wine-1.1.1 ] ~ [ wine-1.1.0 ] ~ [ wine-1.0 ] ~

  1 /*
  2  * Copyright (C) 2001 Francois Gouget
  3  *
  4  * This library is free software; you can redistribute it and/or
  5  * modify it under the terms of the GNU Lesser General Public
  6  * License as published by the Free Software Foundation; either
  7  * version 2.1 of the License, or (at your option) any later version.
  8  *
  9  * This library is distributed in the hope that it will be useful,
 10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 12  * Lesser General Public License for more details.
 13  *
 14  * You should have received a copy of the GNU Lesser General Public
 15  * License along with this library; if not, write to the Free Software
 16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 17  */
 18 
 19 #ifndef __WS2TCPIP__
 20 #define __WS2TCPIP__
 21 
 22 #include <winsock2.h>
 23 #include <ws2ipdef.h>
 24 #include <limits.h>
 25 
 26 #ifdef USE_WS_PREFIX
 27 #define WS(x)    WS_##x
 28 #else
 29 #define WS(x)    x
 30 #endif
 31 
 32 /* FIXME: This gets defined by some Unix (Linux) header and messes things */
 33 #undef s6_addr
 34 
 35 /* for addrinfo calls */
 36 typedef struct WS(addrinfo)
 37 {
 38     int                ai_flags;
 39     int                ai_family;
 40     int                ai_socktype;
 41     int                ai_protocol;
 42     size_t             ai_addrlen;
 43     char *             ai_canonname;
 44     struct WS(sockaddr)*   ai_addr;
 45     struct WS(addrinfo)*   ai_next;
 46 } ADDRINFOA, *PADDRINFOA;
 47 
 48 typedef struct WS(addrinfoW)
 49 {
 50     int                ai_flags;
 51     int                ai_family;
 52     int                ai_socktype;
 53     int                ai_protocol;
 54     size_t             ai_addrlen;
 55     PWSTR              ai_canonname;
 56     struct WS(sockaddr)*   ai_addr;
 57     struct WS(addrinfoW)*   ai_next;
 58 } ADDRINFOW, *PADDRINFOW;
 59 
 60 typedef int WS(socklen_t);
 61 
 62 typedef ADDRINFOA ADDRINFO, *LPADDRINFO;
 63 
 64 /* Possible Windows flags for getaddrinfo() */
 65 #ifndef USE_WS_PREFIX
 66 # define AI_PASSIVE     0x0001
 67 # define AI_CANONNAME   0x0002
 68 # define AI_NUMERICHOST 0x0004
 69 /* getaddrinfo error codes */
 70 # define EAI_AGAIN      WSATRY_AGAIN
 71 # define EAI_BADFLAGS   WSAEINVAL
 72 # define EAI_FAIL       WSANO_RECOVERY
 73 # define EAI_FAMILY     WSAEAFNOSUPPORT
 74 # define EAI_MEMORY     WSA_NOT_ENOUGH_MEMORY
 75 # define EAI_NODATA     EAI_NONAME
 76 # define EAI_NONAME     WSAHOST_NOT_FOUND
 77 # define EAI_SERVICE    WSATYPE_NOT_FOUND
 78 # define EAI_SOCKTYPE   WSAESOCKTNOSUPPORT
 79 #else
 80 # define WS_AI_PASSIVE     0x0001
 81 # define WS_AI_CANONNAME   0x0002
 82 # define WS_AI_NUMERICHOST 0x0004
 83 /* getaddrinfo error codes */
 84 # define WS_EAI_AGAIN   WSATRY_AGAIN
 85 # define WS_EAI_BADFLAGS        WSAEINVAL
 86 # define WS_EAI_FAIL    WSANO_RECOVERY
 87 # define WS_EAI_FAMILY  WSAEAFNOSUPPORT
 88 # define WS_EAI_MEMORY  WSA_NOT_ENOUGH_MEMORY
 89 # define WS_EAI_NODATA  WS_EAI_NONAME
 90 # define WS_EAI_NONAME  WSAHOST_NOT_FOUND
 91 # define WS_EAI_SERVICE WSATYPE_NOT_FOUND
 92 # define WS_EAI_SOCKTYPE        WSAESOCKTNOSUPPORT
 93 #endif
 94 
 95 #ifndef USE_WS_PREFIX
 96 # define NI_MAXHOST         1025
 97 # define NI_MAXSERV         32
 98 #else
 99 # define WS_NI_MAXHOST      1025
100 # define WS_NI_MAXSERV      32
101 #endif
102 
103 /* Possible Windows flags for getnameinfo() */
104 #ifndef USE_WS_PREFIX
105 # define NI_NOFQDN          0x01
106 # define NI_NUMERICHOST     0x02
107 # define NI_NAMEREQD        0x04
108 # define NI_NUMERICSERV     0x08
109 # define NI_DGRAM           0x10
110 #else
111 # define WS_NI_NOFQDN       0x01
112 # define WS_NI_NUMERICHOST  0x02
113 # define WS_NI_NAMEREQD     0x04
114 # define WS_NI_NUMERICSERV  0x08
115 # define WS_NI_DGRAM        0x10
116 #endif
117 
118 
119 #ifdef __cplusplus
120 extern "C" {
121 #endif
122 
123 #define GAI_STRERROR_BUFFER_SIZE        1024
124 
125 static inline char *gai_strerrorA(int errcode)
126 {
127     static char buffer[GAI_STRERROR_BUFFER_SIZE + 1];
128 
129     /* FIXME: should format message from system, ignoring inserts in neutral
130      * language */
131     buffer[0] = '\0';
132 
133     return buffer;
134 }
135 
136 static inline WCHAR *gai_strerrorW(int errcode)
137 {
138     static WCHAR buffer[GAI_STRERROR_BUFFER_SIZE + 1];
139 
140     /* FIXME: should format message from system, ignoring inserts in neutral
141      * language */
142     buffer[0] = '\0';
143 
144     return buffer;
145 }
146 
147 #ifdef USE_WS_PREFIX
148 # define WS_gai_strerror WINELIB_NAME_AW(gai_strerror)
149 #elif defined(WINE_NO_UNICODE_MACROS)
150 # define gai_strerror gai_strerrorA
151 #else
152 # define gai_strerror WINELIB_NAME_AW(gai_strerror)
153 #endif
154 
155 void WINAPI WS(freeaddrinfo)(LPADDRINFO);
156 #define     FreeAddrInfoA WS(freeaddrinfo)
157 void WINAPI FreeAddrInfoW(PADDRINFOW);
158 #define     FreeAddrInfo WINELIB_NAME_AW(FreeAddrInfo)
159 int WINAPI  WS(getaddrinfo)(const char*,const char*,const struct WS(addrinfo)*,struct WS(addrinfo)**);
160 #define     GetAddrInfoA WS(getaddrinfo)
161 int WINAPI  GetAddrInfoW(PCWSTR,PCWSTR,const ADDRINFOW*,PADDRINFOW*);
162 #define     GetAddrInfo WINELIB_NAME_AW(GetAddrInfo)
163 int WINAPI  WS(getnameinfo)(const SOCKADDR*,WS(socklen_t),PCHAR,DWORD,PCHAR,DWORD,INT);
164 #define     GetNameInfoA WS(getnameinfo)
165 INT WINAPI  GetNameInfoW(const SOCKADDR*,WS(socklen_t),PWCHAR,DWORD,PWCHAR,DWORD,INT);
166 #define     GetNameInfo WINELIB_NAME_AW(GetNameInfo)
167 PCSTR WINAPI WS(inet_ntop)(INT,PVOID,PSTR,size_t);
168 #define     InetNtopA WS(inet_ntop)
169 PCWSTR WINAPI InetNtopW(INT,PVOID,PWSTR,size_t);
170 #define     InetNtop WINELIB_NAME_AW(InetNtop)
171 int WINAPI  WS(inet_pton)(INT,PCSTR,PVOID);
172 #define     InetPtonA WS(inet_pton)
173 int WINAPI  InetPtonW(INT,PCWSTR,PVOID);
174 #define     InetPton WINELIB_NAME_AW(InetPton)
175 
176 /*
177  * Ws2tcpip Function Typedefs
178  *
179  * Remember to keep this section in sync with the
180  * prototypes above.
181  */
182 #if INCL_WINSOCK_API_TYPEDEFS
183 
184 typedef void (WINAPI *LPFN_FREEADDRINFO)(LPADDRINFO);
185 #define LPFN_FREEADDRINFOA LPFN_FREEADDRINFO
186 typedef void (WINAPI *LPFN_FREEADDRINFOW)(PADDRINFOW);
187 #define LPFN_FREEADDRINFOT WINELIB_NAME_AW(LPFN_FREEADDRINFO)
188 typedef int (WINAPI *LPFN_GETADDRINFO)(const char*,const char*,const struct WS(addrinfo)*,struct WS(addrinfo)**);
189 #define LPFN_GETADDRINFOA LPFN_GETADDRINFO
190 typedef int (WINAPI *LPFN_GETADDRINFOW)(PCWSTR,PCWSTR,const ADDRINFOW*,PADDRINFOW*);
191 #define LPFN_GETADDRINFOT WINELIB_NAME_AW(LPFN_GETADDRINFO)
192 typedef int (WINAPI *LPFN_GETNAMEINFO)(const struct sockaddr*,socklen_t,char*,DWORD,char*,DWORD,int);
193 #define LPFN_GETNAMEINFOA LPFN_GETNAMEINFO
194 typedef int (WINAPI *LPFN_GETNAMEINFOW)(const SOCKADDR*,socklen_t,PWCHAR,DWORD,PWCHAR,DWORD,INT);
195 #define LPFN_GETNAMEINFOT WINELIB_NAME_AW(LPFN_GETNAMEINFO)
196 
197 #endif
198 
199 #ifdef __cplusplus
200 }
201 #endif
202 
203 #endif /* __WS2TCPIP__ */
204 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.