1 /* $Id$ */
2 /*
3  * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
4  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
5  *
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.
10  *
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.
15  *
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
19  */
20 #ifndef __PJNATH_ERRNO_H__
21 #define __PJNATH_ERRNO_H__
22 
23 /**
24  * @file errno.h
25  * @brief PJNATH specific error codes
26  */
27 
28 #include <pj/errno.h>
29 
30 /**
31  * @defgroup PJNATH_ERROR NAT Helper Library Error Codes
32  * @brief PJNATH specific error code constants
33  * @ingroup PJNATH_STUN_BASE
34  * @{
35  */
36 
37 /**
38  * Start of error code relative to PJ_ERRNO_START_USER.
39  * This value is 370000.
40  */
41 #define PJNATH_ERRNO_START    (PJ_ERRNO_START_USER + PJ_ERRNO_SPACE_SIZE*4)
42 
43 
44 /************************************************************
45  * STUN MESSAGING ERRORS
46  ***********************************************************/
47 
48 /**
49  * Map STUN error code (300-699) into pj_status_t error space.
50  */
51 #define PJ_STATUS_FROM_STUN_CODE(code)	(PJNATH_ERRNO_START+code)
52 
53 /**
54  * @hideinitializer
55  * Invalid STUN message
56  */
57 #define PJNATH_EINSTUNMSG	    (PJNATH_ERRNO_START+1)  /* 370001 */
58 /**
59  * @hideinitializer
60  * Invalid STUN message length.
61  */
62 #define PJNATH_EINSTUNMSGLEN	    (PJNATH_ERRNO_START+2)  /* 370002 */
63 /**
64  * @hideinitializer
65  * Invalid or unexpected STUN message type
66  */
67 #define	PJNATH_EINSTUNMSGTYPE	    (PJNATH_ERRNO_START+3)  /* 370003 */
68 /**
69  * @hideinitializer
70  * STUN transaction has timed out
71  */
72 #define PJNATH_ESTUNTIMEDOUT	    (PJNATH_ERRNO_START+4)  /* 370004 */
73 
74 
75 /**
76  * @hideinitializer
77  * Too many STUN attributes.
78  */
79 #define PJNATH_ESTUNTOOMANYATTR	    (PJNATH_ERRNO_START+21) /* 370021 */
80 /**
81  * @hideinitializer
82  * Invalid STUN attribute length.
83  */
84 #define PJNATH_ESTUNINATTRLEN	    (PJNATH_ERRNO_START+22) /* 370022 */
85 /**
86  * @hideinitializer
87  * Found duplicate STUN attribute.
88  */
89 #define PJNATH_ESTUNDUPATTR	    (PJNATH_ERRNO_START+23) /* 370023 */
90 
91 /**
92  * @hideinitializer
93  * STUN FINGERPRINT verification failed
94  */
95 #define PJNATH_ESTUNFINGERPRINT	    (PJNATH_ERRNO_START+30) /* 370030 */
96 /**
97  * @hideinitializer
98  * Invalid STUN attribute after MESSAGE-INTEGRITY.
99  */
100 #define PJNATH_ESTUNMSGINTPOS	    (PJNATH_ERRNO_START+31) /* 370031 */
101 /**
102  * @hideinitializer
103  * Invalid STUN attribute after FINGERPRINT.
104  */
105 #define PJNATH_ESTUNFINGERPOS	    (PJNATH_ERRNO_START+33) /* 370033 */
106 
107 
108 /**
109  * @hideinitializer
110  * STUN (XOR-)MAPPED-ADDRESS attribute not found
111  */
112 #define PJNATH_ESTUNNOMAPPEDADDR    (PJNATH_ERRNO_START+40) /* 370040 */
113 /**
114  * @hideinitializer
115  * STUN IPv6 attribute not supported
116  */
117 #define PJNATH_ESTUNIPV6NOTSUPP	    (PJNATH_ERRNO_START+41) /* 370041 */
118 /**
119  * @hideinitializer
120  * Invalid address family value in STUN message.
121  */
122 #define PJNATH_EINVAF		    (PJNATH_ERRNO_START+42) /* 370042 */
123 
124 /**
125  * @hideinitializer
126  * Invalid STUN server or server not configured.
127  */
128 #define PJNATH_ESTUNINSERVER	    (PJNATH_ERRNO_START+50) /* 370050 */
129 
130 
131 /************************************************************
132  * STUN SESSION/TRANSPORT ERROR CODES
133  ***********************************************************/
134 /**
135  * @hideinitializer
136  * STUN object has been destoyed.
137  */
138 #define PJNATH_ESTUNDESTROYED	    (PJNATH_ERRNO_START+60) /* 370060 */
139 
140 
141 /************************************************************
142  * ICE ERROR CODES
143  ***********************************************************/
144 
145 /**
146  * @hideinitializer
147  * ICE session not available
148  */
149 #define PJNATH_ENOICE		    (PJNATH_ERRNO_START+80) /* 370080 */
150 /**
151  * @hideinitializer
152  * ICE check is in progress
153  */
154 #define PJNATH_EICEINPROGRESS	    (PJNATH_ERRNO_START+81) /* 370081 */
155 /**
156  * @hideinitializer
157  * This error indicates that ICE connectivity check has failed, because
158  * there is at least one ICE component that does not have a valid check.
159  * Normally this happens because the network topology had caused the
160  * connectivity check to fail (e.g. no route between the two agents),
161  * however other reasons may include software incompatibility between
162  * the two agents, or incomplete candidates gathered by the agent(s).
163  */
164 #define PJNATH_EICEFAILED	    (PJNATH_ERRNO_START+82) /* 370082 */
165 /**
166  * @hideinitializer
167  * Default destination does not match any ICE candidates
168  */
169 #define PJNATH_EICEMISMATCH	    (PJNATH_ERRNO_START+83) /* 370083 */
170 /**
171  * @hideinitializer
172  * Invalid ICE component ID
173  */
174 #define PJNATH_EICEINCOMPID	    (PJNATH_ERRNO_START+86) /* 370086 */
175 /**
176  * @hideinitializer
177  * Invalid ICE candidate ID
178  */
179 #define PJNATH_EICEINCANDID	    (PJNATH_ERRNO_START+87) /* 370087 */
180 /**
181  * @hideinitializer
182  * Source address mismatch. This error occurs if the source address
183  * of the response for ICE connectivity check is different than
184  * the destination address of the request.
185  */
186 #define PJNATH_EICEINSRCADDR	    (PJNATH_ERRNO_START+88) /* 370088 */
187 /**
188  * @hideinitializer
189  * Missing ICE SDP attribute
190  */
191 #define PJNATH_EICEMISSINGSDP	    (PJNATH_ERRNO_START+90) /* 370090 */
192 /**
193  * @hideinitializer
194  * Invalid SDP "candidate" attribute
195  */
196 #define PJNATH_EICEINCANDSDP	    (PJNATH_ERRNO_START+91) /* 370091 */
197 /**
198  * @hideinitializer
199  * No host candidate associated with srflx. This error occurs when
200  * a server reflexive candidate is added without the matching
201  * host candidate.
202  */
203 #define PJNATH_EICENOHOSTCAND	    (PJNATH_ERRNO_START+92) /* 370092 */
204 /**
205  * @hideinitializer
206  * Controlled agent timed-out in waiting for the controlling agent to
207  * send nominated check after all connectivity checks have completed.
208  */
209 #define PJNATH_EICENOMTIMEOUT	    (PJNATH_ERRNO_START+93) /* 370093 */
210 
211 /************************************************************
212  * TURN ERROR CODES
213  ***********************************************************/
214 /**
215  * @hideinitializer
216  * Invalid or unsupported TURN transport.
217  */
218 #define PJNATH_ETURNINTP	    (PJNATH_ERRNO_START+120) /* 370120 */
219 
220 
221 
222 /**
223  * @}
224  */
225 
226 #endif	/* __PJNATH_ERRNO_H__ */
227