case_auth.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Authorization Header Field Name Parsing Macros
  3. *
  4. * Copyright (C) 2001-2003 FhG Fokus
  5. *
  6. * This file is part of SIP-router, a free SIP server.
  7. *
  8. * SIP-router 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. * SIP-router is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. */
  22. /*! \file
  23. * \brief Parser :: Authorization Header Field Name Parsing Macros
  24. *
  25. * \ingroup parser
  26. */
  27. #ifndef CASE_AUTH_H
  28. #define CASE_AUTH_H
  29. #define AUTH_ATIO_CASE \
  30. if (LOWER_DWORD(val) == _atio_) { \
  31. p += 4; \
  32. switch(LOWER_BYTE(*p)) { \
  33. case 'n': \
  34. hdr->type = HDR_AUTHORIZATION_T; \
  35. p++; \
  36. goto dc_end; \
  37. \
  38. default: goto other; \
  39. } \
  40. }
  41. #define AUTH_ORIZ_CASE \
  42. if (LOWER_DWORD(val) == _oriz_) { \
  43. p += 4; \
  44. val = READ(p); \
  45. AUTH_ATIO_CASE; \
  46. goto other; \
  47. }
  48. #define auth_CASE \
  49. p += 4; \
  50. val = READ(p); \
  51. AUTH_ORIZ_CASE; \
  52. goto other;
  53. #endif /* CASE_AUTH_H */