2 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
3 * unrestricted use provided that this legend is included on all tape
4 * media and as a part of the software program in whole or part. Users
5 * may copy or modify Sun RPC without charge, but are not authorized
6 * to license or distribute it to anyone else except as part of a product or
7 * program developed by the user.
9 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
10 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
11 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
13 * Sun RPC is provided with no support and without any obligation on the
14 * part of Sun Microsystems, Inc. to assist in its use, correction,
15 * modification or enhancement.
17 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
18 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
19 * OR ANY PART THEREOF.
21 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
22 * or profits or other special, indirect and consequential damages, even if
23 * Sun has been advised of the possibility of such damages.
25 * Sun Microsystems, Inc.
27 * Mountain View, California 94043
31 * Find out about remote users
35 %#include <sys/cdefs.h>
37 %/*static char sccsid[] = "from: @(#)rnusers.x 1.2 87/09/20 Copyr 1987 Sun Micro";*/
38 %/*static char sccsid[] = "from: @(#)rnusers.x 2.1 88/08/01 4.0 RPCSRC";*/
39 %__RCSID("$NetBSD: rnusers.x,v 1.12 2004/07/01 22:52:34 kleink Exp $");
40 %#endif /* not __lint__ */
46 % * The following structures are used by version 2 of the rusersd protocol.
47 % * They were not developed with rpcgen, so they do not appear as RPCL.
50 %#define RUSERSVERS_ORIG 1 /* original version */
51 %#define RUSERSVERS_IDLE 2
55 % * This is the structure used in version 2 of the rusersd RPC service.
56 % * It corresponds to the utmp structure for BSD sytems.
59 % char ut_line[8]; /* tty name */
60 % char ut_name[8]; /* user id */
61 % char ut_host[16]; /* host name, if remote */
62 % long ut_time; /* time on */
64 %typedef struct ru_utmp rutmp;
67 % struct utmp **uta_arr;
70 %typedef struct utmparr utmparr;
73 % struct ru_utmp ui_utmp;
78 % struct utmpidle **uia_arr;
81 %typedef struct utmpidlearr utmpidlearr;
83 %#include <sys/cdefs.h>
85 %bool_t xdr_utmp __P((XDR *, struct ru_utmp *));
86 %bool_t xdr_utmpptr __P((XDR *, struct ru_utmp **));
87 %bool_t xdr_utmparr __P((XDR *, struct utmparr *));
88 %bool_t xdr_utmpidle __P((XDR *, struct utmpidle *));
89 %bool_t xdr_utmpidleptr __P((XDR *, struct utmpidle **));
90 %bool_t xdr_utmpidlearr __P((XDR *, struct utmpidlearr *));
93 %#define RUSERSVERS_1 ((u_long)1)
94 %#define RUSERSVERS_2 ((u_long)2)
96 %#define RUSERSPROG ((u_long)100002)
98 %#ifndef RUSERSPROC_NUM
99 %#define RUSERSPROC_NUM ((u_long)1)
101 %#ifndef RUSERSPROC_NAMES
102 %#define RUSERSPROC_NAMES ((u_long)2)
104 %#ifndef RUSERSPROC_ALLNAMES
105 %#define RUSERSPROC_ALLNAMES ((u_long)3)
112 %xdr_utmp(xdrs, objp)
114 % struct ru_utmp *objp;
120 % * We are using a non-malloc allocated array,
121 % * so we are not supposed to call xdr_free with it.
123 % if (xdrs->x_op == XDR_FREE)
125 % ptr = objp->ut_line;
126 % size = (u_int)sizeof(objp->ut_line);
127 % if (!xdr_bytes(xdrs, &ptr, &size, size))
129 % ptr = objp->ut_name;
130 % size = (u_int)sizeof(objp->ut_name);
131 % if (!xdr_bytes(xdrs, &ptr, &size, size))
133 % ptr = objp->ut_host;
134 % size = (u_int)sizeof(objp->ut_host);
135 % if (!xdr_bytes(xdrs, &ptr, &size, size))
137 % if (!xdr_long(xdrs, &objp->ut_time))
143 %xdr_utmpptr(xdrs, objpp)
145 % struct ru_utmp **objpp;
148 % if (!xdr_reference(xdrs, (char **) objpp, (u_int)sizeof(struct ru_utmp),
155 %xdr_utmparr(xdrs, objp)
157 % struct utmparr *objp;
160 % if (!xdr_array(xdrs, (char **)(void *)&objp->uta_arr,
161 % (u_int *)&objp->uta_cnt, MAXUSERS,
162 % (u_int)sizeof(struct utmp *), xdr_utmpptr))
168 %xdr_utmpidle(xdrs, objp)
170 % struct utmpidle *objp;
173 % if (!xdr_utmp(xdrs, &objp->ui_utmp))
175 % if (!xdr_u_int(xdrs, &objp->ui_idle))
181 %xdr_utmpidleptr(xdrs, objpp)
183 % struct utmpidle **objpp;
186 % if (!xdr_reference(xdrs, (char **) objpp,
187 % (u_int)sizeof(struct utmpidle), xdr_utmpidle))
193 %xdr_utmpidlearr(xdrs, objp)
195 % struct utmpidlearr *objp;
198 % if (!xdr_array(xdrs, (char **)(void *)&objp->uia_arr,
199 % (u_int *)&objp->uia_cnt, MAXUSERS,
200 % (u_int)sizeof(struct utmpidle *), xdr_utmpidleptr))