symon.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /* $Id: symon.h,v 1.26 2003/10/12 17:26:09 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 _SYMON_SYMON_H
  32. #define _SYMON_SYMON_H
  33. #include <conf.h>
  34. #include <sys/queue.h>
  35. #include "lex.h"
  36. #include "data.h"
  37. #define SYMON_PID_FILE "/var/run/symon.pid"
  38. #define SYMON_INTERVAL 5 /* measurement interval */
  39. #define SYMON_WARN_SENDERR 50 /* warn every x errors */
  40. #define SYMON_MAX_DOBJECTS 2000 /* max dynamic allocation; local limit per
  41. * measurement module */
  42. #define SYMON_MAX_OBJSIZE (_POSIX2_LINE_MAX) /* max allocation unit =
  43. * _POSIX2_LINE_MAX */
  44. #define SYMON_SENSORMASK 0xFF /* sensors 0-255 are allowed */
  45. struct funcmap {
  46. int type;
  47. int used;
  48. void (*init) (char *);
  49. void (*gets) ();
  50. int (*get) (char *, int, char *);
  51. };
  52. extern struct funcmap streamfunc[];
  53. /* prototypes */
  54. __BEGIN_DECLS
  55. /* sm_cpu.c */
  56. extern void init_cpu(char *);
  57. extern int get_cpu(char *, int, char *);
  58. /* sm_mem.c */
  59. extern void init_mem(char *);
  60. extern int get_mem(char *, int, char *);
  61. /* sm_if.c */
  62. extern void init_if(char *);
  63. extern int get_if(char *, int, char *);
  64. /* sm_io.c */
  65. extern void init_io(char *);
  66. extern void gets_io();
  67. extern int get_io(char *, int, char *);
  68. /* sm_pf.c */
  69. extern void init_pf(char *);
  70. extern int get_pf(char *, int, char *);
  71. /* sm_mbuf.c */
  72. extern void init_mbuf(char *);
  73. extern int get_mbuf(char *, int, char *);
  74. /* sm_debug.c */
  75. extern void init_debug(char *);
  76. extern int get_debug(char *, int, char *);
  77. /* sm_proc.c */
  78. extern void init_proc(char *);
  79. extern void gets_proc();
  80. extern int get_proc(char *, int, char *);
  81. /* sm_sensor.c */
  82. extern void init_sensor(char *);
  83. extern int get_sensor(char *, int, char *);
  84. __END_DECLS
  85. #endif /* _SYMON_SYMON_H */