File: nt_err.c

package info (click to toggle)
openldap2 2.1.30-8
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 13,320 kB
  • ctags: 9,329
  • sloc: ansic: 127,414; sh: 18,958; cpp: 3,897; sql: 1,490; makefile: 1,221; perl: 843
file content (87 lines) | stat: -rw-r--r-- 2,432 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/* $OpenLDAP: pkg/ldap/libraries/liblber/nt_err.c,v 1.9.2.1 2003/03/03 17:10:04 kurt Exp $ */
/*
 * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
 */
#include "portable.h"

#ifdef HAVE_WINSOCK2
#include <winsock2.h>
#elif HAVE_WINSOCK
#include <winsock.h>
#endif /* HAVE_WINSOCK(2) */

#define LBER_RETSTR( x ) case x: return #x;

char *ber_pvt_wsa_err2string( int err )
{
	switch( err )
	{
		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 )

#ifdef HAVE_WINSOCK2
		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 )
#endif /* HAVE_WINSOCK2	*/

		LBER_RETSTR( WSAHOST_NOT_FOUND )
		LBER_RETSTR( WSATRY_AGAIN )
		LBER_RETSTR( WSANO_RECOVERY )
		LBER_RETSTR( WSANO_DATA )
	}
	return "unknown WSA error";
}