Back to index

openldap  2.4.31
nt_err.c
Go to the documentation of this file.
00001 /* $OpenLDAP$ */
00002 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
00003  *
00004  * Copyright 1998-2012 The OpenLDAP Foundation.
00005  * All rights reserved.
00006  *
00007  * Redistribution and use in source and binary forms, with or without
00008  * modification, are permitted only as authorized by the OpenLDAP
00009  * Public License.
00010  *
00011  * A copy of this license is available in the file LICENSE in the
00012  * top-level directory of the distribution or, alternatively, at
00013  * <http://www.OpenLDAP.org/license.html>.
00014  */
00015 
00016 #include "portable.h"
00017 
00018 #ifdef HAVE_WINSOCK2
00019 #include <winsock2.h>
00020 #elif defined(HAVE_WINSOCK)
00021 #include <winsock.h>
00022 #endif /* HAVE_WINSOCK(2) */
00023 
00024 #define LBER_RETSTR( x ) case x: return #x;
00025 
00026 char *ber_pvt_wsa_err2string( int err )
00027 {
00028        switch( err ) {
00029               LBER_RETSTR( WSAEINTR )
00030               LBER_RETSTR( WSAEBADF )
00031               LBER_RETSTR( WSAEACCES )
00032               LBER_RETSTR( WSAEFAULT )
00033               LBER_RETSTR( WSAEINVAL )
00034               LBER_RETSTR( WSAEMFILE )
00035               LBER_RETSTR( WSAEWOULDBLOCK )
00036               LBER_RETSTR( WSAEINPROGRESS )
00037               LBER_RETSTR( WSAEALREADY )
00038               LBER_RETSTR( WSAENOTSOCK )
00039               LBER_RETSTR( WSAEDESTADDRREQ )
00040               LBER_RETSTR( WSAEMSGSIZE )
00041               LBER_RETSTR( WSAEPROTOTYPE )
00042               LBER_RETSTR( WSAENOPROTOOPT )
00043               LBER_RETSTR( WSAEPROTONOSUPPORT )
00044               LBER_RETSTR( WSAESOCKTNOSUPPORT )
00045               LBER_RETSTR( WSAEOPNOTSUPP )
00046               LBER_RETSTR( WSAEPFNOSUPPORT )
00047               LBER_RETSTR( WSAEAFNOSUPPORT )
00048               LBER_RETSTR( WSAEADDRINUSE )
00049               LBER_RETSTR( WSAEADDRNOTAVAIL )
00050               LBER_RETSTR( WSAENETDOWN )
00051               LBER_RETSTR( WSAENETUNREACH )
00052               LBER_RETSTR( WSAENETRESET )
00053               LBER_RETSTR( WSAECONNABORTED )
00054               LBER_RETSTR( WSAECONNRESET )
00055               LBER_RETSTR( WSAENOBUFS )
00056               LBER_RETSTR( WSAEISCONN )
00057               LBER_RETSTR( WSAENOTCONN )
00058               LBER_RETSTR( WSAESHUTDOWN )
00059               LBER_RETSTR( WSAETOOMANYREFS )
00060               LBER_RETSTR( WSAETIMEDOUT )
00061               LBER_RETSTR( WSAECONNREFUSED )
00062               LBER_RETSTR( WSAELOOP )
00063               LBER_RETSTR( WSAENAMETOOLONG )
00064               LBER_RETSTR( WSAEHOSTDOWN )
00065               LBER_RETSTR( WSAEHOSTUNREACH )
00066               LBER_RETSTR( WSAENOTEMPTY )
00067               LBER_RETSTR( WSAEPROCLIM )
00068               LBER_RETSTR( WSAEUSERS )
00069               LBER_RETSTR( WSAEDQUOT )
00070               LBER_RETSTR( WSAESTALE )
00071               LBER_RETSTR( WSAEREMOTE )
00072               LBER_RETSTR( WSASYSNOTREADY )
00073               LBER_RETSTR( WSAVERNOTSUPPORTED )
00074               LBER_RETSTR( WSANOTINITIALISED )
00075               LBER_RETSTR( WSAEDISCON )
00076 
00077 #ifdef HAVE_WINSOCK2
00078               LBER_RETSTR( WSAENOMORE )
00079               LBER_RETSTR( WSAECANCELLED )
00080               LBER_RETSTR( WSAEINVALIDPROCTABLE )
00081               LBER_RETSTR( WSAEINVALIDPROVIDER )
00082               LBER_RETSTR( WSASYSCALLFAILURE )
00083               LBER_RETSTR( WSASERVICE_NOT_FOUND )
00084               LBER_RETSTR( WSATYPE_NOT_FOUND )
00085               LBER_RETSTR( WSA_E_NO_MORE )
00086               LBER_RETSTR( WSA_E_CANCELLED )
00087               LBER_RETSTR( WSAEREFUSED )
00088 #endif /* HAVE_WINSOCK2     */
00089 
00090               LBER_RETSTR( WSAHOST_NOT_FOUND )
00091               LBER_RETSTR( WSATRY_AGAIN )
00092               LBER_RETSTR( WSANO_RECOVERY )
00093               LBER_RETSTR( WSANO_DATA )
00094        }
00095        return "unknown WSA error";
00096 }