rtpproxy.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /* $Id: nathelper.c 1808 2007-03-10 17:36:19Z bogdan_iancu $
  2. *
  3. * Copyright (C) 2003 Porta Software Ltd
  4. *
  5. * This file is part of Kamailio, a free SIP server.
  6. *
  7. * Kamailio is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version
  11. *
  12. * Kamailio is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. *
  21. * History:
  22. * ---------
  23. * 2007-04-13 splitted from nathelper.c (ancuta)
  24. */
  25. #ifndef _RTPPROXY_H
  26. #define _RTPPROXY_H
  27. #include "../../str.h"
  28. /* Handy macros */
  29. #define STR2IOVEC(sx, ix) do {(ix).iov_base = (sx).s; (ix).iov_len = (sx).len;} while(0)
  30. #define SZ2IOVEC(sx, ix) do {(ix).iov_base = (sx); (ix).iov_len = strlen(sx);} while(0)
  31. struct rtpp_node {
  32. unsigned int idx; /* overall index */
  33. str rn_url; /* unparsed, deletable */
  34. int rn_umode;
  35. char *rn_address; /* substring of rn_url */
  36. int rn_disabled; /* found unaccessible? */
  37. unsigned rn_weight; /* for load balancing */
  38. unsigned int rn_recheck_ticks;
  39. int rn_rep_supported;
  40. int rn_ptl_supported;
  41. struct rtpp_node *rn_next;
  42. };
  43. struct rtpp_set{
  44. unsigned int id_set;
  45. unsigned weight_sum;
  46. unsigned int rtpp_node_count;
  47. int set_disabled;
  48. unsigned int set_recheck_ticks;
  49. struct rtpp_node *rn_first;
  50. struct rtpp_node *rn_last;
  51. struct rtpp_set *rset_next;
  52. };
  53. struct rtpp_set_head{
  54. struct rtpp_set *rset_first;
  55. struct rtpp_set *rset_last;
  56. };
  57. /* Functions from nathelper */
  58. struct rtpp_node *select_rtpp_node(str, int);
  59. char *send_rtpp_command(struct rtpp_node *, struct iovec *, int);
  60. #endif