t_msgbuilder.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. * For a license to use the ser software under conditions
  15. * other than those described here, or to purchase support for this
  16. * software, please contact iptel.org by e-mail at the following addresses:
  17. * [email protected]
  18. *
  19. * ser is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License
  25. * along with this program; if not, write to the Free Software
  26. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  27. */
  28. #ifndef _MSGBUILDER_H
  29. #define _MSGBUILDER_H
  30. #define CSEQ "CSeq: "
  31. #define CSEQ_LEN 6
  32. #define TO "To: "
  33. #define TO_LEN 4
  34. #define CALLID "Call-ID: "
  35. #define CALLID_LEN 9
  36. #define CONTENT_LENGTH "Content-Length: "
  37. #define CONTENT_LENGTH_LEN 16
  38. #define FROM "From: "
  39. #define FROM_LEN 6
  40. #define FROMTAG ";tag="
  41. #define FROMTAG_LEN 5
  42. #define UAC_CSEQNR "1"
  43. #define UAC_CSEQNR_LEN 1
  44. #define UAC_CSEQNR "1"
  45. #define UAC_CSEQNR_LEN 1
  46. /* convenience macros */
  47. #define memapp(_d,_s,_len) \
  48. do{\
  49. memcpy((_d),(_s),(_len));\
  50. (_d) += (_len);\
  51. }while(0);
  52. #define append_mem_block(_d,_s,_len) \
  53. do{\
  54. memcpy((_d),(_s),(_len));\
  55. (_d) += (_len);\
  56. }while(0);
  57. #ifdef _OBSO
  58. #define append_str(_p,_str) \
  59. do{ \
  60. memcpy((_p), (_str).s, (_str).len); \
  61. (_p)+=(_str).len); \
  62. } while(0);
  63. #endif
  64. char *build_local(struct cell *Trans, unsigned int branch,
  65. unsigned int *len, char *method, int method_len, str *to);
  66. char *build_uac_request( str msg_type, str dst, str from,
  67. str headers, str body, int branch,
  68. struct cell *t, int *len);
  69. int t_calc_branch(struct cell *t,
  70. int b, char *branch, int *branch_len);
  71. int t_setbranch( struct cell *t, struct sip_msg *msg, int b );
  72. #endif