--- old/usr/src/cmd/dtrace/test/tst/common/mib/tst.udp.ksh	2017-05-26 19:11:08.636251994 -0400
+++ new/usr/src/cmd/dtrace/test/tst/common/mib/tst.udp.ksh	2017-05-26 19:11:08.671342051 -0400
@@ -23,7 +23,6 @@
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
 
 #
 # This script tests that several of the the mib:::udp* probes fire and fire
@@ -50,10 +49,10 @@
 EOF
 }
 
-rupper()
+udpper()
 {
 	while true; do
-		rup localhost
+		showmount localhost >/dev/null 2>&1
 		/usr/bin/sleep 1
 	done
 }
@@ -65,10 +64,10 @@
 
 dtrace=$1
 
-rupper &
-rupper=$!
+udpper &
+udpper=$!
 script
 status=$?
 
-kill $rupper
+kill $udpper
 exit $status
--- old/usr/src/cmd/rpcsvc/Makefile	2017-05-26 19:11:09.601246251 -0400
+++ new/usr/src/cmd/rpcsvc/Makefile	2017-05-26 19:11:09.643887296 -0400
@@ -27,81 +27,20 @@
 
 PROTOCOL_DIR= $(ROOT)/usr/include/rpcsvc
 
-BINPROG= rusers rup
-SBINPROG= rwall spray
-RPROG= rpc.rusersd
-SPROG= rpc.sprayd
-WPROG= rpc.rwalld
-TPROG= rpc.rstatd
-
-PROG= $(BINPROG) $(SBINPROG) $(RPROG) $(SPROG) $(WPROG) $(TPROG)
-
-MANIFEST= \
-	rusers.xml \
-	spray.xml \
-	wall.xml \
-	rstat.xml
-
-SVCMETHOD=
-
-SCLNTOBJS= spray.o spray_clnt.o
-SSVCOBJS= spray_subr.o spray_svc.o
-WCLNTOBJS = rwall.o rwall_clnt.o
-WSVCOBJS= rwall_subr.o rwall_svc.o
-TSVCOBJS= rstat_main.o rstat_proc.o rstat_svc.o rstat_v2_svc.o rstat_v2_xdr.o
-
-DERIVED_FILES = rstat.x rstat.h rstat_svc.c rstat_v2.h rstat_v2_svc.c \
-		rstat_v2_xdr.c spray.x spray.h spray_clnt.c spray_svc.c \
-		rwall.x rwall.h rwall_svc.c rwall_clnt.c
-
 include ../Makefile.cmd
 
-ROOTMANIFESTDIR=	$(ROOTSVCNETWORKRPC)
-
-CPPFLAGS= -I. $(CPPFLAGS.master)
-CERRWARN += -_gcc=-Wno-implicit-function-declaration
-CERRWARN += -_gcc=-Wno-unused-variable
-CERRWARN += -_gcc=-Wno-parentheses
-CERRWARN += -_gcc=-Wno-extra
-CERRWARN += -_gcc=-Wno-unused-function
-LDLIBS += -lnsl
-rusers :=	CFLAGS += $(CCVERBOSE)
-$(BINPROG) :=	LDLIBS += -lrpcsvc
-$(RPROG) :=	LDLIBS += -lrpcsvc
-$(SPROG) :=	LDLIBS += -lrpcsvc
-$(TPROG) :=	LDLIBS += -lrpcsvc
-spray :=	LDLIBS += -lrpcsvc
-
-
 SUBDIRS= rpc.bootparamd
-OBJS= $(SCLNTOBJS) $(SSVCOBJS) $(WCLNTOBJS) $(WSVCOBJS) $(TSVCOBJS)
-SRCS= $(OBJS:%.o=%.c) rusers.c rpc.rusersd.c rup.c
-
 ETCFILES= rpc
 
 TXTS= $(ETCFILES:%=net_files/%)
 
 NETSVC=	$(ROOTLIB)/netsvc
 NIS = $(NETSVC)/nis
-RWALL= $(NETSVC)/rwall
-RUSERS= $(NETSVC)/rusers
-SPRAY= $(NETSVC)/spray
-RSTAT= $(NETSVC)/rstat
 
 ROOTDIRS= \
 		$(NETSVC) \
 		$(NIS) \
-		$(RWALL) \
-		$(RUSERS) \
-		$(SPRAY) \
-		$(RSTAT)
-
-IBINPROG=		$(BINPROG:%=$(ROOTBIN)/%)
-ISBINPROG=		$(SBINPROG:%=$(ROOTUSRSBIN)/%)
-IWPROG=			$(WPROG:%=$(RWALL)/%)
-ISPROG=			$(SPROG:%=$(SPRAY)/%)
-IRPROG=			$(RPROG:%=$(RUSERS)/%)
-ITPROG=			$(TPROG:%=$(RSTAT)/%)
+
 IETCFILES=		$(ETCFILES:%=$(ROOTETC)/%)
 
 # non-default file attributes
@@ -113,57 +52,16 @@
 clobber:=	TARGET= clobber
 lint:=		TARGET= lint
 
-rpc.rstatd:=	LDLIBS += -lkstat
-rwall:=		CPPFLAGS += -D_REENTRANT
-rpc.rwalld:=	CPPFLAGS += -D_REENTRANT
-
 # install rules
 
-$(RWALL)/% $(SPRAY)/% $(RUSERS)/% $(RSTAT)/%: %
-	$(INS.file)
-
 $(ROOTETC)/%: ./net_files/%
 	$(INS.file)
 
 .KEEP_STATE:
 
-all: $(PROG) $(TXTS) $(SUBDIRS)
-
-# multi-object targets
-#
-spray:	$(SCLNTOBJS)
-	$(LINK.c) $(SCLNTOBJS) -o $@ $(LDLIBS)
-	$(POST_PROCESS)
-
-spray_svc.o spray_clnt.o: spray.h
-
-rpc.sprayd: $(SSVCOBJS)
-	$(LINK.c) $(SSVCOBJS) -o $@ $(LDLIBS)
-	$(POST_PROCESS)
-
-rwall_svc.o rwall_clnt.o: rwall.h
-
-rwall: $(WCLNTOBJS)
-	$(LINK.c) $(WCLNTOBJS) -o $@ $(LDLIBS)
-	$(POST_PROCESS)
-
-rpc.rwalld: $(WSVCOBJS)
-	$(LINK.c) $(WSVCOBJS) -o $@ $(LDLIBS)
-	$(POST_PROCESS)
-
-rstat_main.o:	rstat.h rstat_v2.h
-
-rstat_svc.o: rstat.h
+all: $(TXTS) $(SUBDIRS)
 
-rstat_V2_svc.o rstat_V2_xdr.o: rstat_v2.h
-
-rpc.rstatd: $(TSVCOBJS)
-	$(LINK.c) $(TSVCOBJS) -o $@ $(LDLIBS)
-	$(POST_PROCESS)
-
-install: $(PROG) $(TXTS) .WAIT $(ROOTDIRS) .WAIT $(IBINPROG) $(ISBINPROG) \
-	$(IWPROG) $(ISPROG) $(IRPROG) $(ITPROG) $(IETCFILES) $(SUBDIRS) \
-	$(ROOTMANIFEST) $(ROOTSVCMETHOD)
+install: $(TXTS) .WAIT $(ROOTDIRS) .WAIT $(IETCFILES) $(SUBDIRS)
 
 $(ROOTDIRS):
 	$(INS.dir)
@@ -171,69 +69,13 @@
 $(SUBDIRS): FRC
 	@cd $@; pwd; $(MAKE) $(TARGET)
 
-#
-# Derived files
-#
-
-rstat.x: $(PROTOCOL_DIR)/rstat.x
-	$(RM) rstat.x
-	$(CP) $(PROTOCOL_DIR)/rstat.x rstat.x
-
-rstat.h: $(PROTOCOL_DIR)/rstat.h
-	$(RM) rstat.h
-	$(CP) $(PROTOCOL_DIR)/rstat.h rstat.h
-
-rstat_svc.c: rstat.x
-	$(RPCGEN) -C -m rstat.x > $@
-
-rstat_v2.h: rstat_v2.x
-	$(RPCGEN) -C -h rstat_v2.x > $@
-
-rstat_v2_svc.c: rstat_v2.x
-	$(RPCGEN) -C -m rstat_v2.x > $@
-
-rstat_v2_xdr.c: rstat_v2.x
-	$(RPCGEN) -c rstat_v2.x > $@
-
-spray.x: $(PROTOCOL_DIR)/spray.x
-	$(RM) spray.x
-	$(CP) $(PROTOCOL_DIR)/spray.x spray.x
-
-spray.h: $(PROTOCOL_DIR)/spray.h
-	$(RM) spray.h
-	$(CP) $(PROTOCOL_DIR)/spray.h spray.h
-
-spray_svc.c: spray.x
-	$(RPCGEN) -s datagram_v -s circuit_v spray.x > $@
-
-spray_clnt.c: spray.x
-	$(RPCGEN) -l spray.x > $@
-
-rwall.x: $(PROTOCOL_DIR)/rwall.x
-	$(RM) rwall.x
-	$(CP) $(PROTOCOL_DIR)/rwall.x rwall.x
-
-rwall.h: $(PROTOCOL_DIR)/rwall.h
-	$(RM) rwall.h
-	$(CP) $(PROTOCOL_DIR)/rwall.h rwall.h
-
-rwall_svc.c: rwall.x
-	$(RPCGEN) -A -s datagram_v rwall.x > $@
-
-rwall_clnt.c: rwall.x
-	$(RPCGEN) -l -M rwall.x > $@
-
-check:	$(CHKMANIFEST)
+check:
 
 clean: $(SUBDIRS)
-	-$(RM) $(OBJS) $(DERIVED_FILES)
 
 clobber: $(SUBDIRS)
 
 lint:
-	$(LINT.c) $(WCLNTOBJS:%.o=%.c) -lnsl -lrpcsvc
-	$(LINT.c) $(WSVCOBJS:%.o=%.c) -lnsl -lrpcsvc
-	$(LINT.c) rusers.c -lnsl -lrpcsvc
 
 FRC:
 
