11832Swollman/*
21832Swollman * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
31832Swollman * unrestricted use provided that this legend is included on all tape
41832Swollman * media and as a part of the software program in whole or part.  Users
51832Swollman * may copy or modify Sun RPC without charge, but are not authorized
61832Swollman * to license or distribute it to anyone else except as part of a product or
71832Swollman * program developed by the user.
81832Swollman *
91832Swollman * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
101832Swollman * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
111832Swollman * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
121832Swollman *
131832Swollman * Sun RPC is provided with no support and without any obligation on the
141832Swollman * part of Sun Microsystems, Inc. to assist in its use, correction,
151832Swollman * modification or enhancement.
161832Swollman *
171832Swollman * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
181832Swollman * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
191832Swollman * OR ANY PART THEREOF.
201832Swollman *
211832Swollman * In no event will Sun Microsystems, Inc. be liable for any lost revenue
221832Swollman * or profits or other special, indirect and consequential damages, even if
231832Swollman * Sun has been advised of the possibility of such damages.
241832Swollman *
251832Swollman * Sun Microsystems, Inc.
261832Swollman * 2550 Garcia Avenue
271832Swollman * Mountain View, California  94043
281832Swollman */
291832Swollman
301832Swollman/*
311832Swollman * Find out about remote users
321832Swollman */
331832Swollman
341832Swollman#ifndef RPC_HDR
351832Swollman%#ifndef lint
361832Swollman%/*static char sccsid[] = "from: @(#)rnusers.x 1.2 87/09/20 Copyr 1987 Sun Micro";*/
371832Swollman%/*static char sccsid[] = "from: @(#)rnusers.x	2.1 88/08/01 4.0 RPCSRC";*/
381832Swollman%#endif /* not lint */
39114629Sobrien%#include <sys/cdefs.h>
40114629Sobrien%__FBSDID("$FreeBSD$");
411832Swollman#endif
421832Swollman
431832Swollmanconst MAXUSERS = 100;
441832Swollmanconst MAXUTLEN = 256;
451832Swollman
461832Swollmanstruct utmp {
471832Swollman	string ut_line<MAXUTLEN>;
481832Swollman	string ut_name<MAXUTLEN>;
491832Swollman	string ut_host<MAXUTLEN>;
501832Swollman	int ut_time;
511832Swollman};
521832Swollman
531832Swollman
541832Swollmanstruct utmpidle {
551832Swollman	utmp ui_utmp;
561832Swollman	unsigned int ui_idle;
571832Swollman};
581832Swollman
591832Swollmantypedef utmp utmparr<MAXUSERS>;
601832Swollman
611832Swollmantypedef utmpidle utmpidlearr<MAXUSERS>;
621832Swollman
6326208Swpaulconst RUSERS_MAXUSERLEN = 32;
6426208Swpaulconst RUSERS_MAXLINELEN = 32;
6526208Swpaulconst RUSERS_MAXHOSTLEN = 257;
6626208Swpaul
6726208Swpaulstruct rusers_utmp {
6826208Swpaul	string ut_user<RUSERS_MAXUSERLEN>;	/* aka ut_name */
6926208Swpaul	string ut_line<RUSERS_MAXLINELEN>;	/* device */
7026208Swpaul	string ut_host<RUSERS_MAXHOSTLEN>;	/* host user logged on from */
7126208Swpaul	int ut_type;				/* type of entry */
7226208Swpaul	int ut_time;				/* time entry was made */
7326208Swpaul	unsigned int ut_idle;			/* minutes idle */
7426208Swpaul};
7526208Swpaul
7626208Swpaultypedef rusers_utmp utmp_array<>;
7726208Swpaul
781832Swollmanprogram RUSERSPROG {
791832Swollman	/*
801832Swollman	 * Old version does not include idle information
811832Swollman	 */
821832Swollman	version RUSERSVERS_ORIG {
831832Swollman		int
841832Swollman		RUSERSPROC_NUM(void) = 1;
851832Swollman
861832Swollman		utmparr
871832Swollman		RUSERSPROC_NAMES(void) = 2;
881832Swollman
891832Swollman		utmparr
901832Swollman		RUSERSPROC_ALLNAMES(void) = 3;
911832Swollman	} = 1;
921832Swollman
931832Swollman	/*
941832Swollman	 * Includes idle information
951832Swollman	 */
961832Swollman	version RUSERSVERS_IDLE {
971832Swollman		int
981832Swollman		RUSERSPROC_NUM(void) = 1;
991832Swollman
1001832Swollman		utmpidlearr
1011832Swollman		RUSERSPROC_NAMES(void) = 2;
1021832Swollman
1031832Swollman		utmpidlearr
1041832Swollman		RUSERSPROC_ALLNAMES(void) = 3;
1051832Swollman	} = 2;
10626208Swpaul
10726208Swpaul	/*
10826208Swpaul	 * Version 3 rusers procedures (from Solaris).
10926208Swpaul	 * (Thanks a lot Sun.)
11026208Swpaul	 */
11126208Swpaul	version RUSERSVERS_3 {
11226208Swpaul		int
11326208Swpaul		RUSERSPROC_NUM(void) = 1;
11426208Swpaul
11526208Swpaul		utmp_array
11626208Swpaul		RUSERSPROC_NAMES(void) = 2;
11726208Swpaul
11826208Swpaul		utmp_array
11926208Swpaul		RUSERSPROC_ALLNAMES(void) = 3;
12026208Swpaul	} = 3;
12126208Swpaul
1221832Swollman} = 100002;
12326208Swpaul
124