parse_identity.h 1.5 KB

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