--- old/usr/src/cmd/rpcsvc/rpc.rusersd.c	2017-05-26 19:11:10.731481661 -0400
+++ /dev/null	2017-05-26 19:11:10.000000000 -0400
@@ -1,484 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- *
- * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
-/*
- * University Copyright- Copyright (c) 1982, 1986, 1988
- * The Regents of the University of California
- * All Rights Reserved
- *
- * University Acknowledgment- Portions of this document are derived from
- * software developed by the University of California, Berkeley, and its
- * contributors.
- */
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#include <stdio.h>
-#include <signal.h>
-#include <sys/stat.h>
-#include <rpc/rpc.h>
-#include <memory.h>
-#include <netconfig.h>
-#include <stropts.h>
-#include <syslog.h>
-#include <utmpx.h>
-#include <rpcsvc/rusers.h>
-#include <sys/resource.h>
-#include <limits.h>
-
-#ifdef	DEBUG
-#define	RPC_SVC_FG
-#endif
-
-#define	_RPCSVC_CLOSEDOWN 120
-
-static void rusers_service();
-static void closedown();
-static void msgout();
-static unsigned min();
-
-static int _rpcpmstart;		/* Started by a port monitor ? */
-static int _rpcfdtype;		/* Whether Stream or Datagram ? */
-static int _rpcsvcdirty;	/* Still serving ? */
-static int _rpcsvcrecent;	/* set when we serivce a request; tested */
-				/* and cleared by closedown() routine */
-
-#define	DIV60(t)	((t+30)/60)	/* x/60 rounded */
-
-#define	ALL_ENTRIES	1
-#define	REAL_USERS	0
-
-utmp_array utmp_array_res;
-int used_array_len = 0;
-struct utmpidlearr utmpidlearr;
-
-static void free_ua_entry(rusers_utmp *uap);
-static int findidle(char *name, int ln, time_t	now);
-static void usys5to_ru(struct utmpx *s5, struct ru_utmp *bss);
-
-int
-main(int argc, char *argv[])
-{
-	pid_t pid;
-	int i;
-	int connmaxrec = RPC_MAXDATASIZE;
-
-	/*
-	 * Set non-blocking mode and maximum record size for
-	 * connection oriented RPC transports.
-	 */
-	if (!rpc_control(RPC_SVC_CONNMAXREC_SET, &connmaxrec)) {
-		msgout("unable to set maximum RPC record size");
-	}
-
-	/*
-	 * If stdin looks like a TLI endpoint, we assume
-	 * that we were started by a port monitor. If
-	 * t_getstate fails with TBADF, this is not a
-	 * TLI endpoint.
-	 */
-	if (t_getstate(0) != -1 || t_errno != TBADF) {
-		char *netid;
-		struct netconfig *nconf = NULL;
-		SVCXPRT *transp;
-		int pmclose;
-		extern char *getenv();
-
-		_rpcpmstart = 1;
-		openlog("rusers", LOG_PID, LOG_DAEMON);
-		if ((netid = getenv("NLSPROVIDER")) == NULL) {
-#ifdef DEBUG
-			msgout("cannot get transport name");
-#endif
-		} else if ((nconf = getnetconfigent(netid)) == NULL) {
-#ifdef DEBUG
-			msgout("cannot get transport info");
-#endif
-		}
-		if ((transp = svc_tli_create(0, nconf, NULL, 0, 0)) == NULL) {
-			msgout("cannot create server handle");
-			exit(1);
-		}
-		if (nconf)
-			freenetconfigent(nconf);
-		if (!svc_reg(transp, RUSERSPROG, RUSERSVERS_3, rusers_service,
-				0)) {
-	msgout("unable to register (RUSERSPROG, RUSERSVERS_3).");
-			exit(1);
-		}
-		if (!svc_reg(transp, RUSERSPROG, RUSERSVERS_IDLE,
-				rusers_service, 0)) {
-	msgout("unable to register (RUSERSPROG, RUSERSVERS_IDLE).");
-			exit(1);
-		}
-		(void) signal(SIGALRM, closedown);
-		(void) alarm(_RPCSVC_CLOSEDOWN);
-		svc_run();
-		msgout("svc_run returned");
-		exit(1);
-		/* NOTREACHED */
-	}
-#ifndef RPC_SVC_FG
-	pid = fork();
-	if (pid < 0) {
-		perror("rpc.rusersd: cannot fork");
-		exit(1);
-	}
-	if (pid)
-		exit(0);
-	for (i = 0; i < 20; i++)
-		(void) close(i);
-	setsid();
-	openlog("rusers", LOG_PID, LOG_DAEMON);
-#endif
-	if (!svc_create(rusers_service, RUSERSPROG, RUSERSVERS_3, "netpath")) {
-	    msgout("unable to create (RUSERSPROG, RUSERSVERS_3) for netpath");
-		exit(1);
-	}
-	if (!svc_create(rusers_service, RUSERSPROG, RUSERSVERS_IDLE,
-			"netpath")) {
-	    msgout(
-		"unable to create (RUSERSPROG, RUSERSVERS_IDLE) for netpath");
-		exit(1);
-	}
-
-	svc_run();
-	msgout("svc_run returned");
-	return (1);
-}
-
-
-/*
- * This routine gets the user information.
- * "all" specifies whether all listings should be counted, or only those of
- *	type "USER_PROCESS".
- * "version" is either RUSERSVERS_IDLE or RUSERSVERS_3.  If anything else,
- *	just a count is returned.
- * "limit" specifies the maximum number of entries to be processed.
- *
- * For both versions, the results are placed into an external variable.
- * For RUSERSVERS_IDLE, this routine mallocs entries in a vector as it
- * processed each utmpx entry.  These malloc'd entries must be freed after the
- * results are returned.
- * For RUSERSVERS_3, this routine uses array entries that are malloc'd prior
- * to this routine being called. "limit" is the number of elements available.
- */
-int
-getutmpx_3(all, version, limit)
-	int all;		/* give all listings? */
-	int version;		/* version 2 or 3 */
-	int limit;		/* limits users returned, 0 means no limit */
-{
-	struct utmpx *utent;
-	struct utmpidle **q = utmpidlearr.uia_arr;
-	int minidle;
-	int cnt = 0;
-	time_t now;
-	extern char *s_malodup();
-
-	time(&now);		/* only one call to time() for this rpc call */
-	setutxent();		/* reset the utmpx file */
-	while ((utent = getutxent()) != NULL && (limit == 0 || cnt < limit)) {
-		if (utent->ut_line[0] == '\0' || utent->ut_user[0] == '\0')
-			continue;
-		/*
-		 * List only user processes.
-		 * XXX modified to exclude cmdtool style window entries.
-		 */
-		if ((all == REAL_USERS) && ((utent->ut_type != USER_PROCESS) ||
-		    nonuserx(*utent)))
-			continue;
-
-		if (version == RUSERSVERS_IDLE) {
-			/*
-			 * need to free this; done after svc_sendreply.
-			 */
-			*q = (struct utmpidle *)
-				malloc(sizeof (struct utmpidle));
-			(*q)->ui_idle = findidle(utent->ut_line,
-						sizeof (utent->ut_line), now);
-			if (strncmp(utent->ut_line, "console",
-				strlen("console")) == 0) {
-				(*q)->ui_idle = min((*q)->ui_idle,
-					console_idle(now));
-			}
-			usys5to_ru(utent, &((*q)->ui_utmp));
-#ifdef DEBUG
-			printf("%-*s %-*s  %s; idle %d",
-			    sizeof (utent->ut_line),
-			    utent->ut_line,
-			    sizeof (utent->ut_name),
-			    utent->ut_name,
-			    ctime(&utent->ut_xtime),
-			    (*q)->ui_idle);
-#endif
-			q++;
-		} else if (version == RUSERSVERS_3) {
-#define	uav	utmp_array_res.utmp_array_val
-
-			uav[cnt].ut_host =
-				s_malodup(utent->ut_host, utent->ut_syslen);
-			uav[cnt].ut_user = s_malodup(utent->ut_user,
-				sizeof (utent->ut_user));
-			uav[cnt].ut_line = s_malodup(utent->ut_line,
-				sizeof (utent->ut_line));
-			uav[cnt].ut_type = utent->ut_type;
-			uav[cnt].ut_time = utent->ut_xtime;
-			uav[cnt].ut_idle = findidle(utent->ut_line,
-						sizeof (utent->ut_line), now);
-			if (strncmp(utent->ut_line, "console",
-				strlen("console")) == 0) {
-				uav[cnt].ut_idle =
-					min(uav[cnt].ut_idle,
-							console_idle(now));
-			}
-#ifdef DEBUG
-			printf("user: %-10s line: %-10s  %s; idle %d (%s)\n",
-					uav[cnt].ut_line, uav[cnt].ut_user,
-					ctime((time_t *)&uav[cnt].ut_time),
-					uav[cnt].ut_idle, uav[cnt].ut_host);
-#endif
-#undef	uav
-		}
-		cnt++;
-	}
-	return (cnt);
-}
-
-/*
- * "string" is a character array with maximum size "size".  Return a
- * malloc'd string that's a duplicate of the string.
- */
-char *
-s_malodup(string, size)
-char *string;
-int size;
-{
-	char *tmp;
-
-	tmp = (char *)malloc(size+1);
-	if (tmp == NULL) {
-		msgout("rpc.rusersd: malloc failed (2)");
-		return (NULL);
-	}
-	strncpy(tmp, string, size);
-	tmp[size] = '\0';
-	return (tmp);
-}
-
-
-int
-console_idle(now)
-	time_t now;
-{
-	/*
-	 * On the console, the user may be running a window system; if so,
-	 * their activity will show up in the last-access times of
-	 * "/dev/kbd" and "/dev/mouse", so take the minimum of the idle
-	 * times on those two devices and "/dev/console" and treat that as
-	 * the idle time.
-	 */
-	return (min((unsigned)findidle("kbd", strlen("kbd"), now),
-		(unsigned)findidle("mouse", strlen("mouse"), now)));
-}
-
-static void
-rusers_service(rqstp, transp)
-	register struct svc_req *rqstp;
-	register SVCXPRT *transp;
-{
-	int i;
-	int cnt;
-	char *replyerr = "rpc.rusersd: error replying to request";
-
-	_rpcsvcrecent = _rpcsvcdirty = 1;
-	switch (rqstp->rq_proc) {
-	case 0:
-		if (svc_sendreply(transp, xdr_void, 0) == FALSE) {
-			msgout(replyerr);
-		}
-		break;
-	case RUSERSPROC_NUM:
-		cnt = getutmpx_3(REAL_USERS, 0, 0);
-		if (!svc_sendreply(transp, xdr_u_long, (caddr_t)&cnt))
-			msgout(replyerr);
-		break;
-	case RUSERSPROC_NAMES:
-	case RUSERSPROC_ALLNAMES:
-		if (rqstp->rq_vers == RUSERSVERS_IDLE) {
-			utmpidlearr.uia_arr = (struct utmpidle **)
-				malloc(MAXUSERS*sizeof (struct utmpidle *));
-			utmpidlearr.uia_cnt = getutmpx_3(rqstp->rq_proc ==
-				RUSERSPROC_ALLNAMES,
-				RUSERSVERS_IDLE, MAXUSERS);
-			if (!svc_sendreply(transp, xdr_utmpidlearr,
-					(caddr_t)&utmpidlearr))
-				msgout(replyerr);
-			for (i = 0; i < utmpidlearr.uia_cnt; i++) {
-				free(utmpidlearr.uia_arr[i]);
-			}
-			free(utmpidlearr.uia_arr);
-		} else if (rqstp->rq_vers == RUSERSVERS_3) {
-			int entries, alloc_array_len;
-
-			/*
-			 * Always free strings from previous results array
-			 */
-			for (i = 0; i < used_array_len; i++) {
-			free_ua_entry(&utmp_array_res.utmp_array_val[i]);
-			}
-			entries = (rqstp->rq_proc == RUSERSPROC_ALLNAMES);
-			cnt = getutmpx_3(entries, 0, 0);	/* get cnt */
-			if (cnt > utmp_array_res.utmp_array_len) {
-				free(utmp_array_res.utmp_array_val);
-				utmp_array_res.utmp_array_len = 0;
-				utmp_array_res.utmp_array_val = (rusers_utmp *)
-					malloc(cnt * sizeof (rusers_utmp));
-				if (utmp_array_res.utmp_array_val == NULL) {
-				    msgout("rpc.rusersd: malloc failed (1)");
-				    break;
-				}
-				alloc_array_len = cnt;
-			} else {
-				alloc_array_len = utmp_array_res.utmp_array_len;
-			}
-			cnt = getutmpx_3(entries, RUSERSVERS_3, cnt);
-			utmp_array_res.utmp_array_len = used_array_len = cnt;
-			if (!svc_sendreply(transp, xdr_utmp_array,
-					(caddr_t)&utmp_array_res))
-				msgout(replyerr);
-			utmp_array_res.utmp_array_len = alloc_array_len;
-		}
-		break;
-	default:
-		svcerr_noproc(transp);
-		break;
-	}
-	_rpcsvcdirty = 0;
-
-}
-
-static void
-free_ua_entry(rusers_utmp *uap)
-{
-	if (uap == NULL)
-		return;
-	if (uap->ut_user)
-		free(uap->ut_user);
-	if (uap->ut_line)
-		free(uap->ut_line);
-	if (uap->ut_host)
-		free(uap->ut_host);
-}
-
-
-
-/* find & return number of minutes current tty has been idle */
-static int
-findidle(char *name, int ln, time_t	now)
-{
-	struct stat stbuf;
-	long lastaction, diff;
-	char ttyname[32];
-
-	strcpy(ttyname, "/dev/");
-	strncat(ttyname, name, ln);
-	if (stat(ttyname, &stbuf) < 0)
-		return (INT_MAX);
-	lastaction = stbuf.st_atime;
-	diff = now - lastaction;
-	diff = DIV60(diff);
-	if (diff < 0) diff = 0;
-	return (diff);
-}
-
-static void
-usys5to_ru(struct utmpx *s5, struct ru_utmp *bss)
-{
-	int i;
-
-#ifdef DEBUG
-	printf("sizeof (bss->ut_host) == %d\n", sizeof (bss->ut_host));
-#endif
-	strncpy(bss->ut_name, s5->ut_name, sizeof (bss->ut_name));
-	strncpy(bss->ut_line, s5->ut_line, sizeof (bss->ut_line));
-	strncpy(bss->ut_host, s5->ut_host, sizeof (bss->ut_host));
-	bss->ut_time = s5->ut_xtime;
-}
-
-static void
-msgout(msg)
-	char *msg;
-{
-#ifdef RPC_SVC_FG
-	if (_rpcpmstart)
-		syslog(LOG_ERR, msg);
-	else
-		(void) fprintf(stderr, "%s\n", msg);
-#else
-	syslog(LOG_ERR, msg);
-#endif
-}
-
-static void
-closedown(sig)
-int sig;
-{
-	if (_rpcsvcrecent) {
-		_rpcsvcrecent = 0;
-	} else {
-		if (_rpcsvcdirty == 0) {
-			int i, openfd;
-			struct t_info tinfo;
-
-			if (t_getinfo(0, &tinfo) || (tinfo.servtype == T_CLTS))
-				exit(0);
-
-			for (i = 0, openfd = 0;
-					i < svc_max_pollfd && openfd < 2;
-					i++) {
-				if (svc_pollfd[i].fd >= 0)
-					openfd++;
-			}
-
-			if (openfd <= 1)
-				exit(0);
-		}
-	}
-	(void) signal(SIGALRM, closedown);
-	(void) alarm(_RPCSVC_CLOSEDOWN);
-}
-
-unsigned
-min(a, b)
-unsigned a;
-unsigned b;
-{
-	if (a < b)
-		return (a);
-	else
-		return (b);
-}
--- old/usr/src/cmd/rpcsvc/rstat.xml	2017-05-26 19:11:11.079590860 -0400
+++ /dev/null	2017-05-26 19:11:11.000000000 -0400
@@ -1,125 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
-
-<!--
- Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
- Use is subject to license terms.
-
- Copyright 2016 Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
-
- CDDL HEADER START
-
- The contents of this file are subject to the terms of the
- Common Development and Distribution License (the "License").
- You may not use this file except in compliance with the License.
-
- You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- or http://www.opensolaris.org/os/licensing.
- See the License for the specific language governing permissions
- and limitations under the License.
-
- When distributing Covered Code, include this CDDL HEADER in each
- file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- If applicable, add the following below this CDDL HEADER, with the
- fields enclosed by brackets "[]" replaced with your own identifying
- information: Portions Copyright [yyyy] [name of copyright owner]
-
- CDDL HEADER END
-
-	NOTE:  This service manifest is not editable; its contents will
-	be overwritten by package or patch operations, including
-	operating system upgrade.  Make customizations in a different
-	file.
-
-	Service manifest for rpc.rstatd
--->
-
-<service_bundle type='manifest' name='SUNWrcmdr:rstatd'>
-
-<service
-	name='network/rpc/rstat'
-	type='service'
-	version='1'>
-
-	<create_default_instance enabled='false' />
-
-	<restarter>
-		<service_fmri value='svc:/network/inetd:default' />
-	</restarter>
-
-	<dependency name='rpcbind'
-	    grouping='require_all'
-	    restart_on='restart'
-	    type='service'>
-		<service_fmri value='svc:/network/rpc/bind' />
-	</dependency>
-
-	<exec_method
-	    type='method'
-	    name='inetd_start'
-	    exec='/usr/lib/netsvc/rstat/rpc.rstatd'
-	    timeout_seconds='0'>
-		<method_context>
-		    <method_credential user='root' group='root' />
-		</method_context>
-	</exec_method>
-
-	<exec_method
-		type='method'
-		name='inetd_offline'
-		exec=':kill_process'
-		timeout_seconds='0'>
-	</exec_method>
-
-	<exec_method
-	    type='method'
-	    name='inetd_disable'
-	    exec=':kill'
-	    timeout_seconds='0'>
-	</exec_method>
-
-	<property_group name='inetd' type='framework'>
-		<stability value='Evolving' />
-		<propval name='name' type='astring' value='rstatd' />
-		<propval name='endpoint_type' type='astring' value='tli' />
-		<propval name='proto' type='astring' value='datagram_v' 
-		    override='true' />
-		<propval name='isrpc' type='boolean' value='true' />
-		<propval name='rpc_low_version' type='integer' value='2' />
-		<propval name='rpc_high_version' type='integer' value='4' />
-		<propval name='wait' type='boolean' value='true' />
-	</property_group>
-
-	<property_group name='firewall_config' type='com.sun,fw_configuration'>
-		<propval name='policy' type='astring' value='use_global' />
-		<propval name='block_policy' type='astring'
-			value='use_global' />
-		<propval name='apply_to' type='astring' value='' />
-		<propval name='apply_to_6' type='astring' value='' />
-		<propval name='exceptions' type='astring' value='' />
-		<propval name='exceptions_6' type='astring' value='' />
-		<propval name='target' type='astring' value='' />
-		<propval name='target_6' type='astring' value='' />
-		<propval name='value_authorization' type='astring'
-			value='solaris.smf.value.firewall.config' />
-	</property_group>
-
-	<stability value='Unstable' />
-
-	<template>
-		<common_name>
-			<loctext xml:lang='C'>
-				kernel statistics server
-			</loctext>
-		</common_name>
-		<documentation>
-			<manpage title='rpc.rstatd' section='1M'
-				manpath='/usr/share/man' />
-			<manpage title='rstatd' section='1M'
-				manpath='/usr/share/man' />
-		</documentation>
-	</template>
-
-</service>
-
-</service_bundle>
--- old/usr/src/cmd/rpcsvc/rstat_main.c	2017-05-26 19:11:11.419841435 -0400
+++ /dev/null	2017-05-26 19:11:11.000000000 -0400
@@ -1,181 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#include "rstat.h"
-#include "rstat_v2.h"
-#include <stdio.h>
-#include <stdlib.h> /* getenv, exit */
-#include <signal.h>
-#include <sys/types.h>
-#include <memory.h>
-#include <stropts.h>
-#include <netconfig.h>
-#include <syslog.h>
-
-#ifdef __STDC__
-#define	SIG_PF void(*)(int)
-#endif
-
-#ifdef DEBUG
-#define	RPC_SVC_FG
-#endif
-
-
-int _rpcpmstart;		/* Started by a port monitor ? */
-int _rpcfdtype;			/* Whether Stream or Datagram ? */
-int _rpcsvcdirty;		/* Still serving ? */
-
-static void _msgout(/*char *msg*/);
-static void closedown();
-
-extern void rstatprog_4(/*struct svc_req *rqstp, SVCXPRT *transp*/);
-extern void rstatprog_3(/*struct svc_req *rqstp, SVCXPRT *transp*/);
-extern void rstatprog_2(/*struct svc_req *rqstp, SVCXPRT *transp*/);
-
-int
-main(int argc, char *argv[])
-{
-	pid_t pid;
-	int i;
-
-	/*
-	 * If stdin looks like a TLI endpoint, we assume
-	 * that we were started by a port monitor. If
-	 * t_getstate fails with TBADF, this is not a
-	 * TLI endpoint.
-	 */
-	if (t_getstate(0) != -1 || t_errno != TBADF) {
-		char *netid;
-		struct netconfig *nconf = NULL;
-		SVCXPRT *transp;
-
-		_rpcpmstart = 1;
-		openlog("rstatd", LOG_PID, LOG_DAEMON);
-		if ((netid = getenv("NLSPROVIDER")) == NULL) {
-#ifdef DEBUG
-			_msgout("cannot get transport name");
-#endif
-		} else if ((nconf = getnetconfigent(netid)) == NULL) {
-#ifdef DEBUG
-			_msgout("cannot get transport info");
-#endif
-		}
-		if ((transp = svc_tli_create(0, nconf, NULL, 0, 0)) == NULL) {
-			_msgout("cannot create server handle");
-			exit(1);
-		}
-		if (nconf)
-			freenetconfigent(nconf);
-		if (!svc_reg(transp, RSTATPROG, RSTATVERS_VAR, rstatprog_4,
-		    0)) {
-			_msgout("unable to register "
-			    "(RSTATPROG, RSTATVERS_VAR).");
-			exit(1);
-		}
-		if (!svc_reg(transp, RSTATPROG, RSTATVERS_TIME, rstatprog_3,
-		    0)) {
-			_msgout("unable to register "
-			    "(RSTATPROG, RSTATVERS_TIME).");
-			exit(1);
-		}
-		if (!svc_reg(transp, RSTATPROG, RSTATVERS_SWTCH, rstatprog_2,
-		    0)) {
-			_msgout("unable to register "
-			    "(RSTATPROG, RSTATVERS_SWTCH).");
-			exit(1);
-		}
-		svc_run();
-		exit(1);
-		/* NOTREACHED */
-	} else {
-#ifndef RPC_SVC_FG
-		pid = fork();
-		if (pid < 0) {
-			perror("cannot fork");
-			exit(1);
-		}
-		if (pid)
-			exit(0);
-		closefrom(0);
-		i = open("/dev/console", 2);
-		(void) dup2(i, 1);
-		(void) dup2(i, 2);
-		setsid();
-		openlog("rstatd", LOG_PID, LOG_DAEMON);
-#endif
-	}
-	if (!svc_create(rstatprog_4, RSTATPROG, RSTATVERS_VAR, "datagram_v")) {
-		_msgout("unable to create (RSTATPROG, RSTATVERS_VAR) "
-		    "for datagram_v.");
-		exit(1);
-	}
-	if (!svc_create(rstatprog_3, RSTATPROG, RSTATVERS_TIME,
-	    "datagram_v")) {
-		_msgout("unable to create (RSTATPROG, RSTATVERS_TIME) "
-		    "for datagram_v.");
-		exit(1);
-	}
-	if (!svc_create(rstatprog_4, RSTATPROG, RSTATVERS_VAR, "circuit_v")) {
-		_msgout("unable to create (RSTATPROG, RSTATVERS_VAR) "
-		    "for circuit_v.");
-		exit(1);
-	}
-	if (!svc_create(rstatprog_3, RSTATPROG, RSTATVERS_TIME, "circuit_v")) {
-		_msgout("unable to create (RSTATPROG, RSTATVERS_TIME) "
-		    "for circuit_v.");
-		exit(1);
-	}
-
-	/*
-	 * V2 supported on datagram transports *only*
-	 */
-	if (!svc_create(rstatprog_2, RSTATPROG, RSTATVERS_SWTCH,
-	    "datagram_v")) {
-		_msgout("unable to create (RSTATPROG, RSTATVERS_SWTCH) "
-		    "for datagram_v.");
-		exit(1);
-	}
-
-	svc_run();
-	_msgout("svc_run returned");
-	return (1);
-}
-
-static void
-_msgout(msg)
-	char *msg;
-{
-#ifdef RPC_SVC_FG
-	if (_rpcpmstart)
-		syslog(LOG_ERR, msg);
-	else
-		(void) fprintf(stderr, "%s\n", msg);
-#else
-	syslog(LOG_ERR, msg);
-#endif
-}
--- old/usr/src/cmd/rpcsvc/rstat_proc.c	2017-05-26 19:11:11.760408583 -0400
+++ /dev/null	2017-05-26 19:11:11.000000000 -0400
@@ -1,1100 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-/*
- * rstat service:  built with rstat.x
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <signal.h>
-#include <utmpx.h>
-#include <nlist.h>
-#include <fcntl.h>
-#include <syslog.h>
-#include <kstat.h>
-
-#include <rpc/rpc.h>
-
-#include <sys/socket.h>
-#include <sys/cpuvar.h>
-#include <sys/sysinfo.h>
-#include <sys/systm.h>
-#include <errno.h>
-#include <sys/stropts.h>
-#include <sys/tihdr.h>
-#include <sys/sysmacros.h>
-
-#include <net/if.h>
-#include <inet/mib2.h>
-
-#include "rstat.h"
-#include "rstat_v2.h"
-
-typedef struct {
-	kstat_t	sys;
-	kstat_t	vm;
-} _cpu_stats_t;
-
-/*
- *	system and cpu stats
- */
-static	kstat_ctl_t	*kc;		/* libkstat cookie */
-static	int	ncpus;
-static	_cpu_stats_t	*cpu_stats_list = NULL;
-static	kstat_t	*system_misc_ksp;
-static	kstat_named_t *boot_time_knp;
-static	kstat_named_t *avenrun_1min_knp, *avenrun_5min_knp, *avenrun_15min_knp;
-static	int	hz;
-static	struct	timeval btm;		/* boottime */
-
-/*
- *	network interface stats
- */
-
-typedef struct mib_item_s {
-	struct mib_item_s	*next_item;
-	long			group;
-	long			mib_id;
-	long			length;
-	char			*valp;
-} mib_item_t;
-
-mib_item_t	*netstat_item;
-
-/*
- * disk stats
- */
-
-struct diskinfo {
-	struct diskinfo *next;
-	kstat_t *ks;
-	kstat_io_t kios;
-};
-
-#define	NULLDISK (struct diskinfo *)0
-static	struct diskinfo zerodisk = { NULL, NULL };
-static	struct diskinfo *firstdisk = NULLDISK;
-static	struct diskinfo *lastdisk = NULLDISK;
-static	struct diskinfo *snip = NULLDISK;
-static	int ndisks;
-
-/*
- * net stats
- */
-
-struct netinfo {
-	struct netinfo *next;
-	kstat_t	*ks;
-	kstat_named_t *ipackets;
-	kstat_named_t *opackets;
-	kstat_named_t *ierrors;
-	kstat_named_t *oerrors;
-	kstat_named_t *collisions;
-};
-
-#define	NULLNET (struct netinfo *)0
-static	struct netinfo zeronet = { NULL, NULL, NULL, NULL, NULL, NULL, NULL };
-static	struct netinfo *firstnet = NULLNET;
-static	struct netinfo *lastnet = NULLNET;
-static	struct netinfo *netsnip = NULLNET;
-static	int nnets;
-
-/*
- *  Define EXIT_WHEN_IDLE if you are able to have this program invoked
- *  automatically on demand (as from inetd).  When defined, the service
- *  will terminated after being idle for 120 seconds.
- */
-
-#define	EXIT_WHEN_IDLE	1
-
-int sincelastreq = 0;		/* number of alarms since last request */
-#ifdef EXIT_WHEN_IDLE
-#define	CLOSEDOWN 120		/* how long to wait before exiting */
-#endif /* def EXIT_WHEN_IDLE */
-
-statstime stats_s3;
-statsvar stats_s4;
-/* V2 support for backwards compatibility to pre-5.0 systems */
-statsswtch stats_s2;
-
-static int stat_is_init = 0;
-
-static	void	fail(int, char *, ...);
-static	void	safe_zalloc(void **, int, int);
-static	kid_t	safe_kstat_read(kstat_ctl_t *, kstat_t *, void *);
-static	kstat_t	*safe_kstat_lookup(kstat_ctl_t *, char *, int, char *);
-static	void	*safe_kstat_data_lookup(kstat_t *, char *);
-static	void	system_stat_init(void);
-static	int	system_stat_load(void);
-static	void	init_disks(void);
-static	int	diskinfo_load(void);
-static	void	init_net(void);
-static	int	netinfo_load(void);
-
-static	void	updatestat(int);
-
-static	mib_item_t	*mibget(int sd);
-static	int	mibopen(void);
-static  char	*octetstr(char *buf, Octet_t *op, int code);
-
-static	void	kstat_copy(kstat_t *, kstat_t *, int);
-
-static	char	*cmdname = "rpc.rstatd";
-
-#define	CPU_STAT(ksp, name)	(((kstat_named_t *)safe_kstat_data_lookup( \
-				    (ksp), (name)))->value.ui64)
-static	_cpu_stats_t	cpu_stats_all = { 0 };
-
-static void
-stat_init(void)
-{
-	struct utmpx *utmpx, utmpx_id;
-
-	stat_is_init = 1;
-
-	if ((kc = kstat_open()) == NULL)
-		fail(1, "kstat_open(): can't open /dev/kstat");
-
-	/*
-	 * Preallocate minimal set of drive entries.
-	 */
-
-	if (stats_s4.dk_xfer.dk_xfer_val == NULL) {
-		stats_s4.dk_xfer.dk_xfer_len = RSTAT_DK_NDRIVE;
-		stats_s4.dk_xfer.dk_xfer_val =
-		    (int *)calloc(RSTAT_DK_NDRIVE, sizeof (int));
-	}
-
-	system_stat_init();
-	init_disks();
-	init_net();
-
-	/*
-	 * To get the boot time, use utmpx, which is per-zone, but fall back
-	 * to the system-wide kstat if utmpx is hosed for any reason.
-	 */
-	utmpx_id.ut_type = BOOT_TIME;
-	if ((utmpx = getutxid(&utmpx_id)) != NULL)
-		btm = utmpx->ut_tv;
-	else {
-		btm.tv_sec = boot_time_knp->value.ul;
-		btm.tv_usec = 0; /* don't bother with usecs for boot time */
-	}
-	endutxent();
-	stats_s4.boottime.tv_sec =
-		stats_s2.boottime.tv_sec =
-		stats_s3.boottime.tv_sec = btm.tv_sec;
-	stats_s4.boottime.tv_usec =
-		stats_s2.boottime.tv_usec =
-		stats_s3.boottime.tv_usec = btm.tv_usec;
-
-	updatestat(0);
-	alarm(1);
-	signal(SIGALRM, updatestat);
-	sleep(2);		/* allow for one wake-up */
-}
-
-statsvar *
-rstatproc_stats_4_svc(argp, svcrq)
-void *argp;
-struct svc_req *svcrq;
-{
-	if (! stat_is_init)
-		stat_init();
-#ifdef EXIT_WHEN_IDLE
-	sincelastreq = 0;
-#endif
-	return (&stats_s4);
-}
-
-statstime *
-rstatproc_stats_3_svc(argp, svcrq)
-void *argp;
-struct svc_req *svcrq;
-{
-	if (! stat_is_init)
-		stat_init();
-#ifdef EXIT_WHEN_IDLE
-	sincelastreq = 0;
-#endif
-	return (&stats_s3);
-}
-
-statsswtch *
-rstatproc_stats_2_svc(argp, svcrq)
-void *argp;
-struct svc_req *svcrq;
-{
-	if (! stat_is_init)
-		stat_init();
-#ifdef EXIT_WHEN_IDLE
-	sincelastreq = 0;
-#endif
-	return (&stats_s2);
-}
-
-
-uint_t *
-rstatproc_havedisk_4_svc(argp, svcrq)
-void *argp;
-struct svc_req *svcrq;
-{
-	return (rstatproc_havedisk_3_svc(argp, svcrq));
-}
-
-uint_t *
-rstatproc_havedisk_3_svc(argp, svcrq)
-void *argp;
-struct svc_req *svcrq;
-{
-	static uint_t have;
-
-	if (! stat_is_init)
-		stat_init();
-#ifdef EXIT_WHEN_IDLE
-	sincelastreq = 0;
-#endif
-	have = (ndisks != 0);
-	return (&have);
-}
-
-uint_t *
-rstatproc_havedisk_2_svc(argp, svcrq)
-void *argp;
-struct svc_req *svcrq;
-{
-	return (rstatproc_havedisk_3_svc(argp, svcrq));
-}
-
-void
-updatestat(int ignored)
-{
-extern int _rpcpmstart;		 /* Started by a port monitor ? */
-extern int _rpcsvcdirty;	 /* Still serving ? */
-
-#ifdef DEBUG
-	fprintf(stderr, "entering updatestat\n");
-#endif
-#ifdef EXIT_WHEN_IDLE
-	if (_rpcpmstart && sincelastreq >= CLOSEDOWN && !_rpcsvcdirty) {
-#ifdef DEBUG
-		fprintf(stderr, "about to closedown\n");
-#endif
-		exit(0);
-	}
-	sincelastreq++;
-#endif /* def EXIT_WHEN_IDLE */
-
-	(void) alarm(0);
-#ifdef DEBUG
-	fprintf(stderr, "boottime: %d %d\n", stats_s3.boottime.tv_sec,
-		stats_s3.boottime.tv_usec);
-#endif
-	while (system_stat_load() || diskinfo_load() || netinfo_load()) {
-		(void) kstat_chain_update(kc);
-		system_stat_init();
-		init_disks();
-		init_net();
-	}
-	stats_s4.cp_time.cp_time_len = CPU_STATES;
-	if (stats_s4.cp_time.cp_time_val == NULL)
-		stats_s4.cp_time.cp_time_val =
-		malloc(stats_s4.cp_time.cp_time_len * sizeof (int));
-	stats_s2.cp_time[RSTAT_CPU_USER] =
-	stats_s3.cp_time[RSTAT_CPU_USER] =
-	stats_s4.cp_time.cp_time_val[RSTAT_CPU_USER] =
-		CPU_STAT(&cpu_stats_all.sys, "cpu_ticks_user");
-	stats_s2.cp_time[RSTAT_CPU_NICE] =
-	stats_s3.cp_time[RSTAT_CPU_NICE] =
-	stats_s4.cp_time.cp_time_val[RSTAT_CPU_NICE] =
-		CPU_STAT(&cpu_stats_all.sys, "cpu_ticks_wait");
-	stats_s2.cp_time[RSTAT_CPU_SYS] =
-	stats_s3.cp_time[RSTAT_CPU_SYS] =
-	stats_s4.cp_time.cp_time_val[RSTAT_CPU_SYS] =
-		CPU_STAT(&cpu_stats_all.sys, "cpu_ticks_kernel");
-	stats_s2.cp_time[RSTAT_CPU_IDLE] =
-	stats_s3.cp_time[RSTAT_CPU_IDLE] =
-	stats_s4.cp_time.cp_time_val[RSTAT_CPU_IDLE] =
-		CPU_STAT(&cpu_stats_all.sys, "cpu_ticks_idle");
-
-#ifdef DEBUG
-	fprintf(stderr, "cpu: %d %d %d %d\n",
-		CPU_STAT(&cpu_stats_all.sys, "cpu_ticks_user"),
-		CPU_STAT(&cpu_stats_all.sys, "cpu_ticks_wait"),
-		CPU_STAT(&cpu_stats_all.sys, "cpu_ticks_kernel"),
-		CPU_STAT(&cpu_stats_all.sys, "cpu_ticks_idle"));
-	fprintf(stderr, "cp_time: %d %d %d %d\n",
-		stats_s3.cp_time[RSTAT_CPU_USER],
-		stats_s3.cp_time[RSTAT_CPU_NICE],
-		stats_s3.cp_time[RSTAT_CPU_SYS],
-		stats_s3.cp_time[RSTAT_CPU_IDLE]);
-#endif
-
-	/* current time */
-	gettimeofday((struct timeval *)&stats_s3.curtime, NULL);
-	stats_s4.curtime = stats_s3.curtime;
-
-	stats_s2.v_pgpgin =
-	stats_s3.v_pgpgin =
-	stats_s4.v_pgpgin = CPU_STAT(&cpu_stats_all.vm, "pgpgin");
-	stats_s2.v_pgpgout =
-	stats_s3.v_pgpgout =
-	stats_s4.v_pgpgout = CPU_STAT(&cpu_stats_all.vm, "pgpgout");
-	stats_s2.v_pswpin =
-	stats_s3.v_pswpin =
-	stats_s4.v_pswpin = CPU_STAT(&cpu_stats_all.vm, "pgswapin");
-	stats_s2.v_pswpout =
-	stats_s3.v_pswpout =
-	stats_s4.v_pswpout = CPU_STAT(&cpu_stats_all.vm, "pgswapout");
-	stats_s3.v_intr = CPU_STAT(&cpu_stats_all.sys, "intr");
-	stats_s3.v_intr -= hz*(stats_s3.curtime.tv_sec - btm.tv_sec) +
-		hz*(stats_s3.curtime.tv_usec - btm.tv_usec)/1000000;
-	stats_s2.v_intr =
-	stats_s4.v_intr = stats_s3.v_intr;
-	/* swtch not in V1 */
-	stats_s2.v_swtch =
-	stats_s3.v_swtch =
-	stats_s4.v_swtch = CPU_STAT(&cpu_stats_all.sys, "pswitch");
-
-#ifdef DEBUG
-	fprintf(stderr,
-		"pgin: %d pgout: %d swpin: %d swpout: %d intr: %d swtch: %d\n",
-		stats_s3.v_pgpgin,
-		stats_s3.v_pgpgout,
-		stats_s3.v_pswpin,
-		stats_s3.v_pswpout,
-		stats_s3.v_intr,
-		stats_s3.v_swtch);
-#endif
-	/*
-	 * V2 and V3 of rstat are limited to RSTAT_DK_NDRIVE drives
-	 */
-	memcpy(stats_s3.dk_xfer, stats_s4.dk_xfer.dk_xfer_val,
-		RSTAT_DK_NDRIVE * sizeof (int));
-	memcpy(stats_s2.dk_xfer, stats_s4.dk_xfer.dk_xfer_val,
-		RSTAT_DK_NDRIVE * sizeof (int));
-#ifdef DEBUG
-	fprintf(stderr, "dk_xfer: %d %d %d %d\n",
-		stats_s4.dk_xfer.dk_xfer_val[0],
-		stats_s4.dk_xfer.dk_xfer_val[1],
-		stats_s4.dk_xfer.dk_xfer_val[2],
-		stats_s4.dk_xfer.dk_xfer_val[3]);
-#endif
-
-	stats_s2.if_ipackets =
-	stats_s3.if_ipackets = stats_s4.if_ipackets;
-	/* no s2 opackets */
-	stats_s3.if_opackets = stats_s4.if_opackets;
-	stats_s2.if_ierrors =
-	stats_s3.if_ierrors = stats_s4.if_ierrors;
-	stats_s2.if_oerrors =
-	stats_s3.if_oerrors = stats_s4.if_oerrors;
-	stats_s2.if_collisions =
-	stats_s3.if_collisions = stats_s4.if_collisions;
-
-	stats_s2.avenrun[0] =
-	stats_s3.avenrun[0] =
-	stats_s4.avenrun[0] = avenrun_1min_knp->value.ul;
-	stats_s2.avenrun[1] =
-	stats_s3.avenrun[1] =
-	stats_s4.avenrun[1] = avenrun_5min_knp->value.ul;
-	stats_s2.avenrun[2] =
-	stats_s3.avenrun[2] =
-	stats_s4.avenrun[2] = avenrun_15min_knp->value.ul;
-#ifdef DEBUG
-	fprintf(stderr, "avenrun: %d %d %d\n", stats_s3.avenrun[0],
-		stats_s3.avenrun[1], stats_s3.avenrun[2]);
-#endif
-	signal(SIGALRM, updatestat);
-	alarm(1);
-}
-
-/* --------------------------------- MIBGET -------------------------------- */
-
-static mib_item_t *
-mibget(int sd)
-{
-	int			flags;
-	int			j, getcode;
-	struct strbuf		ctlbuf, databuf;
-	char			buf[512];
-	struct T_optmgmt_req	*tor = (struct T_optmgmt_req *)buf;
-	struct T_optmgmt_ack	*toa = (struct T_optmgmt_ack *)buf;
-	struct T_error_ack	*tea = (struct T_error_ack *)buf;
-	struct opthdr		*req;
-	mib_item_t		*first_item = NULL;
-	mib_item_t		*last_item  = NULL;
-	mib_item_t		*temp;
-
-	tor->PRIM_type = T_SVR4_OPTMGMT_REQ;
-	tor->OPT_offset = sizeof (struct T_optmgmt_req);
-	tor->OPT_length = sizeof (struct opthdr);
-	tor->MGMT_flags = T_CURRENT;
-	req = (struct opthdr *)&tor[1];
-	req->level = MIB2_IP;		/* any MIB2_xxx value ok here */
-	req->name  = 0;
-	req->len   = 0;
-
-	ctlbuf.buf = buf;
-	ctlbuf.len = tor->OPT_length + tor->OPT_offset;
-	flags = 0;
-	if (putmsg(sd, &ctlbuf, NULL, flags) == -1) {
-		perror("mibget: putmsg(ctl) failed");
-		goto error_exit;
-	}
-	/*
-	 * each reply consists of a ctl part for one fixed structure
-	 * or table, as defined in mib2.h.  The format is a T_OPTMGMT_ACK,
-	 * containing an opthdr structure.  level/name identify the entry,
-	 * len is the size of the data part of the message.
-	 */
-	req = (struct opthdr *)&toa[1];
-	ctlbuf.maxlen = sizeof (buf);
-	/*CSTYLED*/
-	for (j = 1; ; j++) {
-		flags = 0;
-		getcode = getmsg(sd, &ctlbuf, NULL, &flags);
-		if (getcode == -1) {
-#ifdef DEBUG_MIB
-			perror("mibget getmsg(ctl) failed");
-			fprintf(stderr, "#   level   name    len\n");
-			i = 0;
-			for (last_item = first_item; last_item;
-				last_item = last_item->next_item)
-				fprintf(stderr, "%d  %4d   %5d   %d\n", ++i,
-					last_item->group,
-					last_item->mib_id,
-					last_item->length);
-#endif /* DEBUG_MIB */
-			goto error_exit;
-		}
-		if (getcode == 0 &&
-			(ctlbuf.len >= sizeof (struct T_optmgmt_ack)) &&
-			(toa->PRIM_type == T_OPTMGMT_ACK) &&
-			(toa->MGMT_flags == T_SUCCESS) &&
-			req->len == 0) {
-#ifdef DEBUG_MIB
-			fprintf(stderr,
-		"mibget getmsg() %d returned EOD (level %d, name %d)\n",
-				j, req->level, req->name);
-#endif /* DEBUG_MIB */
-			return (first_item);		/* this is EOD msg */
-		}
-
-		if (ctlbuf.len >= sizeof (struct T_error_ack) &&
-			(tea->PRIM_type == T_ERROR_ACK)) {
-#ifdef DEBUG_MIB
-			fprintf(stderr,
-	"mibget %d gives T_ERROR_ACK: TLI_error = 0x%x, UNIX_error = 0x%x\n",
-				j, getcode, tea->TLI_error, tea->UNIX_error);
-#endif /* DEBUG_MIB */
-			errno = (tea->TLI_error == TSYSERR)
-				? tea->UNIX_error : EPROTO;
-			goto error_exit;
-		}
-
-		if (getcode != MOREDATA ||
-			(ctlbuf.len < sizeof (struct T_optmgmt_ack)) ||
-			(toa->PRIM_type != T_OPTMGMT_ACK) ||
-			(toa->MGMT_flags != T_SUCCESS)) {
-#ifdef DEBUG_MIB
-			fprintf(stderr,
-	"mibget getmsg(ctl) %d returned %d, ctlbuf.len = %d, PRIM_type = %d\n",
-				j, getcode, ctlbuf.len, toa->PRIM_type);
-			if (toa->PRIM_type == T_OPTMGMT_ACK)
-				fprintf(stderr,
-	"T_OPTMGMT_ACK: MGMT_flags = 0x%x, req->len = %d\n",
-					toa->MGMT_flags, req->len);
-#endif /* DEBUG_MIB */
-			errno = ENOMSG;
-			goto error_exit;
-		}
-
-		temp = malloc(sizeof (mib_item_t));
-		if (!temp) {
-			perror("mibget malloc failed");
-			goto error_exit;
-		}
-		if (last_item)
-			last_item->next_item = temp;
-		else
-			first_item = temp;
-		last_item = temp;
-		last_item->next_item = NULL;
-		last_item->group = req->level;
-		last_item->mib_id = req->name;
-		last_item->length = req->len;
-		last_item->valp = malloc(req->len);
-#ifdef DEBUG_MIB
-		fprintf(stderr,
-			"msg %d:  group = %4d   mib_id = %5d   length = %d\n",
-			j, last_item->group, last_item->mib_id,
-			last_item->length);
-#endif /* DEBUG_MIB */
-		databuf.maxlen = last_item->length;
-		databuf.buf    = last_item->valp;
-		databuf.len    = 0;
-		flags = 0;
-		getcode = getmsg(sd, NULL, &databuf, &flags);
-		if (getcode == -1) {
-			perror("mibget getmsg(data) failed");
-			goto error_exit;
-		} else if (getcode != 0) {
-			fprintf(stderr,
-"mibget getmsg(data) returned %d, databuf.maxlen = %d, databuf.len = %d\n",
-				getcode, databuf.maxlen, databuf.len);
-			goto error_exit;
-		}
-	}
-
-error_exit:
-	while (first_item) {
-		last_item = first_item;
-		first_item = first_item->next_item;
-		if (last_item->valp) {
-			free(last_item->valp);
-		}
-		free(last_item);
-	}
-	return (first_item);
-}
-
-static int
-mibopen(void)
-{
-	int	sd;
-
-	/* gives us ip w/ arp on top */
-	sd = open("/dev/arp", O_RDWR);
-	if (sd == -1) {
-		perror("arp open");
-		close(sd);
-		return (-1);
-	}
-	if (ioctl(sd, I_PUSH, "tcp") == -1) {
-		perror("tcp I_PUSH");
-		close(sd);
-		return (-1);
-	}
-	if (ioctl(sd, I_PUSH, "udp") == -1) {
-		perror("udp I_PUSH");
-		close(sd);
-		return (-1);
-	}
-	return (sd);
-}
-
-static char *
-octetstr(char *buf, Octet_t *op, int code)
-{
-	int	i;
-	char	*cp;
-
-	cp = buf;
-	if (op)
-		for (i = 0; i < op->o_length; i++)
-			switch (code) {
-			case 'd':
-				sprintf(cp, "%d.", 0xff & op->o_bytes[i]);
-				cp = strchr(cp, '\0');
-				break;
-			case 'a':
-				*cp++ = op->o_bytes[i];
-				break;
-			case 'h':
-			default:
-				sprintf(cp, "%02x:", 0xff & op->o_bytes[i]);
-				cp += 3;
-				break;
-			}
-	if (code != 'a' && cp != buf)
-		cp--;
-	*cp = '\0';
-	return (buf);
-}
-
-static void
-fail(int do_perror, char *message, ...)
-{
-	va_list args;
-
-	va_start(args, message);
-	fprintf(stderr, "%s: ", cmdname);
-	vfprintf(stderr, message, args);
-	va_end(args);
-	if (do_perror)
-		fprintf(stderr, ": %s", strerror(errno));
-	fprintf(stderr, "\n");
-	exit(2);
-}
-
-static void
-safe_zalloc(void **ptr, int size, int free_first)
-{
-	if (free_first && *ptr != NULL)
-		free(*ptr);
-	if ((*ptr = malloc(size)) == NULL)
-		fail(1, "malloc failed");
-	memset(*ptr, 0, size);
-}
-
-kid_t
-safe_kstat_read(kstat_ctl_t *kctl, kstat_t *ksp, void *data)
-{
-	kid_t kstat_chain_id = kstat_read(kctl, ksp, data);
-
-	if (kstat_chain_id == -1)
-		fail(1, "kstat_read(%x, '%s') failed", kctl, ksp->ks_name);
-	return (kstat_chain_id);
-}
-
-kstat_t *
-safe_kstat_lookup(kstat_ctl_t *kctl, char *ks_module, int ks_instance,
-	char *ks_name)
-{
-	kstat_t *ksp = kstat_lookup(kctl, ks_module, ks_instance, ks_name);
-
-	if (ksp == NULL)
-		fail(0, "kstat_lookup('%s', %d, '%s') failed",
-			ks_module == NULL ? "" : ks_module,
-			ks_instance,
-			ks_name == NULL ? "" : ks_name);
-	return (ksp);
-}
-
-void *
-safe_kstat_data_lookup(kstat_t *ksp, char *name)
-{
-	void *fp = kstat_data_lookup(ksp, name);
-
-	if (fp == NULL) {
-		fail(0, "kstat_data_lookup('%s', '%s') failed",
-			ksp->ks_name, name);
-	}
-	return (fp);
-}
-
-/*
- * Get various KIDs for subsequent system_stat_load operations.
- */
-
-static void
-system_stat_init(void)
-{
-	kstat_t *ksp;
-	int i, nvmks;
-
-	/*
-	 * Global statistics
-	 */
-
-	system_misc_ksp	= safe_kstat_lookup(kc, "unix", 0, "system_misc");
-
-	safe_kstat_read(kc, system_misc_ksp, NULL);
-	boot_time_knp = safe_kstat_data_lookup(system_misc_ksp, "boot_time");
-	avenrun_1min_knp = safe_kstat_data_lookup(system_misc_ksp,
-		"avenrun_1min");
-	avenrun_5min_knp = safe_kstat_data_lookup(system_misc_ksp,
-		"avenrun_5min");
-	avenrun_15min_knp = safe_kstat_data_lookup(system_misc_ksp,
-		"avenrun_15min");
-
-	/*
-	 * Per-CPU statistics
-	 */
-
-	ncpus = 0;
-	for (ksp = kc->kc_chain; ksp; ksp = ksp->ks_next)
-		if (strcmp(ksp->ks_module, "cpu") == 0 &&
-		    strcmp(ksp->ks_name, "sys") == 0)
-			ncpus++;
-
-	safe_zalloc((void **)&cpu_stats_list, ncpus * sizeof (*cpu_stats_list),
-	    1);
-
-	ncpus = 0;
-	for (ksp = kc->kc_chain; ksp; ksp = ksp->ks_next)
-		if (strcmp(ksp->ks_module, "cpu") == 0 &&
-		    strcmp(ksp->ks_name, "sys") == 0 &&
-		    kstat_read(kc, ksp, NULL) != -1) {
-			kstat_copy(ksp, &cpu_stats_list[ncpus].sys,
-			    1);
-			if ((ksp = kstat_lookup(kc, "cpu", ksp->ks_instance,
-			    "vm")) != NULL && kstat_read(kc, ksp, NULL) != -1)
-				kstat_copy(ksp, &cpu_stats_list[ncpus].vm, 1);
-			else
-				fail(0, "couldn't find per-CPU VM statistics");
-			ncpus++;
-		    }
-
-	if (ncpus == 0)
-		fail(0, "couldn't find per-CPU statistics");
-}
-
-/*
- * load statistics, summing across CPUs where needed
- */
-
-static int
-system_stat_load(void)
-{
-	int i, j;
-	_cpu_stats_t cs;
-	ulong_t *np, *tp;
-
-	/*
-	 * Global statistics
-	 */
-
-	safe_kstat_read(kc, system_misc_ksp, NULL);
-
-	/*
-	 * Per-CPU statistics.
-	 */
-
-	for (i = 0; i < ncpus; i++) {
-		if (kstat_read(kc, &cpu_stats_list[i].sys, NULL) == -1 ||
-		    kstat_read(kc, &cpu_stats_list[i].vm, NULL) == -1)
-			return (1);
-		if (i == 0) {
-			kstat_copy(&cpu_stats_list[0].sys, &cpu_stats_all.sys,
-			    1);
-			kstat_copy(&cpu_stats_list[0].vm, &cpu_stats_all.vm, 1);
-		} else {
-			kstat_named_t *nkp;
-			kstat_named_t *tkp;
-
-			/*
-			 * Other CPUs' statistics are accumulated in
-			 * cpu_stats_all, initialized at the first iteration of
-			 * the loop.
-			 */
-			nkp = (kstat_named_t *)cpu_stats_all.sys.ks_data;
-			tkp = (kstat_named_t *)cpu_stats_list[i].sys.ks_data;
-			for (j = 0; j < cpu_stats_list[i].sys.ks_ndata; j++)
-				(nkp++)->value.ui64 += (tkp++)->value.ui64;
-			nkp = (kstat_named_t *)cpu_stats_all.vm.ks_data;
-			tkp = (kstat_named_t *)cpu_stats_list[i].vm.ks_data;
-			for (j = 0; j < cpu_stats_list[i].vm.ks_ndata; j++)
-				(nkp++)->value.ui64 += (tkp++)->value.ui64;
-		}
-	}
-	return (0);
-}
-
-static int
-kscmp(kstat_t *ks1, kstat_t *ks2)
-{
-	int cmp;
-
-	cmp = strcmp(ks1->ks_module, ks2->ks_module);
-	if (cmp != 0)
-		return (cmp);
-	cmp = ks1->ks_instance - ks2->ks_instance;
-	if (cmp != 0)
-		return (cmp);
-	return (strcmp(ks1->ks_name, ks2->ks_name));
-}
-
-static void
-init_disks(void)
-{
-	struct diskinfo *disk, *prevdisk, *comp;
-	kstat_t *ksp;
-
-	ndisks = 0;
-	disk = &zerodisk;
-
-	/*
-	 * Patch the snip in the diskinfo list (see below)
-	 */
-	if (snip)
-		lastdisk->next = snip;
-
-	for (ksp = kc->kc_chain; ksp; ksp = ksp->ks_next) {
-
-		if (ksp->ks_type != KSTAT_TYPE_IO ||
-		    strcmp(ksp->ks_class, "disk") != 0)
-			continue;
-		prevdisk = disk;
-		if (disk->next)
-			disk = disk->next;
-		else {
-			safe_zalloc((void **)&disk->next,
-			    sizeof (struct diskinfo), 0);
-			disk = disk->next;
-			disk->next = NULLDISK;
-		}
-		disk->ks = ksp;
-		memset((void *)&disk->kios, 0, sizeof (kstat_io_t));
-		disk->kios.wlastupdate = disk->ks->ks_crtime;
-		disk->kios.rlastupdate = disk->ks->ks_crtime;
-
-		/*
-		 * Insertion sort on (ks_module, ks_instance, ks_name)
-		 */
-		comp = &zerodisk;
-		while (kscmp(disk->ks, comp->next->ks) > 0)
-			comp = comp->next;
-		if (prevdisk != comp) {
-			prevdisk->next = disk->next;
-			disk->next = comp->next;
-			comp->next = disk;
-			disk = prevdisk;
-		}
-		ndisks++;
-	}
-	/*
-	 * Put a snip in the linked list of diskinfos.  The idea:
-	 * If there was a state change such that now there are fewer
-	 * disks, we snip the list and retain the tail, rather than
-	 * freeing it.  At the next state change, we clip the tail back on.
-	 * This prevents a lot of malloc/free activity, and it's simpler.
-	 */
-	lastdisk = disk;
-	snip = disk->next;
-	disk->next = NULLDISK;
-
-	firstdisk = zerodisk.next;
-
-	if (ndisks > stats_s4.dk_xfer.dk_xfer_len) {
-		stats_s4.dk_xfer.dk_xfer_len = ndisks;
-		safe_zalloc((void **)&stats_s4.dk_xfer.dk_xfer_val,
-			ndisks * sizeof (int), 1);
-	}
-}
-
-static int
-diskinfo_load(void)
-{
-	struct diskinfo *disk;
-	int i;
-
-	for (disk = firstdisk, i = 0; disk; disk = disk->next, i++) {
-		if (kstat_read(kc, disk->ks, (void *)&disk->kios) == -1)
-			return (1);
-		stats_s4.dk_xfer.dk_xfer_val[i] = disk->kios.reads +
-			disk->kios.writes;
-	}
-	return (0);
-}
-
-static void
-init_net(void)
-{
-	static int sd;
-	mib_item_t *item;
-	mib2_ipAddrEntry_t *ap;
-	char namebuf[KSTAT_STRLEN];
-	struct netinfo *net, *prevnet, *comp;
-	kstat_t *ksp;
-
-	if (sd) {
-		close(sd);
-	}
-	while (netstat_item) {
-		item = netstat_item;
-		netstat_item = netstat_item->next_item;
-		if (item->valp) {
-			free(item->valp);
-		}
-		free(item);
-	}
-	sd = mibopen();
-	if (sd == -1) {
-#ifdef DEBUG
-		fprintf(stderr, "mibopen() failed\n");
-#endif
-		sd = 0;
-	} else {
-		if ((netstat_item = mibget(sd)) == NULL) {
-#ifdef DEBUG
-			fprintf(stderr, "mibget() failed\n");
-#endif
-			close(sd);
-			sd = 0;
-		}
-	}
-#ifdef DEBUG
-	fprintf(stderr, "mibget returned item: %x\n", netstat_item);
-#endif
-
-	nnets = 0;
-	net = &zeronet;
-
-	if (netsnip)
-		lastnet->next = netsnip;
-
-	for (item = netstat_item; item; item = item->next_item) {
-#ifdef DEBUG_MIB
-		fprintf(stderr, "\n--- Item %x ---\n", item);
-		fprintf(stderr,
-		"Group = %d, mib_id = %d, length = %d, valp = 0x%x\n",
-		item->group, item->mib_id, item->length,
-		item->valp);
-#endif
-		if (item->group != MIB2_IP || item->mib_id != MIB2_IP_20)
-			continue;
-		ap = (mib2_ipAddrEntry_t *)item->valp;
-		for (; (char *)ap < item->valp + item->length; ap++) {
-
-			octetstr(namebuf, &ap->ipAdEntIfIndex, 'a');
-#ifdef DEBUG
-			fprintf(stderr, "%s ", namebuf);
-#endif
-			if (strlen(namebuf) == 0)
-				continue;
-			/*
-			 * We found a device of interest.
-			 * Now, let's see if there's a kstat for it.
-			 * First we try to query the "link" kstats in case
-			 * the link is renamed. If that fails, fallback
-			 * to legacy ktats for those non-GLDv3 links.
-			 */
-			if (((ksp = kstat_lookup(kc, "link", 0, namebuf))
-			    == NULL) && ((ksp = kstat_lookup(kc, NULL, -1,
-			    namebuf)) == NULL)) {
-				continue;
-			}
-			if (ksp->ks_type != KSTAT_TYPE_NAMED)
-				continue;
-			if (kstat_read(kc, ksp, NULL) == -1)
-				continue;
-			prevnet = net;
-			if (net->next)
-				net = net->next;
-			else {
-				safe_zalloc((void **)&net->next,
-					sizeof (struct netinfo), 0);
-				net = net->next;
-				net->next = NULLNET;
-			}
-			net->ks = ksp;
-			net->ipackets	= kstat_data_lookup(net->ks,
-				"ipackets");
-			net->opackets	= kstat_data_lookup(net->ks,
-				"opackets");
-			net->ierrors	= kstat_data_lookup(net->ks,
-				"ierrors");
-			net->oerrors	= kstat_data_lookup(net->ks,
-				"oerrors");
-			net->collisions	= kstat_data_lookup(net->ks,
-				"collisions");
-			/*
-			 * Insertion sort on the name
-			 */
-			comp = &zeronet;
-			while (strcmp(net->ks->ks_name,
-			    comp->next->ks->ks_name) > 0)
-				comp = comp->next;
-			if (prevnet != comp) {
-				prevnet->next = net->next;
-				net->next = comp->next;
-				comp->next = net;
-				net = prevnet;
-			}
-			nnets++;
-		}
-#ifdef DEBUG
-		fprintf(stderr, "\n");
-#endif
-	}
-	/*
-	 * Put a snip in the linked list of netinfos.  The idea:
-	 * If there was a state change such that now there are fewer
-	 * nets, we snip the list and retain the tail, rather than
-	 * freeing it.  At the next state change, we clip the tail back on.
-	 * This prevents a lot of malloc/free activity, and it's simpler.
-	 */
-	lastnet = net;
-	netsnip = net->next;
-	net->next = NULLNET;
-
-	firstnet = zeronet.next;
-}
-
-static int
-netinfo_load(void)
-{
-	struct netinfo *net;
-
-	if (netstat_item == NULL) {
-#ifdef DEBUG
-		fprintf(stderr, "No net stats\n");
-#endif
-		return (0);
-	}
-
-	stats_s4.if_ipackets =
-	stats_s4.if_opackets =
-	stats_s4.if_ierrors =
-	stats_s4.if_oerrors =
-	stats_s4.if_collisions = 0;
-
-	for (net = firstnet; net; net = net->next) {
-		if (kstat_read(kc, net->ks, NULL) == -1)
-			return (1);
-		if (net->ipackets)
-			stats_s4.if_ipackets	+= net->ipackets->value.ul;
-		if (net->opackets)
-			stats_s4.if_opackets	+= net->opackets->value.ul;
-		if (net->ierrors)
-			stats_s4.if_ierrors	+= net->ierrors->value.ul;
-		if (net->oerrors)
-			stats_s4.if_oerrors	+= net->oerrors->value.ul;
-		if (net->collisions)
-			stats_s4.if_collisions	+= net->collisions->value.ul;
-	}
-#ifdef DEBUG
-	fprintf(stderr,
-	    "ipackets: %d opackets: %d ierrors: %d oerrors: %d colls: %d\n",
-		stats_s4.if_ipackets,
-		stats_s4.if_opackets,
-		stats_s4.if_ierrors,
-		stats_s4.if_oerrors,
-		stats_s4.if_collisions);
-#endif
-	return (0);
-}
-
-static void
-kstat_copy(kstat_t *src, kstat_t *dst, int fr)
-{
-	if (fr)
-		free(dst->ks_data);
-	*dst = *src;
-	if (src->ks_data != NULL) {
-		safe_zalloc(&dst->ks_data, src->ks_data_size, 0);
-		(void) memcpy(dst->ks_data, src->ks_data, src->ks_data_size);
-	} else {
-		dst->ks_data = NULL;
-		dst->ks_data_size = 0;
-	}
-}
--- old/usr/src/cmd/rpcsvc/rstat_v2.x	2017-05-26 19:11:12.117864050 -0400
+++ /dev/null	2017-05-26 19:11:12.000000000 -0400
@@ -1,86 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-%/*
-% * Version 2 rstat; for backwards compatibility only.
-% */
-
-%/*
-% * Copyright (c) 1985, 1990, 1991 by Sun Microsystems, Inc.
-% */
-
-%/* from rstat_v2.x */
-
-#ifdef RPC_HDR
-%
-%#pragma ident	"%Z%%M%	%I%	%E% SMI"
-%
-#endif
-
-const RSTAT_V2_CPUSTATES = 4;
-const RSTAT_V2_DK_NDRIVE = 4;
-
-/*
- * the cpu stat values
- */
-
-const RSTAT_V2_CPU_USER = 0;
-const RSTAT_V2_CPU_NICE = 1;
-const RSTAT_V2_CPU_SYS = 2;
-const RSTAT_V2_CPU_IDLE = 3;
-
-/*
- * GMT since 0:00, January 1, 1970
- */
-struct rstat_v2_timeval {
-	int tv_sec;	/* seconds */
-	int tv_usec;	/* and microseconds */
-};
-
-struct statsswtch {				/* RSTATVERS_SWTCH */
-	int cp_time[RSTAT_V2_CPUSTATES];
-	int dk_xfer[RSTAT_V2_DK_NDRIVE];
-	int v_pgpgin;	/* these are cumulative sum */
-	int v_pgpgout;
-	int v_pswpin;
-	int v_pswpout;
-	int v_intr;
-	int if_ipackets;
-	int if_ierrors;
-	int if_oerrors;
-	int if_collisions;
-	int v_swtch;
-	int avenrun[3];
-	rstat_v2_timeval boottime;
-};
-
-program RSTATPROG {
-	/*
-	 * Does not have current time
-	 */
-	version RSTATVERS_SWTCH {
-		statsswtch
-		RSTATPROC_STATS(void) = 1;
-
-		unsigned int
-		RSTATPROC_HAVEDISK(void) = 2;
-	} = 2;
-} = 100001;
--- old/usr/src/cmd/rpcsvc/rup.c	2017-05-26 19:11:12.455617129 -0400
+++ /dev/null	2017-05-26 19:11:12.000000000 -0400
@@ -1,541 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-/*
- * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <netdb.h>
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <rpc/rpc.h>
-#include <netdir.h>
-#include <rpcsvc/rstat.h>
-#include <rpc/pmap_clnt.h>
-
-
-#define	MACHINELEN	15	/* length of machine name printed out */
-#define	MACHINELENMAX	128	/* maximum machine name length */
-#define	AVENSIZE	(3 * sizeof (long))
-#define	SLOTS	256
-
-int machinecmp();
-int loadcmp();
-int uptimecmp();
-static int collectnames();
-int singlehost();		/* returns 1 if rup of given host fails */
-void printsinglehosts();
-void printnames();
-static void putline();
-int netbufeq(struct netbuf *ap, struct netbuf *bp);
-void usage(void);
-
-struct entry {
-	struct netconfig *nconf;
-	struct netbuf *addr;
-	char *machine;
-	struct timeval boottime;
-	time_t curtime;
-	long avenrun[3];
-};
-
-int total_entries;
-int curentry;
-struct entry *entry;
-int vers;			/* which version did the broadcasting */
-int lflag;			/* load: sort by load average */
-int tflag;			/* time: sort by uptime average */
-int hflag;			/* host: sort by machine name */
-int dflag;			/* debug: list only first n machines */
-int debug;
-
-int
-main(int argc, char *argv[])
-{
-	statsvar sv;
-	statstime st;
-	int single, nfailed;
-	enum clnt_stat bstat;
-
-	/*
-	 * set number of slots to be 256 to begin with,
-	 * this is large enough for most subnets but not all
-	 */
-
-	curentry = 0;
-	total_entries = SLOTS;
-	entry = malloc(sizeof (struct entry) * total_entries);
-	single = nfailed = 0;
-	while (argc > 1) {
-		if (argv[1][0] != '-') {
-			single++;
-			nfailed += singlehost(argv[1]);
-		} else {
-			switch (argv[1][1]) {
-
-			case 'l':
-				lflag++;
-				break;
-			case 't':
-				tflag++;
-				break;
-			case 'h':
-				hflag++;
-				break;
-			case 'd':
-				dflag++;
-				if (argc < 3)
-					usage();
-				debug = atoi(argv[2]);
-				argc--;
-				argv++;
-				break;
-			default:
-				usage();
-			}
-		}
-		argv++;
-		argc--;
-	}
-	if (single > 0) {
-		if (hflag || tflag || lflag)
-			printsinglehosts();
-		if (nfailed == single) {
-			free(entry);
-			exit(1);	/* all hosts we tried failed */
-		} else {
-			free(entry);
-			exit(0);
-		}
-
-	}
-	if (hflag || tflag || lflag) {
-		printf("collecting responses... ");
-		fflush(stdout);
-	}
-
-	sv.cp_time.cp_time_val = (int *)NULL;
-	sv.dk_xfer.dk_xfer_val = (int *)NULL;
-
-	/*
-	 * Null out pointers in the statsvar struct
-	 * so that we don't follow a random pointer
-	 * somewhere when we get our results back.
-	 * Set lengths to zero so we don't allocate
-	 * some random amount of space we don't need
-	 * (in the case where the reply was program
-	 *  not registered).
-	 */
-	sv.cp_time.cp_time_len = 0;
-	sv.cp_time.cp_time_val = (int *)NULL;
-	sv.dk_xfer.dk_xfer_len = 0;
-	sv.dk_xfer.dk_xfer_val = (int *)NULL;
-
-	vers = RSTATVERS_VAR;
-	bstat = rpc_broadcast(RSTATPROG, RSTATVERS_VAR, RSTATPROC_STATS,
-			xdr_void, NULL, xdr_statsvar, (caddr_t)&sv,
-			(resultproc_t)collectnames, (char *)0);
-#ifdef TESTING
-	if (bstat != RPC_SUCCESS)
-		printf("rpc_broadcast for rstat version %d returned %s\n",
-			vers, clnt_sperrno(bstat));
-	fprintf(stderr, "starting second round of broadcasting\n");
-#endif
-	vers = RSTATVERS_TIME;
-	bstat = rpc_broadcast(RSTATPROG, RSTATVERS_TIME, RSTATPROC_STATS,
-			xdr_void, NULL, xdr_statstime, (caddr_t)&st,
-			(resultproc_t)collectnames, (char *)0);
-#ifdef	TESTING
-	if (bstat != RPC_SUCCESS)
-		printf("rpc_broadcast for rstat version %d returned %s\n",
-			vers, clnt_sperrno(bstat));
-#endif
-	if (hflag || tflag || lflag)
-		printnames();
-
-
-
-	free(entry);
-	return (0);
-}
-
-int
-singlehost(host)
-	char *host;
-{
-	static int debugcnt;
-	enum clnt_stat err;
-	statstime st;
-	statsvar sw_var;
-	bool_t is_var_vers = FALSE;
-
-
-	if (curentry >= total_entries) {
-		struct entry *tmp;
-
-		total_entries += SLOTS;
-		tmp = realloc((struct entry *)entry, sizeof (struct entry)
-						* total_entries);
-		if (tmp == NULL) {
-			return (1);
-		}
-		entry = tmp;
-	}
-
-	sw_var.cp_time.cp_time_val = (int *)NULL;
-	sw_var.dk_xfer.dk_xfer_val = (int *)NULL;
-	err = (enum clnt_stat)callrpc(host, RSTATPROG, RSTATVERS_VAR,
-			RSTATPROC_STATS, xdr_void, 0, xdr_statsvar, &sw_var);
-	if (err == RPC_SUCCESS) {
-		is_var_vers = TRUE;
-	} else if (err == RPC_PROGVERSMISMATCH) {
-		err = (enum clnt_stat)callrpc(host, RSTATPROG, RSTATVERS_TIME,
-			RSTATPROC_STATS, xdr_void, 0, xdr_statstime, &st);
-		if (err != RPC_SUCCESS)
-			goto error;
-	} else
-		goto error;
-
-	debugcnt++;
-	if (!hflag && !lflag && !tflag) {
-		printf("%*.*s  ", MACHINELEN, MACHINELEN, host);
-		if (is_var_vers == TRUE)
-			putline(sw_var.curtime.tv_sec, sw_var.boottime,
-				sw_var.avenrun);
-		else
-			putline(st.curtime.tv_sec, st.boottime, st.avenrun);
-		return (0);		/* success */
-	} else {
-		entry[curentry].machine = host;
-		if (is_var_vers == FALSE) { /* RSTATVERS_TIME */
-			entry[curentry].boottime.tv_sec = st.boottime.tv_sec;
-			entry[curentry].boottime.tv_usec =
-				st.boottime.tv_usec;
-			entry[curentry].curtime = st.curtime.tv_sec;
-			memcpy(entry[curentry].avenrun, st.avenrun, AVENSIZE);
-		} else { /* RSTATVERS_VAR */
-			entry[curentry].boottime.tv_sec =
-				sw_var.boottime.tv_sec;
-			entry[curentry].boottime.tv_usec =
-				sw_var.boottime.tv_usec;
-			entry[curentry].curtime = sw_var.curtime.tv_sec;
-			memcpy(entry[curentry].avenrun, sw_var.avenrun,
-							AVENSIZE);
-		}
-	}
-	curentry++;
-	if (dflag && debugcnt >= debug)
-		return (1);
-	return (0);
-
-error:
-	fprintf(stderr, "%*.*s: ", MACHINELEN, MACHINELEN, host);
-	clnt_perrno(err);
-	/*
-	 * clnt_perrno now prints a newline
-	 */
-	/* fprintf(stderr, "\n"); */
-	return (1);		/* a failure */
-}
-
-static void
-putline(now, boottime, avenrun)
-	time_t now;
-	struct timeval boottime;
-	long avenrun[];
-{
-	int uptime, days, hrs, mins, i;
-
-	uptime = now - boottime.tv_sec;
-	uptime += 30;
-	if (uptime < 0)		/* unsynchronized clocks */
-		uptime = 0;
-	days = uptime / (60*60*24);
-	uptime %= (60*60*24);
-	hrs = uptime / (60*60);
-	uptime %= (60*60);
-	mins = uptime / 60;
-
-	printf("  up");
-	if (days > 0)
-		printf(" %2d day%s", days, days > 1 ? "s," : ", ");
-	else
-		printf("         ");
-	if (hrs > 0)
-		printf(" %2d:%02d,  ", hrs, mins);
-	else
-		printf(" %2d min%s", mins, mins > 1 ? "s," : ", ");
-
-	/*
-	 * Print 1, 5, and 15 minute load averages.
-	 * (Found by looking in kernel for avenrun).
-	 */
-	printf("  load average:");
-	for (i = 0; i < (AVENSIZE / sizeof (avenrun[0])); i++) {
-		if (i > 0)
-			printf(",");
-		printf(" %.2f", (double)avenrun[i]/FSCALE);
-	}
-	printf("\n");
-}
-
-static int
-collectnames(resultsp, taddr, nconf)
-	char *resultsp;
-	struct t_bind *taddr;
-	struct netconfig *nconf;
-{
-	static int debugcnt;
-	register struct entry *entryp, *lim;
-	statstime *st;
-	statsvar *sv;
-	struct nd_hostservlist *hs;
-	extern struct netbuf *netbufdup();
-	extern struct netconfig *netconfigdup();
-	extern int netbufeq();
-
-	/*
-	 * need to realloc more space if we have more than 256 machines
-	 * that responded to the broadcast
-	 */
-
-	if (curentry >= total_entries) {
-		struct entry *tmp;
-
-		total_entries += SLOTS;
-		tmp = realloc((struct entry *)entry, sizeof (struct entry)
-						* total_entries);
-		if (tmp == NULL) {
-			return (1);
-		}
-		entry = tmp;
-	}
-	/*
-	 * weed out duplicates
-	 */
-	lim = entry + curentry;
-	for (entryp = entry; entryp < lim; entryp++)
-		if (netbufeq(&taddr->addr, entryp->addr))
-			return (0);
-
-	if (vers == RSTATVERS_TIME) {
-		st = (statstime *)resultsp;
-	} else if (vers == RSTATVERS_VAR) {
-		sv = (statsvar *)resultsp;
-	} else {
-		return (0);	/* we don't handle this version */
-	}
-	debugcnt++;
-	entry[curentry].nconf = netconfigdup(nconf);
-	entry[curentry].addr = netbufdup(&taddr->addr);
-
-	/*
-	 * if raw, print this entry out immediately
-	 * otherwise store for later sorting
-	 */
-	if (!hflag && !lflag && !tflag) {
-		if (netdir_getbyaddr(nconf, &hs, &taddr->addr) == ND_OK)
-			printf("%*.*s  ", MACHINELEN, MACHINELEN,
-				hs->h_hostservs->h_host);
-		else {
-			char *uaddr = taddr2uaddr(nconf, &taddr->addr);
-
-			if (uaddr) {
-				printf("  %*.*s", MACHINELEN, MACHINELEN,
-					uaddr);
-				(void) free(uaddr);
-			} else
-				printf("  %*.*s", MACHINELEN, MACHINELEN,
-					"unknown");
-		}
-		if (vers == RSTATVERS_TIME) {
-			putline(st->curtime.tv_sec, st->boottime, st->avenrun);
-		} else if (vers == RSTATVERS_VAR) {
-			putline(sv->curtime.tv_sec, sv->boottime, sv->avenrun);
-		}
-	} else {
-		if (vers == RSTATVERS_TIME) {
-			entry[curentry].boottime.tv_sec = st->boottime.tv_sec;
-			entry[curentry].boottime.tv_usec =
-				st->boottime.tv_usec;
-			entry[curentry].curtime = st->curtime.tv_sec;
-			memcpy(entry[curentry].avenrun, st->avenrun, AVENSIZE);
-		} else if (vers == RSTATVERS_VAR) {
-			entry[curentry].boottime.tv_sec = sv->boottime.tv_sec;
-			entry[curentry].boottime.tv_usec =
-				sv->boottime.tv_usec;
-			entry[curentry].curtime = sv->curtime.tv_sec;
-			memcpy(entry[curentry].avenrun, sv->avenrun, AVENSIZE);
-		}
-	}
-	curentry++;
-	if (dflag && debugcnt >= debug)
-		return (1);
-	return (0);
-}
-
-void
-printsinglehosts()
-{
-	register int i;
-	register struct entry *ep;
-
-
-	if (hflag)
-		qsort(entry, curentry, sizeof (struct entry), machinecmp);
-	else if (lflag)
-		qsort(entry, curentry, sizeof (struct entry), loadcmp);
-	else
-		qsort(entry, curentry, sizeof (struct entry), uptimecmp);
-	for (i = 0; i < curentry; i++) {
-		ep = &entry[i];
-		printf("%*.*s  ", MACHINELEN, MACHINELEN, ep->machine);
-		putline(ep->curtime, ep->boottime, ep->avenrun);
-
-	}
-}
-
-void
-printnames()
-{
-	char buf[MACHINELENMAX+1];
-	struct nd_hostservlist *hs;
-	register int i;
-	register struct entry *ep;
-
-
-	for (i = 0; i < curentry; i++) {
-		ep = &entry[i];
-		if (netdir_getbyaddr(ep->nconf, &hs, ep->addr) == ND_OK)
-			sprintf(buf, "%s", hs->h_hostservs->h_host);
-		else {
-			char *uaddr = taddr2uaddr(ep->nconf, ep->addr);
-
-			if (uaddr) {
-				sprintf(buf, "%s", uaddr);
-				(void) free(uaddr);
-			} else
-				sprintf(buf, "%s", "unknown");
-		}
-		if (ep->machine = (char *)malloc(MACHINELENMAX + 1))
-			strcpy(ep->machine, buf);
-	}
-	printf("\n");
-	printsinglehosts();
-}
-
-int
-machinecmp(struct entry *a, struct entry *b)
-{
-	return (strcmp(a->machine, b->machine));
-}
-
-int
-uptimecmp(struct entry *a, struct entry *b)
-{
-	if (a->boottime.tv_sec != b->boottime.tv_sec)
-		return (a->boottime.tv_sec - b->boottime.tv_sec);
-	else
-		return (a->boottime.tv_usec - b->boottime.tv_usec);
-}
-
-int
-loadcmp(struct entry *a, struct entry *b)
-{
-	register int i;
-
-	for (i = 0; i < AVENSIZE / sizeof (a->avenrun[0]); i++)
-		if (a->avenrun[i] != b->avenrun[i])
-			return (a->avenrun[i] - b->avenrun[i]);
-
-	return (0);
-}
-
-struct netbuf *
-netbufdup(ap)
-	register struct netbuf	*ap;
-{
-	register struct netbuf	*np;
-
-	np = (struct netbuf *) malloc(sizeof (struct netbuf) + ap->len);
-	if (np) {
-		np->maxlen = np->len = ap->len;
-		np->buf = ((char *)np) + sizeof (struct netbuf);
-		(void) memcpy(np->buf, ap->buf, ap->len);
-	}
-	return (np);
-}
-
-struct netconfig *
-netconfigdup(onp)
-	register struct netconfig *onp;
-{
-	register int nlookupdirs;
-	register struct netconfig *nnp;
-	extern char *strdup();
-
-	nnp = (struct netconfig *)malloc(sizeof (struct netconfig));
-	if (nnp) {
-		nnp->nc_netid = strdup(onp->nc_netid);
-		nnp->nc_semantics = onp->nc_semantics;
-		nnp->nc_flag = onp->nc_flag;
-		nnp->nc_protofmly = strdup(onp->nc_protofmly);
-		nnp->nc_proto = strdup(onp->nc_proto);
-		nnp->nc_device = strdup(onp->nc_device);
-		nnp->nc_nlookups = onp->nc_nlookups;
-		if (onp->nc_nlookups == 0)
-			nnp->nc_lookups = (char **)0;
-		else {
-			register int i;
-
-			nnp->nc_lookups = (char **)malloc(onp->nc_nlookups *
-			    sizeof (char *));
-			if (nnp->nc_lookups)
-				for (i = 0; i < onp->nc_nlookups; i++)
-					nnp->nc_lookups[i] =
-						strdup(onp->nc_lookups[i]);
-		}
-	}
-
-	return (nnp);
-}
-
-int
-netbufeq(struct netbuf *ap, struct netbuf *bp)
-{
-	return (ap->len == bp->len && !memcmp(ap->buf, bp->buf, ap->len));
-}
-
-void
-usage(void)
-{
-	fprintf(stderr, "Usage: rup [-h] [-l] [-t] [host ...]\n");
-	free(entry);
-	exit(1);
-}
--- old/usr/src/cmd/rpcsvc/rusers.c	2017-05-26 19:11:12.805866798 -0400
+++ /dev/null	2017-05-26 19:11:12.000000000 -0400
@@ -1,652 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-/*
- * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
-/*
- * University Copyright- Copyright (c) 1982, 1986, 1988
- * The Regents of the University of California
- * All Rights Reserved
- *
- * University Acknowledgment- Portions of this document are derived from
- * software developed by the University of California, Berkeley, and its
- * contributors.
- */
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <netconfig.h>
-#include <netdir.h>
-#include <rpc/rpc.h>
-#include <rpcsvc/rusers.h>
-#include <string.h>
-#include <limits.h>
-
-#define	NMAX	12		/* These are used as field width specifiers */
-#define	LMAX	8		/* when printing.			    */
-#define	HMAX	16		/* "Logged in" host name. */
-
-#define	MACHINELEN 16		/* length of machine name printed out */
-#define	NUMENTRIES 256
-#define	min(a, b) ((a) < (b) ? (a) : (b))
-
-struct entry {
-	int cnt;
-	int idle;		/* set to INT_MAX if not present */
-	char *machine;
-	utmp_array users;
-};
-
-static int curentry;
-static int total_entries;
-static struct entry *entry;
-static int hflag;		/* host: sort by machine name */
-static int iflag;		/* idle: sort by idle time */
-static int uflag;		/* users: sort by number of users */
-static int lflag;		/* print out long form */
-static int aflag;		/* all: list all machines */
-static int dflag;		/* debug: list only first n machines */
-static int sorted;
-static int debug;
-static int debugcnt;
-static char *nettype;
-
-static int hcompare(const struct entry *, const struct entry *);
-static int icompare(const struct entry *, const struct entry *);
-static int ucompare(const struct entry *, const struct entry *);
-static int print_info(struct utmpidlearr *, const char *);
-static int print_info_3(utmp_array *, const char *);
-static int collectnames(void *, struct netbuf *, struct netconfig *);
-static int collectnames_3(void *, struct netbuf *, struct netconfig *);
-static void singlehost(char *);
-static void printnames(void);
-static void putline_2(char *, struct utmpidle *);
-static void putline_3(char *, rusers_utmp *);
-static void prttime(uint_t, char *);
-static void usage(void);
-
-/*
- * rusers [-ahilu] [host...]
- */
-int
-main(int argc, char *argv[])
-{
-	int c;
-	uint_t errflag = 0;
-	uint_t single = 0;
-	struct utmpidlearr utmpidlearr;
-	utmp_array	utmp_array_res;
-
-	curentry = 0;
-	total_entries = NUMENTRIES;
-	entry = malloc(sizeof (struct entry) * total_entries);
-
-	while ((c = getopt(argc, argv, ":ad:hilun:")) != -1) {
-		switch (c) {
-		case 'a':
-			aflag++;
-			break;
-		case 'd':
-			dflag++;
-			debug = atoi(optarg);
-			(void) printf("Will collect %d responses.\n", debug);
-			break;
-		case 'h':
-			hflag++;
-			sorted++;
-			if (iflag || uflag)
-				errflag++;
-			break;
-		case 'i':
-			iflag++;
-			sorted++;
-			if (hflag || uflag)
-				errflag++;
-			break;
-		case 'u':
-			uflag++;
-			sorted++;
-			if (hflag || iflag)
-				errflag++;
-			break;
-		case 'l':
-			lflag++;
-			break;
-		case ':':	/* required operand missing */
-			errflag++;
-			break;
-		case 'n':
-			nettype = optarg;
-			break;
-		default:
-		case '?':	/* Unrecognized option */
-			errflag++;
-			break;
-		}
-	}
-	if (errflag)
-		usage();
-
-	for (; optind < argc; optind++) {
-		single++;
-		singlehost(argv[optind]);
-	}
-	if (single) {
-		if (sorted)
-			printnames();
-		free(entry);
-		exit(0);
-	}
-
-	if (sorted) {
-		(void) printf("Collecting responses...\n");
-		(void) fflush(stdout);
-	}
-	utmp_array_res.utmp_array_val = NULL;
-	utmp_array_res.utmp_array_len = 0;
-	(void) printf("Sending broadcast for rusersd protocol version 3...\n");
-	(void) rpc_broadcast(RUSERSPROG, RUSERSVERS_3,
-		RUSERSPROC_NAMES, (xdrproc_t)xdr_void, NULL,
-		(xdrproc_t)xdr_utmp_array, (char *)&utmp_array_res,
-		(resultproc_t)collectnames_3, nettype);
-	utmpidlearr.uia_arr = NULL;
-	(void) printf("Sending broadcast for rusersd protocol version 2...\n");
-	(void) rpc_broadcast(RUSERSPROG, RUSERSVERS_IDLE,
-		RUSERSPROC_NAMES, (xdrproc_t)xdr_void, NULL,
-		(xdrproc_t)xdr_utmpidlearr, (char *)&utmpidlearr,
-		(resultproc_t)collectnames, nettype);
-
-	if (sorted)
-		printnames();
-
-	free(entry);
-	return (0);
-}
-
-static void
-singlehost(char *name)
-{
-	enum clnt_stat err;
-	struct utmpidlearr utmpidlearr;
-	utmp_array	utmp_array_res;
-
-	if (curentry >= total_entries) {
-		struct entry *tmp;
-
-		total_entries += NUMENTRIES;
-		if ((tmp = realloc(entry, sizeof (struct entry)
-						* total_entries)) == NULL)
-			return;
-		entry = tmp;
-	}
-	utmp_array_res.utmp_array_val = NULL;
-	utmp_array_res.utmp_array_len = 0;
-	err = rpc_call(name, RUSERSPROG, RUSERSVERS_3,
-		RUSERSPROC_NAMES, (xdrproc_t)xdr_void, 0,
-		(xdrproc_t)xdr_utmp_array, (char *)&utmp_array_res,
-		nettype);
-	if (err == RPC_SUCCESS) {
-		(void) print_info_3(&utmp_array_res, name);
-		return;
-	}
-	if (err == RPC_PROGVERSMISMATCH) {
-		utmpidlearr.uia_arr = NULL;
-		err = rpc_call(name, RUSERSPROG, RUSERSVERS_IDLE,
-				RUSERSPROC_NAMES, (xdrproc_t)xdr_void, 0,
-				(xdrproc_t)xdr_utmpidlearr,
-				(char *)&utmpidlearr, nettype);
-	}
-	if (err != RPC_SUCCESS) {
-		(void) fprintf(stderr, "%s: ", name);
-		clnt_perrno(err);
-		return;
-	}
-	(void) print_info(&utmpidlearr, name);
-}
-
-/*
- * Collect responses from RUSERSVERS_IDLE broadcast, convert to
- * RUSERSVERS_3 format, and store in entry database.
- */
-static int
-collectnames(void *resultsp, struct netbuf *raddrp, struct netconfig *nconf)
-{
-	struct utmpidlearr utmpidlearr;
-	struct entry *entryp, *lim;
-	struct nd_hostservlist *hs;
-	char host[MACHINELEN + 1];
-
-	utmpidlearr = *(struct utmpidlearr *)resultsp;
-	if (utmpidlearr.uia_cnt < 1 && !aflag)
-		return (0);
-
-	if (netdir_getbyaddr(nconf, &hs, raddrp)) {
-#ifdef DEBUG
-		netdir_perror("netdir_getbyaddr");
-#endif
-		/* netdir routine couldn't resolve addr;just print out uaddr */
-		(void) sprintf(host, "%.*s", MACHINELEN,
-						taddr2uaddr(nconf, raddrp));
-	} else {
-		(void) sprintf(host, "%.*s", MACHINELEN,
-						hs->h_hostservs->h_host);
-		netdir_free((char *)hs, ND_HOSTSERVLIST);
-	}
-	/*
-	 * need to realloc more space if we have more than 256 machines
-	 * that respond to broadcast
-	 */
-	if (curentry >= total_entries) {
-		struct entry *tmp;
-
-		total_entries += NUMENTRIES;
-		if ((tmp = realloc(entry, sizeof (struct entry)
-						* total_entries)) == NULL)
-			return (1);
-		entry = tmp;
-	}
-
-
-	/*
-	 * weed out duplicates
-	 */
-	lim = entry + curentry;
-	for (entryp = entry; entryp < lim; entryp++) {
-		if (strcmp(entryp->machine, host) == 0)
-			return (0);
-	}
-	return (print_info((struct utmpidlearr *)resultsp, host));
-}
-
-static int
-print_info(struct utmpidlearr *utmpidlearrp, const char *name)
-{
-	utmp_array *iconvert;
-	int i, cnt, minidle;
-	char host[MACHINELEN + 1];
-	char username[NMAX + 1];
-
-	cnt = utmpidlearrp->uia_cnt;
-	(void) sprintf(host, "%.*s", MACHINELEN, name);
-
-	/*
-	 * if raw, print this entry out immediately
-	 * otherwise store for later sorting
-	 */
-	if (!sorted) {
-		if (lflag && (cnt > 0))
-			for (i = 0; i < cnt; i++)
-				putline_2(host, utmpidlearrp->uia_arr[i]);
-		else {
-		    (void) printf("%-*.*s", MACHINELEN, MACHINELEN, host);
-		    for (i = 0; i < cnt; i++) {
-			(void) strlcpy(username,
-				    utmpidlearrp->uia_arr[i]->ui_utmp.ut_name,
-				    NMAX + 1);
-			(void) printf(" %.*s", NMAX, username);
-		    }
-		    (void) printf("\n");
-		}
-		/* store just the name */
-		entry[curentry].machine = malloc(MACHINELEN + 1);
-		if (entry[curentry].machine == NULL) {
-			(void) fprintf(stderr, "Ran out of memory - exiting\n");
-			exit(1);
-		}
-		(void) strlcpy(entry[curentry].machine, name, MACHINELEN + 1);
-		entry[curentry++].cnt = 0;
-		if (dflag && (++debugcnt >= debug))
-			return (1);
-		return (0);
-	}
-	entry[curentry].machine = malloc(MACHINELEN + 1);
-	if (entry[curentry].machine == NULL) {
-		(void) fprintf(stderr, "Ran out of memory - exiting\n");
-		exit(1);
-	}
-	(void) strlcpy(entry[curentry].machine, name, MACHINELEN + 1);
-	entry[curentry].cnt = cnt;
-	iconvert = &entry[curentry].users;
-	iconvert->utmp_array_len = cnt;
-	iconvert->utmp_array_val = malloc(cnt * sizeof (rusers_utmp));
-	minidle = INT_MAX;
-	for (i = 0; i < cnt; i++) {
-		iconvert->utmp_array_val[i].ut_user =
-			strdup(utmpidlearrp->uia_arr[i]->ui_utmp.ut_name);
-		iconvert->utmp_array_val[i].ut_line =
-			strdup(utmpidlearrp->uia_arr[i]->ui_utmp.ut_line);
-		iconvert->utmp_array_val[i].ut_host =
-			strdup(utmpidlearrp->uia_arr[i]->ui_utmp.ut_host);
-		iconvert->utmp_array_val[i].ut_time =
-			utmpidlearrp->uia_arr[i]->ui_utmp.ut_time;
-		iconvert->utmp_array_val[i].ut_idle =
-			utmpidlearrp->uia_arr[i]->ui_idle;
-		minidle = min(minidle, utmpidlearrp->uia_arr[i]->ui_idle);
-	}
-	entry[curentry].idle = minidle;
-	curentry++;
-	if (dflag && (++debugcnt >= debug))
-		return (1);
-	return (0);
-}
-
-
-/*
- * Collect responses from RUSERSVERS_3 broadcast.
- */
-static int
-collectnames_3(void *resultsp, struct netbuf *raddrp, struct netconfig *nconf)
-{
-	utmp_array *uap;
-	struct entry *entryp, *lim;
-	struct nd_hostservlist *hs;
-	char host[MACHINELEN + 1];
-
-	uap = (utmp_array *)resultsp;
-	if (uap->utmp_array_len < 1 && !aflag)
-		return (0);
-
-	if (netdir_getbyaddr(nconf, &hs, raddrp)) {
-#ifdef DEBUG
-	netdir_perror("netdir_getbyaddr");
-#endif
-		/* netdir routine couldn't resolve addr;just print out uaddr */
-		(void) sprintf(host, "%.*s", MACHINELEN,
-						taddr2uaddr(nconf, raddrp));
-	} else {
-		(void) sprintf(host, "%.*s", MACHINELEN,
-						hs->h_hostservs->h_host);
-		netdir_free((char *)hs, ND_HOSTSERVLIST);
-	}
-
-	/*
-	 * need to realloc more space if we have more than 256 machines
-	 * that respond to broadcast
-	 */
-	if (curentry >= total_entries) {
-		struct entry *tmp;
-
-		total_entries += NUMENTRIES;
-		if ((tmp = realloc(entry, sizeof (struct entry)
-						* total_entries)) == NULL)
-			return (1);
-		entry = tmp;
-	}
-
-
-	/*
-	 * weed out duplicates
-	 */
-	lim = entry + curentry;
-	for (entryp = entry; entryp < lim; entryp++) {
-		if (strcmp(entryp->machine, host) == 0)
-			return (0);
-	}
-	return (print_info_3(uap, host));
-}
-
-static int
-print_info_3(utmp_array *uap, const char *name)
-{
-	int i, cnt, minidle;
-	char host[MACHINELEN + 1];
-
-	cnt = uap->utmp_array_len;
-
-	(void) sprintf(host, "%.*s", MACHINELEN, name);
-
-	/*
-	 * if raw, print this entry out immediately
-	 * otherwise store for later sorting
-	 */
-	if (!sorted) {
-		if (lflag && (cnt > 0))
-			for (i = 0; i < cnt; i++)
-				putline_3(host, &uap->utmp_array_val[i]);
-		else {
-			(void) printf("%-*.*s", MACHINELEN, MACHINELEN, host);
-			for (i = 0; i < cnt; i++)
-				(void) printf(" %.*s", NMAX,
-				    uap->utmp_array_val[i].ut_user);
-			(void) printf("\n");
-		}
-		/* store just the name */
-		entry[curentry].machine = malloc(MACHINELEN + 1);
-		if (entry[curentry].machine == NULL) {
-			(void) fprintf(stderr, "Ran out of memory - exiting\n");
-			exit(1);
-		}
-		(void) strlcpy(entry[curentry].machine, name, MACHINELEN + 1);
-		entry[curentry++].cnt = 0;
-		if (dflag && (++debugcnt >= debug))
-			return (1);
-		return (0);
-	}
-
-	entry[curentry].machine = malloc(MACHINELEN + 1);
-	if (entry[curentry].machine == NULL) {
-		(void) fprintf(stderr, "Ran out of memory - exiting\n");
-		exit(1);
-	}
-	(void) strlcpy(entry[curentry].machine, name, MACHINELEN + 1);
-	entry[curentry].cnt = cnt;
-	entry[curentry].users.utmp_array_len = cnt;
-	entry[curentry].users.utmp_array_val = malloc(cnt *
-		sizeof (rusers_utmp));
-	minidle = INT_MAX;
-	for (i = 0; i < cnt; i++) {
-		entry[curentry].users.utmp_array_val[i].ut_user =
-			strdup(uap->utmp_array_val[i].ut_user);
-		entry[curentry].users.utmp_array_val[i].ut_line =
-			strdup(uap->utmp_array_val[i].ut_line);
-		entry[curentry].users.utmp_array_val[i].ut_host =
-			strdup(uap->utmp_array_val[i].ut_host);
-		entry[curentry].users.utmp_array_val[i].ut_time =
-			uap->utmp_array_val[i].ut_time;
-		entry[curentry].users.utmp_array_val[i].ut_idle =
-			uap->utmp_array_val[i].ut_idle;
-		minidle = min(minidle, uap->utmp_array_val[i].ut_idle);
-	}
-	entry[curentry].idle = minidle;
-	curentry++;
-	if (dflag && (++debugcnt >= debug))
-		return (1);
-	return (0);
-}
-
-static void
-printnames(void)
-{
-	int i, j;
-	int (*compare)(const void *, const void *);
-
-	/* the name of the machine should already be in the structure */
-	if (iflag)
-		compare = (int (*)(const void *, const void *))icompare;
-	else if (hflag)
-		compare = (int (*)(const void *, const void *))hcompare;
-	else
-		compare = (int (*)(const void *, const void *))ucompare;
-	qsort(entry, curentry, sizeof (struct entry), compare);
-	for (i = 0; i < curentry; i++) {
-		if (!lflag || (entry[i].cnt < 1)) {
-			(void) printf("%-*.*s", MACHINELEN,
-					MACHINELEN, entry[i].machine);
-			for (j = 0; j < entry[i].cnt; j++)
-				(void) printf(" %.*s", NMAX,
-				    entry[i].users.utmp_array_val[j].ut_user);
-			(void) printf("\n");
-		} else {
-			for (j = 0; j < entry[i].cnt; j++)
-				putline_3(entry[i].machine,
-					&entry[i].users.utmp_array_val[j]);
-		}
-	}
-}
-
-static int
-hcompare(const struct entry *a, const struct entry *b)
-{
-	return (strcmp(a->machine, b->machine));
-}
-
-static int
-ucompare(const struct entry *a, const struct entry *b)
-{
-	return (b->cnt - a->cnt);
-}
-
-static int
-icompare(const struct entry *a, const struct entry *b)
-{
-	return (a->idle - b->idle);
-}
-
-static void
-putline_2(char *host, struct utmpidle *uip)
-{
-	char *cbuf;
-	struct ru_utmp *up;
-	char buf[100];
-
-	up = &uip->ui_utmp;
-#define	NAMEMAX	((sizeof (up->ut_name) < NMAX) ? NMAX : sizeof (up->ut_name))
-#define	NAMEMIN	((sizeof (up->ut_name) > NMAX) ? NMAX : sizeof (up->ut_name))
-	/* Try and align this up nicely */
-#define	LINEMAX	sizeof (up->ut_line)
-#define	HOSTMAX	sizeof (up->ut_host)
-	/*
-	 * We copy the strings into a buffer because they aren't strictly
-	 * speaking strings but byte arrays (and they may not have a
-	 * terminating NULL.
-	 */
-
-	(void) strncpy(buf, up->ut_name, NAMEMAX);
-	buf[NAMEMIN] = '\0';
-	(void) printf("%-*.*s ", NAMEMAX, NAMEMAX, buf);
-
-	(void) strcpy(buf, host);
-	(void) strcat(buf, ":");
-	(void) strncat(buf, up->ut_line, LINEMAX);
-	buf[MACHINELEN+LINEMAX] = '\0';
-	(void) printf("%-*.*s", MACHINELEN+LINEMAX, MACHINELEN+LINEMAX, buf);
-
-	cbuf = (char *)ctime(&up->ut_time);
-	(void) printf("  %.12s  ", cbuf+4);
-	if (uip->ui_idle == INT_MAX)
-		(void) printf("    ??");
-	else
-		prttime(uip->ui_idle, "");
-	if (up->ut_host[0]) {
-		(void) strncpy(buf, up->ut_host, HOSTMAX);
-		buf[HOSTMAX] = '\0';
-		(void) printf(" (%.*s)", HOSTMAX, buf);
-	}
-	(void) putchar('\n');
-}
-
-static void
-putline_3(char *host, rusers_utmp *rup)
-{
-	char *cbuf;
-	char buf[100];
-
-	(void) printf("%-*.*s ", NMAX, NMAX, rup->ut_user);
-	(void) strcpy(buf, host);
-	(void) strcat(buf, ":");
-	(void) strncat(buf, rup->ut_line, LMAX);
-	(void) printf("%-*.*s", MACHINELEN+LMAX, MACHINELEN+LMAX, buf);
-
-	cbuf = (char *)ctime((time_t *)&rup->ut_time);
-	(void) printf("  %.12s  ", cbuf+4);
-	if (rup->ut_idle == INT_MAX)
-		(void) printf("    ??");
-	else
-		prttime(rup->ut_idle, "");
-	if (rup->ut_host[0])
-		(void) printf(" (%.*s)", HMAX, rup->ut_host);
-	(void) putchar('\n');
-}
-
-/*
- * prttime prints a time in hours and minutes.
- * The character string tail is printed at the end, obvious
- * strings to pass are "", " ", or "am".
- */
-static void
-prttime(uint_t tim, char *tail)
-{
-	int didhrs = 0;
-
-	if (tim >= 60) {
-		(void) printf("%3d:", tim/60);
-		didhrs++;
-	} else {
-		(void) printf("    ");
-	}
-	tim %= 60;
-	if (tim > 0 || didhrs) {
-		(void) printf(didhrs && tim < 10 ? "%02d" : "%2d", tim);
-	} else {
-		(void) printf("  ");
-	}
-	(void) printf("%s", tail);
-}
-
-#ifdef DEBUG
-/*
- * for debugging
- */
-int
-printit(int i)
-{
-	int j, v;
-
-	(void) printf("%12.12s: ", entry[i].machine);
-	if (entry[i].cnt) {
-		putline_3(entry[i].machine, &entry[i].users.utmp_array_val[0]);
-		for (j = 1; j < entry[i].cnt; j++) {
-			(void) printf("\t");
-			putline_3(entry[i].machine,
-				&entry[i].users.utmp_array_val[j]);
-		}
-	} else
-		(void) printf("\n");
-}
-#endif
-
-static void
-usage(void)
-{
-	(void) fprintf(stderr, "Usage: rusers [-ahilu] [host ...]\n");
-	free(entry);
-	exit(1);
-}
--- old/usr/src/cmd/rpcsvc/rusers.xml	2017-05-26 19:11:13.153928093 -0400
+++ /dev/null	2017-05-26 19:11:13.000000000 -0400
@@ -1,129 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
-
-<!--
- Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
- Use is subject to license terms.
-
- Copyright 2016 Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
-
- CDDL HEADER START
-
- The contents of this file are subject to the terms of the
- Common Development and Distribution License (the "License").
- You may not use this file except in compliance with the License.
-
- You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- or http://www.opensolaris.org/os/licensing.
- See the License for the specific language governing permissions
- and limitations under the License.
-
- When distributing Covered Code, include this CDDL HEADER in each
- file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- If applicable, add the following below this CDDL HEADER, with the
- fields enclosed by brackets "[]" replaced with your own identifying
- information: Portions Copyright [yyyy] [name of copyright owner]
-
- CDDL HEADER END
-
-	NOTE:  This service manifest is not editable; its contents will
-	be overwritten by package or patch operations, including
-	operating system upgrade.  Make customizations in a different
-	file.
-
-	Service manifest for rpc.rusersd
--->
-
-<service_bundle type='manifest' name='SUNWrcmdr:rusersd'>
-
-<service
-	name='network/rpc/rusers'
-	type='service'
-	version='1'>
-
-	<create_default_instance enabled='false' />
-
-	<restarter>
-		<service_fmri value='svc:/network/inetd:default' />
-	</restarter>
-
-	<dependency name='rpcbind'
-	    grouping='require_all'
-	    restart_on='restart'
-	    type='service'>
-		<service_fmri value='svc:/network/rpc/bind' />
-	</dependency>
-
-	<exec_method
-	    type='method'
-	    name='inetd_start'
-	    exec='/usr/lib/netsvc/rusers/rpc.rusersd'
-	    timeout_seconds='0'>
-		<method_context>
-		    <method_credential user='root' group='root' />
-		</method_context>
-	</exec_method>
-
-	<exec_method
-		type='method'
-		name='inetd_offline'
-		exec=':kill_process'
-		timeout_seconds='0'>
-	</exec_method>
-
-	<exec_method
-	    type='method'
-	    name='inetd_disable'
-	    exec=':kill'
-	    timeout_seconds='0'>
-	</exec_method>
-
-	<property_group name='inetd' type='framework'>
-		<stability value='Evolving' />
-		<propval name='name' type='astring' value='rusersd' />
-		<propval name='endpoint_type' type='astring' value='tli' />
-		<propval name='wait' type='boolean' value='true' />
-		<propval name='isrpc' type='boolean' value='true' />
-		<propval name='rpc_low_version' type='integer' value='2' />
-		<propval name='rpc_high_version' type='integer' value='3' />
-		<property name='proto' type='astring' override='true'>
-			<astring_list>
-				<value_node value='datagram_v'/>
-				<value_node value='circuit_v' />
-			</astring_list>
-		</property>
-	</property_group>
-
-	<property_group name='firewall_config' type='com.sun,fw_configuration'>
-		<propval name='policy' type='astring' value='use_global' />
-		<propval name='block_policy' type='astring'
-			value='use_global' />
-		<propval name='apply_to' type='astring' value='' />
-		<propval name='apply_to_6' type='astring' value='' />
-		<propval name='exceptions' type='astring' value='' />
-		<propval name='exceptions_6' type='astring' value='' />
-		<propval name='target' type='astring' value='' />
-		<propval name='target_6' type='astring' value='' />
-		<propval name='value_authorization' type='astring'
-			value='solaris.smf.value.firewall.config' />
-	</property_group>
-
-	<stability value='Unstable' />
-
-	<template>
-		<common_name>
-			<loctext xml:lang='C'>
-				network user name service
-			</loctext>
-		</common_name>
-		<documentation>
-			<manpage title='rpc.rusersd' section='1M'
-			    manpath='/usr/share/man' />
-			<manpage title='rusersd' section='1M'
-			    manpath='/usr/share/man' />
-		</documentation>
-	</template>
-
-</service>
-
-</service_bundle>
--- old/usr/src/cmd/rpcsvc/rwall.c	2017-05-26 19:11:13.494664967 -0400
+++ /dev/null	2017-05-26 19:11:13.000000000 -0400
@@ -1,266 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
-/*
- * University Copyright- Copyright (c) 1982, 1986, 1988
- * The Regents of the University of California
- * All Rights Reserved
- *
- * University Acknowledgment- Portions of this document are derived from
- * software developed by the University of California, Berkeley, and its
- * contributors.
- */
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-/*
- * rwall.c
- *	The client rwall program
- */
-
-#include <stdio.h>
-#include <stdio_ext.h>
-#include <sys/types.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <thread.h>
-#include <string.h>
-#include <rpc/rpc.h>
-#include <signal.h>
-#include <pwd.h>
-#include <rpcsvc/rwall.h>
-#include <netconfig.h>
-#include <netdb.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-
-static void init_who(void);
-static void doall(void);
-static void doit(char *);
-static void *do_one(void *);
-static void usage(void);
-
-#define	PATIENCE 10
-#define	MAX_THREADS 1024
-
-static mutex_t tty = DEFAULTMUTEX;
-static char who[9] = "???";
-static char *path;
-static mutex_t thr_mtx = DEFAULTMUTEX;
-static int thread_count = 8;	/* fudge factor for system threads/fds */
-static int qflag = 0;		/* quiet: we don't care about errors */
-
-int
-main(int argc, char *argv[])
-{
-	int msize;
-	char buf[BUFSIZ+1];
-	int i;
-	char hostname[256];
-	int hflag;
-	struct rlimit rl;
-
-	if (argc < 2)
-		usage();
-
-	if (getrlimit(RLIMIT_NOFILE, &rl) == 0) {
-		rl.rlim_cur = (rl.rlim_max < MAX_THREADS ?
-		    rl.rlim_max : MAX_THREADS);
-		(void) setrlimit(RLIMIT_NOFILE, &rl);
-		(void) enable_extended_FILE_stdio(-1, -1);
-	}
-
-	(void) gethostname(hostname, sizeof (hostname));
-
-	init_who();
-
-	msize = snprintf(buf, sizeof (buf), "From %s@%s:  ", who, hostname);
-	while ((i = getchar()) != EOF) {
-		if (msize >= (sizeof (buf) - 1)) {
-			(void) fprintf(stderr, "Message too long\n");
-			exit(1);
-		}
-		buf[msize++] = i;
-	}
-	buf[msize] = '\0';
-	path = buf;
-	hflag = 1;
-	while (argc > 1) {
-		if (argv[1][0] == '-') {
-			switch (argv[1][1]) {
-				case 'h':
-					hflag = 1;
-					break;
-				case 'n':
-					hflag = 0;
-					break;
-				case 'q':
-					qflag = 1;
-					break;
-				default:
-					usage();
-					break;
-			}
-			argc--;
-			argv++;
-			continue;
-		}
-		if (hflag) {
-			doit(argv[1]);
-		} else {
-			char *machine, *user, *domain;
-
-			(void) setnetgrent(argv[1]);
-			while (getnetgrent(&machine, &user, &domain)) {
-				if (machine)
-					doit(machine);
-				else
-					doall();
-			}
-			(void) endnetgrent();
-		}
-		argc--;
-		argv++;
-	}
-	thr_exit(NULL);
-	return (0);
-}
-
-static void
-init_who(void)
-{
-	char *wp;
-	struct passwd *pwd;
-
-	wp = getlogin();
-
-	if (wp != NULL)
-		(void) strncpy(who, wp, sizeof (who));
-	else {
-		pwd = getpwuid(getuid());
-		if (pwd)
-			(void) strncpy(who, pwd->pw_name, sizeof (who));
-	}
-
-}
-
-/*
- * Saw a wild card, so do everything
- */
-static void
-doall(void)
-{
-	(void) mutex_lock(&tty);
-	(void) fprintf(stderr, "writing to everyone not supported\n");
-	(void) mutex_unlock(&tty);
-}
-
-/*
- * Fire off a detached thread for each host in the list, if the thread
- * create fails simply run synchronously.
- */
-static void
-doit(char *hostname)
-{
-	thread_t tid;
-	char *thread_hostname;
-
-	(void) mutex_lock(&thr_mtx);
-	while (thread_count >= MAX_THREADS) {
-		(void) mutex_unlock(&thr_mtx);
-		(void) sleep(PATIENCE/2);
-		(void) mutex_lock(&thr_mtx);
-	}
-
-	thread_count++;
-	(void) mutex_unlock(&thr_mtx);
-
-	thread_hostname = strdup(hostname);
-	if (thread_hostname == (char *)NULL) {
-		(void) mutex_lock(&tty);
-		(void) fprintf(stderr, "Ran out of memory\n");
-		(void) mutex_unlock(&tty);
-		exit(1);
-	}
-
-	if (thr_create(NULL, 0, do_one, thread_hostname,
-			THR_DETACHED, &tid) != 0) {
-		(void) do_one(thread_hostname);
-	}
-}
-
-static void *
-do_one(void *arg)
-{
-	char *hostname = arg;
-	CLIENT *clnt;
-	struct timeval tp;
-	void *vp = NULL;
-
-#ifdef DEBUG
-	(void) mutex_lock(&tty);
-	(void) fprintf(stderr, "sending message to %s\n%s\n", hostname, path);
-	(void) mutex_unlock(&tty);
-	return (0);
-#endif
-	tp.tv_sec = PATIENCE;
-	tp.tv_usec = 0;
-	clnt = clnt_create_timed(
-		hostname, WALLPROG, WALLVERS, "datagram_v", &tp);
-	if (clnt == NULL) {
-		if (!qflag) {
-			(void) mutex_lock(&tty);
-			(void) fprintf(stderr, "rwall: Can't send to %s\n",
-			    hostname);
-			clnt_pcreateerror(hostname);
-			(void) mutex_unlock(&tty);
-		}
-		goto errout;
-	}
-
-	if (wallproc_wall_1(&path, vp, clnt) != RPC_SUCCESS) {
-		if (!qflag) {
-			(void) mutex_lock(&tty);
-			clnt_perror(clnt, hostname);
-			(void) mutex_unlock(&tty);
-		}
-	}
-	clnt_destroy(clnt);
-errout:
-	(void) mutex_lock(&thr_mtx);
-	thread_count--;
-	(void) mutex_unlock(&thr_mtx);
-	free(hostname);
-	return (0);
-}
-
-static void
-usage(void)
-{
-	(void) fprintf(stderr,
-	    "Usage: rwall [-q] host .... [-n netgroup ....] [-h host ...]\n");
-	exit(1);
-}
--- old/usr/src/cmd/rpcsvc/rwall_subr.c	2017-05-26 19:11:13.841342527 -0400
+++ /dev/null	2017-05-26 19:11:13.000000000 -0400
@@ -1,119 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- *
- * Copyright 2002 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
-/*
- * University Copyright- Copyright (c) 1982, 1986, 1988
- * The Regents of the University of California
- * All Rights Reserved
- *
- * University Acknowledgment- Portions of this document are derived from
- * software developed by the University of California, Berkeley, and its
- * contributors.
- */
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-/*
- * rwall_subr.c
- *	The server procedure for rwalld
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <rpc/rpc.h>
-#include <thread.h>
-#include <rpcsvc/rwall.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <syslog.h>
-#include <string.h>
-
-#define	WALL_PROG	"/usr/sbin/wall"
-
-static mutex_t wall_mutex = DEFAULTMUTEX;
-static char *oldmsg;
-
-/* ARGSUSED */
-bool_t
-wallproc_wall_1_svc(wrapstring *argp, void *res, struct svc_req *rqstp)
-{
-	char *msg;
-	FILE *fp;
-	int rval;
-	struct stat wall;
-
-	msg = *argp;
-
-	/*
-	 * Do not wall the same message twice in case of a retransmission
-	 * in the rare case that two walls arrive close enough with
-	 * a retransmission we might get a duplicate, but that is OK.
-	 */
-	(void) mutex_lock(&wall_mutex);
-	if ((oldmsg != 0) && (strcmp(msg, oldmsg) == 0)) {
-		(void) mutex_unlock(&wall_mutex);
-		return (TRUE);
-	}
-
-	if (oldmsg)
-		free(oldmsg);
-	oldmsg = strdup(msg);
-
-	rval = stat(WALL_PROG, &wall);
-
-	/*
-	 * Make sure the wall programs exists, is executeable, and runs
-	 */
-	if (rval == -1 || (wall.st_mode & S_IXUSR) == 0 ||
-	    (fp = popen(WALL_PROG, "w")) == NULL) {
-		syslog(LOG_NOTICE,
-			"rwall message received but could not execute %s",
-			WALL_PROG);
-		syslog(LOG_NOTICE, "%s", msg);
-#ifdef	DEBUG
-		(void) fprintf(stderr,
-			"rwall message received but could not execute %s",
-			WALL_PROG);
-		(void) fprintf(stderr, "%s", msg);
-#endif
-		(void) mutex_unlock(&wall_mutex);
-		return (TRUE);
-	}
-
-	(void) fprintf(fp, "%s", msg);
-	(void) pclose(fp);
-	(void) mutex_unlock(&wall_mutex);
-
-	return (TRUE);
-}
-
-/* ARGSUSED */
-int
-wallprog_1_freeresult(SVCXPRT *transp, xdrproc_t proc, caddr_t arg)
-{
-	return (TRUE);
-}
--- old/usr/src/cmd/rpcsvc/spray.c	2017-05-26 19:11:14.182248256 -0400
+++ /dev/null	2017-05-26 19:11:14.000000000 -0400
@@ -1,184 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- *
- * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
-/*
- * University Copyright- Copyright (c) 1982, 1986, 1988
- * The Regents of the University of California
- * All Rights Reserved
- *
- * University Acknowledgment- Portions of this document are derived from
- * software developed by the University of California, Berkeley, and its
- * contributors.
- */
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <rpc/rpc.h>
-#include <rpcsvc/spray.h>
-#include <sys/poll.h>
-
-enum clnt_stat sprayproc_spray_1nd(/*argp, clnt*/);
-
-#define	DEFBYTES	100000	/* default numbers of bytes to send */
-#define	MAXPACKETLEN	1514
-#define	SPRAYOVERHEAD	86	/* size of rpc packet when size=0 */
-
-static void slp(int usecs);
-static void usage(void);
-
-int
-main(int argc, char *argv[])
-{
-	int		c;
-	extern char	*optarg;
-	extern int	optind;
-	register CLIENT *clnt;
-	unsigned int	i;
-	int		delay = 0;
-	unsigned int	psec, bsec;
-	int		buf[SPRAYMAX/4];
-	char		msgbuf[256];
-	unsigned int	lnth, cnt;
-	sprayarr	arr;
-	spraycumul	cumul;
-	spraycumul	*co;
-	char		*host = NULL;
-	char		*type;
-
-	if (argc < 2)
-		usage();
-
-	cnt = 0;
-	lnth = SPRAYOVERHEAD;
-	type = "netpath";
-	while (optind < argc) {
-		if (argv[optind][0] == '-') {
-			if ((c = getopt(argc, argv, "d:c:t:l:")) == EOF) {
-				break;
-			}
-			switch (c) {
-				case 'd':
-					delay = atoi(optarg);
-					break;
-				case 'c':
-					cnt = (unsigned int) atoi(optarg);
-					break;
-				case 't':
-					type = optarg;
-					break;
-				case 'l':
-					lnth = (unsigned int) atoi(optarg);
-					break;
-				default:
-					usage();
-			}
-		} else {
-			host = argv[optind++];
-		}
-	}
-	if (host == NULL)
-		usage();
-	clnt = clnt_create(host, SPRAYPROG, SPRAYVERS, type);
-	if (clnt == (CLIENT *)NULL) {
-		sprintf(msgbuf, "spray: cannot clnt_create %s:%s", host, type);
-		clnt_pcreateerror(msgbuf);
-		exit(1);
-	}
-	if (cnt == 0)
-		cnt = DEFBYTES/lnth;
-	if (lnth < SPRAYOVERHEAD)
-		lnth = SPRAYOVERHEAD;
-	else if (lnth >= SPRAYMAX)
-		lnth = SPRAYMAX;
-	if (lnth <= MAXPACKETLEN && lnth % 4 != 2)
-		lnth = ((lnth + 5) / 4) * 4 - 2;
-	arr.sprayarr_len = lnth - SPRAYOVERHEAD;
-	arr.sprayarr_val = (char *)buf;
-	printf("sending %u packets of length %u to %s ...", cnt, lnth, host);
-	fflush(stdout);
-	if (sprayproc_clear_1(NULL, clnt) == NULL) {
-		clnt_perror(clnt, "SPRAYPROC_CLEAR ");
-		exit(1);
-	}
-	for (i = 0; i < cnt; i++) {
-		sprayproc_spray_1nd(&arr, clnt);
-		if (delay > 0)
-			slp(delay);
-	}
-	if ((co = sprayproc_get_1(NULL, clnt)) == NULL) {
-		clnt_perror(clnt, "SPRAYPROC_GET ");
-		exit(1);
-	}
-	cumul = *co;
-	if (cumul.counter < cnt)
-		printf("\n\t%d packets (%.3f%%) dropped by %s\n",
-			cnt - cumul.counter,
-			100.0 * (cnt - cumul.counter)/cnt, host);
-	else
-		printf("\n\tno packets dropped by %s\n", host);
-	psec = (1000000.0 * cumul.counter)
-		/ (1000000.0 * cumul.clock.sec + cumul.clock.usec);
-	bsec = (lnth * 1000000.0 * cumul.counter)/
-		(1000000.0 * cumul.clock.sec + cumul.clock.usec);
-	printf("\t%u packets/sec, %u bytes/sec\n", psec, bsec);
-	exit(0);
-	/* NOTREACHED */
-}
-
-/*
- * A special call, where the TIMEOUT is 0. So, every call times-out.
- */
-static struct timeval TIMEOUT = { 0, 0 };
-
-enum clnt_stat
-sprayproc_spray_1nd(argp, clnt)
-	sprayarr *argp;
-	CLIENT *clnt;
-{
-	return (clnt_call(clnt, SPRAYPROC_SPRAY, xdr_sprayarr, (caddr_t)argp,
-			xdr_void, NULL, TIMEOUT));
-}
-
-/* A cheap milliseconds sleep call */
-static void
-slp(usecs)
-{
-	static struct pollfd pfds[1] = {
-		0, POLLIN, 0
-	};
-	pfds[0].fd = fileno(stdout);
-	poll(pfds, 1, usecs/1000);
-}
-
-static void
-usage()
-{
-	printf("spray host [-t nettype] [-l lnth] [-c cnt] [-d delay]\n");
-	exit(1);
-}
--- old/usr/src/cmd/rpcsvc/spray.xml	2017-05-26 19:11:14.522926769 -0400
+++ /dev/null	2017-05-26 19:11:14.000000000 -0400
@@ -1,125 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
-
-<!--
- Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
- Use is subject to license terms.
-
- Copyright 2016 Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
-
- CDDL HEADER START
-
- The contents of this file are subject to the terms of the
- Common Development and Distribution License (the "License").
- You may not use this file except in compliance with the License.
-
- You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- or http://www.opensolaris.org/os/licensing.
- See the License for the specific language governing permissions
- and limitations under the License.
-
- When distributing Covered Code, include this CDDL HEADER in each
- file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- If applicable, add the following below this CDDL HEADER, with the
- fields enclosed by brackets "[]" replaced with your own identifying
- information: Portions Copyright [yyyy] [name of copyright owner]
-
- CDDL HEADER END
-
-	NOTE:  This service manifest is not editable; its contents will
-	be overwritten by package or patch operations, including
-	operating system upgrade.  Make customizations in a different
-	file.
-
-	Service manifest for rpc.sprayd
--->
-
-<service_bundle type='manifest' name='SUNWrcmdr:sprayd'>
-
-<service
-	name='network/rpc/spray'
-	type='service'
-	version='1'>
-
-	<create_default_instance enabled='false' />
-
-	<restarter>
-		<service_fmri value='svc:/network/inetd:default' />
-	</restarter>
-
-	<dependency name='rpcbind'
-	    grouping='require_all'
-	    restart_on='restart'
-	    type='service'>
-		<service_fmri value='svc:/network/rpc/bind' />
-	</dependency>
-
-	<exec_method
-	    type='method'
-	    name='inetd_start'
-	    exec='/usr/lib/netsvc/spray/rpc.sprayd'
-	    timeout_seconds='0'>
-		<method_context>
-		    <method_credential user='root' group='root' />
-		</method_context>
-	</exec_method>
-
-	<exec_method
-		type='method'
-		name='inetd_offline'
-		exec=':kill_process'
-		timeout_seconds='0'>
-	</exec_method>
-
-	<exec_method
-	    type='method'
-	    name='inetd_disable'
-	    exec=':kill'
-	    timeout_seconds='0'>
-	</exec_method>
-
-	<property_group name='inetd' type='framework'>
-		<stability value='Evolving' />
-		<propval name='name' type='astring' value='sprayd' />
-		<propval name='endpoint_type' type='astring' value='tli' />
-		<propval name='proto' type='astring' value='datagram_v'
-		    override='true' />
-		<propval name='isrpc' type='boolean' value='true' />
-		<propval name='rpc_low_version' type='integer' value='1' />
-		<propval name='rpc_high_version' type='integer' value='1' />
-		<propval name='wait' type='boolean' value='true' />
-	</property_group>
-
-	<property_group name='firewall_config' type='com.sun,fw_configuration'>
-		<propval name='policy' type='astring' value='use_global' />
-		<propval name='block_policy' type='astring'
-			value='use_global' />
-		<propval name='apply_to' type='astring' value='' />
-		<propval name='apply_to_6' type='astring' value='' />
-		<propval name='exceptions' type='astring' value='' />
-		<propval name='exceptions_6' type='astring' value='' />
-		<propval name='target' type='astring' value='' />
-		<propval name='target_6' type='astring' value='' />
-		<propval name='value_authorization' type='astring'
-			value='solaris.smf.value.firewall.config' />
-	</property_group>
-
-	<stability value='Unstable' />
-
-	<template>
-		<common_name>
-			<loctext xml:lang='C'>
-				RPC spray
-			</loctext>
-		</common_name>
-		<documentation>
-			<manpage title='rpc.sprayd' section='1M'
-			    manpath='/usr/share/man' />
-			<manpage title='sprayd' section='1M'
-			    manpath='/usr/share/man' />
-		</documentation>
-	</template>
-
-</service>
-
-</service_bundle>
--- old/usr/src/cmd/rpcsvc/spray_subr.c	2017-05-26 19:11:14.864659058 -0400
+++ /dev/null	2017-05-26 19:11:14.000000000 -0400
@@ -1,80 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- *
- * Copyright 1985 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
-/*
- * University Copyright- Copyright (c) 1982, 1986, 1988
- * The Regents of the University of California
- * All Rights Reserved
- *
- * University Acknowledgment- Portions of this document are derived from
- * software developed by the University of California, Berkeley, and its
- * contributors.
- */
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#include <rpc/rpc.h>
-#include <rpcsvc/spray.h>
-
-static spraycumul cumul;
-static spraytimeval start_time;
-
-void *
-sprayproc_spray_1(argp, clnt)
-	sprayarr *argp;
-	CLIENT *clnt;
-{
-	cumul.counter++;
-	return ((void *)0);
-}
-
-spraycumul *
-sprayproc_get_1(argp, clnt)
-	void *argp;
-	CLIENT *clnt;
-{
-	gettimeofday((struct timeval *)&cumul.clock, 0);
-	if (cumul.clock.usec < start_time.usec) {
-		cumul.clock.usec += 1000000;
-		cumul.clock.sec -= 1;
-	}
-	cumul.clock.sec -= start_time.sec;
-	cumul.clock.usec -= start_time.usec;
-	return (&cumul);
-}
-
-void *
-sprayproc_clear_1(argp, clnt)
-	void *argp;
-	CLIENT *clnt;
-{
-	static char res;
-
-	cumul.counter = 0;
-	gettimeofday((struct timeval *)&start_time, 0);
-	(void) memset((char *)&res, 0, sizeof(res));
-	return ((void *)&res);
-}
--- old/usr/src/cmd/rpcsvc/wall.xml	2017-05-26 19:11:15.326689029 -0400
+++ /dev/null	2017-05-26 19:11:15.000000000 -0400
@@ -1,125 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
-
-<!--
- Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
- Use is subject to license terms.
-
- Copyright 2016 Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
-
- CDDL HEADER START
-
- The contents of this file are subject to the terms of the
- Common Development and Distribution License (the "License").
- You may not use this file except in compliance with the License.
-
- You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- or http://www.opensolaris.org/os/licensing.
- See the License for the specific language governing permissions
- and limitations under the License.
-
- When distributing Covered Code, include this CDDL HEADER in each
- file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- If applicable, add the following below this CDDL HEADER, with the
- fields enclosed by brackets "[]" replaced with your own identifying
- information: Portions Copyright [yyyy] [name of copyright owner]
-
- CDDL HEADER END
-
-	NOTE:  This service manifest is not editable; its contents will
-	be overwritten by package or patch operations, including
-	operating system upgrade.  Make customizations in a different
-	file.
-
-	Service manifest for rpc.rwalld
--->
-
-<service_bundle type='manifest' name='SUNWrcmdr:walld'>
-
-<service
-	name='network/rpc/wall'
-	type='service'
-	version='1'>
-
-	<create_default_instance enabled='false' />
-
-	<restarter>
-		<service_fmri value='svc:/network/inetd:default' />
-	</restarter>
-
-	<dependency name='rpcbind'
-	    grouping='require_all'
-	    restart_on='restart'
-	    type='service'>
-		<service_fmri value='svc:/network/rpc/bind' />
-	</dependency>
-
-	<exec_method
-	    type='method'
-	    name='inetd_start'
-	    exec='/usr/lib/netsvc/rwall/rpc.rwalld'
-	    timeout_seconds='0'>
-		<method_context>
-		    <method_credential user='noaccess' group='noaccess' />
-		</method_context>
-	</exec_method>
-
-	<exec_method
-		type='method'
-		name='inetd_offline'
-		exec=':kill_process'
-		timeout_seconds='0'>
-	</exec_method>
-
-	<exec_method
-	    type='method'
-	    name='inetd_disable'
-	    exec=':kill'
-	    timeout_seconds='0'>
-	</exec_method>
-
-	<property_group name='inetd' type='framework'>
-		<stability value='Evolving' />
-		<propval name='name' type='astring' value='walld' />
-		<propval name='endpoint_type' type='astring' value='tli' />
-		<propval name='proto' type='astring' value='datagram_v'
-		    override='true' />
-		<propval name='isrpc' type='boolean' value='true' />
-		<propval name='rpc_low_version' type='integer' value='1' />
-		<propval name='rpc_high_version' type='integer' value='1' />
-		<propval name='wait' type='boolean' value='true' />
-	</property_group>
-
-	<property_group name='firewall_config' type='com.sun,fw_configuration'>
-		<propval name='policy' type='astring' value='use_global' />
-		<propval name='block_policy' type='astring'
-			value='use_global' />
-		<propval name='apply_to' type='astring' value='' />
-		<propval name='apply_to_6' type='astring' value='' />
-		<propval name='exceptions' type='astring' value='' />
-		<propval name='exceptions_6' type='astring' value='' />
-		<propval name='target' type='astring' value='' />
-		<propval name='target_6' type='astring' value='' />
-		<propval name='value_authorization' type='astring'
-			value='solaris.smf.value.firewall.config' />
-	</property_group>
-
-	<stability value='Unstable' />
-
-	<template>
-		<common_name>
-			<loctext xml:lang='C'>
-				network rwall server
-			</loctext>
-		</common_name>
-		<documentation>
-			<manpage title='rpc.rwalld' section='1M'
-			    manpath='/usr/share/man' />
-			<manpage title='rwalld' section='1M'
-			    manpath='/usr/share/man' />
-		</documentation>
-	</template>
-
-</service>
-
-</service_bundle>
--- old/usr/src/cmd/svc/profile/generic_limited_net.xml	2017-05-26 19:11:15.701400697 -0400
+++ new/usr/src/cmd/svc/profile/generic_limited_net.xml	2017-05-26 19:11:15.763164030 -0400
@@ -267,9 +267,6 @@
   <service name='network/rpc/gss' version='1' type='service'>
     <instance name='default' enabled='true'/>
   </service>
