mon.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /* $Id: mon.h,v 1.16 2002/08/31 15:00:25 dijkstra Exp $ */
  2. /*
  3. * Copyright (c) 2001-2002 Willem Dijkstra
  4. * All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. *
  10. * - Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * - Redistributions in binary form must reproduce the above
  13. * copyright notice, this list of conditions and the following
  14. * disclaimer in the documentation and/or other materials provided
  15. * with the distribution.
  16. *
  17. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  18. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  19. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  20. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  21. * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  22. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  23. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  24. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  25. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  26. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  27. * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  28. * POSSIBILITY OF SUCH DAMAGE.
  29. *
  30. */
  31. #ifndef _MON_MON_H
  32. #define _MON_MON_H
  33. #include <sys/queue.h>
  34. #ifdef MON_KVM
  35. #include <kvm.h>
  36. #include <nlist.h>
  37. #endif
  38. #include "lex.h"
  39. #include "data.h"
  40. #define MON_CONFIG_FILE "/etc/mon.conf"
  41. #define MON_PID_FILE "/var/run/mon.pid"
  42. #define MON_VERSION "2.3"
  43. #define MON_INTERVAL 5 /* measurement interval */
  44. #define MON_WARN_SENDERR 50 /* warn every x errors */
  45. /* kvm interface */
  46. #ifdef MON_KVM
  47. extern kvm_t *kvmd;
  48. extern struct nlist mon_nl[];
  49. #define MON_DL 0
  50. #endif /* MON_KVM */
  51. struct funcmap {
  52. int type;
  53. void (*init)(char *);
  54. int (*get)(char*, int, char *);
  55. };
  56. extern struct funcmap streamfunc[];
  57. /* prototypes */
  58. __BEGIN_DECLS
  59. #ifdef MON_KVM
  60. extern int kread(u_long, char *, int);
  61. #else
  62. extern int kread(u_long, char *, int); /* This is a stub that reports an error
  63. when called. I included it so as not
  64. to miss any stuff when the time has
  65. come to rip all MON_KVM stuff out */
  66. #endif
  67. /* cpu.c */
  68. extern void init_cpu(char *);
  69. extern int get_cpu(char *, int, char *);
  70. /* mem.c */
  71. extern void init_mem(char *);
  72. extern int get_mem(char *, int, char *);
  73. /* if.c */
  74. extern void init_if(char *);
  75. extern int get_if(char *, int, char *);
  76. /* io.c */
  77. extern void init_io(char *);
  78. extern int get_io(char *, int, char *);
  79. /* pf.c */
  80. extern void init_pf(char *);
  81. extern int get_pf(char *, int, char *);
  82. __END_DECLS
  83. #endif /*_MON_MON_H*/