case_requ.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. * Require, Request-Disposition Header Field Name Parsing Macros
  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. * For a license to use the ser software under conditions
  14. * other than those described here, or to purchase support for this
  15. * software, please contact iptel.org by e-mail at the following addresses:
  16. * [email protected]
  17. *
  18. * ser is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU General Public License
  24. * along with this program; if not, write to the Free Software
  25. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  26. *
  27. * History:
  28. * -------------
  29. * 2003-02-28 scratchpad compatibility abandoned (jiri)
  30. * 2003-01-27 next baby-step to removing ZT - PRESERVE_ZT (jiri)
  31. */
  32. /*! \file
  33. * \brief Parser :: Require, Request-Disposition Header Field Name Parsing Macros
  34. *
  35. * \ingroup parser
  36. */
  37. #ifndef CASE_REQU_H
  38. #define CASE_REQU_H
  39. #include "../comp_defs.h"
  40. #define REQUESTDISPOSIT_ion_CASE \
  41. switch(LOWER_DWORD(val)) { \
  42. case _ion1_: \
  43. hdr->type = HDR_REQUESTDISPOSITION_T; \
  44. hdr->name.len = 19; \
  45. return (p + 4); \
  46. \
  47. case _ion2_: \
  48. hdr->type = HDR_REQUESTDISPOSITION_T; \
  49. p += 4; \
  50. goto dc_end; \
  51. }
  52. #define REQUESTDISP_OSITION_CASE \
  53. switch(LOWER_DWORD(val)) { \
  54. case _osit_: \
  55. p += 4; \
  56. val = READ(p); \
  57. REQUESTDISPOSIT_ion_CASE; \
  58. goto other; \
  59. }
  60. #define REQUEST_DISPOSITION_CASE \
  61. switch(LOWER_DWORD(val)) { \
  62. case _disp_: \
  63. p += 4; \
  64. val = READ(p); \
  65. REQUESTDISP_OSITION_CASE; \
  66. goto other; \
  67. }
  68. #define IRE_CASE \
  69. switch(LOWER_DWORD(val)) { \
  70. case _ire1_: \
  71. hdr->type = HDR_REQUIRE_T; \
  72. hdr->name.len = 7; \
  73. return (p + 4); \
  74. \
  75. case _ire2_: \
  76. hdr->type = HDR_REQUIRE_T; \
  77. p += 4; \
  78. goto dc_end; \
  79. case _est__: \
  80. p += 4; \
  81. val = READ(p); \
  82. REQUEST_DISPOSITION_CASE;\
  83. goto other; \
  84. }
  85. #define requ_CASE \
  86. p += 4; \
  87. val = READ(p); \
  88. IRE_CASE; \
  89. goto other;
  90. #endif /* CASE_REQU_H */