-  <service name='network/rpc/mdcomm' version='1' type='service'>
-    <instance name='default' enabled='false'/>
-  </service>
   <service name='network/rpc/smserver' version='1' type='service'>
     <instance name='default' enabled='true'/>
   </service>
@@ -277,28 +274,6 @@
     <instance name='default' enabled='true'/>
   </service>
 
-  <!--
-	default inetd(1M) RPC services disabled
-  -->
-  <service name='network/rpc/rstat' version='1' type='service'>
-    <instance name='default' enabled='false'/>
-  </service>
-  <service name='network/rpc/rusers' version='1' type='service'>
-    <instance name='default' enabled='false'/>
-  </service>
-
-  <!--
-	non-default inetd(1M) RPC services disabled
-  -->
-  <service name='network/rpc/rex' version='1' type='service'>
-    <instance name='default' enabled='false'/>
-  </service>
-  <service name='network/rpc/spray' version='1' type='service'>
-    <instance name='default' enabled='false'/>
-  </service>
-  <service name='network/rpc/wall' version='1' type='service'>
-    <instance name='default' enabled='false'/>
-  </service>
 
   <!--
       Disable Avahi mDNS bridge service
@@ -308,18 +283,12 @@
   </service>
 
   <!--
-      Enable CDE/ToolTalk/GDM services.
+      Enable gdm
   -->
