2
0

kstats_types.h 2.1 KB

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