mod_sanity.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * Sanity Checks Module
  3. *
  4. * Copyright (C) 2006 iptelorg GbmH
  5. *
  6. * This file is part of Kamailio, a free SIP server.
  7. *
  8. * Kamailio 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. * Kamailio 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. */
  23. #ifndef MOD_SANITY_CHK_H
  24. #define MOD_SANITY_CHK_H
  25. #include "../../str.h"
  26. #include "../../modules/sl/sl.h"
  27. #include "../../parser/msg_parser.h"
  28. #define SANITY_RURI_SIP_VERSION (1<<0)
  29. #define SANITY_RURI_SCHEME (1<<1)
  30. #define SANITY_REQUIRED_HEADERS (1<<2)
  31. #define SANITY_VIA_SIP_VERSION (1<<3)
  32. #define SANITY_VIA_PROTOCOL (1<<4)
  33. #define SANITY_CSEQ_METHOD (1<<5)
  34. #define SANITY_CSEQ_VALUE (1<<6)
  35. #define SANITY_CL (1<<7)
  36. #define SANITY_EXPIRES_VALUE (1<<8)
  37. #define SANITY_PROXY_REQUIRE (1<<9)
  38. #define SANITY_PARSE_URIS (1<<10)
  39. #define SANITY_CHECK_DIGEST (1<<11)
  40. #define SANITY_CHECK_DUPTAGS (1<<12)
  41. #define SANITY_MAX_CHECKS (1<<13) /* Make sure this is the highest value */
  42. /* VIA_SIP_VERSION and VIA_PROTOCOL do not work yet
  43. * and PARSE_URIS is very expensive */
  44. #define SANITY_DEFAULT_CHECKS SANITY_RURI_SIP_VERSION | \
  45. SANITY_RURI_SCHEME | \
  46. SANITY_REQUIRED_HEADERS | \
  47. SANITY_CSEQ_METHOD | \
  48. SANITY_CSEQ_VALUE | \
  49. SANITY_CL | \
  50. SANITY_EXPIRES_VALUE | \
  51. SANITY_PROXY_REQUIRE | \
  52. SANITY_CHECK_DIGEST
  53. #define SANITY_URI_CHECK_RURI (1<<0)
  54. #define SANITY_URI_CHECK_FROM (1<<1)
  55. #define SANITY_URI_CHECK_TO (1<<2)
  56. #define SANITY_URI_CHECK_CONTACT (1<<3)
  57. #define SANITY_URI_MAX_CHECKS (1<<4) /* Make sure this is the highest value */
  58. #define SANITY_DEFAULT_URI_CHECKS SANITY_URI_CHECK_RURI | \
  59. SANITY_URI_CHECK_FROM | \
  60. SANITY_URI_CHECK_TO
  61. #define SANITY_CHECK_PASSED 1
  62. #define SANITY_CHECK_FAILED 0
  63. #define SANITY_CHECK_ERROR -1
  64. struct _strlist {
  65. str string; /* the string */
  66. struct _strlist* next; /* the next strlist element */
  67. };
  68. typedef struct _strlist strl;
  69. extern int default_checks;
  70. extern strl* proxyrequire_list;
  71. extern sl_api_t slb;
  72. #endif /* MOD_SANITY_CHK_H */