126213Swpaul/*
226213Swpaul * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
326213Swpaul * unrestricted use provided that this legend is included on all tape
426213Swpaul * media and as a part of the software program in whole or part.  Users
526213Swpaul * may copy or modify Sun RPC without charge, but are not authorized
626213Swpaul * to license or distribute it to anyone else except as part of a product or
726213Swpaul * program developed by the user or with the express written consent of
826213Swpaul * Sun Microsystems, Inc.
926213Swpaul *
1026213Swpaul * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
1126213Swpaul * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
1226213Swpaul * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
1326213Swpaul *
1426213Swpaul * Sun RPC is provided with no support and without any obligation on the
1526213Swpaul * part of Sun Microsystems, Inc. to assist in its use, correction,
1626213Swpaul * modification or enhancement.
1726213Swpaul *
1826213Swpaul * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
1926213Swpaul * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
2026213Swpaul * OR ANY PART THEREOF.
2126213Swpaul *
2226213Swpaul * In no event will Sun Microsystems, Inc. be liable for any lost revenue
2326213Swpaul * or profits or other special, indirect and consequential damages, even if
2426213Swpaul * Sun has been advised of the possibility of such damages.
2526213Swpaul *
2626213Swpaul * Sun Microsystems, Inc.
2726213Swpaul * 2550 Garcia Avenue
2826213Swpaul * Mountain View, California  94043
2926213Swpaul */
3084220Sdillon
3184220Sdillon#include <sys/cdefs.h>
3284220Sdillon__FBSDID("$FreeBSD: releng/10.3/lib/librpcsvc/rnusers.c 189087 2009-02-26 20:32:11Z ed $");
3384220Sdillon
3426213Swpaul#if !defined(lint) && defined(SCCSIDS)
3526213Swpaulstatic char sccsid[] = "@(#)rnusers.c	1.2 91/03/11 TIRPC 1.0; from 1.7 89/03/24 SMI";
3626213Swpaul#endif
3726213Swpaul
3826213Swpaul/*
3926213Swpaul * rnusers.c
4026213Swpaul *
4126213Swpaul * "High" level programmatic interface to rnusers RPC service.
4226213Swpaul *
4326213Swpaul * Copyright (c) 1985 by Sun Microsystems, Inc.
4426213Swpaul */
4526213Swpaul
4626213Swpaul#include <rpc/rpc.h>
4726213Swpaul#include <rpcsvc/rnusers.h>
4826213Swpaul
4926213Swpaulint
50189087Sedrusers(char *host, utmpidlearr *up)
5126213Swpaul{
5226213Swpaul	return (callrpc(host, RUSERSPROG, RUSERSVERS_IDLE, RUSERSPROC_NAMES,
53121529Speter			(xdrproc_t)xdr_void, (char *) NULL,
54121529Speter			(xdrproc_t)xdr_utmpidlearr, (char *) up));
5526213Swpaul}
5626213Swpaul
5726213Swpaulint
58189087Sedrnusers(char *host)
5926213Swpaul{
6026213Swpaul	int nusers;
6126213Swpaul
6226213Swpaul	if (callrpc(host, RUSERSPROG, RUSERSVERS_ORIG, RUSERSPROC_NUM,
63121529Speter			(xdrproc_t)xdr_void, (char *) NULL,
64121529Speter			(xdrproc_t)xdr_u_long, (char *) &nusers) != 0)
6526213Swpaul		return (-1);
6626213Swpaul	else
6726213Swpaul		return (nusers);
6826213Swpaul}
6926213Swpaul
70