1272850Shrs/*-
2272850Shrs * Copyright (c) 2010, Oracle America, Inc.
3272850Shrs *
4272850Shrs * Redistribution and use in source and binary forms, with or without
5272850Shrs * modification, are permitted provided that the following conditions are
6272850Shrs * met:
7272850Shrs *
8272850Shrs *     * Redistributions of source code must retain the above copyright
9272850Shrs *       notice, this list of conditions and the following disclaimer.
10272850Shrs *     * Redistributions in binary form must reproduce the above
11272850Shrs *       copyright notice, this list of conditions and the following
12272850Shrs *       disclaimer in the documentation and/or other materials
13272850Shrs *       provided with the distribution.
14272850Shrs *     * Neither the name of the "Oracle America, Inc." nor the names of its
15272850Shrs *       contributors may be used to endorse or promote products derived
16272850Shrs *       from this software without specific prior written permission.
17272850Shrs *
18272850Shrs *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19272850Shrs *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20272850Shrs *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21272850Shrs *   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22272850Shrs *   COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23272850Shrs *   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24272850Shrs *   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
25272850Shrs *   GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26272850Shrs *   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27272850Shrs *   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28272850Shrs *   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29272850Shrs *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
301832Swollman */
311832Swollman
321832Swollman/*
331832Swollman * Find out about remote users
341832Swollman */
351832Swollman
361832Swollman#ifndef RPC_HDR
371832Swollman%#ifndef lint
381832Swollman%/*static char sccsid[] = "from: @(#)rnusers.x 1.2 87/09/20 Copyr 1987 Sun Micro";*/
391832Swollman%/*static char sccsid[] = "from: @(#)rnusers.x	2.1 88/08/01 4.0 RPCSRC";*/
401832Swollman%#endif /* not lint */
41114629Sobrien%#include <sys/cdefs.h>
42114629Sobrien%__FBSDID("$FreeBSD: releng/10.3/include/rpcsvc/rnusers.x 272850 2014-10-09 23:05:32Z hrs $");
431832Swollman#endif
441832Swollman
451832Swollmanconst MAXUSERS = 100;
461832Swollmanconst MAXUTLEN = 256;
471832Swollman
481832Swollmanstruct utmp {
491832Swollman	string ut_line<MAXUTLEN>;
501832Swollman	string ut_name<MAXUTLEN>;
511832Swollman	string ut_host<MAXUTLEN>;
521832Swollman	int ut_time;
531832Swollman};
541832Swollman
551832Swollman
561832Swollmanstruct utmpidle {
571832Swollman	utmp ui_utmp;
581832Swollman	unsigned int ui_idle;
591832Swollman};
601832Swollman
611832Swollmantypedef utmp utmparr<MAXUSERS>;
621832Swollman
631832Swollmantypedef utmpidle utmpidlearr<MAXUSERS>;
641832Swollman
6526208Swpaulconst RUSERS_MAXUSERLEN = 32;
6626208Swpaulconst RUSERS_MAXLINELEN = 32;
6726208Swpaulconst RUSERS_MAXHOSTLEN = 257;
6826208Swpaul
6926208Swpaulstruct rusers_utmp {
7026208Swpaul	string ut_user<RUSERS_MAXUSERLEN>;	/* aka ut_name */
7126208Swpaul	string ut_line<RUSERS_MAXLINELEN>;	/* device */
7226208Swpaul	string ut_host<RUSERS_MAXHOSTLEN>;	/* host user logged on from */
7326208Swpaul	int ut_type;				/* type of entry */
7426208Swpaul	int ut_time;				/* time entry was made */
7526208Swpaul	unsigned int ut_idle;			/* minutes idle */
7626208Swpaul};
7726208Swpaul
7826208Swpaultypedef rusers_utmp utmp_array<>;
7926208Swpaul
801832Swollmanprogram RUSERSPROG {
811832Swollman	/*
821832Swollman	 * Old version does not include idle information
831832Swollman	 */
841832Swollman	version RUSERSVERS_ORIG {
851832Swollman		int
861832Swollman		RUSERSPROC_NUM(void) = 1;
871832Swollman
881832Swollman		utmparr
891832Swollman		RUSERSPROC_NAMES(void) = 2;
901832Swollman
911832Swollman		utmparr
921832Swollman		RUSERSPROC_ALLNAMES(void) = 3;
931832Swollman	} = 1;
941832Swollman
951832Swollman	/*
961832Swollman	 * Includes idle information
971832Swollman	 */
981832Swollman	version RUSERSVERS_IDLE {
991832Swollman		int
1001832Swollman		RUSERSPROC_NUM(void) = 1;
1011832Swollman
1021832Swollman		utmpidlearr
1031832Swollman		RUSERSPROC_NAMES(void) = 2;
1041832Swollman
1051832Swollman		utmpidlearr
1061832Swollman		RUSERSPROC_ALLNAMES(void) = 3;
1071832Swollman	} = 2;
10826208Swpaul
10926208Swpaul	/*
11026208Swpaul	 * Version 3 rusers procedures (from Solaris).
11126208Swpaul	 * (Thanks a lot Sun.)
11226208Swpaul	 */
11326208Swpaul	version RUSERSVERS_3 {
11426208Swpaul		int
11526208Swpaul		RUSERSPROC_NUM(void) = 1;
11626208Swpaul
11726208Swpaul		utmp_array
11826208Swpaul		RUSERSPROC_NAMES(void) = 2;
11926208Swpaul
12026208Swpaul		utmp_array
12126208Swpaul		RUSERSPROC_ALLNAMES(void) = 3;
12226208Swpaul	} = 3;
12326208Swpaul
1241832Swollman} = 100002;
12526208Swpaul
126