dispatcher.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /**
  2. * $Id$
  3. *
  4. * dispatcher module
  5. *
  6. * Copyright (C) 2004-2006 FhG Fokus
  7. * Copyright (C) 2005-2008 Hendrik Scholz <[email protected]>
  8. *
  9. * This file is part of ser, a free SIP server.
  10. *
  11. * ser is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation; either version 2 of the License, or
  14. * (at your option) any later version
  15. *
  16. * For a license to use the ser software under conditions
  17. * other than those described here, or to purchase support for this
  18. * software, please contact iptel.org by e-mail at the following addresses:
  19. * [email protected]
  20. *
  21. * ser is distributed in the hope that it will be useful,
  22. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24. * GNU General Public License for more details.
  25. *
  26. * You should have received a copy of the GNU General Public License
  27. * along with this program; if not, write to the Free Software
  28. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  29. *
  30. */
  31. #ifndef _DISPATCHER_H_
  32. #define _DISPATCHER_H_
  33. #include "../../sr_module.h"
  34. /* these are tunable
  35. *
  36. * if you increase no of sets or nodes to >99 output in di_rpc.c
  37. * might get garbled (increase %2d and %3d respectively)
  38. */
  39. #define DS_MAX_SETS 32 /* maximum number of dispatcher sets */
  40. #define DS_MAX_NODES 32 /* max number of nodes per set */
  41. #define DS_MAX_URILEN 256 /* max SIP uri length */
  42. /* no service needed below */
  43. #define DS_HASH_USER_ONLY 1 /* use only the uri user part for hashing */
  44. #define DS_HASH_USER_OR_HOST 2 /* use user part of uri for hashing with
  45. fallback to host */
  46. /* MAX_LINE_LEN should be >= DS_MAX_URI_LEN to prevent overflow in
  47. * config file parser
  48. */
  49. #define MAX_LINE_LEN DS_MAX_URILEN
  50. extern int ds_flags;
  51. /* prototypes */
  52. int ds_load_list(char *lfile);
  53. int ds_destroy_lists();
  54. int ds_select_dst(struct sip_msg *msg, char *set, char *alg);
  55. int ds_select_new(struct sip_msg *msg, char *set, char *alg);
  56. int ds_init_memory(void);
  57. void ds_clean_list(void);
  58. #define DS_SWITCH_ACTIVE_LIST *ds_activelist = (0 == *ds_activelist) ? 1 : 0;
  59. #endif /* _DISPATCHER_H_ */