1999-09-09 03:06:24 +08:00
|
|
|
/* $OpenLDAP$ */
|
2000-05-13 08:50:27 +08:00
|
|
|
/*
|
2002-01-05 05:17:25 +08:00
|
|
|
* Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
|
2000-05-13 08:50:27 +08:00
|
|
|
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
|
|
|
|
*/
|
1999-07-27 08:36:58 +08:00
|
|
|
#include "portable.h"
|
|
|
|
|
1999-10-31 10:26:41 +08:00
|
|
|
#ifdef HAVE_WINSOCK2
|
|
|
|
#include <winsock2.h>
|
|
|
|
#elif HAVE_WINSOCK
|
1999-10-28 15:17:08 +08:00
|
|
|
#include <winsock.h>
|
1999-10-31 10:26:41 +08:00
|
|
|
#endif /* HAVE_WINSOCK(2) */
|
1999-07-27 08:36:58 +08:00
|
|
|
|
2001-07-22 07:13:04 +08:00
|
|
|
#define LBER_RETSTR( x ) case x: return #x;
|
1999-07-27 08:36:58 +08:00
|
|
|
|
2000-05-13 05:16:15 +08:00
|
|
|
char *ber_pvt_wsa_err2string( int err )
|
1999-07-27 08:36:58 +08:00
|
|
|
{
|
|
|
|
switch( err )
|
|
|
|
{
|
2001-07-22 07:13:04 +08:00
|
|
|
LBER_RETSTR( WSAEINTR )
|
|
|
|
LBER_RETSTR( WSAEBADF )
|
|
|
|
LBER_RETSTR( WSAEACCES )
|
|
|
|
LBER_RETSTR( WSAEFAULT )
|
|
|
|
LBER_RETSTR( WSAEINVAL )
|
|
|
|
LBER_RETSTR( WSAEMFILE )
|
|
|
|
LBER_RETSTR( WSAEWOULDBLOCK )
|
|
|
|
LBER_RETSTR( WSAEINPROGRESS )
|
|
|
|
LBER_RETSTR( WSAEALREADY )
|
|
|
|
LBER_RETSTR( WSAENOTSOCK )
|
|
|
|
LBER_RETSTR( WSAEDESTADDRREQ )
|
|
|
|
LBER_RETSTR( WSAEMSGSIZE )
|
|
|
|
LBER_RETSTR( WSAEPROTOTYPE )
|
|
|
|
LBER_RETSTR( WSAENOPROTOOPT )
|
|
|
|
LBER_RETSTR( WSAEPROTONOSUPPORT )
|
|
|
|
LBER_RETSTR( WSAESOCKTNOSUPPORT )
|
|
|
|
LBER_RETSTR( WSAEOPNOTSUPP )
|
|
|
|
LBER_RETSTR( WSAEPFNOSUPPORT )
|
|
|
|
LBER_RETSTR( WSAEAFNOSUPPORT )
|
|
|
|
LBER_RETSTR( WSAEADDRINUSE )
|
|
|
|
LBER_RETSTR( WSAEADDRNOTAVAIL )
|
|
|
|
LBER_RETSTR( WSAENETDOWN )
|
|
|
|
LBER_RETSTR( WSAENETUNREACH )
|
|
|
|
LBER_RETSTR( WSAENETRESET )
|
|
|
|
LBER_RETSTR( WSAECONNABORTED )
|
|
|
|
LBER_RETSTR( WSAECONNRESET )
|
|
|
|
LBER_RETSTR( WSAENOBUFS )
|
|
|
|
LBER_RETSTR( WSAEISCONN )
|
|
|
|
LBER_RETSTR( WSAENOTCONN )
|
|
|
|
LBER_RETSTR( WSAESHUTDOWN )
|
|
|
|
LBER_RETSTR( WSAETOOMANYREFS )
|
|
|
|
LBER_RETSTR( WSAETIMEDOUT )
|
|
|
|
LBER_RETSTR( WSAECONNREFUSED )
|
|
|
|
LBER_RETSTR( WSAELOOP )
|
|
|
|
LBER_RETSTR( WSAENAMETOOLONG )
|
|
|
|
LBER_RETSTR( WSAEHOSTDOWN )
|
|
|
|
LBER_RETSTR( WSAEHOSTUNREACH )
|
|
|
|
LBER_RETSTR( WSAENOTEMPTY )
|
|
|
|
LBER_RETSTR( WSAEPROCLIM )
|
|
|
|
LBER_RETSTR( WSAEUSERS )
|
|
|
|
LBER_RETSTR( WSAEDQUOT )
|
|
|
|
LBER_RETSTR( WSAESTALE )
|
|
|
|
LBER_RETSTR( WSAEREMOTE )
|
|
|
|
LBER_RETSTR( WSASYSNOTREADY )
|
|
|
|
LBER_RETSTR( WSAVERNOTSUPPORTED )
|
|
|
|
LBER_RETSTR( WSANOTINITIALISED )
|
|
|
|
LBER_RETSTR( WSAEDISCON )
|
1999-10-28 15:17:08 +08:00
|
|
|
|
|
|
|
#ifdef HAVE_WINSOCK2
|
2001-07-22 07:13:04 +08:00
|
|
|
LBER_RETSTR( WSAENOMORE )
|
|
|
|
LBER_RETSTR( WSAECANCELLED )
|
|
|
|
LBER_RETSTR( WSAEINVALIDPROCTABLE )
|
|
|
|
LBER_RETSTR( WSAEINVALIDPROVIDER )
|
|
|
|
LBER_RETSTR( WSASYSCALLFAILURE )
|
|
|
|
LBER_RETSTR( WSASERVICE_NOT_FOUND )
|
|
|
|
LBER_RETSTR( WSATYPE_NOT_FOUND )
|
|
|
|
LBER_RETSTR( WSA_E_NO_MORE )
|
|
|
|
LBER_RETSTR( WSA_E_CANCELLED )
|
|
|
|
LBER_RETSTR( WSAEREFUSED )
|
2001-12-20 05:22:04 +08:00
|
|
|
#endif /* HAVE_WINSOCK2 */
|
1999-07-27 08:36:58 +08:00
|
|
|
|
2001-07-22 07:13:04 +08:00
|
|
|
LBER_RETSTR( WSAHOST_NOT_FOUND )
|
|
|
|
LBER_RETSTR( WSATRY_AGAIN )
|
|
|
|
LBER_RETSTR( WSANO_RECOVERY )
|
|
|
|
LBER_RETSTR( WSANO_DATA )
|
1999-07-27 08:36:58 +08:00
|
|
|
}
|
2000-05-13 08:48:17 +08:00
|
|
|
return "unknown WSA error";
|
|
|
|
}
|