Old rstat.x
1 %/*
2 % * Copyright (c) 1985, 1990, 1991 by Sun Microsystems, Inc.
3 % */
4
5 %/* from rstat.x */
6
7 /*
8 * Gather statistics on remote machines
9 */
10
11 #ifdef RPC_HDR
12 %
13 %#pragma ident "@(#)rstat.x 1.2 92/07/14 SMI"
14 %
15 %#ifndef FSCALE
16 %/*
17 % * Scale factor for scaled integers used to count load averages.
18 % */
19 %#define FSHIFT 8 /* bits to right of fixed binary point */
20 %#define FSCALE (1<<FSHIFT)
21 %
22 %#endif /* ndef FSCALE */
23
24 %#ifndef DST_NONE
25 %#include <sys/time.h> /* The time struct defined below is meant to */
26 %#endif /* match struct timeval. */
27 %
28 %
29 %
30 %
31 %
32 %
33 #elif RPC_SVC
34 %
35 %/*
36 % * Server side stub routines for the rstat daemon
37 % */
38 %
39 #elif RPC_CLNT
40 %
41 %/*
42 % * Client side stub routines for the rstat daemon
43 % */
44 %
45 #elif RPC_XDR
46 %/*
47 % * XDR routines for the rstat daemon, rup and perfmeter.
48 % */
49 %
50 %/*
51 % * xdr_timeval was used in previous releases.
52 % */
53 %
54 %bool_t
55 %#ifdef __STDC__
56 %xdr_timeval(XDR *xdrs, struct timeval *tvp)
57 %#else /* K&R C */
58 %xdr_timeval(xdrs, tvp)
59 % XDR *xdrs;
60 % struct timeval *tvp;
61 %#endif /* K&R C */
62 %{
63 % return (xdr_rstat_timeval(xdrs, tvp));
64 %}
65
66 %
67 #endif
68
69 const RSTAT_CPUSTATES = 4;
70 const RSTAT_DK_NDRIVE = 4;
71
72 /*
73 * GMT since 0:00, January 1, 1970
74 */
75 struct rstat_timeval {
76 long tv_sec; /* seconds */
77 long tv_usec; /* and microseconds */
78 };
79
80 struct statsvar { /* RSTATVERS_VAR */
81 int cp_time<>; /* variable number of CPU states */
82 int dk_xfer<>; /* variable number of disks */
83 unsigned v_pgpgin; /* these are cumulative sum */
84 unsigned v_pgpgout;
85 unsigned v_pswpin;
86 unsigned v_pswpout;
87 unsigned v_intr;
88 int if_ipackets;
89 int if_ierrors;
90 int if_opackets;
91 int if_oerrors;
92 int if_collisions;
93 unsigned v_swtch;
94 long avenrun[3];
95 rstat_timeval boottime;
96 rstat_timeval curtime;
97 };
98
99 struct statstime { /* RSTATVERS_TIME */
100 int cp_time[RSTAT_CPUSTATES];
101 int dk_xfer[RSTAT_DK_NDRIVE];
102 unsigned int v_pgpgin; /* these are cumulative sum */
103 unsigned int v_pgpgout;
104 unsigned int v_pswpin;
105 unsigned int v_pswpout;
106 unsigned int v_intr;
107 int if_ipackets;
108 int if_ierrors;
109 int if_oerrors;
110 int if_collisions;
111 unsigned int v_swtch;
112 long avenrun[3];
113 rstat_timeval boottime;
114 rstat_timeval curtime;
115 int if_opackets;
116 };
117
118 struct statsswtch { /* RSTATVERS_SWTCH */
119 int cp_time[RSTAT_CPUSTATES];
120 int dk_xfer[RSTAT_DK_NDRIVE];
121 unsigned int v_pgpgin; /* these are cumulative sum */
122 unsigned int v_pgpgout;
123 unsigned int v_pswpin;
124 unsigned int v_pswpout;
125 unsigned int v_intr;
126 int if_ipackets;
127 int if_ierrors;
128 int if_oerrors;
129 int if_collisions;
130 unsigned int v_swtch;
131 unsigned int avenrun[3];/* scaled by FSCALE */
132 rstat_timeval boottime;
133 int if_opackets;
134 };
135
136 struct stats { /* RSTATVERS_ORIG */
137 int cp_time[RSTAT_CPUSTATES];
138 int dk_xfer[RSTAT_DK_NDRIVE];
139 unsigned int v_pgpgin; /* these are cumulative sum */
140 unsigned int v_pgpgout;
141 unsigned int v_pswpin;
142 unsigned int v_pswpout;
143 unsigned int v_intr;
144 int if_ipackets;
145 int if_ierrors;
146 int if_oerrors;
147 int if_collisions;
148 int if_opackets;
149 };
150
151 program RSTATPROG {
152 /*
153 * Version 4 allows for variable number of disk and RSTAT_CPU states.
154 */
155 version RSTATVERS_VAR {
156 statsvar
157 RSTATPROC_STATS (void) = 1;
158 unsigned int
159 RSTATPROC_HAVEDISK (void) = 2;
160 } = 4;
161 /*
162 * Newest version includes current time and context switching info
163 */
164 version RSTATVERS_TIME {
165 statstime
166 RSTATPROC_STATS(void) = 1;
167 unsigned int
168 RSTATPROC_HAVEDISK(void) = 2;
169 } = 3;
170 /*
171 * Does not have current time
172 */
173 version RSTATVERS_SWTCH {
174 statsswtch
175 RSTATPROC_STATS(void) = 1;
176
177 unsigned int
178 RSTATPROC_HAVEDISK(void) = 2;
179 } = 2;
180 /*
181 * Old version has no info about current time or context switching
182 */
183 version RSTATVERS_ORIG {
184 stats
185 RSTATPROC_STATS(void) = 1;
186
187 unsigned int
188 RSTATPROC_HAVEDISK(void) = 2;
189 } = 1;
190 } = 100001;