Index: eebsd-userspace/include/rpc/clnt.h
===================================================================
--- freebsd-userspace/include/rpc/clnt.h	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ 	(revision )
@@ -1,557 +1,0 @@
-/*	$NetBSD: clnt.h,v 1.14 2000/06/02 22:57:55 fvdl Exp $	*/
-
-/*
- * The contents of this file are subject to the Sun Standards
- * License Version 1.0 the (the "License";) You may not use
- * this file except in compliance with the License.  You may
- * obtain a copy of the License at lib/libc/rpc/LICENSE
- *
- * Software distributed under the License is distributed on
- * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
- * express or implied.  See the License for the specific
- * language governing rights and limitations under the License.
- *
- * The Original Code is Copyright 1998 by Sun Microsystems, Inc
- *
- * The Initial Developer of the Original Code is:  Sun
- * Microsystems, Inc.
- *
- * All Rights Reserved.
- *
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part.  Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California  94043
- *
- *	from: @(#)clnt.h 1.31 94/04/29 SMI
- *	from: @(#)clnt.h	2.1 88/07/29 4.0 RPCSRC
- * $FreeBSD$
- */
-
-/*
- * clnt.h - Client side remote procedure call interface.
- *
- * Copyright (c) 1986-1991,1994-1999 by Sun Microsystems, Inc.
- * All rights reserved.
- */
-
-#ifndef _RPC_CLNT_H_
-#define _RPC_CLNT_H_
-#include <rpc/clnt_stat.h>
-#include <sys/cdefs.h>
-#include <netconfig.h>
-#include <sys/un.h>
-
-/*
- * Well-known IPV6 RPC broadcast address.
- */
-#define RPCB_MULTICAST_ADDR "ff02::202"
-
-/*
- * the following errors are in general unrecoverable.  The caller
- * should give up rather than retry.
- */
-#define IS_UNRECOVERABLE_RPC(s) (((s) == RPC_AUTHERROR) || \
-	((s) == RPC_CANTENCODEARGS) || \
-	((s) == RPC_CANTDECODERES) || \
-	((s) == RPC_VERSMISMATCH) || \
-	((s) == RPC_PROCUNAVAIL) || \
-	((s) == RPC_PROGUNAVAIL) || \
-	((s) == RPC_PROGVERSMISMATCH) || \
-	((s) == RPC_CANTDECODEARGS))
-
-/*
- * Error info.
- */
-struct rpc_err {
-	enum clnt_stat re_status;
-	union {
-		int RE_errno;		/* related system error */
-		enum auth_stat RE_why;	/* why the auth error occurred */
-		struct {
-			rpcvers_t low;	/* lowest version supported */
-			rpcvers_t high;	/* highest version supported */
-		} RE_vers;
-		struct {		/* maybe meaningful if RPC_FAILED */
-			int32_t s1;
-			int32_t s2;
-		} RE_lb;		/* life boot & debugging only */
-	} ru;
-#define	re_errno	ru.RE_errno
-#define	re_why		ru.RE_why
-#define	re_vers		ru.RE_vers
-#define	re_lb		ru.RE_lb
-};
-
-
-/*
- * Client rpc handle.
- * Created by individual implementations
- * Client is responsible for initializing auth, see e.g. auth_none.c.
- */
-typedef struct __rpc_client {
-	AUTH	*cl_auth;			/* authenticator */
-	struct clnt_ops {
-		/* call remote procedure */
-		enum clnt_stat	(*cl_call)(struct __rpc_client *,
-				    rpcproc_t, xdrproc_t, void *, xdrproc_t,
-				        void *, struct timeval);
-		/* abort a call */
-		void		(*cl_abort)(struct __rpc_client *);
-		/* get specific error code */
-		void		(*cl_geterr)(struct __rpc_client *,
-					struct rpc_err *);
-		/* frees results */
-		bool_t		(*cl_freeres)(struct __rpc_client *,
-					xdrproc_t, void *);
-		/* destroy this structure */
-		void		(*cl_destroy)(struct __rpc_client *);
-		/* the ioctl() of rpc */
-		bool_t          (*cl_control)(struct __rpc_client *, u_int,
-				    void *);
-	} *cl_ops;
-	void 			*cl_private;	/* private stuff */
-	char			*cl_netid;	/* network token */
-	char			*cl_tp;		/* device name */
-} CLIENT;
-
-
-/*
- * Timers used for the pseudo-transport protocol when using datagrams
- */
-struct rpc_timers {
-	u_short		rt_srtt;	/* smoothed round-trip time */
-	u_short		rt_deviate;	/* estimated deviation */
-	u_long		rt_rtxcur;	/* current (backed-off) rto */
-};
-
-/*      
- * Feedback values used for possible congestion and rate control
- */
-#define FEEDBACK_REXMIT1	1	/* first retransmit */
-#define FEEDBACK_OK		2	/* no retransmits */    
-
-/* Used to set version of portmapper used in broadcast */
-  
-#define CLCR_SET_LOWVERS	3
-#define CLCR_GET_LOWVERS	4
- 
-#define RPCSMALLMSGSIZE 400	/* a more reasonable packet size */
-
-/*
- * client side rpc interface ops
- *
- * Parameter types are:
- *
- */
-
-/*
- * enum clnt_stat
- * CLNT_CALL(rh, proc, xargs, argsp, xres, resp, timeout)
- * 	CLIENT *rh;
- *	rpcproc_t proc;
- *	xdrproc_t xargs;
- *	void *argsp;
- *	xdrproc_t xres;
- *	void *resp;
- *	struct timeval timeout;
- */
-#define	CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs) \
-	((*(rh)->cl_ops->cl_call)(rh, proc, xargs, \
-		argsp, xres, resp, secs))
-#define	clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \
-	((*(rh)->cl_ops->cl_call)(rh, proc, xargs, \
-		argsp, xres, resp, secs))
-
-/*
- * void
- * CLNT_ABORT(rh);
- * 	CLIENT *rh;
- */
-#define	CLNT_ABORT(rh)	((*(rh)->cl_ops->cl_abort)(rh))
-#define	clnt_abort(rh)	((*(rh)->cl_ops->cl_abort)(rh))
-
-/*
- * struct rpc_err
- * CLNT_GETERR(rh);
- * 	CLIENT *rh;
- */
-#define	CLNT_GETERR(rh,errp)	((*(rh)->cl_ops->cl_geterr)(rh, errp))
-#define	clnt_geterr(rh,errp)	((*(rh)->cl_ops->cl_geterr)(rh, errp))
-
-
-/*
- * bool_t
- * CLNT_FREERES(rh, xres, resp);
- * 	CLIENT *rh;
- *	xdrproc_t xres;
- *	void *resp;
- */
-#define	CLNT_FREERES(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
-#define	clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
-
-/*
- * bool_t
- * CLNT_CONTROL(cl, request, info)
- *      CLIENT *cl;
- *      u_int request;
- *      char *info;
- */
-#define	CLNT_CONTROL(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in))
-#define	clnt_control(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in))
-
-/*
- * control operations that apply to both udp and tcp transports
- */
-#define CLSET_TIMEOUT		1	/* set timeout (timeval) */
-#define CLGET_TIMEOUT		2	/* get timeout (timeval) */
-#define CLGET_SERVER_ADDR	3	/* get server's address (sockaddr) */
-#define CLGET_FD		6	/* get connections file descriptor */
-#define CLGET_SVC_ADDR		7	/* get server's address (netbuf) */
-#define CLSET_FD_CLOSE		8	/* close fd while clnt_destroy */
-#define CLSET_FD_NCLOSE		9	/* Do not close fd while clnt_destroy */
-#define CLGET_XID 		10	/* Get xid */
-#define CLSET_XID		11	/* Set xid */
-#define CLGET_VERS		12	/* Get version number */
-#define CLSET_VERS		13	/* Set version number */
-#define CLGET_PROG		14	/* Get program number */
-#define CLSET_PROG		15	/* Set program number */
-#define CLSET_SVC_ADDR		16	/* get server's address (netbuf) */
-#define CLSET_PUSH_TIMOD	17	/* push timod if not already present */
-#define CLSET_POP_TIMOD		18	/* pop timod */
-/*
- * Connectionless only control operations
- */
-#define CLSET_RETRY_TIMEOUT 4   /* set retry timeout (timeval) */
-#define CLGET_RETRY_TIMEOUT 5   /* get retry timeout (timeval) */
-#define CLSET_ASYNC		19
-#define CLSET_CONNECT		20	/* Use connect() for UDP. (int) */
-
-/*
- * void
- * CLNT_DESTROY(rh);
- * 	CLIENT *rh;
- */
-#define	CLNT_DESTROY(rh)	((*(rh)->cl_ops->cl_destroy)(rh))
-#define	clnt_destroy(rh)	((*(rh)->cl_ops->cl_destroy)(rh))
-
-
-/*
- * RPCTEST is a test program which is accessible on every rpc
- * transport/port.  It is used for testing, performance evaluation,
- * and network administration.
- */
-
-#define RPCTEST_PROGRAM		((rpcprog_t)1)
-#define RPCTEST_VERSION		((rpcvers_t)1)
-#define RPCTEST_NULL_PROC	((rpcproc_t)2)
-#define RPCTEST_NULL_BATCH_PROC	((rpcproc_t)3)
-
-/*
- * By convention, procedure 0 takes null arguments and returns them
- */
-
-#define NULLPROC ((rpcproc_t)0)
-
-/*
- * Below are the client handle creation routines for the various
- * implementations of client side rpc.  They can return NULL if a
- * creation failure occurs.
- */
-
-/*
- * Generic client creation routine. Supported protocols are those that
- * belong to the nettype namespace (/etc/netconfig).
- */
-__BEGIN_DECLS
-extern CLIENT *clnt_create(const char *, const rpcprog_t, const rpcvers_t,
-			   const char *);
-/*
- *
- * 	const char *hostname;			-- hostname
- *	const rpcprog_t prog;			-- program number
- *	const rpcvers_t vers;			-- version number
- *	const char *nettype;			-- network type
- */
-
- /*
- * Generic client creation routine. Just like clnt_create(), except
- * it takes an additional timeout parameter.
- */
-extern CLIENT * clnt_create_timed(const char *, const rpcprog_t,
-	const rpcvers_t, const char *, const struct timeval *);
-/*
- *
- *	const char *hostname;			-- hostname
- *	const rpcprog_t prog;			-- program number
- *	const rpcvers_t vers;			-- version number
- *	const char *nettype;			-- network type
- *	const struct timeval *tp;		-- timeout
- */
-
-/*
- * Generic client creation routine. Supported protocols are which belong
- * to the nettype name space.
- */
-extern CLIENT *clnt_create_vers(const char *, const rpcprog_t, rpcvers_t *,
-				const rpcvers_t, const rpcvers_t,
-				const char *);
-/*
- *	const char *host;		-- hostname
- *	const rpcprog_t prog;		-- program number
- *	rpcvers_t *vers_out;		-- servers highest available version
- *	const rpcvers_t vers_low;	-- low version number
- *	const rpcvers_t vers_high;	-- high version number
- *	const char *nettype;		-- network type
- */
-
-/*
- * Generic client creation routine. Supported protocols are which belong
- * to the nettype name space.
- */
-extern CLIENT * clnt_create_vers_timed(const char *, const rpcprog_t,
-	rpcvers_t *, const rpcvers_t, const rpcvers_t, const char *,
-	const struct timeval *);
-/*
- *	const char *host;		-- hostname
- *	const rpcprog_t prog;		-- program number
- *	rpcvers_t *vers_out;		-- servers highest available version
- *	const rpcvers_t vers_low;	-- low version number
- *	const rpcvers_t vers_high;	-- high version number
- *	const char *nettype;		-- network type
- *	const struct timeval *tp	-- timeout
- */
-
-/*
- * Generic client creation routine. It takes a netconfig structure
- * instead of nettype
- */
-extern CLIENT *clnt_tp_create(const char *, const rpcprog_t,
-			      const rpcvers_t, const struct netconfig *);
-/*
- *	const char *hostname;			-- hostname
- *	const rpcprog_t prog;			-- program number
- *	const rpcvers_t vers;			-- version number
- *	const struct netconfig *netconf; 	-- network config structure
- */
-
-/*
- * Generic client creation routine. Just like clnt_tp_create(), except
- * it takes an additional timeout parameter.
- */
-extern CLIENT * clnt_tp_create_timed(const char *, const rpcprog_t,
-	const rpcvers_t, const struct netconfig *, const struct timeval *);
-/*
- *	const char *hostname;			-- hostname
- *	const rpcprog_t prog;			-- program number
- *	const rpcvers_t vers;			-- version number
- *	const struct netconfig *netconf; 	-- network config structure
- *	const struct timeval *tp		-- timeout
- */
-
-/*
- * Generic TLI create routine. Only provided for compatibility.
- */
-
-extern CLIENT *clnt_tli_create(const int, const struct netconfig *,
-			       struct netbuf *, const rpcprog_t,
-			       const rpcvers_t, const u_int, const u_int);
-/*
- *	const register int fd;		-- fd
- *	const struct netconfig *nconf;	-- netconfig structure
- *	struct netbuf *svcaddr;		-- servers address
- *	const u_long prog;			-- program number
- *	const u_long vers;			-- version number
- *	const u_int sendsz;			-- send size
- *	const u_int recvsz;			-- recv size
- */
-
-/*
- * Low level clnt create routine for connectionful transports, e.g. tcp.
- */
-extern CLIENT *clnt_vc_create(const int, const struct netbuf *,
-			      const rpcprog_t, const rpcvers_t,
-			      u_int, u_int);
-/*
- * Added for compatibility to old rpc 4.0. Obsoleted by clnt_vc_create().
- */
-extern CLIENT *clntunix_create(struct sockaddr_un *,
-			       u_long, u_long, int *, u_int, u_int);
-/*
- *	const int fd;				-- open file descriptor
- *	const struct netbuf *svcaddr;		-- servers address
- *	const rpcprog_t prog;			-- program number
- *	const rpcvers_t vers;			-- version number
- *	const u_int sendsz;			-- buffer recv size
- *	const u_int recvsz;			-- buffer send size
- */
-
-/*
- * Low level clnt create routine for connectionless transports, e.g. udp.
- */
-extern CLIENT *clnt_dg_create(const int, const struct netbuf *,
-			      const rpcprog_t, const rpcvers_t,
-			      const u_int, const u_int);
-/*
- *	const int fd;				-- open file descriptor
- *	const struct netbuf *svcaddr;		-- servers address
- *	const rpcprog_t program;		-- program number
- *	const rpcvers_t version;		-- version number
- *	const u_int sendsz;			-- buffer recv size
- *	const u_int recvsz;			-- buffer send size
- */
-
-/*
- * Memory based rpc (for speed check and testing)
- * CLIENT *
- * clnt_raw_create(prog, vers)
- *	u_long prog;
- *	u_long vers;
- */
-extern CLIENT *clnt_raw_create(rpcprog_t, rpcvers_t);
-
-__END_DECLS
-
-
-/*
- * Print why creation failed
- */
-__BEGIN_DECLS
-extern void clnt_pcreateerror(const char *);			/* stderr */
-extern char *clnt_spcreateerror(const char *);			/* string */
-__END_DECLS
-
-/*
- * Like clnt_perror(), but is more verbose in its output
- */
-__BEGIN_DECLS
-extern void clnt_perrno(enum clnt_stat);		/* stderr */
-extern char *clnt_sperrno(enum clnt_stat);		/* string */
-__END_DECLS
-
-/*
- * Print an English error message, given the client error code
- */
-__BEGIN_DECLS
-extern void clnt_perror(CLIENT *, const char *);	 	/* stderr */
-extern char *clnt_sperror(CLIENT *, const char *);		/* string */
-__END_DECLS
-
-
-/*
- * If a creation fails, the following allows the user to figure out why.
- */
-struct rpc_createerr {
-	enum clnt_stat cf_stat;
-	struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */
-};
-
-__BEGIN_DECLS
-extern struct rpc_createerr	*__rpc_createerr(void);
-__END_DECLS
-#define rpc_createerr		(*(__rpc_createerr()))
-
-/*
- * The simplified interface:
- * enum clnt_stat
- * rpc_call(host, prognum, versnum, procnum, inproc, in, outproc, out, nettype)
- *	const char *host;
- *	const rpcprog_t prognum;
- *	const rpcvers_t versnum;
- *	const rpcproc_t procnum;
- *	const xdrproc_t inproc, outproc;
- *	const char *in;
- *	char *out;
- *	const char *nettype;
- */
-__BEGIN_DECLS
-extern enum clnt_stat rpc_call(const char *, const rpcprog_t,
-			       const rpcvers_t, const rpcproc_t,
-			       const xdrproc_t, const char *,
-			       const xdrproc_t, char *, const char *);
-__END_DECLS
-
-/*
- * RPC broadcast interface
- * The call is broadcasted to all locally connected nets.
- *
- * extern enum clnt_stat
- * rpc_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp,
- *			eachresult, nettype)
- *	const rpcprog_t		prog;		-- program number
- *	const rpcvers_t		vers;		-- version number
- *	const rpcproc_t		proc;		-- procedure number
- *	const xdrproc_t	xargs;		-- xdr routine for args
- *	caddr_t		argsp;		-- pointer to args
- *	const xdrproc_t	xresults;	-- xdr routine for results
- *	caddr_t		resultsp;	-- pointer to results
- *	const resultproc_t	eachresult;	-- call with each result
- *	const char		*nettype;	-- Transport type
- *
- * For each valid response received, the procedure eachresult is called.
- * Its form is:
- *		done = eachresult(resp, raddr, nconf)
- *			bool_t done;
- *			caddr_t resp;
- *			struct netbuf *raddr;
- *			struct netconfig *nconf;
- * where resp points to the results of the call and raddr is the
- * address if the responder to the broadcast.  nconf is the transport
- * on which the response was received.
- *
- * extern enum clnt_stat
- * rpc_broadcast_exp(prog, vers, proc, xargs, argsp, xresults, resultsp,
- *			eachresult, inittime, waittime, nettype)
- *	const rpcprog_t		prog;		-- program number
- *	const rpcvers_t		vers;		-- version number
- *	const rpcproc_t		proc;		-- procedure number
- *	const xdrproc_t	xargs;		-- xdr routine for args
- *	caddr_t		argsp;		-- pointer to args
- *	const xdrproc_t	xresults;	-- xdr routine for results
- *	caddr_t		resultsp;	-- pointer to results
- *	const resultproc_t	eachresult;	-- call with each result
- *	const int 		inittime;	-- how long to wait initially
- *	const int 		waittime;	-- maximum time to wait
- *	const char		*nettype;	-- Transport type
- */
-
-typedef bool_t (*resultproc_t)(caddr_t, ...);
-
-__BEGIN_DECLS
-extern enum clnt_stat rpc_broadcast(const rpcprog_t, const rpcvers_t,
-				    const rpcproc_t, const xdrproc_t,
-				    caddr_t, const xdrproc_t, caddr_t,
-				    const resultproc_t, const char *);
-extern enum clnt_stat rpc_broadcast_exp(const rpcprog_t, const rpcvers_t,
-					const rpcproc_t, const xdrproc_t,
-					caddr_t, const xdrproc_t, caddr_t,
-					const resultproc_t, const int,
-					const int, const char *);
-__END_DECLS
-
-/* For backward compatibility */
-#include <rpc/clnt_soc.h>
-
-#endif /* !_RPC_CLNT_H_ */
Index: eebsd-userspace/include/rpc/rpc.h
===================================================================
--- freebsd-userspace/include/rpc/rpc.h	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ 	(revision )
@@ -1,108 +1,0 @@
-/*	$NetBSD: rpc.h,v 1.13 2000/06/02 22:57:56 fvdl Exp $	*/
-
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part.  Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California  94043
- *
- *	from: @(#)rpc.h 1.9 88/02/08 SMI
- *	from: @(#)rpc.h	2.4 89/07/11 4.0 RPCSRC
- * $FreeBSD$
- */
-
-/*
- * rpc.h, Just includes the billions of rpc header files necessary to
- * do remote procedure calling.
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- */
-#ifndef _RPC_RPC_H
-#define _RPC_RPC_H
-
-#include <rpc/types.h>		/* some typedefs */
-#include <sys/socket.h>
-#include <netinet/in.h>
-
-/* external data representation interfaces */
-#include <rpc/xdr.h>		/* generic (de)serializer */
-
-/* Client side only authentication */
-#include <rpc/auth.h>		/* generic authenticator (client side) */
-
-/* Client side (mostly) remote procedure call */
-#include <rpc/clnt.h>		/* generic rpc stuff */
-
-/* semi-private protocol headers */
-#include <rpc/rpc_msg.h>	/* protocol for rpc messages */
-#include <rpc/auth_unix.h>	/* protocol for unix style cred */
-/*
- *  Uncomment-out the next line if you are building the rpc library with
- *  DES Authentication (see the README file in the secure_rpc/ directory).
- */
-#include <rpc/auth_des.h>	/* protocol for des style cred */
-
-/* Server side only remote procedure callee */
-#include <rpc/svc.h>		/* service manager and multiplexer */
-#include <rpc/svc_auth.h>	/* service side authenticator */
-
-/* Portmapper client, server, and protocol headers */
-#include <rpc/pmap_clnt.h>
-#include <rpc/pmap_prot.h>
-
-#ifndef _KERNEL
-#include <rpc/rpcb_clnt.h>	/* rpcbind interface functions */
-#endif
-
-#include <rpc/rpcent.h>
-
-__BEGIN_DECLS
-extern int get_myaddress(struct sockaddr_in *);
-extern int bindresvport(int, struct sockaddr_in *);
-extern int registerrpc(int, int, int, char *(*)(char [UDPMSGSIZE]),
-    xdrproc_t, xdrproc_t);
-extern int callrpc(const char *, int, int, int, xdrproc_t, void *,
-    xdrproc_t , void *);
-extern int getrpcport(char *, int, int, int);
-
-char *taddr2uaddr(const struct netconfig *, const struct netbuf *);
-struct netbuf *uaddr2taddr(const struct netconfig *, const char *);
-
-struct sockaddr;
-extern int bindresvport_sa(int, struct sockaddr *);
-__END_DECLS
-
-/*
- * The following are not exported interfaces, they are for internal library
- * and rpcbind use only. Do not use, they may change without notice.
- */
-__BEGIN_DECLS
-int __rpc_nconf2fd(const struct netconfig *);
-int __rpc_nconf2sockinfo(const struct netconfig *, struct __rpc_sockinfo *);
-int __rpc_fd2sockinfo(int, struct __rpc_sockinfo *);
-u_int __rpc_get_t_size(int, int, int);
-__END_DECLS
-
-#endif /* !_RPC_RPC_H */
Index: freebsd-userspace/rtems/include/rpc.h
===================================================================
--- freebsd-userspace/rtems/include/rpc.h	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
+++ freebsd-userspace/rtems/include/rpc.h	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -0,0 +1,108 @@
+/*	$NetBSD: rpc.h,v 1.13 2000/06/02 22:57:56 fvdl Exp $	*/
+
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part.  Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California  94043
+ *
+ *	from: @(#)rpc.h 1.9 88/02/08 SMI
+ *	from: @(#)rpc.h	2.4 89/07/11 4.0 RPCSRC
+ * $FreeBSD$
+ */
+
+/*
+ * rpc.h, Just includes the billions of rpc header files necessary to
+ * do remote procedure calling.
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+#ifndef _RPC_RPC_H
+#define _RPC_RPC_H
+
+#include <rpc/types.h>		/* some typedefs */
+#include <sys/socket.h>
+#include <netinet/in.h>
+
+/* external data representation interfaces */
+#include <rpc/xdr.h>		/* generic (de)serializer */
+
+/* Client side only authentication */
+#include <rpc/auth.h>		/* generic authenticator (client side) */
+
+/* Client side (mostly) remote procedure call */
+#include <rpc/clnt.h>		/* generic rpc stuff */
+
+/* semi-private protocol headers */
+#include <rpc/rpc_msg.h>	/* protocol for rpc messages */
+#include <rpc/auth_unix.h>	/* protocol for unix style cred */
+/*
+ *  Uncomment-out the next line if you are building the rpc library with
+ *  DES Authentication (see the README file in the secure_rpc/ directory).
+ */
+#include <rpc/auth_des.h>	/* protocol for des style cred */
+
+/* Server side only remote procedure callee */
+#include <rpc/svc.h>		/* service manager and multiplexer */
+#include <rpc/svc_auth.h>	/* service side authenticator */
+
+/* Portmapper client, server, and protocol headers */
+#include <rpc/pmap_clnt.h>
+#include <rpc/pmap_prot.h>
+
+#ifndef _KERNEL
+#include <rpc/rpcb_clnt.h>	/* rpcbind interface functions */
+#endif
+
+#include <rpc/rpcent.h>
+
+__BEGIN_DECLS
+extern int get_myaddress(struct sockaddr_in *);
+extern int bindresvport(int, struct sockaddr_in *);
+extern int registerrpc(int, int, int, char *(*)(char [UDPMSGSIZE]),
+    xdrproc_t, xdrproc_t);
+extern int callrpc(const char *, int, int, int, xdrproc_t, void *,
+    xdrproc_t , void *);
+extern int getrpcport(char *, int, int, int);
+
+char *taddr2uaddr(const struct netconfig *, const struct netbuf *);
+struct netbuf *uaddr2taddr(const struct netconfig *, const char *);
+
+struct sockaddr;
+extern int bindresvport_sa(int, struct sockaddr *);
+__END_DECLS
+
+/*
+ * The following are not exported interfaces, they are for internal library
+ * and rpcbind use only. Do not use, they may change without notice.
+ */
+__BEGIN_DECLS
+int __rpc_nconf2fd(const struct netconfig *);
+int __rpc_nconf2sockinfo(const struct netconfig *, struct __rpc_sockinfo *);
+int __rpc_fd2sockinfo(int, struct __rpc_sockinfo *);
+u_int __rpc_get_t_size(int, int, int);
+__END_DECLS
+
+#endif /* !_RPC_RPC_H */
Index: freebsd-userspace/rtems/include/rpc/clnt.h
===================================================================
--- freebsd-userspace/rtems/include/rpc/clnt.h	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
+++ freebsd-userspace/rtems/include/rpc/clnt.h	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -0,0 +1,557 @@
+/*	$NetBSD: clnt.h,v 1.14 2000/06/02 22:57:55 fvdl Exp $	*/
+
+/*
+ * The contents of this file are subject to the Sun Standards
+ * License Version 1.0 the (the "License";) You may not use
+ * this file except in compliance with the License.  You may
+ * obtain a copy of the License at lib/libc/rpc/LICENSE
+ *
+ * Software distributed under the License is distributed on
+ * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
+ * express or implied.  See the License for the specific
+ * language governing rights and limitations under the License.
+ *
+ * The Original Code is Copyright 1998 by Sun Microsystems, Inc
+ *
+ * The Initial Developer of the Original Code is:  Sun
+ * Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part.  Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California  94043
+ *
+ *	from: @(#)clnt.h 1.31 94/04/29 SMI
+ *	from: @(#)clnt.h	2.1 88/07/29 4.0 RPCSRC
+ * $FreeBSD$
+ */
+
+/*
+ * clnt.h - Client side remote procedure call interface.
+ *
+ * Copyright (c) 1986-1991,1994-1999 by Sun Microsystems, Inc.
+ * All rights reserved.
+ */
+
+#ifndef _RPC_CLNT_H_
+#define _RPC_CLNT_H_
+#include <rpc/clnt_stat.h>
+#include <sys/cdefs.h>
+#include <netconfig.h>
+#include <sys/un.h>
+
+/*
+ * Well-known IPV6 RPC broadcast address.
+ */
+#define RPCB_MULTICAST_ADDR "ff02::202"
+
+/*
+ * the following errors are in general unrecoverable.  The caller
+ * should give up rather than retry.
+ */
+#define IS_UNRECOVERABLE_RPC(s) (((s) == RPC_AUTHERROR) || \
+	((s) == RPC_CANTENCODEARGS) || \
+	((s) == RPC_CANTDECODERES) || \
+	((s) == RPC_VERSMISMATCH) || \
+	((s) == RPC_PROCUNAVAIL) || \
+	((s) == RPC_PROGUNAVAIL) || \
+	((s) == RPC_PROGVERSMISMATCH) || \
+	((s) == RPC_CANTDECODEARGS))
+
+/*
+ * Error info.
+ */
+struct rpc_err {
+	enum clnt_stat re_status;
+	union {
+		int RE_errno;		/* related system error */
+		enum auth_stat RE_why;	/* why the auth error occurred */
+		struct {
+			rpcvers_t low;	/* lowest version supported */
+			rpcvers_t high;	/* highest version supported */
+		} RE_vers;
+		struct {		/* maybe meaningful if RPC_FAILED */
+			int32_t s1;
+			int32_t s2;
+		} RE_lb;		/* life boot & debugging only */
+	} ru;
+#define	re_errno	ru.RE_errno
+#define	re_why		ru.RE_why
+#define	re_vers		ru.RE_vers
+#define	re_lb		ru.RE_lb
+};
+
+
+/*
+ * Client rpc handle.
+ * Created by individual implementations
+ * Client is responsible for initializing auth, see e.g. auth_none.c.
+ */
+typedef struct __rpc_client {
+	AUTH	*cl_auth;			/* authenticator */
+	struct clnt_ops {
+		/* call remote procedure */
+		enum clnt_stat	(*cl_call)(struct __rpc_client *,
+				    rpcproc_t, xdrproc_t, void *, xdrproc_t,
+				        void *, struct timeval);
+		/* abort a call */
+		void		(*cl_abort)(struct __rpc_client *);
+		/* get specific error code */
+		void		(*cl_geterr)(struct __rpc_client *,
+					struct rpc_err *);
+		/* frees results */
+		bool_t		(*cl_freeres)(struct __rpc_client *,
+					xdrproc_t, void *);
+		/* destroy this structure */
+		void		(*cl_destroy)(struct __rpc_client *);
+		/* the ioctl() of rpc */
+		bool_t          (*cl_control)(struct __rpc_client *, u_int,
+				    void *);
+	} *cl_ops;
+	void 			*cl_private;	/* private stuff */
+	char			*cl_netid;	/* network token */
+	char			*cl_tp;		/* device name */
+} CLIENT;
+
+
+/*
+ * Timers used for the pseudo-transport protocol when using datagrams
+ */
+struct rpc_timers {
+	u_short		rt_srtt;	/* smoothed round-trip time */
+	u_short		rt_deviate;	/* estimated deviation */
+	u_long		rt_rtxcur;	/* current (backed-off) rto */
+};
+
+/*      
+ * Feedback values used for possible congestion and rate control
+ */
+#define FEEDBACK_REXMIT1	1	/* first retransmit */
+#define FEEDBACK_OK		2	/* no retransmits */    
+
+/* Used to set version of portmapper used in broadcast */
+  
+#define CLCR_SET_LOWVERS	3
+#define CLCR_GET_LOWVERS	4
+ 
+#define RPCSMALLMSGSIZE 400	/* a more reasonable packet size */
+
+/*
+ * client side rpc interface ops
+ *
+ * Parameter types are:
+ *
+ */
+
+/*
+ * enum clnt_stat
+ * CLNT_CALL(rh, proc, xargs, argsp, xres, resp, timeout)
+ * 	CLIENT *rh;
+ *	rpcproc_t proc;
+ *	xdrproc_t xargs;
+ *	void *argsp;
+ *	xdrproc_t xres;
+ *	void *resp;
+ *	struct timeval timeout;
+ */
+#define	CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs) \
+	((*(rh)->cl_ops->cl_call)(rh, proc, xargs, \
+		argsp, xres, resp, secs))
+#define	clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \
+	((*(rh)->cl_ops->cl_call)(rh, proc, xargs, \
+		argsp, xres, resp, secs))
+
+/*
+ * void
+ * CLNT_ABORT(rh);
+ * 	CLIENT *rh;
+ */
+#define	CLNT_ABORT(rh)	((*(rh)->cl_ops->cl_abort)(rh))
+#define	clnt_abort(rh)	((*(rh)->cl_ops->cl_abort)(rh))
+
+/*
+ * struct rpc_err
+ * CLNT_GETERR(rh);
+ * 	CLIENT *rh;
+ */
+#define	CLNT_GETERR(rh,errp)	((*(rh)->cl_ops->cl_geterr)(rh, errp))
+#define	clnt_geterr(rh,errp)	((*(rh)->cl_ops->cl_geterr)(rh, errp))
+
+
+/*
+ * bool_t
+ * CLNT_FREERES(rh, xres, resp);
+ * 	CLIENT *rh;
+ *	xdrproc_t xres;
+ *	void *resp;
+ */
+#define	CLNT_FREERES(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
+#define	clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
+
+/*
+ * bool_t
+ * CLNT_CONTROL(cl, request, info)
+ *      CLIENT *cl;
+ *      u_int request;
+ *      char *info;
+ */
+#define	CLNT_CONTROL(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in))
+#define	clnt_control(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in))
+
+/*
+ * control operations that apply to both udp and tcp transports
+ */
+#define CLSET_TIMEOUT		1	/* set timeout (timeval) */
+#define CLGET_TIMEOUT		2	/* get timeout (timeval) */
+#define CLGET_SERVER_ADDR	3	/* get server's address (sockaddr) */
+#define CLGET_FD		6	/* get connections file descriptor */
+#define CLGET_SVC_ADDR		7	/* get server's address (netbuf) */
+#define CLSET_FD_CLOSE		8	/* close fd while clnt_destroy */
+#define CLSET_FD_NCLOSE		9	/* Do not close fd while clnt_destroy */
+#define CLGET_XID 		10	/* Get xid */
+#define CLSET_XID		11	/* Set xid */
+#define CLGET_VERS		12	/* Get version number */
+#define CLSET_VERS		13	/* Set version number */
+#define CLGET_PROG		14	/* Get program number */
+#define CLSET_PROG		15	/* Set program number */
+#define CLSET_SVC_ADDR		16	/* get server's address (netbuf) */
+#define CLSET_PUSH_TIMOD	17	/* push timod if not already present */
+#define CLSET_POP_TIMOD		18	/* pop timod */
+/*
+ * Connectionless only control operations
+ */
+#define CLSET_RETRY_TIMEOUT 4   /* set retry timeout (timeval) */
+#define CLGET_RETRY_TIMEOUT 5   /* get retry timeout (timeval) */
+#define CLSET_ASYNC		19
+#define CLSET_CONNECT		20	/* Use connect() for UDP. (int) */
+
+/*
+ * void
+ * CLNT_DESTROY(rh);
+ * 	CLIENT *rh;
+ */
+#define	CLNT_DESTROY(rh)	((*(rh)->cl_ops->cl_destroy)(rh))
+#define	clnt_destroy(rh)	((*(rh)->cl_ops->cl_destroy)(rh))
+
+
+/*
+ * RPCTEST is a test program which is accessible on every rpc
+ * transport/port.  It is used for testing, performance evaluation,
+ * and network administration.
+ */
+
+#define RPCTEST_PROGRAM		((rpcprog_t)1)
+#define RPCTEST_VERSION		((rpcvers_t)1)
+#define RPCTEST_NULL_PROC	((rpcproc_t)2)
+#define RPCTEST_NULL_BATCH_PROC	((rpcproc_t)3)
+
+/*
+ * By convention, procedure 0 takes null arguments and returns them
+ */
+
+#define NULLPROC ((rpcproc_t)0)
+
+/*
+ * Below are the client handle creation routines for the various
+ * implementations of client side rpc.  They can return NULL if a
+ * creation failure occurs.
+ */
+
+/*
+ * Generic client creation routine. Supported protocols are those that
+ * belong to the nettype namespace (/etc/netconfig).
+ */
+__BEGIN_DECLS
+extern CLIENT *clnt_create(const char *, const rpcprog_t, const rpcvers_t,
+			   const char *);
+/*
+ *
+ * 	const char *hostname;			-- hostname
+ *	const rpcprog_t prog;			-- program number
+ *	const rpcvers_t vers;			-- version number
+ *	const char *nettype;			-- network type
+ */
+
+ /*
+ * Generic client creation routine. Just like clnt_create(), except
+ * it takes an additional timeout parameter.
+ */
+extern CLIENT * clnt_create_timed(const char *, const rpcprog_t,
+	const rpcvers_t, const char *, const struct timeval *);
+/*
+ *
+ *	const char *hostname;			-- hostname
+ *	const rpcprog_t prog;			-- program number
+ *	const rpcvers_t vers;			-- version number
+ *	const char *nettype;			-- network type
+ *	const struct timeval *tp;		-- timeout
+ */
+
+/*
+ * Generic client creation routine. Supported protocols are which belong
+ * to the nettype name space.
+ */
+extern CLIENT *clnt_create_vers(const char *, const rpcprog_t, rpcvers_t *,
+				const rpcvers_t, const rpcvers_t,
+				const char *);
+/*
+ *	const char *host;		-- hostname
+ *	const rpcprog_t prog;		-- program number
+ *	rpcvers_t *vers_out;		-- servers highest available version
+ *	const rpcvers_t vers_low;	-- low version number
+ *	const rpcvers_t vers_high;	-- high version number
+ *	const char *nettype;		-- network type
+ */
+
+/*
+ * Generic client creation routine. Supported protocols are which belong
+ * to the nettype name space.
+ */
+extern CLIENT * clnt_create_vers_timed(const char *, const rpcprog_t,
+	rpcvers_t *, const rpcvers_t, const rpcvers_t, const char *,
+	const struct timeval *);
+/*
+ *	const char *host;		-- hostname
+ *	const rpcprog_t prog;		-- program number
+ *	rpcvers_t *vers_out;		-- servers highest available version
+ *	const rpcvers_t vers_low;	-- low version number
+ *	const rpcvers_t vers_high;	-- high version number
+ *	const char *nettype;		-- network type
+ *	const struct timeval *tp	-- timeout
+ */
+
+/*
+ * Generic client creation routine. It takes a netconfig structure
+ * instead of nettype
+ */
+extern CLIENT *clnt_tp_create(const char *, const rpcprog_t,
+			      const rpcvers_t, const struct netconfig *);
+/*
+ *	const char *hostname;			-- hostname
+ *	const rpcprog_t prog;			-- program number
+ *	const rpcvers_t vers;			-- version number
+ *	const struct netconfig *netconf; 	-- network config structure
+ */
+
+/*
+ * Generic client creation routine. Just like clnt_tp_create(), except
+ * it takes an additional timeout parameter.
+ */
+extern CLIENT * clnt_tp_create_timed(const char *, const rpcprog_t,
+	const rpcvers_t, const struct netconfig *, const struct timeval *);
+/*
+ *	const char *hostname;			-- hostname
+ *	const rpcprog_t prog;			-- program number
+ *	const rpcvers_t vers;			-- version number
+ *	const struct netconfig *netconf; 	-- network config structure
+ *	const struct timeval *tp		-- timeout
+ */
+
+/*
+ * Generic TLI create routine. Only provided for compatibility.
+ */
+
+extern CLIENT *clnt_tli_create(const int, const struct netconfig *,
+			       struct netbuf *, const rpcprog_t,
+			       const rpcvers_t, const u_int, const u_int);
+/*
+ *	const register int fd;		-- fd
+ *	const struct netconfig *nconf;	-- netconfig structure
+ *	struct netbuf *svcaddr;		-- servers address
+ *	const u_long prog;			-- program number
+ *	const u_long vers;			-- version number
+ *	const u_int sendsz;			-- send size
+ *	const u_int recvsz;			-- recv size
+ */
+
+/*
+ * Low level clnt create routine for connectionful transports, e.g. tcp.
+ */
+extern CLIENT *clnt_vc_create(const int, const struct netbuf *,
+			      const rpcprog_t, const rpcvers_t,
+			      u_int, u_int);
+/*
+ * Added for compatibility to old rpc 4.0. Obsoleted by clnt_vc_create().
+ */
+extern CLIENT *clntunix_create(struct sockaddr_un *,
+			       u_long, u_long, int *, u_int, u_int);
+/*
+ *	const int fd;				-- open file descriptor
+ *	const struct netbuf *svcaddr;		-- servers address
+ *	const rpcprog_t prog;			-- program number
+ *	const rpcvers_t vers;			-- version number
+ *	const u_int sendsz;			-- buffer recv size
+ *	const u_int recvsz;			-- buffer send size
+ */
+
+/*
+ * Low level clnt create routine for connectionless transports, e.g. udp.
+ */
+extern CLIENT *clnt_dg_create(const int, const struct netbuf *,
+			      const rpcprog_t, const rpcvers_t,
+			      const u_int, const u_int);
+/*
+ *	const int fd;				-- open file descriptor
+ *	const struct netbuf *svcaddr;		-- servers address
+ *	const rpcprog_t program;		-- program number
+ *	const rpcvers_t version;		-- version number
+ *	const u_int sendsz;			-- buffer recv size
+ *	const u_int recvsz;			-- buffer send size
+ */
+
+/*
+ * Memory based rpc (for speed check and testing)
+ * CLIENT *
+ * clnt_raw_create(prog, vers)
+ *	u_long prog;
+ *	u_long vers;
+ */
+extern CLIENT *clnt_raw_create(rpcprog_t, rpcvers_t);
+
+__END_DECLS
+
+
+/*
+ * Print why creation failed
+ */
+__BEGIN_DECLS
+extern void clnt_pcreateerror(const char *);			/* stderr */
+extern char *clnt_spcreateerror(const char *);			/* string */
+__END_DECLS
+
+/*
+ * Like clnt_perror(), but is more verbose in its output
+ */
+__BEGIN_DECLS
+extern void clnt_perrno(enum clnt_stat);		/* stderr */
+extern char *clnt_sperrno(enum clnt_stat);		/* string */
+__END_DECLS
+
+/*
+ * Print an English error message, given the client error code
+ */
+__BEGIN_DECLS
+extern void clnt_perror(CLIENT *, const char *);	 	/* stderr */
+extern char *clnt_sperror(CLIENT *, const char *);		/* string */
+__END_DECLS
+
+
+/*
+ * If a creation fails, the following allows the user to figure out why.
+ */
+struct rpc_createerr {
+	enum clnt_stat cf_stat;
+	struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */
+};
+
+__BEGIN_DECLS
+extern struct rpc_createerr	*__rpc_createerr(void);
+__END_DECLS
+#define rpc_createerr		(*(__rpc_createerr()))
+
+/*
+ * The simplified interface:
+ * enum clnt_stat
+ * rpc_call(host, prognum, versnum, procnum, inproc, in, outproc, out, nettype)
+ *	const char *host;
+ *	const rpcprog_t prognum;
+ *	const rpcvers_t versnum;
+ *	const rpcproc_t procnum;
+ *	const xdrproc_t inproc, outproc;
+ *	const char *in;
+ *	char *out;
+ *	const char *nettype;
+ */
+__BEGIN_DECLS
+extern enum clnt_stat rpc_call(const char *, const rpcprog_t,
+			       const rpcvers_t, const rpcproc_t,
+			       const xdrproc_t, const char *,
+			       const xdrproc_t, char *, const char *);
+__END_DECLS
+
+/*
+ * RPC broadcast interface
+ * The call is broadcasted to all locally connected nets.
+ *
+ * extern enum clnt_stat
+ * rpc_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp,
+ *			eachresult, nettype)
+ *	const rpcprog_t		prog;		-- program number
+ *	const rpcvers_t		vers;		-- version number
+ *	const rpcproc_t		proc;		-- procedure number
+ *	const xdrproc_t	xargs;		-- xdr routine for args
+ *	caddr_t		argsp;		-- pointer to args
+ *	const xdrproc_t	xresults;	-- xdr routine for results
+ *	caddr_t		resultsp;	-- pointer to results
+ *	const resultproc_t	eachresult;	-- call with each result
+ *	const char		*nettype;	-- Transport type
+ *
+ * For each valid response received, the procedure eachresult is called.
+ * Its form is:
+ *		done = eachresult(resp, raddr, nconf)
+ *			bool_t done;
+ *			caddr_t resp;
+ *			struct netbuf *raddr;
+ *			struct netconfig *nconf;
+ * where resp points to the results of the call and raddr is the
+ * address if the responder to the broadcast.  nconf is the transport
+ * on which the response was received.
+ *
+ * extern enum clnt_stat
+ * rpc_broadcast_exp(prog, vers, proc, xargs, argsp, xresults, resultsp,
+ *			eachresult, inittime, waittime, nettype)
+ *	const rpcprog_t		prog;		-- program number
+ *	const rpcvers_t		vers;		-- version number
+ *	const rpcproc_t		proc;		-- procedure number
+ *	const xdrproc_t	xargs;		-- xdr routine for args
+ *	caddr_t		argsp;		-- pointer to args
+ *	const xdrproc_t	xresults;	-- xdr routine for results
+ *	caddr_t		resultsp;	-- pointer to results
+ *	const resultproc_t	eachresult;	-- call with each result
+ *	const int 		inittime;	-- how long to wait initially
+ *	const int 		waittime;	-- maximum time to wait
+ *	const char		*nettype;	-- Transport type
+ */
+
+typedef bool_t (*resultproc_t)(caddr_t, ...);
+
+__BEGIN_DECLS
+extern enum clnt_stat rpc_broadcast(const rpcprog_t, const rpcvers_t,
+				    const rpcproc_t, const xdrproc_t,
+				    caddr_t, const xdrproc_t, caddr_t,
+				    const resultproc_t, const char *);
+extern enum clnt_stat rpc_broadcast_exp(const rpcprog_t, const rpcvers_t,
+					const rpcproc_t, const xdrproc_t,
+					caddr_t, const xdrproc_t, caddr_t,
+					const resultproc_t, const int,
+					const int, const char *);
+__END_DECLS
+
+/* For backward compatibility */
+#include <rpc/clnt_soc.h>
+
+#endif /* !_RPC_CLNT_H_ */
Index: rvices/librpc/include/rpc/clnt.h
===================================================================
--- services/librpc/include/rpc/clnt.h	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ 	(revision )
@@ -1,310 +1,0 @@
-/*	$NetBSD: clnt.h,v 1.14 2000/06/02 22:57:55 fvdl Exp $	*/
-
-/*
- * The contents of this file are subject to the Sun Standards
- * License Version 1.0 the (the "License";) You may not use
- * this file except in compliance with the License.  You may
- * obtain a copy of the License at lib/libc/rpc/LICENSE
- *
- * Software distributed under the License is distributed on
- * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
- * express or implied.  See the License for the specific
- * language governing rights and limitations under the License.
- *
- * The Original Code is Copyright 1998 by Sun Microsystems, Inc
- *
- * The Initial Developer of the Original Code is:  Sun
- * Microsystems, Inc.
- *
- * All Rights Reserved.
- *
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part.  Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California  94043
- *
- *	from: @(#)clnt.h 1.31 94/04/29 SMI
- *	from: @(#)clnt.h	2.1 88/07/29 4.0 RPCSRC
- * $FreeBSD: src/include/rpc/clnt.h,v 1.21 2003/01/24 01:47:55 fjoe Exp $
- */
-
-/*
- * clnt.h - Client side remote procedure call interface.
- *
- * Copyright (c) 1986-1991,1994-1999 by Sun Microsystems, Inc.
- * All rights reserved.
- */
-
-
-#ifndef _RPC_CLNT_H_
-#define _RPC_CLNT_H_
-#include <rpc/clnt_stat.h>
-#include <sys/cdefs.h>
-#include <sys/un.h>
-#include <rpc/auth.h> /* auth_stat */
-
-/*
- * Error info.
- */
-struct rpc_err {
-	enum clnt_stat re_status;
-	union {
-		int RE_errno;		/* related system error */
-		enum auth_stat RE_why;	/* why the auth error occurred */
-		struct {
-			rpcvers_t low;	/* lowest version supported */
-			rpcvers_t high;	/* highest version supported */
-		} RE_vers;
-		struct {		/* maybe meaningful if RPC_FAILED */
-			int32_t s1;
-			int32_t s2;
-		} RE_lb;		/* life boot & debugging only */
-	} ru;
-#define	re_errno	ru.RE_errno
-#define	re_why		ru.RE_why
-#define	re_vers		ru.RE_vers
-#define	re_lb		ru.RE_lb
-};
-
-
-/*
- * Client rpc handle.
- * Created by individual implementations
- * Client is responsible for initializing auth, see e.g. auth_none.c.
- */
-typedef struct __rpc_client {
-	AUTH	*cl_auth;			/* authenticator */
-	struct clnt_ops {
-		/* call remote procedure */
-		enum clnt_stat	(*cl_call)(struct __rpc_client *,
-				    rpcproc_t, xdrproc_t, void *, xdrproc_t,
-				        void *, struct timeval);
-		/* abort a call */
-		void		(*cl_abort)(void);
-		/* get specific error code */
-		void		(*cl_geterr)(struct __rpc_client *,
-					struct rpc_err *);
-		/* frees results */
-		bool_t		(*cl_freeres)(struct __rpc_client *,
-					xdrproc_t, void *);
-		/* destroy this structure */
-		void		(*cl_destroy)(struct __rpc_client *);
-		/* the ioctl() of rpc */
-		bool_t          (*cl_control)(struct __rpc_client *, int,
-					char *);
-	} *cl_ops;
-	void			*cl_private;	/* private stuff */
-} CLIENT;
-
-#define RPCSMALLMSGSIZE	400	/* a more reasonable packet size */
-
-/*
- * client side rpc interface ops
- *
- * Parameter types are:
- *
- */
-
-/*
- * enum clnt_stat
- * CLNT_CALL(rh, proc, xargs, argsp, xres, resp, timeout)
- * 	CLIENT *rh;
- *	rpcproc_t proc;
- *	xdrproc_t xargs;
- *	void *argsp;
- *	xdrproc_t xres;
- *	void *resp;
- *	struct timeval timeout;
- */
-#define	CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs)	\
-	((*(rh)->cl_ops->cl_call)(rh, proc, xargs, \
-		argsp, xres, resp, secs))
-#define	clnt_call(rh, proc, xargs, argsp, xres, resp, secs)	\
-	((*(rh)->cl_ops->cl_call)(rh, proc, xargs, \
-		argsp, xres, resp, secs))
-
-/*
- * void
- * CLNT_ABORT(rh);
- * 	CLIENT *rh;
- */
-#define	CLNT_ABORT(rh)	((*(rh)->cl_ops->cl_abort)(rh))
-#define	clnt_abort(rh)	((*(rh)->cl_ops->cl_abort)(rh))
-
-/*
- * struct rpc_err
- * CLNT_GETERR(rh);
- * 	CLIENT *rh;
- */
-#define	CLNT_GETERR(rh,errp)	((*(rh)->cl_ops->cl_geterr)(rh, errp))
-#define	clnt_geterr(rh,errp)	((*(rh)->cl_ops->cl_geterr)(rh, errp))
-
-
-/*
- * bool_t
- * CLNT_FREERES(rh, xres, resp);
- * 	CLIENT *rh;
- *	xdrproc_t xres;
- *	void *resp;
- */
-#define	CLNT_FREERES(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
-#define	clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
-
-/*
- * bool_t
- * CLNT_CONTROL(cl, request, info)
- *      CLIENT *cl;
- *      u_int request;
- *      char *info;
- */
-#define	CLNT_CONTROL(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in))
-#define	clnt_control(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in))
-
-/*
- * control operations that apply to udp, tcp and unix transports
- *
- * Note: options marked XXX are no-ops in this implementation of RPC.
- * The are present in TI-RPC but can't be implemented here since they
- * depend on the presence of STREAMS/TLI, which we don't have.
- *
- */
-#define CLSET_TIMEOUT       1   /* set timeout (timeval) */
-#define CLGET_TIMEOUT       2   /* get timeout (timeval) */
-#define CLGET_SERVER_ADDR   3   /* get server's address (sockaddr) */
-#define CLGET_FD            6	/* get connections file descriptor */
-#define CLGET_SVC_ADDR      7   /* get server's address (netbuf) */
-#define CLSET_FD_CLOSE      8   /* close fd while clnt_destroy */
-#define CLSET_FD_NCLOSE     9   /* Do not close fd while clnt_destroy */
-#define CLGET_XID           10	/* Get xid */
-#define CLSET_XID           11	/* Set xid */
-#define CLGET_VERS          12	/* Get version number */
-#define CLSET_VERS          13	/* Set version number */
-#define CLGET_PROG	    14	/* Get program number */
-#define CLSET_PROG          15	/* Set program number */
-#define CLSET_SVC_ADDR      16	/* get server's address (netbuf)         XXX */
-#define CLSET_PUSH_TIMOD    17	/* push timod if not already present     XXX */
-#define CLSET_POP_TIMOD     18	/* pop timod                             XXX */
-
-/*
- * Connectionless only control operations
- */
-#define CLSET_RETRY_TIMEOUT 4   /* set retry timeout (timeval) */
-#define CLGET_RETRY_TIMEOUT 5   /* get retry timeout (timeval) */
-
-/*
- * Operations which GSSAPI needs. (Bletch.)
- */
-#define CLGET_LOCAL_ADDR    19	/* get local addr (sockaddr) */
-
-
-/*
- * void
- * CLNT_DESTROY(rh);
- * 	CLIENT *rh;
- */
-#define	CLNT_DESTROY(rh)	((*(rh)->cl_ops->cl_destroy)(rh))
-#define	clnt_destroy(rh)	((*(rh)->cl_ops->cl_destroy)(rh))
-
-
-/*
- * RPCTEST is a test program which is accessible on every rpc
- * transport/port.  It is used for testing, performance evaluation,
- * and network administration.
- */
-
-#define RPCTEST_PROGRAM		((rpcprog_t)1)
-#define RPCTEST_VERSION		((rpcvers_t)1)
-#define RPCTEST_NULL_PROC	((rpcproc_t)2)
-#define RPCTEST_NULL_BATCH_PROC	((rpcproc_t)3)
-
-/*
- * By convention, procedure 0 takes null arguments and returns them
- */
-
-#define NULLPROC ((rpcproc_t)0)
-
-/*
- * Below are the client handle creation routines for the various
- * implementations of client side rpc.  They can return NULL if a
- * creation failure occurs.
- */
-
-/*
- * Generic client creation routine. Supported protocols are "udp", "tcp"
- * and "unix".
- */
-__BEGIN_DECLS
-extern CLIENT *clnt_create(const char *, const rpcprog_t, const rpcvers_t,
-	const char *);
-__END_DECLS
-
-/*
- * Added for compatibility to old rpc 4.0. Obsoleted by clnt_vc_create().
- */
-__BEGIN_DECLS
-extern CLIENT *clntunix_create(struct sockaddr_un *,
-			       u_long, u_long, int *, u_int, u_int);
-__END_DECLS
-
-
-/*
- * Print why creation failed
- */
-__BEGIN_DECLS
-extern void clnt_pcreateerror(const char *);			/* stderr */
-extern char *clnt_spcreateerror(const char *);		/* string */
-__END_DECLS
-
-/*
- * Like clnt_perror(), but is more verbose in its output
- */
-__BEGIN_DECLS
-extern void clnt_perrno(enum clnt_stat);		/* stderr */
-extern char *clnt_sperrno(enum clnt_stat);		/* string */
-__END_DECLS
-
-/*
- * Print an English error message, given the client error code
- */
-__BEGIN_DECLS
-extern void clnt_perror(CLIENT *, const char *); 		/* stderr */
-extern char *clnt_sperror(CLIENT *, const char *);		/* string */
-__END_DECLS
-
-
-/*
- * If a creation fails, the following allows the user to figure out why.
- */
-struct rpc_createerr {
-	enum clnt_stat cf_stat;
-	struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */
-};
-
-extern struct rpc_createerr rpc_createerr;
-
-/* For backward compatibility */
-#include <rpc/clnt_soc.h>
-
-#endif /* !_RPC_CLNT_H_ */
Index: services/librpc/include/rpc/rpc_com.h
===================================================================
--- services/librpc/include/rpc/rpc_com.h	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/include/rpc/rpc_com.h	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -57,5 +57,8 @@
 __BEGIN_DECLS
 extern u_int __rpc_get_a_size(int);
-extern u_int __rpc_get_t_size(int, long);
+#ifndef __rtems__
+	/* XXX defined in old.. in new rpc.h as internal */
+	extern u_int __rpc_get_t_size(int, long);
+#endif
 extern int __rpc_dtbsize(void);
 extern int _rpc_dtablesize(void);
Index: rvices/librpc/include/rpc/svc.h
===================================================================
--- services/librpc/include/rpc/svc.h	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ 	(revision )
@@ -1,296 +1,0 @@
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part.  Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California  94043
- *
- *	from: @(#)svc.h 1.35 88/12/17 SMI
- *	from: @(#)svc.h      1.27    94/04/25 SMI
- * $FreeBSD: src/include/rpc/svc.h,v 1.24 2003/06/15 10:32:01 mbr Exp $
- */
-
-/*
- * svc.h, Server-side remote procedure call interface.
- *
- * Copyright (C) 1986-1993 by Sun Microsystems, Inc.
- */
-
-#ifndef _RPC_SVC_H
-#define _RPC_SVC_H
-
-#include <sys/cdefs.h>
-#include <rpc/types.h>
-#include <rpc/xdr.h> /* xdrproc_t */
-#include <sys/socket.h> /* socklen_t */
-#include <netinet/in.h> /* struct sockaddr_in */
-#include <rpc/auth.h> /* auth_stat */
-
-/*
- * This interface must manage two items concerning remote procedure calling:
- *
- * 1) An arbitrary number of transport connections upon which rpc requests
- * are received.  The two most notable transports are TCP and UDP;  they are
- * created and registered by routines in svc_tcp.c and svc_udp.c, respectively;
- * they in turn call xprt_register and xprt_unregister.
- *
- * 2) An arbitrary number of locally registered services.  Services are
- * described by the following four data: program number, version number,
- * "service dispatch" function, a transport handle, and a boolean that
- * indicates whether or not the exported program should be registered with a
- * local binder service;  if true the program's number and version and the
- * port number from the transport handle are registered with the binder.
- * These data are registered with the rpc svc system via svc_register.
- *
- * A service's dispatch function is called whenever an rpc request comes in
- * on a transport.  The request's program and version numbers must match
- * those of the registered service.  The dispatch function is passed two
- * parameters, struct svc_req * and SVCXPRT *, defined below.
- */
-
-enum xprt_stat {
-	XPRT_DIED,
-	XPRT_MOREREQS,
-	XPRT_IDLE,
-	_XPRT_STAT = 0xffffffff
-};
-
-struct rpc_msg;
-
-/*
- * Server side transport handle
- */
-typedef struct __rpc_svcxprt {
-	int		xp_sock;
-	u_short		xp_port;	 /* associated port number */
-	struct xp_ops {
-	    /* receive incoming requests */
-	    bool_t	(*xp_recv)(struct __rpc_svcxprt *, struct rpc_msg *);
-	    /* get transport status */
-	    enum xprt_stat (*xp_stat)(struct __rpc_svcxprt *);
-	    /* get arguments */
-	    bool_t	(*xp_getargs)(struct __rpc_svcxprt *, xdrproc_t,
-				caddr_t args_ptr);
-	    /* send reply */
-	    bool_t	(*xp_reply)(struct __rpc_svcxprt *, struct rpc_msg *);
-	    /* free mem allocated for args */
-	    bool_t	(*xp_freeargs)(struct __rpc_svcxprt *, xdrproc_t,
-				caddr_t args_ptr);
-	    /* destroy this struct */
-	    void	(*xp_destroy)(struct __rpc_svcxprt *);
-	} *xp_ops;
-	socklen_t	xp_addrlen;	 /* length of remote address */
-	struct sockaddr_in xp_raddr;	 /* remote addr. (backward ABI compat) */
-	struct opaque_auth xp_verf;	 /* raw response verifier */
-	void		*xp_p1;		 /* private: for use by svc ops */
-	void		*xp_p2;		 /* private: for use by svc ops */
-} SVCXPRT;
-
-/*
- * Service request
- */
-struct svc_req {
-	u_int32_t	rq_prog;	/* service program number */
-	u_int32_t	rq_vers;	/* service protocol version */
-	u_int32_t	rq_proc;	/* the desired procedure */
-	struct opaque_auth rq_cred;	/* raw creds from the wire */
-	caddr_t		rq_clntcred;	/* read only cooked cred */
-	SVCXPRT		*rq_xprt;	/* associated transport */
-};
-
-
-/*
- * Operations defined on an SVCXPRT handle
- *
- * SVCXPRT		*xprt;
- * struct rpc_msg	*msg;
- * xdrproc_t		 xargs;
- * caddr_t		 argsp;
- */
-#define SVC_RECV(xprt, msg)				\
-	(*(xprt)->xp_ops->xp_recv)((xprt), (msg))
-#define svc_recv(xprt, msg)				\
-	(*(xprt)->xp_ops->xp_recv)((xprt), (msg))
-
-#define SVC_STAT(xprt)					\
-	(*(xprt)->xp_ops->xp_stat)(xprt)
-#define svc_stat(xprt)					\
-	(*(xprt)->xp_ops->xp_stat)(xprt)
-
-#define SVC_GETARGS(xprt, xargs, argsp)			\
-	(*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp))
-#define svc_getargs(xprt, xargs, argsp)			\
-	(*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp))
-
-#define SVC_REPLY(xprt, msg)				\
-	(*(xprt)->xp_ops->xp_reply) ((xprt), (msg))
-#define svc_reply(xprt, msg)				\
-	(*(xprt)->xp_ops->xp_reply) ((xprt), (msg))
-
-#define SVC_FREEARGS(xprt, xargs, argsp)		\
-	(*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp))
-#define svc_freeargs(xprt, xargs, argsp)		\
-	(*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp))
-
-#define SVC_DESTROY(xprt)				\
-	(*(xprt)->xp_ops->xp_destroy)(xprt)
-#define svc_destroy(xprt)				\
-	(*(xprt)->xp_ops->xp_destroy)(xprt)
-
-/*
- * Transport registration.
- *
- * xprt_register(xprt)
- *	SVCXPRT *xprt;
- */
-__BEGIN_DECLS
-extern void	xprt_register(SVCXPRT *);
-__END_DECLS
-
-/*
- * Transport un-register
- *
- * xprt_unregister(xprt)
- *	SVCXPRT *xprt;
- */
-__BEGIN_DECLS
-extern void	xprt_unregister(SVCXPRT *);
-__END_DECLS
-
-
-/*
- * When the service routine is called, it must first check to see if it
- * knows about the procedure;  if not, it should call svcerr_noproc
- * and return.  If so, it should deserialize its arguments via
- * SVC_GETARGS (defined above).  If the deserialization does not work,
- * svcerr_decode should be called followed by a return.  Successful
- * decoding of the arguments should be followed the execution of the
- * procedure's code and a call to svc_sendreply.
- *
- * Also, if the service refuses to execute the procedure due to too-
- * weak authentication parameters, svcerr_weakauth should be called.
- * Note: do not confuse access-control failure with weak authentication!
- *
- * NB: In pure implementations of rpc, the caller always waits for a reply
- * msg.  This message is sent when svc_sendreply is called.
- * Therefore pure service implementations should always call
- * svc_sendreply even if the function logically returns void;  use
- * xdr.h - xdr_void for the xdr routine.  HOWEVER, tcp based rpc allows
- * for the abuse of pure rpc via batched calling or pipelining.  In the
- * case of a batched call, svc_sendreply should NOT be called since
- * this would send a return message, which is what batching tries to avoid.
- * It is the service/protocol writer's responsibility to know which calls are
- * batched and which are not.  Warning: responding to batch calls may
- * deadlock the caller and server processes!
- */
-
-__BEGIN_DECLS
-extern bool_t	svc_sendreply(SVCXPRT *, xdrproc_t, void *);
-extern void	svcerr_decode(SVCXPRT *);
-extern void	svcerr_weakauth(SVCXPRT *);
-extern void	svcerr_noproc(SVCXPRT *);
-extern void	svcerr_progvers(SVCXPRT *, rpcvers_t, rpcvers_t);
-extern void	svcerr_auth(SVCXPRT *, enum auth_stat);
-extern void	svcerr_noprog(SVCXPRT *);
-extern void	svcerr_systemerr(SVCXPRT *);
-__END_DECLS
-
-/*
- * Lowest level dispatching -OR- who owns this process anyway.
- * Somebody has to wait for incoming requests and then call the correct
- * service routine.  The routine svc_run does infinite waiting; i.e.,
- * svc_run never returns.
- * Since another (co-existant) package may wish to selectively wait for
- * incoming calls or other events outside of the rpc architecture, the
- * routine svc_getreq is provided.  It must be passed readfds, the
- * "in-place" results of a select system call (see select, section 2).
- */
-
-/*
- * Global keeper of rpc service descriptors in use
- * dynamic; must be inspected before each call to select
- */
-extern int svc_maxfd;
-extern fd_set svc_fdset;
-#define svc_fds svc_fdset.fds_bits[0]	/* compatibility */
-
-#ifndef _KERNEL
-/*
- * a small program implemented by the svc_rpc implementation itself;
- * also see clnt.h for protocol numbers.
- */
-__BEGIN_DECLS
-extern void rpctest_service(void);
-__END_DECLS
-#endif
-
-__BEGIN_DECLS
-extern void	svc_getreq(int);
-extern void	svc_getreqset(fd_set *);
-extern void	svc_getreqset2(fd_set *, int); /* XXX: nonstd, undoc */
-extern void	svc_run(void);
-__END_DECLS
-
-/*
- * Socket to use on svcxxx_create call to get default socket
- */
-#define	RPC_ANYSOCK	-1
-#define RPC_ANYFD	RPC_ANYSOCK
-
-/*
- * These are the existing service side transport implementations
- */
-
-__BEGIN_DECLS
-/*
- * Transport independent svc_create routine.
- */
-
-/*
- * Connectionless and connectionful create routines
- */
-
-extern SVCXPRT *svc_vc_create(const int, const u_int, const u_int);
-/*
- *      const int fd;                           -- open connection end point
- *      const u_int sendsize;                   -- max send size
- *      const u_int recvsize;                   -- max recv size
- */
-
-/*
- * Added for compatibility to old rpc 4.0. Obsoleted by svc_vc_create().
- */
-extern SVCXPRT *svcunix_create(int, u_int, u_int, char *);
-
-/*
- * Added for compatibility to old rpc 4.0. Obsoleted by svc_fd_create().
- */
-extern SVCXPRT *svcunixfd_create(int, u_int, u_int);
-__END_DECLS
-
-
-/* for backward compatibility */
-#include <rpc/svc_soc.h>
-
-#endif /* !_RPC_SVC_H */
Index: services/librpc/src/rpc/auth_none.c
===================================================================
--- services/librpc/src/rpc/auth_none.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/auth_none.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -46,5 +46,5 @@
 #endif
 
-#include <stdlib.h>
+#include <freebsd/bsd.h>
 #include <rpc/types.h>
 #include <rpc/xdr.h>
Index: services/librpc/src/rpc/auth_unix.c
===================================================================
--- services/librpc/src/rpc/auth_unix.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/auth_unix.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -50,4 +50,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <stdio.h>
 #include <stdlib.h>
Index: services/librpc/src/rpc/authunix_prot.c
===================================================================
--- services/librpc/src/rpc/authunix_prot.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/authunix_prot.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -46,4 +46,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <rpc/types.h>
 #include <rpc/xdr.h>
Index: services/librpc/src/rpc/bindresvport.c
===================================================================
--- services/librpc/src/rpc/bindresvport.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/bindresvport.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -47,4 +47,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <sys/types.h>
 #include <sys/socket.h>
Index: services/librpc/src/rpc/clnt_generic.c
===================================================================
--- services/librpc/src/rpc/clnt_generic.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/clnt_generic.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -41,4 +41,6 @@
 #endif
 
+#include <freebsd/bsd.h>
+#include <rpc/rpc.h>
 #include <rpc/rpc.h>
 #include <sys/socket.h>
Index: services/librpc/src/rpc/clnt_perror.c
===================================================================
--- services/librpc/src/rpc/clnt_perror.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/clnt_perror.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -45,4 +45,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -52,4 +53,7 @@
 #include <rpc/auth.h>
 #include <rpc/clnt.h>
+#ifdef __rtems__
+#include <rpc/rpc_rtems.h>
+#endif
 
 static char *auth_errmsg(enum auth_stat stat);
Index: services/librpc/src/rpc/clnt_raw.c
===================================================================
--- services/librpc/src/rpc/clnt_raw.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/clnt_raw.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -49,7 +49,11 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <rpc/rpc.h>
 #include <stdlib.h>
 #include <stdio.h>
+#ifdef __rtems__
+#include <rpc/rpc_rtems.h>
+#endif
 
 #define MCALL_MSG_SIZE 24
@@ -190,5 +194,5 @@
 	}  /* end successful completion */
 	else {
-		if (AUTH_REFRESH(h->cl_auth))
+		if (AUTH_REFRESH(h->cl_auth, &msg))
 			goto call_again;
 	}  /* end of unsuccessful completion */
