parse_disposition.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. * 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. * History:
  21. * 2003-09-09 created (bogdan)
  22. */
  23. /*! \file
  24. * \brief Parser :: Content-Disposition header
  25. *
  26. * \ingroup parser
  27. */
  28. #ifndef _PARSE_DISPOSITION_H_
  29. #define _PARSE_DISPOSITION_H_
  30. #include "../str.h"
  31. #include "msg_parser.h"
  32. #define get_content_disposition(_msg_) \
  33. ((struct disposition*)((_msg_)->content_disposition->parsed))
  34. struct disposition_param {
  35. str name;
  36. str body;
  37. int is_quoted;
  38. struct disposition_param *next;
  39. };
  40. struct disposition {
  41. str type;
  42. struct disposition_param *params;
  43. };
  44. /*! \brief looks inside the message, gets the Content-Disposition hdr, parse it, builds
  45. * and fills a disposition structure for it what will be attached to hdr as
  46. * parsed link.
  47. * Returns: -1 : error
  48. * 0 : success
  49. * 1 : hdr not found
  50. */
  51. int parse_content_disposition( struct sip_msg *msg );
  52. /*! \brief parse a string that supposed to be a disposition and fills up the structure
  53. * Returns: -1 : error
  54. * o : success */
  55. int parse_disposition( str *s, struct disposition *disp);
  56. /*! \brief Frees the entire disposition structure (params + itself) */
  57. void free_disposition( struct disposition **disp);
  58. /*! \brief Prints recursive a disposition structure */
  59. void print_disposition( struct disposition *disp);
  60. #endif