-  <service name='network/rpc/cde-ttdbserver' version='1' type='service'>
-    <instance name='tcp' enabled='true' />
-  </service>
   <service name='application/graphical-login/gdm' version='1'
     type='service'>
     <instance name='default' enabled='true' />
   </service>
-  <service name='network/rpc/cde-calendar-manager' version='1' type='service'>
-    <instance name='default' enabled='true'/>
-  </service>
 
   <!--
       Disable X11 services.
--- old/usr/src/cmd/svc/profile/inetd_generic.xml	2017-05-26 19:11:16.738875658 -0400
+++ new/usr/src/cmd/svc/profile/inetd_generic.xml	2017-05-26 19:11:16.772992654 -0400
@@ -56,28 +56,10 @@
 	<service name='network/rpc/gss' version='1' type='service'>
 		<instance name='default' enabled='true'/>
 	</service>
-	<service name='network/rpc/rstat' version='1' type='service'>
-		<instance name='default' enabled='true'/>
-	</service>
-	<service name='network/rpc/rusers' version='1' type='service'>
-		<instance name='default' enabled='true'/>
-	</service>
 	<service name='network/rpc/smserver' version='1' type='service'>
 		<instance name='default' enabled='true'/>
 	</service>
 	<service name='network/security/ktkt_warn' version='1' type='service'>
 		<instance name='default' enabled='true'/>
 	</service>
