1
/* $Id: errno.h 3553 2011-05-05 06:14:19Z nanang $ */
3
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
4
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
#ifndef __PJLIB_UTIL_ERRNO_H__
21
#define __PJLIB_UTIL_ERRNO_H__
27
* @defgroup PJLIB_UTIL_ERROR Error Codes
28
* @ingroup PJLIB_UTIL_BASE
33
* Start of error code relative to PJ_ERRNO_START_USER.
34
* This value is 320000.
36
#define PJLIB_UTIL_ERRNO_START (PJ_ERRNO_START_USER + PJ_ERRNO_SPACE_SIZE*3)
39
/************************************************************
41
***********************************************************/
44
* Unable to resolve STUN server
46
#define PJLIB_UTIL_ESTUNRESOLVE (PJLIB_UTIL_ERRNO_START+1) /* 320001 */
49
* Unknown STUN message type.
51
#define PJLIB_UTIL_ESTUNINMSGTYPE (PJLIB_UTIL_ERRNO_START+2) /* 320002 */
54
* Invalid STUN message length
56
#define PJLIB_UTIL_ESTUNINMSGLEN (PJLIB_UTIL_ERRNO_START+3) /* 320003 */
59
* Invalid STUN attribute length
61
#define PJLIB_UTIL_ESTUNINATTRLEN (PJLIB_UTIL_ERRNO_START+4) /* 320004 */
64
* Invalid STUN attribute type
66
#define PJLIB_UTIL_ESTUNINATTRTYPE (PJLIB_UTIL_ERRNO_START+5) /* 320005 */
69
* Invalid STUN server/socket index
71
#define PJLIB_UTIL_ESTUNININDEX (PJLIB_UTIL_ERRNO_START+6) /* 320006 */
74
* No STUN binding response in the message
76
#define PJLIB_UTIL_ESTUNNOBINDRES (PJLIB_UTIL_ERRNO_START+7) /* 320007 */
79
* Received STUN error attribute
81
#define PJLIB_UTIL_ESTUNRECVERRATTR (PJLIB_UTIL_ERRNO_START+8) /* 320008 */
84
* No STUN mapped address attribute
86
#define PJLIB_UTIL_ESTUNNOMAP (PJLIB_UTIL_ERRNO_START+9) /* 320009 */
89
* Received no response from STUN server
91
#define PJLIB_UTIL_ESTUNNOTRESPOND (PJLIB_UTIL_ERRNO_START+10) /* 320010 */
94
* Symetric NAT detected by STUN
96
#define PJLIB_UTIL_ESTUNSYMMETRIC (PJLIB_UTIL_ERRNO_START+11) /* 320011 */
99
* Invalid STUN magic value
101
#define PJLIB_UTIL_ESTUNNOTMAGIC (PJLIB_UTIL_ERRNO_START+12) /* 320012 */
104
* Invalid STUN fingerprint value
106
#define PJLIB_UTIL_ESTUNFINGERPRINT (PJLIB_UTIL_ERRNO_START+13) /* 320013 */
110
/************************************************************
112
***********************************************************/
115
* General invalid XML message.
117
#define PJLIB_UTIL_EINXML (PJLIB_UTIL_ERRNO_START+20) /* 320020 */
121
/************************************************************
123
***********************************************************/
126
* DNS query packet buffer is too small.
127
* This error occurs when the user supplied buffer for creating DNS
128
* query (#pj_dns_make_query() function) is too small.
130
#define PJLIB_UTIL_EDNSQRYTOOSMALL (PJLIB_UTIL_ERRNO_START+40) /* 320040 */
133
* Invalid DNS packet length.
134
* This error occurs when the received DNS response packet does not
135
* match all the fields length.
137
#define PJLIB_UTIL_EDNSINSIZE (PJLIB_UTIL_ERRNO_START+41) /* 320041 */
141
* This error occurs when the received DNS response contains network
142
* class other than IN (Internet).
144
#define PJLIB_UTIL_EDNSINCLASS (PJLIB_UTIL_ERRNO_START+42) /* 320042 */
147
* Invalid DNS name pointer.
148
* This error occurs when parsing the compressed names inside DNS
149
* response packet, when the name pointer points to an invalid address
150
* or the parsing has triggerred too much recursion.
152
#define PJLIB_UTIL_EDNSINNAMEPTR (PJLIB_UTIL_ERRNO_START+43) /* 320043 */
155
* Invalid DNS nameserver address. If hostname was specified for nameserver
156
* address, this error means that the function was unable to resolve
157
* the nameserver hostname.
159
#define PJLIB_UTIL_EDNSINNSADDR (PJLIB_UTIL_ERRNO_START+44) /* 320044 */
162
* No nameserver is in DNS resolver. No nameserver is configured in the
165
#define PJLIB_UTIL_EDNSNONS (PJLIB_UTIL_ERRNO_START+45) /* 320045 */
168
* No working DNS nameserver. All nameservers have been queried,
169
* but none was able to serve any DNS requests. These "bad" nameservers
170
* will be re-tested again for "goodness" after some period.
172
#define PJLIB_UTIL_EDNSNOWORKINGNS (PJLIB_UTIL_ERRNO_START+46) /* 320046 */
175
* No answer record in the DNS response.
177
#define PJLIB_UTIL_EDNSNOANSWERREC (PJLIB_UTIL_ERRNO_START+47) /* 320047 */
180
* Invalid DNS answer. This error is raised for example when the DNS
181
* answer does not have a query section, or the type of RR in the answer
182
* doesn't match the query.
184
#define PJLIB_UTIL_EDNSINANSWER (PJLIB_UTIL_ERRNO_START+48) /* 320048 */
187
/* DNS ERRORS MAPPED FROM RCODE: */
190
* Start of error code mapped from DNS RCODE
192
#define PJLIB_UTIL_DNS_RCODE_START (PJLIB_UTIL_ERRNO_START+50) /* 320050 */
195
* Map DNS RCODE status into pj_status_t.
197
#define PJ_STATUS_FROM_DNS_RCODE(rcode) (rcode==0 ? PJ_SUCCESS : \
198
PJLIB_UTIL_DNS_RCODE_START+rcode)
201
* Format error - The name server was unable to interpret the query.
202
* This corresponds to DNS RCODE 1.
204
#define PJLIB_UTIL_EDNS_FORMERR PJ_STATUS_FROM_DNS_RCODE(1) /* 320051 */
207
* Server failure - The name server was unable to process this query due to a
208
* problem with the name server.
209
* This corresponds to DNS RCODE 2.
211
#define PJLIB_UTIL_EDNS_SERVFAIL PJ_STATUS_FROM_DNS_RCODE(2) /* 320052 */
214
* Name Error - Meaningful only for responses from an authoritative name
215
* server, this code signifies that the domain name referenced in the query
217
* This corresponds to DNS RCODE 3.
219
#define PJLIB_UTIL_EDNS_NXDOMAIN PJ_STATUS_FROM_DNS_RCODE(3) /* 320053 */
222
* Not Implemented - The name server does not support the requested kind of
224
* This corresponds to DNS RCODE 4.
226
#define PJLIB_UTIL_EDNS_NOTIMPL PJ_STATUS_FROM_DNS_RCODE(4) /* 320054 */
229
* Refused - The name server refuses to perform the specified operation for
231
* This corresponds to DNS RCODE 5.
233
#define PJLIB_UTIL_EDNS_REFUSED PJ_STATUS_FROM_DNS_RCODE(5) /* 320055 */
237
* This corresponds to DNS RCODE 6.
239
#define PJLIB_UTIL_EDNS_YXDOMAIN PJ_STATUS_FROM_DNS_RCODE(6) /* 320056 */
242
* The RRset (name, type) exists.
243
* This corresponds to DNS RCODE 7.
245
#define PJLIB_UTIL_EDNS_YXRRSET PJ_STATUS_FROM_DNS_RCODE(7) /* 320057 */
248
* The RRset (name, type) does not exist.
249
* This corresponds to DNS RCODE 8.
251
#define PJLIB_UTIL_EDNS_NXRRSET PJ_STATUS_FROM_DNS_RCODE(8) /* 320058 */
254
* The requestor is not authorized to perform this operation.
255
* This corresponds to DNS RCODE 9.
257
#define PJLIB_UTIL_EDNS_NOTAUTH PJ_STATUS_FROM_DNS_RCODE(9) /* 320059 */
260
* The zone specified is not a zone.
261
* This corresponds to DNS RCODE 10.
263
#define PJLIB_UTIL_EDNS_NOTZONE PJ_STATUS_FROM_DNS_RCODE(10)/* 320060 */
266
/************************************************************
268
***********************************************************/
269
/* Messaging errors */
272
* Too many STUN attributes.
274
#define PJLIB_UTIL_ESTUNTOOMANYATTR (PJLIB_UTIL_ERRNO_START+110)/* 320110 */
277
* Unknown STUN attribute. This error happens when the decoder encounters
278
* mandatory attribute type which it doesn't understand.
280
#define PJLIB_UTIL_ESTUNUNKNOWNATTR (PJLIB_UTIL_ERRNO_START+111)/* 320111 */
283
* Invalid STUN socket address length.
285
#define PJLIB_UTIL_ESTUNINADDRLEN (PJLIB_UTIL_ERRNO_START+112)/* 320112 */
288
* STUN IPv6 attribute not supported
290
#define PJLIB_UTIL_ESTUNIPV6NOTSUPP (PJLIB_UTIL_ERRNO_START+113)/* 320113 */
293
* Expecting STUN response message.
295
#define PJLIB_UTIL_ESTUNNOTRESPONSE (PJLIB_UTIL_ERRNO_START+114)/* 320114 */
298
* STUN transaction ID mismatch.
300
#define PJLIB_UTIL_ESTUNINVALIDID (PJLIB_UTIL_ERRNO_START+115)/* 320115 */
303
* Unable to find handler for the request.
305
#define PJLIB_UTIL_ESTUNNOHANDLER (PJLIB_UTIL_ERRNO_START+116)/* 320116 */
308
* Found non-FINGERPRINT attribute after MESSAGE-INTEGRITY. This is not
309
* valid since MESSAGE-INTEGRITY MUST be the last attribute or the
310
* attribute right before FINGERPRINT before the message.
312
#define PJLIB_UTIL_ESTUNMSGINTPOS (PJLIB_UTIL_ERRNO_START+118)/* 320118 */
315
* Found attribute after FINGERPRINT. This is not valid since FINGERPRINT
316
* MUST be the last attribute in the message.
318
#define PJLIB_UTIL_ESTUNFINGERPOS (PJLIB_UTIL_ERRNO_START+119)/* 320119 */
321
* Missing STUN USERNAME attribute.
322
* When credential is included in the STUN message (MESSAGE-INTEGRITY is
323
* present), the USERNAME attribute must be present in the message.
325
#define PJLIB_UTIL_ESTUNNOUSERNAME (PJLIB_UTIL_ERRNO_START+120)/* 320120 */
328
* Unknown STUN username/credential.
330
#define PJLIB_UTIL_ESTUNUSERNAME (PJLIB_UTIL_ERRNO_START+121)/* 320121 */
333
* Missing/invalidSTUN MESSAGE-INTEGRITY attribute.
335
#define PJLIB_UTIL_ESTUNMSGINT (PJLIB_UTIL_ERRNO_START+122)/* 320122 */
338
* Found duplicate STUN attribute.
340
#define PJLIB_UTIL_ESTUNDUPATTR (PJLIB_UTIL_ERRNO_START+123)/* 320123 */
343
* Missing STUN REALM attribute.
345
#define PJLIB_UTIL_ESTUNNOREALM (PJLIB_UTIL_ERRNO_START+124)/* 320124 */
348
* Missing/stale STUN NONCE attribute value.
350
#define PJLIB_UTIL_ESTUNNONCE (PJLIB_UTIL_ERRNO_START+125)/* 320125 */
353
* STUN transaction terminates with failure.
355
#define PJLIB_UTIL_ESTUNTSXFAILED (PJLIB_UTIL_ERRNO_START+126)/* 320126 */
358
//#define PJ_STATUS_FROM_STUN_CODE(code) (PJLIB_UTIL_ERRNO_START+code)
360
/************************************************************
362
***********************************************************/
367
#define PJLIB_UTIL_EHTTPINURL (PJLIB_UTIL_ERRNO_START+151)/* 320151 */
370
* Invalid port number
372
#define PJLIB_UTIL_EHTTPINPORT (PJLIB_UTIL_ERRNO_START+152)/* 320152 */
375
* Incomplete headers received
377
#define PJLIB_UTIL_EHTTPINCHDR (PJLIB_UTIL_ERRNO_START+153)/* 320153 */
380
* Insufficient buffer
382
#define PJLIB_UTIL_EHTTPINSBUF (PJLIB_UTIL_ERRNO_START+154)/* 320154 */
387
#define PJLIB_UTIL_EHTTPLOST (PJLIB_UTIL_ERRNO_START+155)/* 320155 */
393
#endif /* __PJLIB_UTIL_ERRNO_H__ */