]> git.sur5r.net Git - openldap/blob - libraries/liblber/nt_err.c
Ready for 2.2beta
[openldap] / libraries / liblber / nt_err.c
1 /* $OpenLDAP$ */
2 /*
3  * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
4  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
5  */
6 #include "portable.h"
7
8 #ifdef HAVE_WINSOCK2
9 #include <winsock2.h>
10 #elif HAVE_WINSOCK
11 #include <winsock.h>
12 #endif /* HAVE_WINSOCK(2) */
13
14 #define LBER_RETSTR( x ) case x: return #x;
15
16 char *ber_pvt_wsa_err2string( int err )
17 {
18         switch( err ) {
19                 LBER_RETSTR( WSAEINTR )
20                 LBER_RETSTR( WSAEBADF )
21                 LBER_RETSTR( WSAEACCES )
22                 LBER_RETSTR( WSAEFAULT )
23                 LBER_RETSTR( WSAEINVAL )
24                 LBER_RETSTR( WSAEMFILE )
25                 LBER_RETSTR( WSAEWOULDBLOCK )
26                 LBER_RETSTR( WSAEINPROGRESS )
27                 LBER_RETSTR( WSAEALREADY )
28                 LBER_RETSTR( WSAENOTSOCK )
29                 LBER_RETSTR( WSAEDESTADDRREQ )
30                 LBER_RETSTR( WSAEMSGSIZE )
31                 LBER_RETSTR( WSAEPROTOTYPE )
32                 LBER_RETSTR( WSAENOPROTOOPT )
33                 LBER_RETSTR( WSAEPROTONOSUPPORT )
34                 LBER_RETSTR( WSAESOCKTNOSUPPORT )
35                 LBER_RETSTR( WSAEOPNOTSUPP )
36                 LBER_RETSTR( WSAEPFNOSUPPORT )
37                 LBER_RETSTR( WSAEAFNOSUPPORT )
38                 LBER_RETSTR( WSAEADDRINUSE )
39                 LBER_RETSTR( WSAEADDRNOTAVAIL )
40                 LBER_RETSTR( WSAENETDOWN )
41                 LBER_RETSTR( WSAENETUNREACH )
42                 LBER_RETSTR( WSAENETRESET )
43                 LBER_RETSTR( WSAECONNABORTED )
44                 LBER_RETSTR( WSAECONNRESET )
45                 LBER_RETSTR( WSAENOBUFS )
46                 LBER_RETSTR( WSAEISCONN )
47                 LBER_RETSTR( WSAENOTCONN )
48                 LBER_RETSTR( WSAESHUTDOWN )
49                 LBER_RETSTR( WSAETOOMANYREFS )
50                 LBER_RETSTR( WSAETIMEDOUT )
51                 LBER_RETSTR( WSAECONNREFUSED )
52                 LBER_RETSTR( WSAELOOP )
53                 LBER_RETSTR( WSAENAMETOOLONG )
54                 LBER_RETSTR( WSAEHOSTDOWN )
55                 LBER_RETSTR( WSAEHOSTUNREACH )
56                 LBER_RETSTR( WSAENOTEMPTY )
57                 LBER_RETSTR( WSAEPROCLIM )
58                 LBER_RETSTR( WSAEUSERS )
59                 LBER_RETSTR( WSAEDQUOT )
60                 LBER_RETSTR( WSAESTALE )
61                 LBER_RETSTR( WSAEREMOTE )
62                 LBER_RETSTR( WSASYSNOTREADY )
63                 LBER_RETSTR( WSAVERNOTSUPPORTED )
64                 LBER_RETSTR( WSANOTINITIALISED )
65                 LBER_RETSTR( WSAEDISCON )
66
67 #ifdef HAVE_WINSOCK2
68                 LBER_RETSTR( WSAENOMORE )
69                 LBER_RETSTR( WSAECANCELLED )
70                 LBER_RETSTR( WSAEINVALIDPROCTABLE )
71                 LBER_RETSTR( WSAEINVALIDPROVIDER )
72                 LBER_RETSTR( WSASYSCALLFAILURE )
73                 LBER_RETSTR( WSASERVICE_NOT_FOUND )
74                 LBER_RETSTR( WSATYPE_NOT_FOUND )
75                 LBER_RETSTR( WSA_E_NO_MORE )
76                 LBER_RETSTR( WSA_E_CANCELLED )
77                 LBER_RETSTR( WSAEREFUSED )
78 #endif /* HAVE_WINSOCK2 */
79
80                 LBER_RETSTR( WSAHOST_NOT_FOUND )
81                 LBER_RETSTR( WSATRY_AGAIN )
82                 LBER_RETSTR( WSANO_RECOVERY )
83                 LBER_RETSTR( WSANO_DATA )
84         }
85         return "unknown WSA error";
86 }