Index: services/librpc/src/rpc/clnt_simple.c
===================================================================
--- services/librpc/src/rpc/clnt_simple.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/clnt_simple.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -45,4 +45,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <sys/param.h>
 #include <stdio.h>
@@ -53,4 +54,7 @@
 #include <sys/socket.h>
 #include <netdb.h>
+#ifdef __rtems__
+#include <rpc/rpc_rtems.h>
+#endif
 
 struct call_rpc_private {
@@ -64,8 +68,8 @@
 int
 callrpc(
-	char *host,
+	const char *host,
 	int prognum, int versnum, int procnum,
-	xdrproc_t inproc, char *in,
-	xdrproc_t outproc, char *out )
+	xdrproc_t inproc, void *in,
+	xdrproc_t outproc, void *out )
 {
 	register struct call_rpc_private *crp = callrpc_private;
Index: services/librpc/src/rpc/clnt_tcp.c
===================================================================
--- services/librpc/src/rpc/clnt_tcp.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/clnt_tcp.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -57,4 +57,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -331,5 +332,5 @@
 	else {
 		/* maybe our credentials need to be refreshed ... */
-		if (refreshes-- && AUTH_REFRESH(h->cl_auth))
+		if (refreshes-- && AUTH_REFRESH(h->cl_auth, &reply_msg))
 			goto call_again;
 	}  /* end of unsuccessful completion */
@@ -471,4 +472,6 @@
 		break;
 
+#ifndef __rtems__
+	/* XXX defined in old.. not new */
 	case CLGET_LOCAL_ADDR:
 		len = sizeof(struct sockaddr);
@@ -476,4 +479,5 @@
 			return(FALSE);
 		break;
+#endif
 
 	case CLGET_RETRY_TIMEOUT:
Index: services/librpc/src/rpc/clnt_udp.c
===================================================================
--- services/librpc/src/rpc/clnt_udp.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/clnt_udp.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -44,4 +44,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -389,5 +390,5 @@
 		else {
 			/* maybe our credentials need to be refreshed ... */
-			if (nrefreshes > 0 && AUTH_REFRESH(cl->cl_auth)) {
+			if (nrefreshes > 0 && AUTH_REFRESH(cl->cl_auth, &reply_msg)) {
 				nrefreshes--;
 				goto call_again;
@@ -550,4 +551,6 @@
 				= htonl(*(u_long *)info);
 		break;
+#ifndef __rtems__
+	/* XXX defined in old.. not new */
 	case CLGET_LOCAL_ADDR:
 		len = sizeof(struct sockaddr);
@@ -555,4 +558,5 @@
 			return(FALSE);
 		break;
+#endif
 	case CLGET_SVC_ADDR:
 	case CLSET_SVC_ADDR:
Index: services/librpc/src/rpc/get_myaddress.c
===================================================================
--- services/librpc/src/rpc/get_myaddress.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/get_myaddress.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -45,4 +45,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <rpc/types.h>
 #include <rpc/xdr.h>
@@ -51,5 +52,10 @@
 #include <stdio.h>
 #include <unistd.h>
-#include <sys/mbuf.h>
+#ifndef __rtems__
+	/* XXX old.. not new */
+	#include <sys/mbuf.h>
+#else
+	#include <freebsd/sys/mbuf.h>
+#endif
 #include <net/if.h>
 #include <sys/ioctl.h>
Index: services/librpc/src/rpc/getrpcent.c
===================================================================
--- services/librpc/src/rpc/getrpcent.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/getrpcent.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -42,4 +42,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <stdio.h>
 #include <stdlib.h>
Index: services/librpc/src/rpc/getrpcport.c
===================================================================
--- services/librpc/src/rpc/getrpcport.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/getrpcport.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -42,4 +42,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <stdio.h>
 #include <string.h>
Index: services/librpc/src/rpc/netname.c
===================================================================
--- services/librpc/src/rpc/netname.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/netname.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -44,4 +44,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <sys/param.h>
 #include <rpc/rpc.h>
@@ -89,6 +90,6 @@
 user2netname(
 	char netname[MAXNETNAMELEN + 1],
-	uid_t uid,
-	char *domain)
+	const uid_t uid,
+	const char *domain)
 {
 	char *dfltdom;
@@ -116,6 +117,6 @@
 host2netname(
 	char netname[MAXNETNAMELEN + 1],
-	char *host,
-	char *domain)
+	const char *host,
+	const char *domain)
 {
 	char *dfltdom;
Index: services/librpc/src/rpc/netnamer.c
===================================================================
--- services/librpc/src/rpc/netnamer.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/netnamer.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -41,4 +41,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <sys/param.h>
 #include <rpc/rpc.h>
Index: services/librpc/src/rpc/pmap_clnt.c
===================================================================
--- services/librpc/src/rpc/pmap_clnt.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/pmap_clnt.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -45,4 +45,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <sys/types.h>
 #include <sys/stat.h>
Index: services/librpc/src/rpc/pmap_getmaps.c
===================================================================
--- services/librpc/src/rpc/pmap_getmaps.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/pmap_getmaps.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -46,4 +46,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <rpc/rpc.h>
 #include <rpc/pmap_prot.h>
@@ -54,5 +55,10 @@
 #include <unistd.h>
 #include <errno.h>
-#include <sys/mbuf.h>
+#ifndef __rtems__
+	/* XXX fix for new location */
+	#include <sys/mbuf.h>
+#else
+	#include <freebsd/sys/mbuf.h>
+#endif
 #include <net/if.h>
 #include <sys/ioctl.h>
Index: services/librpc/src/rpc/pmap_getport.c
===================================================================
--- services/librpc/src/rpc/pmap_getport.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/pmap_getport.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -45,9 +45,15 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <rpc/rpc.h>
 #include <rpc/pmap_prot.h>
 #include <rpc/pmap_clnt.h>
 #include <sys/socket.h>
-#include <sys/mbuf.h>
+#ifndef __rtems__
+	/* XXX fix for new location */
+	#include <sys/mbuf.h>
+#else
+	#include <freebsd/sys/mbuf.h>
+#endif
 #include <net/if.h>
 #include <unistd.h>
Index: services/librpc/src/rpc/pmap_prot.c
===================================================================
--- services/librpc/src/rpc/pmap_prot.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/pmap_prot.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -45,4 +45,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <rpc/types.h>
 #include <rpc/xdr.h>
Index: services/librpc/src/rpc/pmap_prot2.c
===================================================================
--- services/librpc/src/rpc/pmap_prot2.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/pmap_prot2.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -45,4 +45,9 @@
 #endif
 
+#include <freebsd/bsd.h>
+#ifndef __rtems__
+	/* XXX not needed in old.. */
+	#include <sys/types.h>
+#endif
 #include <rpc/types.h>
 #include <rpc/xdr.h>
Index: services/librpc/src/rpc/pmap_rmt.c
===================================================================
--- services/librpc/src/rpc/pmap_rmt.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/pmap_rmt.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -249,5 +249,8 @@
 }
 
+#ifndef __rtems__
+/* XXX now defined in rpc/clnt.h */
 typedef bool_t (*resultproc_t)(caddr_t, struct sockaddr_in *);
+#endif
 
 enum clnt_stat
@@ -257,7 +260,7 @@
 	u_long		proc,		/* procedure number */
 	xdrproc_t	xargs,		/* xdr routine for args */
-	caddr_t		argsp,		/* pointer to args */
+	void *		argsp,		/* pointer to args */
 	xdrproc_t	xresults,	/* xdr routine for results */
-	caddr_t		resultsp,	/* pointer to results */
+	void *		resultsp,	/* pointer to results */
 	resultproc_t	eachresult	/* call with each result obtained */ )
 {
Index: services/librpc/src/rpc/rpc.3
===================================================================
--- services/librpc/src/rpc/rpc.3	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/rpc.3	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -1451,5 +1451,5 @@
 port, then this routine binds it to an arbitrary port.  Upon
 completion,
-\fB\%xprt\->xp_sock\fR
+\fB\%xprt\->xp_fd\fR
 is the transport's socket descriptor, and
 \fB\%xprt\->xp_port\fR
@@ -1516,5 +1516,5 @@
 Upon
 completion,
-\fB\%xprt\->xp_sock\fR
+\fB\%xprt\->xp_fd\fR
 is the transport's socket descriptor, and
 \fB\%xprt\->xp_port\fR
Index: services/librpc/src/rpc/rpc_callmsg.c
===================================================================
--- services/librpc/src/rpc/rpc_callmsg.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/rpc_callmsg.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -45,4 +45,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <sys/param.h>
 #include <stdlib.h>
Index: services/librpc/src/rpc/rpc_commondata.c
===================================================================
--- services/librpc/src/rpc/rpc_commondata.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/rpc_commondata.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -37,5 +37,10 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <rpc/rpc.h>
+#ifdef __rtems__
+	#include <rpc/clnt.h>
+#endif
+
 /*
  * This file should only contain common data (global data) that is exported
Index: services/librpc/src/rpc/rpc_dtablesize.c
===================================================================
--- services/librpc/src/rpc/rpc_dtablesize.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/rpc_dtablesize.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -38,4 +38,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <sys/types.h>
 #include <unistd.h>
Index: services/librpc/src/rpc/rpc_prot.c
===================================================================
--- services/librpc/src/rpc/rpc_prot.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/rpc_prot.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -51,4 +51,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <assert.h>
 #include <sys/param.h>
Index: services/librpc/src/rpc/rpcdname.c
===================================================================
--- services/librpc/src/rpc/rpcdname.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/rpcdname.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -41,8 +41,13 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
 #include <rpc/rpc.h>
+#ifdef __rtems__
+	/* XXX in rpc.h in old .. not new */
+	#include <rpc/rpc_rtems.h>
+#endif
 
 int getdomainname(char *, size_t);
Index: services/librpc/src/rpc/rtems_portmapper.c
===================================================================
--- services/librpc/src/rpc/rtems_portmapper.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/rtems_portmapper.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -32,4 +32,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <rpc/rpc.h>
 #include <rpc/pmap_prot.h>
Index: services/librpc/src/rpc/rtems_rpc.c
===================================================================
--- services/librpc/src/rpc/rtems_rpc.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/rtems_rpc.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -7,7 +7,12 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <rpc/rpc.h>
 #include <rtems.h>
 #include <stdlib.h>
+#ifdef __rtems__
+	/* XXX in rpc.h in old .. not new */
+	#include <rpc/rpc_rtems.h>
+#endif
 
 /*
Index: services/librpc/src/rpc/rtime.c
===================================================================
--- services/librpc/src/rpc/rtime.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/rtime.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -47,4 +47,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <stdlib.h>
 #include <string.h>
Index: services/librpc/src/rpc/svc.c
===================================================================
--- services/librpc/src/rpc/svc.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/svc.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -48,4 +48,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <string.h>
 #ifdef HAVE_STRINGS_H
@@ -56,4 +57,8 @@
 #include <rpc/rpc.h>
 #include <rpc/pmap_clnt.h>
+#ifdef __rtems__
+	/* XXX in rpc.h in old .. not new */
+	#include <rpc/rpc_rtems.h>
+#endif
 
 #define xports (rtems_rpc_task_variables->svc_xports)
@@ -91,5 +96,5 @@
 	SVCXPRT *xprt )
 {
-	register int sock = xprt->xp_sock;
+	register int sock = xprt->xp_fd;
 
 	if (sock + 1 > __svc_fdsetsize) {
@@ -137,5 +142,5 @@
 	SVCXPRT *xprt )
 {
-	register int sock = xprt->xp_sock;
+	register int sock = xprt->xp_fd;
 
 	if (xports[sock] == xprt) {
Index: services/librpc/src/rpc/svc_auth.c
===================================================================
--- services/librpc/src/rpc/svc_auth.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/svc_auth.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -51,4 +51,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #ifdef _KERNEL
 #include <sys/param.h>
@@ -65,4 +66,8 @@
 #endif
 #include <sys/types.h>
+#ifdef __rtems__
+	/* XXX in rpc.h in old .. not new */
+	#include <rpc/rpc_rtems.h>
+#endif
 
 /*
Index: services/librpc/src/rpc/svc_auth_unix.c
===================================================================
--- services/librpc/src/rpc/svc_auth_unix.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/svc_auth_unix.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -49,4 +49,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <stdio.h>
 #include <string.h>
Index: services/librpc/src/rpc/svc_raw.c
===================================================================
--- services/librpc/src/rpc/svc_raw.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/svc_raw.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -47,6 +47,11 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <rpc/rpc.h>
 #include <stdlib.h>
+#ifdef __rtems__
+	/* XXX in rpc.h in old .. not new */
+	#include <rpc/rpc_rtems.h>
+#endif
 
 /*
@@ -87,5 +92,5 @@
 			return (0);
 	}
-	srp->server.xp_sock = 0;
+	srp->server.xp_fd = 0;
 	srp->server.xp_port = 0;
 	srp->server.xp_ops = &server_ops;
Index: services/librpc/src/rpc/svc_run.c
===================================================================
--- services/librpc/src/rpc/svc_run.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/svc_run.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -43,4 +43,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <rpc/rpc.h>
 #include <stdio.h>
@@ -52,4 +53,7 @@
 #include <string.h>
 #include <sys/select.h>
+#ifdef __rtems__
+#include <rpc/rpc_rtems.h>
+#endif
 
 void
Index: services/librpc/src/rpc/svc_simple.c
===================================================================
--- services/librpc/src/rpc/svc_simple.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/svc_simple.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -45,4 +45,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -55,4 +56,7 @@
 
 #include <inttypes.h> /* for PRIxx printf formats */
+#ifdef __rtems__
+#include <rpc/rpc_rtems.h>
+#endif
 
 struct prog_lst {
Index: services/librpc/src/rpc/svc_tcp.c
===================================================================
--- services/librpc/src/rpc/svc_tcp.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/svc_tcp.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -48,4 +48,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -57,4 +58,7 @@
 #include <errno.h>
 #include <sys/select.h>
+#ifdef __rtems__
+#include <rpc/rpc_rtems.h>
+#endif
 
 /*
@@ -120,5 +124,5 @@
  * binds it to an arbitrary port.  The routine then starts a tcp
  * listener on the socket's associated port.  In any (successful) case,
- * xprt->xp_sock is the registered socket number and xprt->xp_port is the
+ * xprt->xp_fd is the registered socket number and xprt->xp_port is the
  * associated port number.
  *
@@ -185,5 +189,5 @@
 	xprt->xp_ops = &svctcp_rendezvous_op;
 	xprt->xp_port = ntohs(addr.sin_port);
-	xprt->xp_sock = sock;
+	xprt->xp_fd = sock;
 	xprt_register(xprt);
 	return (xprt);
@@ -234,5 +238,5 @@
 	xprt->xp_ops = &svctcp_op;  /* truely deals with calls */
 	xprt->xp_port = 0;  /* this is a connection, not a rendezvouser */
-	xprt->xp_sock = fd;
+	xprt->xp_fd = fd;
 	xprt_register(xprt);
     done:
@@ -254,5 +258,5 @@
     again:
 	len = sizeof(struct sockaddr_in);
-	if ((sock = accept(xprt->xp_sock, (struct sockaddr *)&addr,
+	if ((sock = accept(xprt->xp_fd, (struct sockaddr *)&addr,
 	    &len)) < 0) {
 		if (errno == EINTR)
@@ -298,5 +302,5 @@
 
 	xprt_unregister(xprt);
-	(void)_RPC_close(xprt->xp_sock);
+	(void)_RPC_close(xprt->xp_fd);
 	if (xprt->xp_port != 0) {
 		/* a rendezvouser socket */
@@ -335,5 +339,5 @@
 {
 	SVCXPRT *xprt = (SVCXPRT*) _xprt;
-	register int sock = xprt->xp_sock;
+	register int sock = xprt->xp_fd;
 	struct timeval start, delta, tv;
 	struct timeval tmp1, tmp2;
@@ -407,5 +411,5 @@
 
 	for (cnt = len; cnt > 0; cnt -= i, buf += i) {
-		if ((i = _RPC_write(xprt->xp_sock, buf, cnt)) < 0) {
+		if ((i = _RPC_write(xprt->xp_fd, buf, cnt)) < 0) {
 			((struct tcp_conn *)(xprt->xp_p1))->strm_stat =
 			    XPRT_DIED;
Index: services/librpc/src/rpc/svc_udp.c
===================================================================
--- services/librpc/src/rpc/svc_udp.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/rpc/svc_udp.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -46,4 +46,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -94,5 +95,5 @@
  * If the socket, sock is not bound to a port then svcudp_create
  * binds it to an arbitrary port.  In any (successful) case,
- * xprt->xp_sock is the registered socket number and xprt->xp_port is the
+ * xprt->xp_fd is the registered socket number and xprt->xp_port is the
  * associated port number.
  * Once *xprt is initialized, it is registered as a transporter;
@@ -154,5 +155,5 @@
 	xprt->xp_ops = &svcudp_op;
 	xprt->xp_port = ntohs(addr.sin_port);
-	xprt->xp_sock = sock;
+	xprt->xp_fd = sock;
 	xprt_register(xprt);
 	return (xprt);
@@ -188,5 +189,5 @@
     again:
 	xprt->xp_addrlen = sizeof(struct sockaddr_in);
-	rlen = recvfrom(xprt->xp_sock, rpc_buffer(xprt), (int) su->su_iosz,
+	rlen = recvfrom(xprt->xp_fd, rpc_buffer(xprt), (int) su->su_iosz,
 	    0, (struct sockaddr *)&(xprt->xp_raddr), &(xprt->xp_addrlen));
 	if (rlen == -1 && errno == EINTR)
@@ -201,5 +202,5 @@
 	if (su->su_cache != NULL) {
 		if (cache_get(xprt, msg, &reply, &replylen)) {
-			(void) sendto(xprt->xp_sock, reply, (int) replylen, 0,
+			(void) sendto(xprt->xp_fd, reply, (int) replylen, 0,
 			  (struct sockaddr *) &xprt->xp_raddr, xprt->xp_addrlen);
 			return (TRUE);
@@ -224,5 +225,5 @@
 	if (xdr_replymsg(xdrs, msg)) {
 		slen = (int)XDR_GETPOS(xdrs);
-		if (sendto(xprt->xp_sock, rpc_buffer(xprt), slen, 0,
+		if (sendto(xprt->xp_fd, rpc_buffer(xprt), slen, 0,
 		    (struct sockaddr *)&(xprt->xp_raddr), xprt->xp_addrlen)
 		    == slen) {
@@ -265,5 +266,5 @@
 
 	xprt_unregister(xprt);
-	(void)_RPC_close(xprt->xp_sock);
+	(void)_RPC_close(xprt->xp_fd);
 	XDR_DESTROY(&(su->su_xdrs));
 	mem_free(rpc_buffer(xprt), su->su_iosz);
Index: services/librpc/src/xdr/xdr.c
===================================================================
--- services/librpc/src/xdr/xdr.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/xdr/xdr.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -48,4 +48,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -78,5 +79,5 @@
 xdr_free(
 	xdrproc_t proc,
-	char *objp)
+	void *objp)
 {
 	XDR x;
Index: services/librpc/src/xdr/xdr_array.c
===================================================================
--- services/librpc/src/xdr/xdr_array.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/xdr/xdr_array.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -47,4 +47,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <stdio.h>
 #include <stdlib.h>
Index: services/librpc/src/xdr/xdr_float.c
===================================================================
--- services/librpc/src/xdr/xdr_float.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/xdr/xdr_float.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -48,4 +48,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <stdio.h>
 #include <sys/types.h>
Index: services/librpc/src/xdr/xdr_mem.c
===================================================================
--- services/librpc/src/xdr/xdr_mem.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/xdr/xdr_mem.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -49,4 +49,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <string.h>
 #include <rpc/types.h>
Index: services/librpc/src/xdr/xdr_rec.c
===================================================================
--- services/librpc/src/xdr/xdr_rec.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/xdr/xdr_rec.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -54,4 +54,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -146,7 +147,7 @@
 	u_int sendsize,
 	u_int recvsize,
-	caddr_t tcp_handle,
-	int (*readit)(char*, char*, int),  /* like read, but pass it a tcp_handle, not sock */
-	int (*writeit)(char*, char*, int)  /* like write, but pass it a tcp_handle, not sock */
+	void *tcp_handle,
+	int (*readit)(void*, void*, int),  /* like read, but pass it a tcp_handle, not sock */
+	int (*writeit)(void*, void*, int)  /* like write, but pass it a tcp_handle, not sock */
 )
 {
@@ -467,5 +468,5 @@
 xdrrec_endofrecord(
 	XDR *xdrs,
-	bool_t sendnow)
+	int sendnow)
 {
 	RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);
Index: services/librpc/src/xdr/xdr_reference.c
===================================================================
--- services/librpc/src/xdr/xdr_reference.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/xdr/xdr_reference.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -47,4 +47,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <stdio.h>
 #include <stdlib.h>
Index: services/librpc/src/xdr/xdr_sizeof.c
===================================================================
--- services/librpc/src/xdr/xdr_sizeof.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/xdr/xdr_sizeof.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -40,4 +40,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <rpc/types.h>
 #include <rpc/xdr.h>
Index: services/librpc/src/xdr/xdr_stdio.c
===================================================================
--- services/librpc/src/xdr/xdr_stdio.c	(revision 8f59c0aea7467a0dcfcf46138c3d1a422cb339fd)
+++ services/librpc/src/xdr/xdr_stdio.c	(revision cd450d239d62c638254a4857aaebdd410a84c35c)
@@ -48,4 +48,5 @@
 #endif
 
+#include <freebsd/bsd.h>
 #include <rpc/types.h>
 #include <stdio.h>
