errno.h 6.4 KB

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