-
-	<!--
-		Enable CDE services.
-	-->
-	<service name='network/rpc/cde-ttdbserver' version='1' type='service'>
-		<instance name='tcp' enabled='true' />
-	</service>
-	<service name='network/rpc/cde-calendar-manager' version='1'
-		type='service'>
-		<instance name='default' enabled='true' />
-	</service>
-
 </service_bundle>
--- old/usr/src/man/man1/Makefile	2017-05-26 19:11:17.692394830 -0400
+++ new/usr/src/man/man1/Makefile	2017-05-26 19:11:17.729110824 -0400
@@ -323,9 +323,7 @@
 	 	rpcgen.1			\
 	 	rsh.1				\
 	 	runat.1				\
-	 	rup.1				\
 	 	ruptime.1			\
-	 	rusers.1			\
 	 	rwho.1				\
 	 	sar.1				\
 	 	script.1			\
--- old/usr/src/man/man1/rup.1	2017-05-26 19:11:18.713816520 -0400
+++ /dev/null	2017-05-26 19:11:18.000000000 -0400
@@ -1,79 +0,0 @@
-'\" te
-.\" Copyright (c) 2000, Sun Microsystems, Inc. All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH RUP 1 "Mar 7, 2003"
-.SH NAME
-rup \- show host status of remote machines (RPC version)
-.SH SYNOPSIS
-.LP
-.nf
-\fBrup\fR [\fB-hlt\fR]
-.fi
-
-.LP
-.nf
-\fBrup\fR [\fIhost\fR]...
-.fi
-
-.SH DESCRIPTION
-.sp
-.LP
-\fBrup\fR gives a status similar to \fBuptime\fR for remote machines. It
-broadcasts on the local network, and displays the responses it receives.
-.sp
-.LP
-Normally, the listing is in the order that responses are received, but this
-order can be changed by specifying one of the options listed below.
-.sp
-.LP
-When \fIhost\fR arguments are given, rather than broadcasting \fBrup\fR will
-only query the list of specified hosts.
-.sp
-.LP
-A remote host will only respond if it is running the \fBrstatd\fR daemon, which
-is normally started up from \fBinetd\fR(1M).
-.sp
-.LP
-In the absence of a name service, such as LDAP or NIS, \fBrup\fR displays host
-names as numeric IP addresses.
-.SH OPTIONS
-.sp
-.ne 2
-.na
-\fB\fB-h\fR\fR
-.ad
-.RS 6n
-Sort the display alphabetically by host name.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-l\fR\fR
-.ad
-.RS 6n
-Sort the display by load average.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-t\fR\fR
-.ad
-.RS 6n
-Sort the display by up time.
-.RE
-
-.SH SEE ALSO
-.sp
-.LP
-\fBruptime\fR(1), \fBinetd\fR(1M), \fBattributes\fR(5)
-.sp
-.LP
-\fISolaris Express Installation Guide: Basic Installations\fR
-.SH BUGS
-.sp
-.LP
-Broadcasting does not work through gateways.
--- old/usr/src/man/man1/rusers.1	2017-05-26 19:11:19.053369362 -0400
+++ /dev/null	2017-05-26 19:11:19.000000000 -0400
@@ -1,97 +0,0 @@
-'\" te
-.\" Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
-.\" Copyright 1989 AT&T
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH RUSERS 1 "Mar 7, 2003"
-.SH NAME
-rusers \- who is logged in on remote machines
-.SH SYNOPSIS
-.LP
-.nf
-\fBrusers\fR [\fB-ahilu\fR] \fIhost\fR...
-.fi
-
-.SH DESCRIPTION
-.sp
-.LP
-The \fBrusers\fR command produces output similar to \fBwho\fR(1), but for
-remote machines. The listing is in the order that responses are received, but
-this order can be changed by specifying one of the options listed below.
-.sp
-.LP
-The default is to print out the names of the users logged in. When the \fB-l\fR
-flag is given, additional information is printed for each user:
-.sp
-.in +2
-.nf
-\fIuserid hostname\fR\fB:\fR\fIterminal login_date login_time idle_time login_host\fR
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-If \fIhostname\fR and \fIlogin\fR \fIhost\fR are the same value, the
-\fIlogin_host\fR field is not displayed. Likewise, if \fIhostname\fR is not
-idle, the \fIidle_time\fR is not displayed.
-.sp
-.LP
-A remote host will only respond if it is running the \fBrusersd\fR daemon,
-which may be started up from \fBinetd\fR(1M) or \fBlisten\fR(1M).
-.sp
-.LP
-In the absence of a name service, such as LDAP or NIS, \fBrusers\fR displays
-host names as numeric IP addresses.
-.SH OPTIONS
-.sp
-.ne 2
-.na
-\fB\fB-a\fR\fR
-.ad
-.RS 6n
-Give a report for a machine even if no users are logged on.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-h\fR\fR
-.ad
-.RS 6n
-Sort alphabetically by host name.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-i\fR\fR
-.ad
-.RS 6n
-Sort by idle time.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-l\fR\fR
-.ad
-.RS 6n
-Give a longer listing in the style of \fBwho\fR(1).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-u\fR\fR
-.ad
-.RS 6n
-Sort by number of users.
-.RE
-
-.SH SEE ALSO
-.sp
-.LP
-\fBwho\fR(1), \fBinetd\fR(1M), \fBlisten\fR(1M), \fBpmadm\fR(1M),
-\fBsacadm\fR(1M), \fBattributes\fR(5)
--- old/usr/src/man/man1c/Makefile	2017-05-26 19:11:19.392422967 -0400
+++ new/usr/src/man/man1c/Makefile	2017-05-26 19:11:19.427220364 -0400
@@ -20,7 +20,6 @@
 
 MANFILES= 	ct.1c		\
 		cu.1c		\
