kstats_types.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * $Id$
  3. *
  4. * Copyright (C) 2010 iptelorg GmbH
  5. *
  6. * Permission to use, copy, modify, and distribute this software for any
  7. * purpose with or without fee is hereby granted, provided that the above
  8. * copyright notice and this permission notice appear in all copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  11. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  12. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  13. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  14. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  15. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  16. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. /** kamailio statistics types.
  19. * This file contains type declaration for kamailio statistics.
  20. * They are needed when modules are loaded (sr_module.c).
  21. * The rest of kamailio stats are in lib/kcore (include
  22. * lib/kcore/kstats_wrapper.h or lib/kcore/statistics.h and link with
  23. * libkcore).
  24. * Note: kamailio statistics are obsolete. Use sr counters in new code
  25. * (counters.h).
  26. * @file kstats_types.h
  27. * @ingroup: core
  28. */
  29. /*
  30. * History:
  31. * --------
  32. * 2010-08-18 initial version (andrei)
  33. */
  34. #ifndef __kstats_types_h
  35. #define __kstats_types_h
  36. #include "counters.h"
  37. /* types */
  38. typedef counter_val_t stat_val;
  39. /* stat_var is always used as a pointer in k, we missuse
  40. stat_var* for holding out counter id */
  41. typedef void stat_var;
  42. /* get val callback
  43. * TODO: change it to counter_cbk_f compatible callback?
  44. */
  45. typedef counter_val_t (*stat_function)(void);
  46. /* statistic module interface */
  47. struct stat_export_s {
  48. char* name;
  49. int flags;
  50. stat_var** stat_pointer; /* pointer to the memory location
  51. (where a counter handle will be stored)
  52. Note: it's a double pointer because of
  53. the original k version which needed it
  54. allocated in shm. This version
  55. will store the counter id at *stat_pointer.
  56. */
  57. };
  58. typedef struct stat_export_s stat_export_t;
  59. #endif /*__kstats_types_h*/
  60. /* vi: set ts=4 sw=4 tw=79:ai:cindent: */