case_prox.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*
  2. * $Id$
  3. *
  4. * Proxy-Require, Proxy-Authorization Header Field Name Parsing Macros
  5. *
  6. * Copyright (C) 2001-2003 Fhg Fokus
  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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  28. */
  29. #ifndef CASE_PROX_H
  30. #define CASE_PROX_H
  31. #define ION_CASE \
  32. switch(LOWER_DWORD(val)) { \
  33. case _ion1_: \
  34. hdr->type = HDR_PROXYAUTH; \
  35. hdr->name.len = 19; \
  36. *(p + 3) = '\0'; \
  37. return (p + 4); \
  38. \
  39. case _ion2_: \
  40. hdr->type = HDR_PROXYAUTH; \
  41. p += 4; \
  42. goto dc_end; \
  43. }
  44. #define IZAT_CASE \
  45. switch(LOWER_DWORD(val)) { \
  46. case _izat_: \
  47. p += 4; \
  48. val = READ(p); \
  49. ION_CASE; \
  50. goto other; \
  51. }
  52. #define THOR_CASE \
  53. switch(LOWER_DWORD(val)) { \
  54. case _thor_: \
  55. p += 4; \
  56. val = READ(p); \
  57. IZAT_CASE; \
  58. goto other; \
  59. }
  60. #define QUIR_CASE \
  61. switch(LOWER_DWORD(val)) { \
  62. case _quir_: \
  63. p += 4; \
  64. switch(LOWER_BYTE(*p)) { \
  65. case 'e': \
  66. hdr->type = HDR_PROXYREQUIRE; \
  67. p++; \
  68. goto dc_end; \
  69. } \
  70. goto other; \
  71. }
  72. #define PROX2_CASE \
  73. switch(LOWER_DWORD(val)) { \
  74. case _y_au_: \
  75. p += 4; \
  76. val = READ(p); \
  77. THOR_CASE; \
  78. goto other; \
  79. \
  80. case _y_re_: \
  81. p += 4; \
  82. val = READ(p); \
  83. QUIR_CASE; \
  84. goto other; \
  85. }
  86. #define prox_CASE \
  87. p += 4; \
  88. val = READ(p); \
  89. PROX2_CASE; \
  90. goto other;
  91. #endif /* CASE_PROX_H */