-		rup.1c		\
 		uucp.1c		\
 		uuencode.1c	\
 		uuglist.1c	\
--- old/usr/src/man/man1c/rup.1c	2017-05-26 19:11:20.517633982 -0400
+++ /dev/null	2017-05-26 19:11:20.000000000 -0400
@@ -1,72 +0,0 @@
-'\" te
-.\" Copyright (c) 1991, Sun Microsystems, Inc.
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH RUP 1C "Feb 13, 1991"
-.SH NAME
-rup \- show host status of remote machines (RPC version)
-.SH SYNOPSIS
-.LP
-.nf
-\fBrup\fR [\fB-hlt\fR]
-.fi
-
-.LP
-.nf
-\fBrup\fR [\fIhost\fR]...
-.fi
-
-.SH DESCRIPTION
-.sp
-.LP
-\fBrup\fR gives a status similar to \fBuptime\fR for remote machines. It
-broadcasts on the local network, and displays the responses it receives.
-.sp
-.LP
-Normally, the listing is in the order that responses are received, but this
-order can be changed by specifying one of the options listed below.
-.sp
-.LP
-When \fIhost\fR arguments are given, rather than broadcasting \fBrup\fR only
-queries the list of specified hosts.
-.sp
-.LP
-A remote host will only respond if it is running the \fBrstatd\fR daemon, which
-is normally started up from \fBinetd\fR(1M).
-.SH OPTIONS
-.sp
-.ne 2
-.na
-\fB\fB-h\fR\fR
-.ad
-.RS 6n
-Sort the display alphabetically by host name.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-l\fR\fR
-.ad
-.RS 6n
-Sort the display by load average.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-t\fR\fR
-.ad
-.RS 6n
-Sort the display by up time.
-.RE
-
-.SH SEE ALSO
-.sp
-.LP
-\fBruptime\fR(1), \fBinetd\fR(1M), \fBattributes\fR(5)
-.SH BUGS
-.sp
-.LP
-Broadcasting does not work through gateways.
--- old/usr/src/man/man1m/Makefile	2017-05-26 19:11:20.874410542 -0400
+++ new/usr/src/man/man1m/Makefile	2017-05-26 19:11:20.918016331 -0400
@@ -409,11 +409,7 @@
 		route.1m		\
 		routeadm.1m		\
 		rpc.bootparamd.1m	\
