symon.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /* $Id: symon.h,v 1.23 2002/12/15 14:23:27 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 <sys/queue.h>
  34. #include "lex.h"
  35. #include "data.h"
  36. #include "conf.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 200 /* 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. struct funcmap {
  45. int type;
  46. void (*init) (char *);
  47. void (*gets) ();
  48. int (*get) (char *, int, char *);
  49. };
  50. extern struct funcmap streamfunc[];
  51. /* prototypes */
  52. __BEGIN_DECLS
  53. /* sm_cpu.c */
  54. extern void init_cpu(char *);
  55. extern int get_cpu(char *, int, char *);
  56. /* sm_mem.c */
  57. extern void init_mem(char *);
  58. extern int get_mem(char *, int, char *);
  59. /* sm_if.c */
  60. extern void init_if(char *);
  61. extern int get_if(char *, int, char *);
  62. /* sm_io.c */
  63. extern void init_io(char *);
  64. extern void gets_io();
  65. extern int get_io(char *, int, char *);
  66. /* sm_pf.c */
  67. extern void init_pf(char *);
  68. extern int get_pf(char *, int, char *);
  69. /* sm_mbuf.c */
  70. extern void init_mbuf(char *);
  71. extern int get_mbuf(char *, int, char *);
  72. /* sm_debug.c */
  73. extern void init_debug(char *);
  74. extern int get_debug(char *, int, char *);
  75. /* sm_proc.c */
  76. extern void init_proc(char *);
  77. extern void gets_proc();
  78. extern int get_proc(char *, int, char *);
  79. __END_DECLS
  80. #endif /* _SYMON_SYMON_H */