parse_cseq.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Copyright (C) 2001-2003 FhG Fokus
  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. * For a license to use the ser software under conditions
  12. * other than those described here, or to purchase support for this
  13. * software, please contact iptel.org by e-mail at the following addresses:
  14. * [email protected]
  15. *
  16. * ser is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  24. */
  25. /*! \file
  26. * \brief Parser :: Parse CSEQ header
  27. *
  28. * \ingroup parser
  29. */
  30. #ifndef PARSE_CSEQ
  31. #define PARSE_CSEQ
  32. #include "../str.h"
  33. struct cseq_body{
  34. int error; /*!< Error code */
  35. str number; /*!< CSeq number */
  36. str method; /*!< Associated method */
  37. unsigned int method_id; /*!< Associated method ID */
  38. };
  39. /*! \brief casting macro for accessing CSEQ body */
  40. #define get_cseq(p_msg) ((struct cseq_body*)(p_msg)->cseq->parsed)
  41. /*! \brief
  42. * Parse CSeq header field
  43. */
  44. char* parse_cseq(char* const buf, const char* const end, struct cseq_body* const cb);
  45. /*! \brief
  46. * Free all associated memory
  47. */
  48. void free_cseq(struct cseq_body* const cb);
  49. #endif