xref: /titanic_50/usr/src/head/rpcsvc/rusers.x (revision b3700b074e637f8c6991b70754c88a2cfffb246b)
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 1991 Sun Microsystems, Inc.
24  * #ident	"%Z%%M%	%I%	%E% SMI"
25  */
26 
27 %/*
28 % * Find out about remote users
29 % */
30 
31 const RUSERS_MAXUSERLEN = 32;
32 const RUSERS_MAXLINELEN = 32;
33 const RUSERS_MAXHOSTLEN = 257;
34 
35 struct rusers_utmp {
36 	string ut_user<RUSERS_MAXUSERLEN>;	/* aka ut_name */
37 	string ut_line<RUSERS_MAXLINELEN>;	/* device */
38 	string ut_host<RUSERS_MAXHOSTLEN>;	/* host user logged on from */
39 	int ut_type;				/* type of entry */
40 	int ut_time;				/* time entry was made */
41 	unsigned int ut_idle;			/* minutes idle */
42 };
43 
44 typedef rusers_utmp utmp_array<>;
45 
46 #ifdef RPC_HDR
47 %
48 %/*
49 % * Values for ut_type field above.
50 % */
51 #endif
52 const	RUSERS_EMPTY = 0;
53 const	RUSERS_RUN_LVL = 1;
54 const	RUSERS_BOOT_TIME = 2;
55 const	RUSERS_OLD_TIME = 3;
56 const	RUSERS_NEW_TIME = 4;
57 const	RUSERS_INIT_PROCESS = 5;
58 const	RUSERS_LOGIN_PROCESS = 6;
59 const	RUSERS_USER_PROCESS = 7;
60 const	RUSERS_DEAD_PROCESS = 8;
61 const	RUSERS_ACCOUNTING = 9;
62 
63 program RUSERSPROG {
64 
65 	version RUSERSVERS_3 {
66 		int
67 		RUSERSPROC_NUM(void) = 1;
68 
69 		utmp_array
70 		RUSERSPROC_NAMES(void) = 2;
71 
72 		utmp_array
73 		RUSERSPROC_ALLNAMES(void) = 3;
74 	} = 3;
75 
76 } = 100002;
77 
78 #ifdef RPC_HDR
79 %
80 %
81 %
82 %/*
83 % * The following structures are used by version 2 of the rusersd protocol.
84 % * They were not developed with rpcgen, so they do not appear as RPCL.
85 % */
86 %
87 %#define	RUSERSVERS_IDLE 2
88 %#define	RUSERSVERS 3		/* current version */
89 %#define	MAXUSERS 100
90 %
91 %/*
92 % * This is the structure used in version 2 of the rusersd RPC service.
93 % * It corresponds to the utmp structure for BSD sytems.
94 % */
95 %struct ru_utmp {
96 %	char	ut_line[8];		/* tty name */
97 %	char	ut_name[8];		/* user id */
98 %	char	ut_host[16];		/* host name, if remote */
99 %	time_t	ut_time;		/* time on */
100 %};
101 %
102 %struct utmpidle {
103 %	struct ru_utmp ui_utmp;
104 %	unsigned ui_idle;
105 %};
106 %
107 %struct utmpidlearr {
108 %	struct utmpidle **uia_arr;
109 %	int uia_cnt;
110 %};
111 %
112 %int xdr_utmpidlearr();
113 %
114 %#if defined(__STDC__) || defined(__cplusplus)
115 %enum clnt_stat rusers(char *host, struct utmpidlearr *up);
116 %int rnusers(char *host);
117 %#else
118 %enum clnt_stat rusers();
119 %int rnusers();
120 %#endif
121 %
122 #endif
123