ucspi-ssl  0.99e
TLS encryption for IPv6 communication
error_str.c
Go to the documentation of this file.
1 /* Public domain. */
2 
3 #include <errno.h>
4 #include "error.h"
5 
6 #define X(e,s) if (i == e) return s;
7 
8 const char *error_str(int i)
9 {
10  X(0,"no error")
11  X(error_intr,"interrupted system call")
12  X(error_nomem,"out of memory")
13  X(error_noent,"file does not exist")
14  X(error_txtbsy,"text busy")
15  X(error_io,"input/output error")
16  X(error_exist,"file already exists")
17  X(error_timeout,"timed out")
18  X(error_inprogress,"operation in progress")
19  X(error_again,"temporary failure")
20  X(error_wouldblock,"input/output would block")
21  X(error_pipe,"broken pipe")
22  X(error_perm,"permission denied")
23  X(error_acces,"access denied")
24  X(error_nodevice,"device not configured")
25  X(error_proto,"protocol error")
26  X(error_isdir,"is a directory")
27  X(error_connrefused,"connection refused")
28  X(error_notdir,"not a directory")
29  X(error_rofs,"read-only file system")
30  X(error_connreset,"connection reset")
31 #ifdef ESRCH
32  X(ESRCH,"no such process")
33 #endif
34 #ifdef E2BIG
35  X(E2BIG,"argument list too long")
36 #endif
37 #ifdef ENOEXEC
38  X(ENOEXEC,"exec format error")
39 #endif
40 #ifdef EBADF
41  X(EBADF,"file descriptor not open")
42 #endif
43 #ifdef ECHILD
44  X(ECHILD,"no child processes")
45 #endif
46 #ifdef EDEADLK
47  X(EDEADLK,"operation would cause deadlock")
48 #endif
49 #ifdef EFAULT
50  X(EFAULT,"bad address")
51 #endif
52 #ifdef ENOTBLK
53  X(ENOTBLK,"not a block device")
54 #endif
55 #ifdef EBUSY
56  X(EBUSY,"device busy")
57 #endif
58 #ifdef EXDEV
59  X(EXDEV,"cross-device link")
60 #endif
61 #ifdef ENODEV
62  X(ENODEV,"device does not support operation")
63 #endif
64 #ifdef EINVAL
65  X(EINVAL,"invalid argument")
66 #endif
67 #ifdef ENFILE
68  X(ENFILE,"system cannot open more files")
69 #endif
70 #ifdef EMFILE
71  X(EMFILE,"process cannot open more files")
72 #endif
73 #ifdef ENOTTY
74  X(ENOTTY,"not a tty")
75 #endif
76 #ifdef EFBIG
77  X(EFBIG,"file too big")
78 #endif
79 #ifdef ENOSPC
80  X(ENOSPC,"out of disk space")
81 #endif
82 #ifdef ESPIPE
83  X(ESPIPE,"unseekable descriptor")
84 #endif
85 #ifdef EMLINK
86  X(EMLINK,"too many links")
87 #endif
88 #ifdef EDOM
89  X(EDOM,"input out of range")
90 #endif
91 #ifdef ERANGE
92  X(ERANGE,"output out of range")
93 #endif
94 #ifdef EALREADY
95  X(EALREADY,"operation already in progress")
96 #endif
97 #ifdef ENOTSOCK
98  X(ENOTSOCK,"not a socket")
99 #endif
100 #ifdef EDESTADDRREQ
101  X(EDESTADDRREQ,"destination address required")
102 #endif
103 #ifdef EMSGSIZE
104  X(EMSGSIZE,"message too long")
105 #endif
106 #ifdef EPROTOTYPE
107  X(EPROTOTYPE,"incorrect protocol type")
108 #endif
109 #ifdef ENOPROTOOPT
110  X(ENOPROTOOPT,"protocol not available")
111 #endif
112 #ifdef EPROTONOSUPPORT
113  X(EPROTONOSUPPORT,"protocol not supported")
114 #endif
115 #ifdef ESOCKTNOSUPPORT
116  X(ESOCKTNOSUPPORT,"socket type not supported")
117 #endif
118 #ifdef EOPNOTSUPP
119  X(EOPNOTSUPP,"operation not supported")
120 #endif
121 #ifdef EPFNOSUPPORT
122  X(EPFNOSUPPORT,"protocol family not supported")
123 #endif
124 #ifdef EAFNOSUPPORT
125  X(EAFNOSUPPORT,"address family not supported")
126 #endif
127 #ifdef EADDRINUSE
128  X(EADDRINUSE,"address already used")
129 #endif
130 #ifdef EADDRNOTAVAIL
131  X(EADDRNOTAVAIL,"address not available")
132 #endif
133 #ifdef ENETDOWN
134  X(ENETDOWN,"network down")
135 #endif
136 #ifdef ENETUNREACH
137  X(ENETUNREACH,"network unreachable")
138 #endif
139 #ifdef ENETRESET
140  X(ENETRESET,"network reset")
141 #endif
142 #ifdef ECONNABORTED
143  X(ECONNABORTED,"connection aborted")
144 #endif
145 #ifdef ECONNRESET
146  X(ECONNRESET,"connection reset")
147 #endif
148 #ifdef ENOBUFS
149  X(ENOBUFS,"out of buffer space")
150 #endif
151 #ifdef EISCONN
152  X(EISCONN,"already connected")
153 #endif
154 #ifdef ENOTCONN
155  X(ENOTCONN,"not connected")
156 #endif
157 #ifdef ESHUTDOWN
158  X(ESHUTDOWN,"socket shut down")
159 #endif
160 #ifdef ETOOMANYREFS
161  X(ETOOMANYREFS,"too many references")
162 #endif
163 #ifdef ELOOP
164  X(ELOOP,"symbolic link loop")
165 #endif
166 #ifdef ENAMETOOLONG
167  X(ENAMETOOLONG,"file name too long")
168 #endif
169 #ifdef EHOSTDOWN
170  X(EHOSTDOWN,"host down")
171 #endif
172 #ifdef EHOSTUNREACH
173  X(EHOSTUNREACH,"host unreachable")
174 #endif
175 #ifdef ENOTEMPTY
176  X(ENOTEMPTY,"directory not empty")
177 #endif
178 #ifdef EPROCLIM
179  X(EPROCLIM,"too many processes")
180 #endif
181 #ifdef EUSERS
182  X(EUSERS,"too many users")
183 #endif
184 #ifdef EDQUOT
185  X(EDQUOT,"disk quota exceeded")
186 #endif
187 #ifdef ESTALE
188  X(ESTALE,"stale NFS file handle")
189 #endif
190 #ifdef EREMOTE
191  X(EREMOTE,"too many levels of remote in path")
192 #endif
193 #ifdef EBADRPC
194  X(EBADRPC,"RPC structure is bad")
195 #endif
196 #ifdef ERPCMISMATCH
197  X(ERPCMISMATCH,"RPC version mismatch")
198 #endif
199 #ifdef EPROGUNAVAIL
200  X(EPROGUNAVAIL,"RPC program unavailable")
201 #endif
202 #ifdef EPROGMISMATCH
203  X(EPROGMISMATCH,"program version mismatch")
204 #endif
205 #ifdef EPROCUNAVAIL
206  X(EPROCUNAVAIL,"bad procedure for program")
207 #endif
208 #ifdef ENOLCK
209  X(ENOLCK,"no locks available")
210 #endif
211 #ifdef ENOSYS
212  X(ENOSYS,"system call not available")
213 #endif
214 #ifdef EFTYPE
215  X(EFTYPE,"bad file type")
216 #endif
217 #ifdef EAUTH
218  X(EAUTH,"authentication error")
219 #endif
220 #ifdef ENEEDAUTH
221  X(ENEEDAUTH,"not authenticated")
222 #endif
223 #ifdef ENOSTR
224  X(ENOSTR,"not a stream device")
225 #endif
226 #ifdef ETIME
227  X(ETIME,"timer expired")
228 #endif
229 #ifdef ENOSR
230  X(ENOSR,"out of stream resources")
231 #endif
232 #ifdef ENOMSG
233  X(ENOMSG,"no message of desired type")
234 #endif
235 #ifdef EBADMSG
236  X(EBADMSG,"bad message type")
237 #endif
238 #ifdef EIDRM
239  X(EIDRM,"identifier removed")
240 #endif
241 #ifdef ENONET
242  X(ENONET,"machine not on network")
243 #endif
244 #ifdef ERREMOTE
245  X(ERREMOTE,"object not local")
246 #endif
247 #ifdef ENOLINK
248  X(ENOLINK,"link severed")
249 #endif
250 #ifdef EADV
251  X(EADV,"advertise error")
252 #endif
253 #ifdef ESRMNT
254  X(ESRMNT,"srmount error")
255 #endif
256 #ifdef ECOMM
257  X(ECOMM,"communication error")
258 #endif
259 #ifdef EMULTIHOP
260  X(EMULTIHOP,"multihop attempted")
261 #endif
262 #ifdef EREMCHG
263  X(EREMCHG,"remote address changed")
264 #endif
265  return "unknown error";
266 }
int error_connreset
Definition: error.c:141
int error_acces
Definition: error.c:92
int error_exist
Definition: error.c:43
#define EAFNOSUPPORT
Definition: socket_udp6.c:9
int error_proto
Definition: error.c:106
int error_again
Definition: error.c:71
int error_pipe
Definition: error.c:78
int error_connrefused
Definition: error.c:120
int error_wouldblock
Definition: error.c:64
int error_nomem
Definition: error.c:15
int error_nodevice
Definition: error.c:99
int error_notdir
Definition: error.c:127
int error_txtbsy
Definition: error.c:29
int error_rofs
Definition: error.c:134
int error_intr
Definition: error.c:8
int error_noent
Definition: error.c:22
#define X(e, s)
Definition: error_str.c:6
int error_perm
Definition: error.c:85
int error_timeout
Definition: error.c:50
const char * error_str(int i)
Definition: error_str.c:8
int error_isdir
Definition: error.c:113
int error_io
Definition: error.c:36
int error_inprogress
Definition: error.c:57