add UNLEASHED_OBJ to unleashed.mk
[unleashed.git] / include / rpcsvc / rstat.x
blobd828473c4bf81a008c66db65fb390db5e7dffdf1
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 %/*
23 % * Copyright (c) 1985, 1990, 1991 by Sun Microsystems, Inc.
24 % */
26 %/* from rstat.x */
29  * Gather statistics on remote machines
30  */
32 #ifdef RPC_HDR
34 %#pragma ident  "%Z%%M% %I%     %E% SMI"
36 %/*
37 % * Scale factor for scaled integers used to count load averages.
38 % */
39 %#ifndef        FSCALE
40 %#define        FSHIFT  8       /* bits to right of fixed binary point */
41 %#define        FSCALE  (1<<FSHIFT)
42 %#endif /* ndef FSCALE */
44 %#ifndef DST_NONE
45 %#include <sys/time.h>          /* The time struct defined below is     */
46 %#endif                         /* meant to match struct timeval.       */
53 #elif RPC_SVC
55 %/*
56 % *  Server side stub routines for the rstat daemon
57 % */
59 #elif RPC_CLNT
61 %/*
62 % *  Client side stub routines for the rstat daemon
63 % */
65 #elif RPC_XDR
66 %/*
67 % * XDR routines for the rstat daemon, rup and perfmeter.
68 % */
70 %/*
71 % * xdr_timeval was used in previous releases.
72 % */
74 %bool_t
75 %xdr_timeval(XDR *xdrs, struct timeval *tvp)
77 %       return (xdr_rstat_timeval(xdrs, (rstat_timeval *)tvp));
81 #endif
83 const RSTAT_CPUSTATES = 4;
84 const RSTAT_DK_NDRIVE = 4;
87  * the cpu stat values
88  */
90 const RSTAT_CPU_USER = 0;
91 const RSTAT_CPU_NICE = 1;
92 const RSTAT_CPU_SYS = 2;
93 const RSTAT_CPU_IDLE = 3;
96  * GMT since 0:00, January 1, 1970
97  */
98 struct rstat_timeval {
99         int tv_sec;     /* seconds */
100         int tv_usec;    /* and microseconds */
103 struct statsvar {                               /* RSTATVERS_VAR */
104         int cp_time<>;          /* variable number of CPU states */
105         int dk_xfer<>;          /* variable number of disks */
106         unsigned v_pgpgin;      /* these are cumulative sum */
107         unsigned v_pgpgout;
108         unsigned v_pswpin;
109         unsigned v_pswpout;
110         unsigned v_intr;
111         int if_ipackets;
112         int if_ierrors;
113         int if_opackets;
114         int if_oerrors;
115         int if_collisions;
116         unsigned v_swtch;
117         int avenrun[3];
118         rstat_timeval boottime;
119         rstat_timeval curtime;
122 struct statstime {                              /* RSTATVERS_TIME */
123         int cp_time[RSTAT_CPUSTATES];
124         int dk_xfer[RSTAT_DK_NDRIVE];
125         unsigned int v_pgpgin;  /* these are cumulative sum */
126         unsigned int v_pgpgout;
127         unsigned int v_pswpin;
128         unsigned int v_pswpout;
129         unsigned int v_intr;
130         int if_ipackets;
131         int if_ierrors;
132         int if_oerrors;
133         int if_collisions;
134         unsigned int v_swtch;
135         int avenrun[3];
136         rstat_timeval boottime;
137         rstat_timeval curtime;
138         int if_opackets;
141 program RSTATPROG {
142         /*
143          * Version 4 allows for variable number of disk and RSTAT_CPU states.
144          */
145         version RSTATVERS_VAR {
146                 statsvar
147                 RSTATPROC_STATS (void) = 1;
148                 unsigned int
149                 RSTATPROC_HAVEDISK (void) = 2;
150         } = 4;
151         /*
152          * Newest version includes current time and context switching info
153          */
154         version RSTATVERS_TIME {
155                 statstime
156                 RSTATPROC_STATS(void) = 1;
157                 unsigned int
158                 RSTATPROC_HAVEDISK(void) = 2;
159         } = 3;
160 } = 100001;
162 #ifdef RPC_HDR
164 %enum clnt_stat rstat(char *, struct statstime *);
165 %int havedisk(char *);
167 #endif