/include/rpcsvc/rstat.x

https://bitbucket.org/freebsd/freebsd-head/ · Alex · 158 lines · 141 code · 17 blank · 0 comment · 0 complexity · e6bc0c4ce23b0a004688e61a67cd44f7 MD5 · raw file

  1. /*
  2. * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
  3. * unrestricted use provided that this legend is included on all tape
  4. * media and as a part of the software program in whole or part. Users
  5. * may copy or modify Sun RPC without charge, but are not authorized
  6. * to license or distribute it to anyone else except as part of a product or
  7. * program developed by the user.
  8. *
  9. * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
  10. * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
  11. * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
  12. *
  13. * Sun RPC is provided with no support and without any obligation on the
  14. * part of Sun Microsystems, Inc. to assist in its use, correction,
  15. * modification or enhancement.
  16. *
  17. * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
  18. * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
  19. * OR ANY PART THEREOF.
  20. *
  21. * In no event will Sun Microsystems, Inc. be liable for any lost revenue
  22. * or profits or other special, indirect and consequential damages, even if
  23. * Sun has been advised of the possibility of such damages.
  24. *
  25. * Sun Microsystems, Inc.
  26. * 2550 Garcia Avenue
  27. * Mountain View, California 94043
  28. */
  29. /*
  30. * Gather statistics on remote machines
  31. */
  32. #ifdef RPC_HDR
  33. %#ifndef FSCALE
  34. %/*
  35. % * Scale factor for scaled integers used to count load averages.
  36. % */
  37. %#define FSHIFT 8 /* bits to right of fixed binary point */
  38. %#define FSCALE (1<<FSHIFT)
  39. %
  40. %#endif /* ndef FSCALE */
  41. #else
  42. %#ifndef lint
  43. %/*static char sccsid[] = "from: @(#)rstat.x 1.2 87/09/18 Copyr 1987 Sun Micro";*/
  44. %/*static char sccsid[] = "from: @(#)rstat.x 2.2 88/08/01 4.0 RPCSRC";*/
  45. %#endif /* not lint */
  46. %#include <sys/cdefs.h>
  47. %__FBSDID("$FreeBSD$");
  48. #endif /* def RPC_HDR */
  49. const RSTAT_CPUSTATES = 4;
  50. const RSTAT_DK_NDRIVE = 4;
  51. /*
  52. * GMT since 0:00, January 1, 1970
  53. */
  54. struct rstat_timeval {
  55. unsigned int tv_sec; /* seconds */
  56. unsigned int tv_usec; /* and microseconds */
  57. };
  58. struct statstime { /* RSTATVERS_TIME */
  59. int cp_time[RSTAT_CPUSTATES];
  60. int dk_xfer[RSTAT_DK_NDRIVE];
  61. unsigned int v_pgpgin; /* these are cumulative sum */
  62. unsigned int v_pgpgout;
  63. unsigned int v_pswpin;
  64. unsigned int v_pswpout;
  65. unsigned int v_intr;
  66. int if_ipackets;
  67. int if_ierrors;
  68. int if_oerrors;
  69. int if_collisions;
  70. unsigned int v_swtch;
  71. int avenrun[3]; /* scaled by FSCALE */
  72. rstat_timeval boottime;
  73. rstat_timeval curtime;
  74. int if_opackets;
  75. };
  76. struct statsswtch { /* RSTATVERS_SWTCH */
  77. int cp_time[RSTAT_CPUSTATES];
  78. int dk_xfer[RSTAT_DK_NDRIVE];
  79. unsigned int v_pgpgin; /* these are cumulative sum */
  80. unsigned int v_pgpgout;
  81. unsigned int v_pswpin;
  82. unsigned int v_pswpout;
  83. unsigned int v_intr;
  84. int if_ipackets;
  85. int if_ierrors;
  86. int if_oerrors;
  87. int if_collisions;
  88. unsigned int v_swtch;
  89. unsigned int avenrun[3];/* scaled by FSCALE */
  90. rstat_timeval boottime;
  91. int if_opackets;
  92. };
  93. struct stats { /* RSTATVERS_ORIG */
  94. int cp_time[RSTAT_CPUSTATES];
  95. int dk_xfer[RSTAT_DK_NDRIVE];
  96. unsigned int v_pgpgin; /* these are cumulative sum */
  97. unsigned int v_pgpgout;
  98. unsigned int v_pswpin;
  99. unsigned int v_pswpout;
  100. unsigned int v_intr;
  101. int if_ipackets;
  102. int if_ierrors;
  103. int if_oerrors;
  104. int if_collisions;
  105. int if_opackets;
  106. };
  107. program RSTATPROG {
  108. /*
  109. * Newest version includes current time and context switching info
  110. */
  111. version RSTATVERS_TIME {
  112. statstime
  113. RSTATPROC_STATS(void) = 1;
  114. unsigned int
  115. RSTATPROC_HAVEDISK(void) = 2;
  116. } = 3;
  117. /*
  118. * Does not have current time
  119. */
  120. version RSTATVERS_SWTCH {
  121. statsswtch
  122. RSTATPROC_STATS(void) = 1;
  123. unsigned int
  124. RSTATPROC_HAVEDISK(void) = 2;
  125. } = 2;
  126. /*
  127. * Old version has no info about current time or context switching
  128. */
  129. version RSTATVERS_ORIG {
  130. stats
  131. RSTATPROC_STATS(void) = 1;
  132. unsigned int
  133. RSTATPROC_HAVEDISK(void) = 2;
  134. } = 1;
  135. } = 100001;
  136. #ifdef RPC_HDR
  137. %
  138. %enum clnt_stat rstat(char *, struct statstime *);
  139. %int havedisk(char *);
  140. %
  141. #endif