mod_sanity.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * $Id$
  3. *
  4. * Sanity Checks Module
  5. *
  6. * Copyright (C) 2006 iptelorg GbmH
  7. *
  8. * This file is part of ser, a free SIP server.
  9. *
  10. * ser is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; either version 2 of the License, or
  13. * (at your option) any later version
  14. *
  15. * For a license to use the ser software under conditions
  16. * other than those described here, or to purchase support for this
  17. * software, please contact iptel.org by e-mail at the following addresses:
  18. * [email protected]
  19. *
  20. * ser is distributed in the hope that it will be useful,
  21. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  22. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  23. * GNU General Public License for more details.
  24. *
  25. * You should have received a copy of the GNU General Public License
  26. * along with this program; if not, write to the Free Software
  27. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  28. *
  29. */
  30. #ifndef MOD_SANITY_CHK_H
  31. #define MOD_SANITY_CHK_H
  32. #include "../../str.h"
  33. #include "../../modules/sl/sl.h"
  34. #include "../../parser/msg_parser.h"
  35. #define SANITY_RURI_SIP_VERSION (1<<0)
  36. #define SANITY_RURI_SCHEME (1<<1)
  37. #define SANITY_REQUIRED_HEADERS (1<<2)
  38. #define SANITY_VIA_SIP_VERSION (1<<3)
  39. #define SANITY_VIA_PROTOCOL (1<<4)
  40. #define SANITY_CSEQ_METHOD (1<<5)
  41. #define SANITY_CSEQ_VALUE (1<<6)
  42. #define SANITY_CL (1<<7)
  43. #define SANITY_EXPIRES_VALUE (1<<8)
  44. #define SANITY_PROXY_REQUIRE (1<<9)
  45. #define SANITY_PARSE_URIS (1<<10)
  46. #define SANITY_CHECK_DIGEST (1<<11)
  47. #define SANITY_CHECK_DUPTAGS (1<<12)
  48. #define SANITY_MAX_CHECKS (1<<13) /* Make sure this is the highest value */
  49. /* VIA_SIP_VERSION and VIA_PROTOCOL do not work yet
  50. * and PARSE_URIS is very expensive */
  51. #define SANITY_DEFAULT_CHECKS SANITY_RURI_SIP_VERSION | \
  52. SANITY_RURI_SCHEME | \
  53. SANITY_REQUIRED_HEADERS | \
  54. SANITY_CSEQ_METHOD | \
  55. SANITY_CSEQ_VALUE | \
  56. SANITY_CL | \
  57. SANITY_EXPIRES_VALUE | \
  58. SANITY_PROXY_REQUIRE | \
  59. SANITY_CHECK_DIGEST
  60. #define SANITY_URI_CHECK_RURI (1<<0)
  61. #define SANITY_URI_CHECK_FROM (1<<1)
  62. #define SANITY_URI_CHECK_TO (1<<2)
  63. #define SANITY_URI_CHECK_CONTACT (1<<3)
  64. #define SANITY_URI_MAX_CHECKS (1<<4) /* Make sure this is the highest value */
  65. #define SANITY_DEFAULT_URI_CHECKS SANITY_URI_CHECK_RURI | \
  66. SANITY_URI_CHECK_FROM | \
  67. SANITY_URI_CHECK_TO
  68. #define SANITY_CHECK_PASSED 1
  69. #define SANITY_CHECK_FAILED 0
  70. #define SANITY_CHECK_ERROR -1
  71. struct _strlist {
  72. str string; /* the string */
  73. struct _strlist* next; /* the next strlist element */
  74. };
  75. typedef struct _strlist strl;
  76. extern int default_checks;
  77. extern strl* proxyrequire_list;
  78. extern sl_api_t slb;
  79. #endif /* MOD_SANITY_CHK_H */