1999-09-09 03:06:24 +08:00
|
|
|
/* $OpenLDAP$ */
|
2000-05-13 08:50:27 +08:00
|
|
|
/*
|
2000-05-14 07:08:25 +08:00
|
|
|
* Copyright 1998-2000 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
|
|
|
|
2000-05-13 08:48:17 +08:00
|
|
|
#undef __RETSTR
|
1999-07-27 08:36:58 +08:00
|
|
|
#define __RETSTR( x ) case x: return #x;
|
|
|
|
|
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 )
|
|
|
|
{
|
|
|
|
__RETSTR( WSAEINTR )
|
|
|
|
__RETSTR( WSAEBADF )
|
|
|
|
__RETSTR( WSAEACCES )
|
|
|
|
__RETSTR( WSAEFAULT )
|
|
|
|
__RETSTR( WSAEINVAL )
|
|
|
|
__RETSTR( WSAEMFILE )
|
|
|
|
__RETSTR( WSAEWOULDBLOCK )
|
|
|
|
__RETSTR( WSAEINPROGRESS )
|
|
|
|
__RETSTR( WSAEALREADY )
|
|
|
|
__RETSTR( WSAENOTSOCK )
|
|
|
|
__RETSTR( WSAEDESTADDRREQ )
|
|
|
|
__RETSTR( WSAEMSGSIZE )
|
|
|
|
__RETSTR( WSAEPROTOTYPE )
|
|
|
|
__RETSTR( WSAENOPROTOOPT )
|
|
|
|
__RETSTR( WSAEPROTONOSUPPORT )
|
|
|
|
__RETSTR( WSAESOCKTNOSUPPORT )
|
|
|
|
__RETSTR( WSAEOPNOTSUPP )
|
|
|
|
__RETSTR( WSAEPFNOSUPPORT )
|
|
|
|
__RETSTR( WSAEAFNOSUPPORT )
|
|
|
|
__RETSTR( WSAEADDRINUSE )
|
|
|
|
__RETSTR( WSAEADDRNOTAVAIL )
|
|
|
|
__RETSTR( WSAENETDOWN )
|
|
|
|
__RETSTR( WSAENETUNREACH )
|
|
|
|
__RETSTR( WSAENETRESET )
|
|
|
|
__RETSTR( WSAECONNABORTED )
|
|
|
|
__RETSTR( WSAECONNRESET )
|
|
|
|
__RETSTR( WSAENOBUFS )
|
|
|
|
__RETSTR( WSAEISCONN )
|
|
|
|
__RETSTR( WSAENOTCONN )
|
|
|
|
__RETSTR( WSAESHUTDOWN )
|
|
|
|
__RETSTR( WSAETOOMANYREFS )
|
|
|
|
__RETSTR( WSAETIMEDOUT )
|
|
|
|
__RETSTR( WSAECONNREFUSED )
|
|
|
|
__RETSTR( WSAELOOP )
|
|
|
|
__RETSTR( WSAENAMETOOLONG )
|
|
|
|
__RETSTR( WSAEHOSTDOWN )
|
|
|
|
__RETSTR( WSAEHOSTUNREACH )
|
|
|
|
__RETSTR( WSAENOTEMPTY )
|
|
|
|
__RETSTR( WSAEPROCLIM )
|
|
|
|
__RETSTR( WSAEUSERS )
|
|
|
|
__RETSTR( WSAEDQUOT )
|
|
|
|
__RETSTR( WSAESTALE )
|
|
|
|
__RETSTR( WSAEREMOTE )
|
|
|
|
__RETSTR( WSASYSNOTREADY )
|
|
|
|
__RETSTR( WSAVERNOTSUPPORTED )
|
|
|
|
__RETSTR( WSANOTINITIALISED )
|
|
|
|
__RETSTR( WSAEDISCON )
|
1999-10-28 15:17:08 +08:00
|
|
|
|
|
|
|
#ifdef HAVE_WINSOCK2
|
1999-07-27 08:36:58 +08:00
|
|
|
__RETSTR( WSAENOMORE )
|
|
|
|
__RETSTR( WSAECANCELLED )
|
|
|
|
__RETSTR( WSAEINVALIDPROCTABLE )
|
|
|
|
__RETSTR( WSAEINVALIDPROVIDER )
|
|
|
|
__RETSTR( WSASYSCALLFAILURE )
|
|
|
|
__RETSTR( WSASERVICE_NOT_FOUND )
|
|
|
|
__RETSTR( WSATYPE_NOT_FOUND )
|
|
|
|
__RETSTR( WSA_E_NO_MORE )
|
|
|
|
__RETSTR( WSA_E_CANCELLED )
|
|
|
|
__RETSTR( WSAEREFUSED )
|
1999-10-28 15:17:08 +08:00
|
|
|
#endif // HAVE_WINSOCK2
|
1999-07-27 08:36:58 +08:00
|
|
|
|
|
|
|
__RETSTR( WSAHOST_NOT_FOUND )
|
|
|
|
__RETSTR( WSATRY_AGAIN )
|
|
|
|
__RETSTR( WSANO_RECOVERY )
|
|
|
|
__RETSTR( WSANO_DATA )
|
|
|
|
}
|
2000-05-13 08:48:17 +08:00
|
|
|
return "unknown WSA error";
|
|
|
|
}
|