]> git.sur5r.net Git - openldap/blob - libraries/liblber/nt_err.c
hex escape everything requires escape (uncomment #define PRETTY_ESCAPE to revert...
[openldap] / libraries / liblber / nt_err.c
1 /* $OpenLDAP$ */
2 /*
3  * Copyright 1998-2000 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         {
20                 LBER_RETSTR( WSAEINTR )
21                 LBER_RETSTR( WSAEBADF )
22                 LBER_RETSTR( WSAEACCES )
23                 LBER_RETSTR( WSAEFAULT )
24                 LBER_RETSTR( WSAEINVAL )
25                 LBER_RETSTR( WSAEMFILE )
26                 LBER_RETSTR( WSAEWOULDBLOCK )
27                 LBER_RETSTR( WSAEINPROGRESS )
28                 LBER_RETSTR( WSAEALREADY )
29                 LBER_RETSTR( WSAENOTSOCK )
30                 LBER_RETSTR( WSAEDESTADDRREQ )
31                 LBER_RETSTR( WSAEMSGSIZE )
32                 LBER_RETSTR( WSAEPROTOTYPE )
33                 LBER_RETSTR( WSAENOPROTOOPT )
34                 LBER_RETSTR( WSAEPROTONOSUPPORT )
35                 LBER_RETSTR( WSAESOCKTNOSUPPORT )
36                 LBER_RETSTR( WSAEOPNOTSUPP )
37                 LBER_RETSTR( WSAEPFNOSUPPORT )
38                 LBER_RETSTR( WSAEAFNOSUPPORT )
39                 LBER_RETSTR( WSAEADDRINUSE )
40                 LBER_RETSTR( WSAEADDRNOTAVAIL )
41                 LBER_RETSTR( WSAENETDOWN )
42                 LBER_RETSTR( WSAENETUNREACH )
43                 LBER_RETSTR( WSAENETRESET )
44                 LBER_RETSTR( WSAECONNABORTED )
45                 LBER_RETSTR( WSAECONNRESET )
46                 LBER_RETSTR( WSAENOBUFS )
47                 LBER_RETSTR( WSAEISCONN )
48                 LBER_RETSTR( WSAENOTCONN )
49                 LBER_RETSTR( WSAESHUTDOWN )
50                 LBER_RETSTR( WSAETOOMANYREFS )
51                 LBER_RETSTR( WSAETIMEDOUT )
52                 LBER_RETSTR( WSAECONNREFUSED )
53                 LBER_RETSTR( WSAELOOP )
54                 LBER_RETSTR( WSAENAMETOOLONG )
55                 LBER_RETSTR( WSAEHOSTDOWN )
56                 LBER_RETSTR( WSAEHOSTUNREACH )
57                 LBER_RETSTR( WSAENOTEMPTY )
58                 LBER_RETSTR( WSAEPROCLIM )
59                 LBER_RETSTR( WSAEUSERS )
60                 LBER_RETSTR( WSAEDQUOT )
61                 LBER_RETSTR( WSAESTALE )
62                 LBER_RETSTR( WSAEREMOTE )
63                 LBER_RETSTR( WSASYSNOTREADY )
64                 LBER_RETSTR( WSAVERNOTSUPPORTED )
65                 LBER_RETSTR( WSANOTINITIALISED )
66                 LBER_RETSTR( WSAEDISCON )
67
68 #ifdef HAVE_WINSOCK2
69                 LBER_RETSTR( WSAENOMORE )
70                 LBER_RETSTR( WSAECANCELLED )
71                 LBER_RETSTR( WSAEINVALIDPROCTABLE )
72                 LBER_RETSTR( WSAEINVALIDPROVIDER )
73                 LBER_RETSTR( WSASYSCALLFAILURE )
74                 LBER_RETSTR( WSASERVICE_NOT_FOUND )
75                 LBER_RETSTR( WSATYPE_NOT_FOUND )
76                 LBER_RETSTR( WSA_E_NO_MORE )
77                 LBER_RETSTR( WSA_E_CANCELLED )
78                 LBER_RETSTR( WSAEREFUSED )
79 #endif /* HAVE_WINSOCK2 */
80
81                 LBER_RETSTR( WSAHOST_NOT_FOUND )
82                 LBER_RETSTR( WSATRY_AGAIN )
83                 LBER_RETSTR( WSANO_RECOVERY )
84                 LBER_RETSTR( WSANO_DATA )
85         }
86         return "unknown WSA error";
87 }