case_retr.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * Expires Header Field Name Parsing Macros
  3. *
  4. * Copyright (C) 2007 iptelorg GmbH
  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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  26. *
  27. * History:
  28. * ---------
  29. * 2007-07-27 created by andrei
  30. */
  31. /*! \file
  32. * \brief Parser :: Expires Header Field Name Parsing Macros
  33. *
  34. * \ingroup parser
  35. */
  36. #ifndef CASE_RETR_H
  37. #define CASE_RETR_H
  38. #include "../comp_defs.h"
  39. #include "keys.h"
  40. #define RETR_TER_CASE \
  41. switch(LOWER_DWORD(val)){ \
  42. case _ter1_: \
  43. hdr->type = HDR_RETRY_AFTER_T; \
  44. hdr->name.len = 11; \
  45. return (p + 4); \
  46. \
  47. case _ter2_: \
  48. hdr->type = HDR_RETRY_AFTER_T; \
  49. p += 4; \
  50. goto dc_end; \
  51. }
  52. #define RETR_Y_AF_CASE \
  53. if (LOWER_DWORD(val)==_y_af_){ \
  54. p+=4; \
  55. val=READ(p); \
  56. RETR_TER_CASE; \
  57. goto other; \
  58. }
  59. #define retr_CASE \
  60. p+=4; \
  61. val=READ(p); \
  62. RETR_Y_AF_CASE; \
  63. goto other;
  64. #endif /* CASE_RETR_H */