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