error.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * $Id$
  3. *
  4. * Copyright (C) 2001-2003 FhG Fokus
  5. *
  6. * This file is part of ser, a free SIP server.
  7. *
  8. * ser is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version
  12. *
  13. * ser is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. */
  22. #ifndef error_h
  23. #define error_h
  24. #define E_OK 0
  25. #define E_UNSPEC -1
  26. #define E_OUT_OF_MEM -2
  27. #define E_BAD_RE -3
  28. /* #define E_BAD_ADDRESS -4 */
  29. #define E_BUG -5
  30. #define E_CFG -6
  31. #define E_NO_SOCKET -7
  32. /* unresolvable topmost Via */
  33. #define E_BAD_VIA -8
  34. /* incomplete transaction tuple */
  35. #define E_BAD_TUPEL -9
  36. /* script programming error */
  37. #define E_SCRIPT -10
  38. /* error in execution of external tools */
  39. #define E_EXEC -11
  40. /* too many branches demanded */
  41. #define E_TOO_MANY_BRANCHES -12
  42. #define E_BAD_TO -13
  43. /* invalid params */
  44. #define E_INVALID_PARAMS -14
  45. #define E_Q_INV_CHAR -15 /* Invalid character in q */
  46. #define E_Q_EMPTY -16 /* Empty q */
  47. #define E_Q_TOO_BIG -17 /* q too big (> 1) */
  48. #define E_Q_DEC_MISSING -18 /* Decimal part missing */
  49. #define E_SEND -477
  50. /* unresolvable next-hop address */
  51. #define E_BAD_ADDRESS -478
  52. /* unparseable URI */
  53. #define E_BAD_URI -479
  54. /* bad protocol, like */
  55. #define E_BAD_PROTO -480
  56. /* malformed request */
  57. #define E_BAD_REQ -400
  58. #define E_CANCELED -487 /* transaction already canceled */
  59. /* error in server */
  60. #define E_BAD_SERVER -500
  61. #define E_ADM_PROHIBITED -510
  62. #define E_BLACKLISTED -520
  63. #define MAX_REASON_LEN 128
  64. #include "str.h"
  65. /* processing status of the last command */
  66. extern int ser_error;
  67. extern int prev_ser_error;
  68. struct sip_msg;
  69. /* ser error -> SIP error */
  70. int err2reason_phrase( int ser_error, int *sip_error,
  71. char *phrase, int etl, char *signature );
  72. /* SIP error core -> SIP text */
  73. char *error_text( int code );
  74. /* return pkg_malloc-ed reply status in status->s */
  75. void get_reply_status( str *status, struct sip_msg *reply, int code );
  76. #endif