-		rpc.rstatd.1m		\
-		rpc.rusersd.1m		\
-		rpc.rwalld.1m		\
 		rpc.smserverd.1m	\
-		rpc.sprayd.1m		\
 		rpc.yppasswdd.1m	\
 		rpc.ypupdated.1m	\
 		rpcbind.1m		\
@@ -423,7 +419,6 @@
 		rtc.1m			\
 		rtquery.1m		\
 		runacct.1m		\
-		rwall.1m		\
 		sac.1m			\
 		sacadm.1m		\
 		saf.1m			\
@@ -456,7 +451,6 @@
 		snoop.1m		\
 		soconfig.1m		\
 		sppptun.1m		\
-		spray.1m		\
 		statd.1m		\
 		stmfadm.1m		\
 		stmsboot.1m		\
@@ -609,15 +603,10 @@
 		rlogind.1m			\
 		routed.1m			\
 		rshd.1m				\
-		rstatd.1m			\
-		rusersd.1m			\
-		rwalld.1m			\
-		rwhod.1m			\
 		sa1.1m				\
 		sa2.1m				\
 		sadc.1m				\
 		shutacct.1m			\
-		sprayd.1m			\
 		startup.1m			\
 		talkd.1m			\
 		telinit.1m			\
@@ -722,10 +711,6 @@
 quotaoff.1m			:= LINKSRC = quotaon.1m
 
 bootparamd.1m			:= LINKSRC = rpc.bootparamd.1m
-rstatd.1m			:= LINKSRC = rpc.rstatd.1m
-rusersd.1m			:= LINKSRC = rpc.rusersd.1m
-rwalld.1m			:= LINKSRC = rpc.rwalld.1m
-sprayd.1m			:= LINKSRC = rpc.sprayd.1m
 yppasswdd.1m			:= LINKSRC = rpc.yppasswdd.1m
 ypupdated.1m			:= LINKSRC = rpc.ypupdated.1m
 
--- old/usr/src/man/man1m/rpc.rstatd.1m	2017-05-26 19:11:21.913553518 -0400
+++ /dev/null	2017-05-26 19:11:21.000000000 -0400
@@ -1,49 +0,0 @@
-'\" te
-.\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH RPC.RSTATD 1M "Nov 4, 2004"
-.SH NAME
-rpc.rstatd, rstatd \- kernel statistics server
-.SH SYNOPSIS
-.LP
-.nf
-\fB/usr/lib/netsvc/rstat/rpc.rstatd\fR
-.fi
-
-.SH DESCRIPTION
-.sp
-.LP
-\fBrpc.rstatd\fR is a server which returns performance statistics obtained from
-the kernel. \fBrup\fR(1) uses \fBrpc.rstatd\fR to collect the \fBuptime\fR
-information that it displays.
-.sp
-.LP
-\fBrpc.rstatd\fR is an RPC service.
-.SH SEE ALSO
-.sp
-.LP
-\fBrup\fR(1), \fBsvcs\fR(1), \fBinetadm\fR(1M), \fBinetd\fR(1M),
-\fBsvcadm\fR(1M), \fBservices\fR(4), \fBattributes\fR(5), \fBsmf\fR(5)
-.SH NOTES
-.sp
-.LP
-The \fBrpc.rstatd\fR service is managed by the service management facility,
-\fBsmf\fR(5), under the service identifier:
-.sp
-.in +2
-.nf
-svc:/network/rpc/rstat:default
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-Administrative actions on this service, such as enabling, disabling, or
-requesting restart, can be performed using \fBsvcadm\fR(1M). Responsibility for
-initiating and restarting this service is delegated to \fBinetd\fR(1M). Use
-\fBinetadm\fR(1M) to make configuration changes and to view configuration
-information for this service. The service's status can be queried using the
-\fBsvcs\fR(1) command.
--- old/usr/src/man/man1m/rpc.rusersd.1m	2017-05-26 19:11:22.254803476 -0400
+++ /dev/null	2017-05-26 19:11:22.000000000 -0400
@@ -1,46 +0,0 @@
-'\" te
-.\"  Copyright 1989 AT&T  Copyright (c) 2004 Sun Microsystems, Inc. - All Rights Reserved.
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH RPC.RUSERSD 1M "Nov 4, 2004"
-.SH NAME
-rpc.rusersd, rusersd \- network username server
-.SH SYNOPSIS
-.LP
-.nf
-\fB/usr/lib/netsvc/rusers/rpc.rusersd\fR
-.fi
-
-.SH DESCRIPTION
-.sp
-.LP
-\fBrpc.rusersd\fR is a server that returns a list of users on the host. The
-\fBrpc.rusersd\fR daemon may be started by \fBinetd\fR(1M) or \fBlisten\fR(1M).
-.SH SEE ALSO
-.sp
-.LP
-\fBsvcs\fR(1), \fBinetadm\fR(1M), \fBinetd\fR(1M), \fBlisten\fR(1M),
-\fBpmadm\fR(1M), \fBsacadm\fR(1M), \fBsvcadm\fR(1M), \fBattributes\fR(5),
-\fBsmf\fR(5)
-.SH NOTES
-.sp
-.LP
-The \fBrpc.rusersd\fR service is managed by the service management facility,
-\fBsmf\fR(5), under the service identifier:
-.sp
-.in +2
-.nf
-svc:/network/rpc/rusers:default
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-Administrative actions on this service, such as enabling, disabling, or
-requesting restart, can be performed using \fBsvcadm\fR(1M). Responsibility for
-initiating and restarting this service is delegated to \fBinetd\fR(1M). Use
-\fBinetadm\fR(1M) to make configuration changes and to view configuration
-information for this service. The service's status can be queried using the
-\fBsvcs\fR(1) command.
--- old/usr/src/man/man1m/rpc.rwalld.1m	2017-05-26 19:11:22.595391826 -0400
+++ /dev/null	2017-05-26 19:11:22.000000000 -0400
@@ -1,48 +0,0 @@
-'\" te
-.\"  Copyright 1989 AT&T  Copyright (c) 2004 Sun Microsystems, Inc. - All Rights Reserved.
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH RPC.RWALLD 1M "Nov 4, 2004"
-.SH NAME
-rpc.rwalld, rwalld \- network rwall server
-.SH SYNOPSIS
-.LP
-.nf
-\fB/usr/lib/netsvc/rwall/rpc.rwalld\fR
-.fi
-
-.SH DESCRIPTION
-.sp
-.LP
-\fBrpc.rwalld\fR is a server that handles \fBrwall\fR(1M) requests. It is
-implemented by calling \fBwall\fR(1M) on all the appropriate network machines.
-The \fBrpc.rwalld\fR daemon may be started by \fBinetd\fR(1M) or
-\fBlisten\fR(1M).
-.SH SEE ALSO
-.sp
-.LP
-\fBsvcs\fR(1), \fBinetadm\fR(1M), \fBinetd\fR(1M), \fBlisten\fR(1M),
-\fBrwall\fR(1M), \fBsvcadm\fR(1M), \fBwall\fR(1M), \fBattributes\fR(5),
-\fBsmf\fR(5)
-.SH NOTES
-.sp
-.LP
-The \fBrpc.rwalld\fR service is managed by the service management facility,
-\fBsmf\fR(5), under the service identifier:
-.sp
-.in +2
-.nf
-svc:/network/rpc/wall:default
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-Administrative actions on this service, such as enabling, disabling, or
-requesting restart, can be performed using \fBsvcadm\fR(1M). Responsibility for
-initiating and restarting this service is delegated to \fBinetd\fR(1M). Use
-\fBinetadm\fR(1M) to make configuration changes and to view configuration
-information for this service. The service's status can be queried using the
-\fBsvcs\fR(1) command.
--- old/usr/src/man/man1m/rpc.sprayd.1m	2017-05-26 19:11:22.935706347 -0400
+++ /dev/null	2017-05-26 19:11:22.000000000 -0400
@@ -1,54 +0,0 @@
-'\" te
-.\"  Copyright 1989 AT&T  Copyright (c) 2004 Sun Microsystems, Inc. - All Rights Reserved.
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH RPC.SPRAYD 1M "Nov 4, 2004"
-.SH NAME
-rpc.sprayd, sprayd \- spray server
-.SH SYNOPSIS
-.LP
-.nf
-\fB/usr/lib/netsvc/spray/rpc.sprayd\fR
-.fi
-
-.SH DESCRIPTION
-.sp
-.LP
-\fBrpc.sprayd\fR is a server that records the packets sent by \fBspray\fR(1M).
-The \fBrpc.sprayd\fR daemon may be started by \fBinetd\fR(1M) or
-\fBlisten\fR(1M).
-.sp
-.LP
-The service provided by \fBrpc.sprayd\fR is not useful as a networking
-benchmark as it uses unreliable connectionless transports, (udp for example).
-It can report a large number of packets dropped when the drops were caused by
-the program sending packets faster than they can be buffered locally (before
-the packets get to the network medium).
-.SH SEE ALSO
-.sp
-.LP
-\fBsvcs\fR(1), \fBinetadm\fR(1M), \fBinetd\fR(1M) \fBlisten\fR(1M),
-\fBpmadm\fR(1M), \fBsacadm\fR(1M), \fBspray\fR(1M), \fBsvcadm\fR(1M),
-\fBattributes\fR(5), \fBsmf\fR(5)
-.SH NOTES
-.sp
-.LP
-The \fBrpc.sprayd\fR service is managed by the service management facility,
-\fBsmf\fR(5), under the service identifier:
-.sp
-.in +2
-.nf
-svc:/network/rpc/spray:default
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-Administrative actions on this service, such as enabling, disabling, or
-requesting restart, can be performed using \fBsvcadm\fR(1M). Responsibility for
-initiating and restarting this service is delegated to \fBinetd\fR(1M). Use
-\fBinetadm\fR(1M) to make configuration changes and to view configuration
-information for this service. The service's status can be queried using the
-\fBsvcs\fR(1) command.
--- old/usr/src/man/man1m/rwall.1m	2017-05-26 19:11:23.278916187 -0400
+++ /dev/null	2017-05-26 19:11:23.000000000 -0400
@@ -1,73 +0,0 @@
-'\" te
-.\"  Copyright 1989 AT&T  Copyright (c) 1988 Sun Microsystems, Inc. - All Rights Reserved.
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH RWALL 1M "Nov 6, 2000"
-.SH NAME
-rwall \- write to all users over a network
-.SH SYNOPSIS
-.LP
-.nf
-\fB/usr/sbin/rwall\fR \fIhostname\fR...
-.fi
-
-.LP
-.nf
-\fB/usr/sbin/rwall\fR \fB-n\fR \fInetgroup\fR...
-.fi
-
-.LP
-.nf
-\fB/usr/sbin/rwall\fR \fB-h\fR \fIhostname\fR \fB-n\fR \fInetgroup\fR
-.fi
-
-.SH DESCRIPTION
-.sp
-.LP
-\fBrwall\fR reads a message from standard input until EOF. It then sends this
-message, preceded by the line:
-.sp
-.ne 2
-.na
-\fB\fR
-.ad
-.sp .6
-.RS 4n
-\fBBroadcast Message .\|.\|.\fR
-.RE
-
-.sp
-.LP
-to all users logged in on the specified host machines. With the \fB-n\fR
-option, it sends to the specified network groups.
-.SH OPTIONS
-.sp
-.ne 2
-.na
-\fB\fB-n\fR\fI netgroup\fR\fR
-.ad
-.RS 15n
-Send the broadcast message to the specified network groups.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-h\fR\fI hostname\fR\fR
-.ad
-.RS 15n
-Specify the \fBhostname\fR, the name of the host machine.
-.RE
-
-.SH SEE ALSO
-.sp
-.LP
-\fBinetd\fR(1M), \fBlisten\fR(1M), \fBpmadm\fR(1M), \fBsacadm\fR(1M),
-\fBwall\fR(1M), \fBattributes\fR(5)
-.SH NOTES
-.sp
-.LP
-The timeout is fairly short to allow transmission to a large group of machines
-(some of which may be down) in a reasonable amount of time. Thus the message
-may not get through to a heavily loaded machine.
--- old/usr/src/man/man1m/spray.1m	2017-05-26 19:11:23.619541524 -0400
+++ /dev/null	2017-05-26 19:11:23.000000000 -0400
@@ -1,81 +0,0 @@
-'\" te
-.\" Copyright (c) 1998, Sun Microsystems,
-.\" Inc.  All Rights Reserved
-.\"  Copyright 1989 AT&T  Copyright (c)
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH SPRAY 1M "Nov 6, 2000"
-.SH NAME
-spray \- spray packets
-.SH SYNOPSIS
-.LP
-.nf
-\fB/usr/sbin/spray\fR [\fB-c\fR \fIcount\fR] [\fB-d\fR \fIdelay\fR] [\fB-l\fR \fIlength\fR]
-     [\fB-t\fR \fInettype\fR] \fIhost\fR
-.fi
-
-.SH DESCRIPTION
-.sp
-.LP
-\fBspray\fR sends a one-way stream of packets to \fIhost\fR using RPC, and
-reports how many were received, as well as the transfer rate. The \fIhost\fR
-argument can be either a name or an Internet address.
-.sp
-.LP
-\fBspray\fR is not useful as a networking benchmark, as it uses unreliable
-connectionless transports, UDP for example. \fBspray\fR can report a large
-number of packets dropped when the drops were caused by \fBspray\fR sending
-packets faster than they can be buffered locally, that is, before the packets
-get to the network medium.
-.SH OPTIONS
-.sp
-.ne 2
-.na
-\fB\fB-c\fR \fIcount\fR\fR
-.ad
-.RS 14n
-Specify how many packets to send. The default value of \fIcount\fR is the
-number of packets required to make the total stream size 100000 bytes.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-d\fR \fIdelay\fR\fR
-.ad
-.RS 14n
-Specify how many microseconds to pause between sending each packet. The default
-is \fB0\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-l\fR \fIlength\fR\fR
-.ad
-.RS 14n
-The \fIlength\fR parameter is the numbers of bytes in the Ethernet packet that
-holds the RPC call message. Since the data is encoded using XDR, and XDR only
-deals with 32 bit quantities, not all values of \fIlength\fR are possible, and
-\fBspray\fR rounds up to the nearest possible value. When \fIlength\fR is
-greater than 1514, then the RPC call can no longer be encapsulated in one
-Ethernet packet, so the \fIlength\fR field no longer has a simple
-correspondence to Ethernet packet size. The default value of \fIlength\fR is
-\fB86 bytes\fR, the size of the RPC and UDP headers.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-t\fR \fInettype\fR\fR
-.ad
-.RS 14n
-Specify class of transports. Defaults to  \fBnetpath\fR. See \fBrpc\fR(3NSL)
-for a description of supported classes.
-.RE
-
-.SH SEE ALSO
-.sp
-.LP
-\fBrpc\fR(3NSL), \fBattributes\fR(5)
--- old/usr/src/man/man3rpc/Makefile	2017-05-26 19:11:23.960297477 -0400
+++ new/usr/src/man/man3rpc/Makefile	2017-05-26 19:11:24.003720963 -0400
@@ -20,7 +20,8 @@
 
 MANFILES= 	rstat.3rpc	\
 	 	rusers.3rpc	\
