data_lump_rpl.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * $Id$
  3. *
  4. *
  5. * Copyright (C) 2001-2003 FhG Fokus
  6. *
  7. * This file is part of ser, a free SIP server.
  8. *
  9. * ser is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version
  13. *
  14. * ser is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. *
  23. * History:
  24. * 2002-02-14 : created by bogdan
  25. * 2003-09-11 : lump_rpl type added - LUMP_RPL_BODY & LUMP_RPL_HDR (bogdan)
  26. * 2003-11-11 : build_lump_rpl merged into add_lump_rpl; type removed;
  27. * flags LUMP_RPL_BODY, LUMP_RPL_NODUP and LUMP_RPL_NOFREE
  28. * added (bogdan)
  29. * 2006-10-16 add_lump_rpl2 added: same as the old add_lump_rpl, but
  30. * returns a lump_rpl**, making a specific lump removal much
  31. * more easy (andrei)
  32. */
  33. /*!
  34. * \file
  35. * \brief SIP-router core :: Data lumps
  36. * \ingroup core
  37. * Module: \ref core
  38. */
  39. #ifndef data_lump_rpl_h
  40. #define data_lump_rpl_h
  41. #include "parser/msg_parser.h"
  42. #define LUMP_RPL_HDR (1<<1)
  43. #define LUMP_RPL_BODY (1<<2)
  44. #define LUMP_RPL_NODUP (1<<3)
  45. #define LUMP_RPL_NOFREE (1<<4)
  46. #define LUMP_RPL_SHMEM (1<<5)
  47. struct lump_rpl
  48. {
  49. str text;
  50. int flags;
  51. struct lump_rpl* next;
  52. };
  53. struct lump_rpl** add_lump_rpl2(struct sip_msg *, char *, int , int );
  54. /*! \brief compatibility wrapper for the old add_lump_rpl version */
  55. inline static struct lump_rpl* add_lump_rpl(struct sip_msg* msg,
  56. char* s, int len , int flags )
  57. {
  58. struct lump_rpl** l;
  59. l=add_lump_rpl2(msg, s, len, flags);
  60. return l?(*l):0;
  61. }
  62. void free_lump_rpl(struct lump_rpl* );
  63. void unlink_lump_rpl(struct sip_msg *, struct lump_rpl* );
  64. void del_nonshm_lump_rpl( struct lump_rpl ** );
  65. #endif