parse_identity.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright (c) 2007 iptelorg GmbH
  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 :: Parse Identity header field
  22. *
  23. * \ingroup parser
  24. */
  25. #ifndef PARSE_IDENTITY
  26. #define PARSE_IDENTITY
  27. #include "../str.h"
  28. #include "msg_parser.h"
  29. struct identity_body{
  30. int error; /*!< Error code */
  31. int ballocated; /*!< Does hash point to an allocated area */
  32. str hash;
  33. };
  34. /*! \brief casting macro for accessing IDENTITY body */
  35. #define get_identity(p_msg) ((struct identity_body*)(p_msg)->identity->parsed)
  36. /*! \brief
  37. * Parse Identity header field
  38. */
  39. void parse_identity(char *buf, char *end, struct identity_body *ib);
  40. /*! \brief
  41. * Parse Identity header field
  42. */
  43. int parse_identity_header(struct sip_msg *msg);
  44. /*! \brief
  45. * Free all associated memory
  46. */
  47. void free_identity(struct identity_body *ib);
  48. #endif