janssonrpc_srv.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /**
  2. * Copyright (C) 2013 Flowroute LLC (flowroute.com)
  3. *
  4. * This file is part of Kamailio, a free SIP server.
  5. *
  6. * This file is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version
  10. *
  11. *
  12. * This file 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. */
  22. #ifndef _JANSSONRPC_SRV_H_
  23. #define _JANSSONRPC_SRV_H_
  24. #include "janssonrpc_server.h"
  25. typedef struct jsonrpc_srv jsonrpc_srv_t;
  26. struct jsonrpc_srv {
  27. str srv;
  28. unsigned int ttl;
  29. jsonrpc_server_group_t* cgroup;
  30. jsonrpc_srv_t* next;
  31. };
  32. typedef struct srv_cb_params {
  33. int cmd_pipe;
  34. unsigned int srv_ttl;
  35. } srv_cb_params_t;
  36. jsonrpc_srv_t* global_srv_list;
  37. unsigned int jsonrpc_min_srv_ttl;
  38. jsonrpc_srv_t* create_srv(str srv, str conn, unsigned int ttl);
  39. void addto_srv_list(jsonrpc_srv_t* srv, jsonrpc_srv_t** list);
  40. void refresh_srv_cb(unsigned int ticks, void* params);
  41. void print_srv(jsonrpc_srv_t* list);
  42. #define JSONRPC_DEFAULT_MIN_SRV_TTL 5
  43. #define ABSOLUTE_MIN_SRV_TTL 1
  44. #endif /* _JSONRPC_SRV_H_ */