pv_trans.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * $Id$
  3. *
  4. * Copyright (C) 2007 voice-system.ro
  5. *
  6. * This file is part of Kamailio, a free SIP server.
  7. *
  8. * Kamailio 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. * Kamailio 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. *
  22. */
  23. /*! \file
  24. * \brief Transformations support
  25. */
  26. #ifndef _PV_TRANS_H_
  27. #define _PV_TRANS_H_
  28. #include "../../pvar.h"
  29. enum _tr_type { TR_NONE=0, TR_STRING, TR_URI, TR_PARAMLIST, TR_NAMEADDR,
  30. TR_TOBODY, TR_LINE };
  31. enum _tr_s_subtype {
  32. TR_S_NONE=0, TR_S_LEN, TR_S_INT, TR_S_MD5, TR_S_SHA256, TR_S_SHA384,
  33. TR_S_SHA512, TR_S_SUBSTR, TR_S_SELECT, TR_S_ENCODEHEXA, TR_S_DECODEHEXA,
  34. TR_S_ENCODE7BIT, TR_S_DECODE7BIT, TR_S_ENCODEBASE64, TR_S_DECODEBASE64,
  35. TR_S_ESCAPECOMMON, TR_S_UNESCAPECOMMON, TR_S_ESCAPEUSER, TR_S_UNESCAPEUSER,
  36. TR_S_ESCAPEPARAM, TR_S_UNESCAPEPARAM, TR_S_TOLOWER, TR_S_TOUPPER,
  37. TR_S_STRIP, TR_S_STRIPTAIL, TR_S_PREFIXES, TR_S_PREFIXES_QUOT, TR_S_REPLACE,
  38. TR_S_TIMEFORMAT, TR_S_TRIM, TR_S_RTRIM, TR_S_LTRIM, TR_S_RM, TR_S_STRIPTO,
  39. TR_S_URLENCODEPARAM, TR_S_URLDECODEPARAM
  40. };
  41. enum _tr_uri_subtype {
  42. TR_URI_NONE=0, TR_URI_USER, TR_URI_HOST, TR_URI_PASSWD, TR_URI_PORT,
  43. TR_URI_PARAMS, TR_URI_PARAM, TR_URI_HEADERS, TR_URI_TRANSPORT, TR_URI_TTL,
  44. TR_URI_UPARAM, TR_URI_MADDR, TR_URI_METHOD, TR_URI_LR,
  45. TR_URI_R2
  46. };
  47. enum _tr_param_subtype {
  48. TR_PL_NONE=0, TR_PL_VALUE, TR_PL_VALUEAT, TR_PL_NAME, TR_PL_COUNT
  49. };
  50. enum _tr_nameaddr_subtype {
  51. TR_NA_NONE=0, TR_NA_NAME, TR_NA_URI, TR_NA_LEN
  52. };
  53. enum _tr_tobody_subtype {
  54. TR_TOBODY_NONE=0, TR_TOBODY_DISPLAY, TR_TOBODY_URI, TR_TOBODY_TAG,
  55. TR_TOBODY_URI_USER, TR_TOBODY_URI_HOST, TR_TOBODY_PARAMS
  56. };
  57. enum _tr_line_subtype {
  58. TR_LINE_NONE=0, TR_LINE_COUNT, TR_LINE_AT, TR_LINE_SW
  59. };
  60. char* tr_parse_string(str *in, trans_t *tr);
  61. char* tr_parse_uri(str *in, trans_t *tr);
  62. char* tr_parse_paramlist(str *in, trans_t *tr);
  63. char* tr_parse_nameaddr(str *in, trans_t *tr);
  64. char* tr_parse_tobody(str* in, trans_t *t);
  65. char* tr_parse_line(str* in, trans_t *t);
  66. int tr_init_buffers(void);
  67. #endif