xref: /openbsd/lib/librpcsvc/rusers.x (revision cb7760d1)
1 /*	$OpenBSD: rusers.x,v 1.5 2010/09/01 14:43:34 millert Exp $	*/
2 
3 /*
4  * Copyright (c) 2010, Oracle America, Inc.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are
8  * met:
9  *
10  *     * Redistributions of source code must retain the above copyright
11  *       notice, this list of conditions and the following disclaimer.
12  *     * Redistributions in binary form must reproduce the above
13  *       copyright notice, this list of conditions and the following
14  *       disclaimer in the documentation and/or other materials
15  *       provided with the distribution.
16  *     * Neither the name of the "Oracle America, Inc." nor the names of its
17  *       contributors may be used to endorse or promote products derived
18  *       from this software without specific prior written permission.
19  *
20  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23  *   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24  *   COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
25  *   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26  *   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
27  *   GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28  *   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29  *   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30  *   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 /*
35  * Find out about remote users
36  */
37 
38 #ifndef RPC_HDR
39 #endif
40 
41 %/*
42 % * Find out about remote users
43 % */
44 
45 const RUSERS_MAXUSERLEN = 32;
46 const RUSERS_MAXLINELEN = 32;
47 const RUSERS_MAXHOSTLEN = 257;
48 
49 struct rusers_utmp {
50 	string ut_user<RUSERS_MAXUSERLEN>;	/* aka ut_name */
51 	string ut_line<RUSERS_MAXLINELEN>;	/* device */
52 	string ut_host<RUSERS_MAXHOSTLEN>;	/* host user logged on from */
53 	int ut_type;				/* type of entry */
54 	int ut_time;				/* time entry was made */
55 	unsigned int ut_idle;			/* minutes idle */
56 };
57 
58 typedef rusers_utmp utmp_array<>;
59 
60 #ifdef RPC_HDR
61 %
62 %/*
63 % * Values for ut_type field above.
64 % */
65 #endif
66 const	RUSERS_EMPTY = 0;
67 const	RUSERS_RUN_LVL = 1;
68 const	RUSERS_BOOT_TIME = 2;
69 const	RUSERS_OLD_TIME = 3;
70 const	RUSERS_NEW_TIME = 4;
71 const	RUSERS_INIT_PROCESS = 5;
72 const	RUSERS_LOGIN_PROCESS = 6;
73 const	RUSERS_USER_PROCESS = 7;
74 const	RUSERS_DEAD_PROCESS = 8;
75 const	RUSERS_ACCOUNTING = 9;
76 
77 program RUSERSPROG {
78 
79 	version RUSERSVERS_3 {
80 		int
81 		RUSERSPROC_NUM(void) = 1;
82 
83 		utmp_array
84 		RUSERSPROC_NAMES(void) = 2;
85 
86 		utmp_array
87 		RUSERSPROC_ALLNAMES(void) = 3;
88 	} = 3;
89 
90 } = 100002;
91