-	 	rwall.3rpc
+	 	rwall.3rpc	\
+		spray.3rpc
 
 MANLINKS=	havedisk.3rpc	\
 		rnusers.3rpc
--- old/usr/src/man/man3rpc/rstat.3rpc	2017-05-26 19:11:24.931846740 -0400
+++ new/usr/src/man/man3rpc/rstat.3rpc	2017-05-26 19:11:24.973940847 -0400
@@ -22,11 +22,9 @@
 .fi
 
 .SH PROTOCOL
-.sp
 .LP
 \fB/usr/include/rpcsvc/rstat.x\fR
 .SH DESCRIPTION
-.sp
 .LP
 These routines require that the \fBrpc.rstatd\fR(1M) daemon be configured and
 available on the remote system indicated by \fIhost\fR. The \fBrstat()\fR
@@ -56,7 +54,6 @@
 .sp
 
 .SH ATTRIBUTES
-.sp
 .LP
 See \fBattributes\fR(5) for descriptions of the following attributes:
 .sp
@@ -72,7 +69,5 @@
 .TE
 
 .SH SEE ALSO
-.sp
 .LP
-\fBrup\fR(1), \fBrpc.rstatd\fR(1M), \fBrpc_clnt_calls\fR(3NSL),
-\fBattributes\fR(5)
+\fBrpc_clnt_calls\fR(3NSL), \fBattributes\fR(5)
--- old/usr/src/man/man3socket/spray.3socket	2017-05-26 19:11:26.709901307 -0400
+++ /dev/null	2017-05-26 19:11:23.000000000 -0400
@@ -1,145 +0,0 @@
-'\" te
-.\"  Copyright 1989 AT&T  Copyright (c) 1997, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH SPRAY 3SOCKET "Dec 30, 1996"
-.SH NAME
-spray \- scatter data in order to test the network
-.SH SYNOPSIS
-.LP
-.nf
-\fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-lsocket\fR \fB -lnsl \fR [ \fIlibrary\fR ... ]
-#include <rpcsvc/spray.h>
-
-\fBbool_t\fR \fBxdr_sprayarr\fR(\fBXDR *\fR\fIxdrs\fR, \fBsprayarr *\fR\fIobjp\fR);
-.fi
-
-.LP
-.nf
-\fBbool_t\fR \fBxdr_spraycumul\fR(\fBXDR *\fR\fIxdrs\fR, \fBspraycumul *\fR\fIobjp\fR);
-.fi
-
-.SH DESCRIPTION
-.sp
-.LP
-The spray program sends packets to a given machine to test communications with
-that machine.
-.sp
-.LP
-The spray program is not a C function interface, per se, but it can be accessed
-using the generic remote procedure calling interface \fBclnt_call()\fR. See
-\fBrpc_clnt_calls\fR(3NSL). The program sends a packet to the called host. The
-host acknowledges receipt of the packet. The program counts the number of
-acknowledgments and can return that count.
-.sp
-.LP
-The spray program currently supports the following procedures, which should be
-called in the order given:
-.sp
-.ne 2
-.na
-\fB\fBSPRAYPROC_CLEAR\fR\fR
-.ad
-.RS 19n
-This procedure clears the counter.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBSPRAYPROC_SPRAY\fR\fR
-.ad
-.RS 19n
-This procedure sends the packet.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBSPRAYPROC_GET\fR\fR
-.ad
-.RS 19n
-This procedure returns the count and the amount of time since the last
-\fBSPRAYPROC_CLEAR\fR.
-.RE
-
-.SH EXAMPLES
-.LP
-\fBExample 1 \fRUsing \fBspray()\fR
-.sp
-.LP
-The following code fragment demonstrates how the spray program is used:
-
-.sp
-.in +2
-.nf
-#include <rpc/rpc.h>
-#include <rpcsvc/spray.h>
- .  .  .
-	spraycumul	spray_result;
-	sprayarr	spray_data;
-	char		buf[100];		/* arbitrary data */
-	int		loop = 1000;
-	CLIENT	*clnt;
-	struct timeval timeout0 = {0, 0};
-	struct timeval timeout25 = {25, 0};
-	spray_data.sprayarr_len = (uint_t)100;
-	spray_data.sprayarr_val = buf;
-	clnt = clnt_create("somehost", SPRAYPROG, SPRAYVERS, "netpath");
-	if (clnt == (CLIENT *)NULL) {
-		/* handle this error */
-	}
-	if (clnt_call(clnt, SPRAYPROC_CLEAR,
-		xdr_void, NULL, xdr_void, NULL, timeout25)) {
-			/* handle this error */
-	}
-	while (loop\(mi > 0) {
-		if (clnt_call(clnt, SPRAYPROC_SPRAY,
-			xdr_sprayarr, &spray_data, xdr_void, NULL, timeout0)) {
-				/* handle this error */
-		}
-	}
-	if (clnt_call(clnt, SPRAYPROC_GET,
-		xdr_void, NULL, xdr_spraycumul, &spray_result, timeout25)) {
-			/* handle this error */
-	}
-	printf("Acknowledged %ld of 1000 packets in %d secs %d usecs\en",
-		spray_result.counter,
-		spray_result.clock.sec,
-		spray_result.clock.usec);
-.fi
-.in -2
-
-.SH ATTRIBUTES
-.sp
-.LP
-See \fBattributes\fR(5) for descriptions of the following attributes:
-.sp
-
-.sp
-.TS
-box;
-c | c
-l | l .
-ATTRIBUTE TYPE	ATTRIBUTE VALUE
-_
-MT-Level	Unsafe
-.TE
-
-.SH SEE ALSO
-.sp
-.LP
-\fBspray\fR(1M), \fBrpc_clnt_calls\fR(3NSL), \fBattributes\fR(5)
-.SH NOTES
-.sp
-.LP
-This interface is unsafe in multithreaded applications.  Unsafe interfaces
-should be called only from the main thread.
-.sp
-.LP
-A spray program is not useful as a networking benchmark as it uses  unreliable
-connectionless transports, for example, udp. It can report a large number of
-packets dropped, when the drops were caused by the program sending packets
-faster than they can be buffered locally, that is, before the packets get to
-the network medium.
--- /dev/null	2017-05-26 19:11:23.000000000 -0400
+++ new/usr/src/man/man3rpc/spray.3rpc	2017-05-26 19:11:26.744093008 -0400
@@ -0,0 +1,142 @@
+'\" te
+.\"  Copyright 1989 AT&T  Copyright (c) 1997, Sun Microsystems, Inc.  All Rights Reserved
+.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
+.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
+.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
+.TH SPRAY 3RPC "Apr 13, 2017"
+.SH NAME
+spray \- scatter data in order to test the network
+.SH SYNOPSIS
+.LP
+.nf
+\fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-lsocket\fR \fB-lnsl\fR \
+\fB-lrpcsvc\fR [ \fIlibrary\fR ... ]
+#include <rpcsvc/spray.h>
+
+\fBbool_t\fR \fBxdr_sprayarr\fR(\fBXDR *\fR\fIxdrs\fR, \fBsprayarr *\fR\fIobjp\fR);
+.fi
+
+.LP
+.nf
+\fBbool_t\fR \fBxdr_spraycumul\fR(\fBXDR *\fR\fIxdrs\fR, \fBspraycumul *\fR\fIobjp\fR);
+.fi
+
+.SH DESCRIPTION
+.LP
+The spray program sends packets to a given machine to test communications with
+that machine.
+.sp
+.LP
+The spray program is not a C function interface, per se, but it can be accessed
+using the generic remote procedure calling interface \fBclnt_call()\fR. See
+\fBrpc_clnt_calls\fR(3NSL). The program sends a packet to the called host. The
+host acknowledges receipt of the packet. The program counts the number of
+acknowledgments and can return that count.
+.sp
+.LP
+The spray program currently supports the following procedures, which should be
+called in the order given:
+.sp
+.ne 2
+.na
+\fB\fBSPRAYPROC_CLEAR\fR\fR
+.ad
+.RS 19n
+This procedure clears the counter.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fBSPRAYPROC_SPRAY\fR\fR
+.ad
+.RS 19n
+This procedure sends the packet.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fBSPRAYPROC_GET\fR\fR
+.ad
+.RS 19n
+This procedure returns the count and the amount of time since the last
+\fBSPRAYPROC_CLEAR\fR.
+.RE
+
+.SH EXAMPLES
+.LP
+\fBExample 1 \fRUsing \fBspray()\fR
+.sp
+.LP
+The following code fragment demonstrates how the spray program is used:
+
+.sp
+.in +2
+.nf
+#include <rpc/rpc.h>
+#include <rpcsvc/spray.h>
+ .  .  .
+	spraycumul	spray_result;
+	sprayarr	spray_data;
+	char		buf[100];		/* arbitrary data */
+	int		loop = 1000;
+	CLIENT	*clnt;
+	struct timeval timeout0 = {0, 0};
+	struct timeval timeout25 = {25, 0};
+	spray_data.sprayarr_len = (uint_t)100;
+	spray_data.sprayarr_val = buf;
+	clnt = clnt_create("somehost", SPRAYPROG, SPRAYVERS, "netpath");
+	if (clnt == (CLIENT *)NULL) {
+		/* handle this error */
+	}
+	if (clnt_call(clnt, SPRAYPROC_CLEAR,
+		xdr_void, NULL, xdr_void, NULL, timeout25)) {
+			/* handle this error */
+	}
+	while (loop\(mi > 0) {
+		if (clnt_call(clnt, SPRAYPROC_SPRAY,
+			xdr_sprayarr, &spray_data, xdr_void, NULL, timeout0)) {
+				/* handle this error */
+		}
+	}
+	if (clnt_call(clnt, SPRAYPROC_GET,
+		xdr_void, NULL, xdr_spraycumul, &spray_result, timeout25)) {
+			/* handle this error */
+	}
+	printf("Acknowledged %ld of 1000 packets in %d secs %d usecs\en",
+		spray_result.counter,
+		spray_result.clock.sec,
+		spray_result.clock.usec);
+.fi
+.in -2
+
+.SH ATTRIBUTES
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+box;
+c | c
+l | l .
+ATTRIBUTE TYPE	ATTRIBUTE VALUE
+_
+MT-Level	Unsafe
+.TE
+
+.SH SEE ALSO
+.LP
+\fBrpc_clnt_calls\fR(3NSL), \fBattributes\fR(5)
+.SH NOTES
+.LP
+This interface is unsafe in multithreaded applications.  Unsafe interfaces
+should be called only from the main thread.
+.sp
+.LP
+A spray program is not useful as a networking benchmark as it uses  unreliable
+connectionless transports, for example, udp. It can report a large number of
+packets dropped, when the drops were caused by the program sending packets
+faster than they can be buffered locally, that is, before the packets get to
+the network medium.
--- old/usr/src/man/man3socket/Makefile	2017-05-26 19:11:28.307002464 -0400
+++ new/usr/src/man/man3socket/Makefile	2017-05-26 19:11:28.350259895 -0400
@@ -55,8 +55,7 @@
 		sockaddr.3socket	\
 		shutdown.3socket	\
 		socket.3socket		\
-		socketpair.3socket	\
-		spray.3socket
+		socketpair.3socket
 
 MANLINKS=	accept4.3socket			\
 		endnetent.3socket		\
--- old/usr/src/pkg/manifests/service-network-network-clients.mf	2017-05-26 19:11:29.288501812 -0400
+++ new/usr/src/pkg/manifests/service-network-network-clients.mf	2017-05-26 19:11:29.323476575 -0400
@@ -42,28 +42,20 @@
 file path=usr/bin/rdist mode=4555
 file path=usr/bin/rlogin mode=4555
 file path=usr/bin/rsh mode=4555
-file path=usr/bin/rup mode=0555
 file path=usr/bin/ruptime mode=0555
-file path=usr/bin/rusers mode=0555
 file path=usr/bin/whois mode=0555
 file path=usr/sbin/rmt mode=0555
-file path=usr/sbin/rwall mode=0555
 file path=usr/sbin/snoop mode=0555
-file path=usr/sbin/spray mode=0555
 file path=usr/share/man/man1/filesync.1
 file path=usr/share/man/man1/rcp.1
 file path=usr/share/man/man1/rdist.1
 file path=usr/share/man/man1/rlogin.1
 file path=usr/share/man/man1/rsh.1
-file path=usr/share/man/man1/rup.1
 file path=usr/share/man/man1/ruptime.1
-file path=usr/share/man/man1/rusers.1
 file path=usr/share/man/man1/whois.1
 file path=usr/share/man/man1m/rdate.1m
 file path=usr/share/man/man1m/rmt.1m
-file path=usr/share/man/man1m/rwall.1m
 file path=usr/share/man/man1m/snoop.1m
-file path=usr/share/man/man1m/spray.1m
 legacy pkg=SUNWrcmdc \
     desc="Remote Network Client Commands (rsh, rlogin, rcp, rsh, ...)" \
     name="Remote Network Client Commands"
--- old/usr/src/pkg/manifests/service-network-network-servers.mf	2017-05-26 19:11:30.370471544 -0400
+++ new/usr/src/pkg/manifests/service-network-network-servers.mf	2017-05-26 19:11:30.409929956 -0400
@@ -40,10 +40,6 @@
 dir path=usr/bin
 dir path=usr/lib
 dir path=usr/lib/netsvc group=sys
-dir path=usr/lib/netsvc/rstat group=sys
-dir path=usr/lib/netsvc/rusers group=sys
-dir path=usr/lib/netsvc/rwall group=sys
-dir path=usr/lib/netsvc/spray group=sys
 dir path=usr/sbin
 dir path=usr/share/man
 dir path=usr/share/man/man1
@@ -53,19 +49,11 @@
 file path=lib/svc/manifest/network/finger.xml group=sys mode=0444
 file path=lib/svc/manifest/network/login.xml group=sys mode=0444
 file path=lib/svc/manifest/network/rexec.xml group=sys mode=0444
-file path=lib/svc/manifest/network/rpc/rstat.xml group=sys mode=0444
-file path=lib/svc/manifest/network/rpc/rusers.xml group=sys mode=0444
-file path=lib/svc/manifest/network/rpc/spray.xml group=sys mode=0444
-file path=lib/svc/manifest/network/rpc/wall.xml group=sys mode=0444
 file path=lib/svc/manifest/network/shell.xml group=sys mode=0444
 file path=lib/svc/manifest/network/talk.xml group=sys mode=0444
 file path=usr/bin/finger mode=0555
 file path=usr/bin/rwho mode=0555
 file path=usr/bin/talk mode=0555
-file path=usr/lib/netsvc/rstat/rpc.rstatd mode=0555
-file path=usr/lib/netsvc/rusers/rpc.rusersd mode=0555
-file path=usr/lib/netsvc/rwall/rpc.rwalld mode=0555
-file path=usr/lib/netsvc/spray/rpc.sprayd mode=0555
 file path=usr/sbin/in.comsat mode=0555
 file path=usr/sbin/in.fingerd mode=0555
 file path=usr/sbin/in.rexecd mode=0555
@@ -83,10 +71,6 @@
 file path=usr/share/man/man1m/in.rshd.1m
 file path=usr/share/man/man1m/in.rwhod.1m
 file path=usr/share/man/man1m/in.talkd.1m
-file path=usr/share/man/man1m/rpc.rstatd.1m
-file path=usr/share/man/man1m/rpc.rusersd.1m
-file path=usr/share/man/man1m/rpc.rwalld.1m
-file path=usr/share/man/man1m/rpc.sprayd.1m
 file path=usr/share/man/man4/hosts.equiv.4
 legacy pkg=SUNWrcmdr desc="Remote Network Server Commands (Root)" \
     name="Remote Network Server Commands (Root)"
@@ -105,10 +89,6 @@
 link path=usr/share/man/man1m/rexecd.1m target=in.rexecd.1m
 link path=usr/share/man/man1m/rlogind.1m target=in.rlogind.1m
 link path=usr/share/man/man1m/rshd.1m target=in.rshd.1m
-link path=usr/share/man/man1m/rstatd.1m target=rpc.rstatd.1m
-link path=usr/share/man/man1m/rusersd.1m target=rpc.rusersd.1m
-link path=usr/share/man/man1m/rwalld.1m target=rpc.rwalld.1m
 link path=usr/share/man/man1m/rwhod.1m target=in.rwhod.1m
-link path=usr/share/man/man1m/sprayd.1m target=rpc.sprayd.1m
 link path=usr/share/man/man1m/talkd.1m target=in.talkd.1m
 link path=usr/share/man/man4/rhosts.4 target=hosts.equiv.4
--- old/usr/src/pkg/manifests/service-network-uucp.mf	2017-05-26 19:11:31.336104477 -0400
+++ new/usr/src/pkg/manifests/service-network-uucp.mf	2017-05-26 19:11:31.371238386 -0400
@@ -113,7 +113,6 @@
 file path=usr/sbin/in.uucpd group=uucp mode=0555
 file path=usr/share/man/man1c/ct.1c
 file path=usr/share/man/man1c/cu.1c
-file path=usr/share/man/man1c/rup.1c
 file path=usr/share/man/man1c/uucp.1c
 file path=usr/share/man/man1c/uuencode.1c
 file path=usr/share/man/man1c/uuglist.1c
--- old/usr/src/pkg/manifests/system-library.man3rpc.inc	2017-05-26 19:11:32.279211897 -0400
+++ new/usr/src/pkg/manifests/system-library.man3rpc.inc	2017-05-26 19:11:32.313508790 -0400
@@ -14,5 +14,6 @@
 file path=usr/share/man/man3rpc/rstat.3rpc
 file path=usr/share/man/man3rpc/rusers.3rpc
 file path=usr/share/man/man3rpc/rwall.3rpc
+file path=usr/share/man/man3rpc/spray.3rpc
 link path=usr/share/man/man3rpc/havedisk.3rpc target=rstat.3rpc
 link path=usr/share/man/man3rpc/rnusers.3rpc target=rusers.3rpc
--- old/usr/src/pkg/manifests/system-library.man3socket.inc	2017-05-26 19:11:33.204535132 -0400
+++ new/usr/src/pkg/manifests/system-library.man3socket.inc	2017-05-26 19:11:33.238676066 -0400
@@ -52,7 +52,6 @@
 file path=usr/share/man/man3socket/sockaddr.3socket
 file path=usr/share/man/man3socket/socket.3socket
 file path=usr/share/man/man3socket/socketpair.3socket
-file path=usr/share/man/man3socket/spray.3socket
 link path=usr/share/man/man3socket/accept4.3socket target=accept.3socket
 link path=usr/share/man/man3socket/endnetent.3socket \
     target=getnetbyname.3socket
