case_iden.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * Identity, Identity-info 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  26. *
  27. * History:
  28. * --------
  29. */
  30. /*! \file
  31. * \brief Parser :: Identity, Identity-info Header Field Name Parsing Macros
  32. *
  33. * \ingroup parser
  34. */
  35. #ifndef CASE_IDEN_H
  36. #define CASE_IDEN_H
  37. #include "../comp_defs.h"
  38. #define INFO_CASE \
  39. switch(LOWER_DWORD(val)) { \
  40. case _info_: \
  41. hdr->type = HDR_IDENTITY_INFO_T; \
  42. p += 4; \
  43. goto dc_end; \
  44. }
  45. #define TITY_CASE \
  46. switch(LOWER_DWORD(val)) { \
  47. case _tity_: \
  48. p += 4; \
  49. switch(LOWER_BYTE(*p)) { \
  50. case ':': \
  51. case ' ': \
  52. hdr->type = HDR_IDENTITY_T; \
  53. goto dc_end; \
  54. case '-': \
  55. p++; \
  56. val = READ(p); \
  57. INFO_CASE; \
  58. } \
  59. goto other; \
  60. }
  61. #define iden_CASE \
  62. p += 4; \
  63. val = READ(p); \
  64. TITY_CASE; \
  65. goto other;
  66. #endif /* CASE_PROX_H */