parse_allow.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * Copyright (c) 2004 Juha Heinanen
  3. *
  4. * This file is part of ser, a free SIP server.
  5. *
  6. * ser is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version
  10. *
  11. * ser is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. /*! \file
  21. * \brief Parser :: Allow header
  22. *
  23. * \ingroup parser
  24. */
  25. #ifndef PARSE_ALLOW_H
  26. #define PARSE_ALLOW_H
  27. #include "hf.h"
  28. #include "msg_parser.h"
  29. /*! \brief
  30. * casting macro for accessing Allow body
  31. */
  32. #define get_allow_methods(p_msg) \
  33. (((struct allow_body*)(p_msg)->allow->parsed)->allow_all)
  34. struct allow_body {
  35. unsigned int allow; /*!< allow mask for the current hdr */
  36. unsigned int allow_all; /*!< allow mask for the all allow hdr - it's
  37. * set only for the first hdr in sibling
  38. * list*/
  39. };
  40. /*! \brief
  41. * Parse all Allow HFs
  42. */
  43. int parse_allow(struct sip_msg *msg);
  44. /*! \brief
  45. * This method is used to parse Allow header.
  46. *
  47. * \param _hf message header field
  48. * \return 0 on success, -1 on failure.
  49. */
  50. int parse_allow_header(struct hdr_field* _hf);
  51. /*! \brief
  52. * Release memory
  53. */
  54. void free_allow_body(struct allow_body **ab);
  55. void free_allow_header(struct hdr_field* hf);
  56. #endif /* PARSE_ALLOW_H */