git: 3a0cdb2675e6 - main - rpc: clean kernel RPC internal headers of non-kernel declarations
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 09 Jan 2025 04:04:56 UTC
The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=3a0cdb2675e64460be17e640fd871907163342e8 commit 3a0cdb2675e64460be17e640fd871907163342e8 Author: Gleb Smirnoff <glebius@FreeBSD.org> AuthorDate: 2025-01-09 04:00:12 +0000 Commit: Gleb Smirnoff <glebius@FreeBSD.org> CommitDate: 2025-01-09 04:00:12 +0000 rpc: clean kernel RPC internal headers of non-kernel declarations The files svc.h and clnt.h derive from the same files that live in /usr/include, however there is nothing really shared between the kernel and libc RPC implementations. The kernel side files are not installed and there is no reason to pollute them with the old definititions. --- sys/rpc/clnt.h | 285 --------------------------------------------------------- sys/rpc/svc.h | 273 ------------------------------------------------------ 2 files changed, 558 deletions(-) diff --git a/sys/rpc/clnt.h b/sys/rpc/clnt.h index da02137397f1..d9fc372709cf 100644 --- a/sys/rpc/clnt.h +++ b/sys/rpc/clnt.h @@ -41,12 +41,8 @@ #define _RPC_CLNT_H_ #include <rpc/clnt_stat.h> #include <sys/cdefs.h> -#ifdef _KERNEL #include <sys/refcount.h> #include <rpc/netconfig.h> -#else -#include <netconfig.h> -#endif #include <sys/un.h> /* @@ -90,7 +86,6 @@ struct rpc_err { #define re_lb ru.RE_lb }; -#ifdef _KERNEL /* * Functions of this type may be used to receive notification when RPC * calls have to be re-transmitted etc. @@ -117,7 +112,6 @@ struct rpc_callextra { struct rpc_timers *rc_timers; /* optional RTT timers */ struct rpc_err rc_err; /* detailed call status */ }; -#endif /* * Client rpc handle. @@ -125,7 +119,6 @@ struct rpc_callextra { * Client is responsible for initializing auth, see e.g. auth_none.c. */ typedef struct __rpc_client { -#ifdef _KERNEL volatile u_int cl_refs; /* reference count */ AUTH *cl_auth; /* authenticator */ const struct clnt_ops { @@ -149,28 +142,6 @@ typedef struct __rpc_client { bool_t (*cl_control)(struct __rpc_client *, u_int, void *); } *cl_ops; -#else - 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; -#endif void *cl_private; /* private stuff */ char *cl_netid; /* network token */ char *cl_tp; /* device name */ @@ -198,7 +169,6 @@ typedef struct __rpc_client { * */ -#ifdef _KERNEL #define CLNT_ACQUIRE(rh) \ refcount_acquire(&(rh)->cl_refs) #define CLNT_RELEASE(rh) \ @@ -246,7 +216,6 @@ enum clnt_stat clnt_call_private(CLIENT *, struct rpc_callextra *, rpcproc_t, #define CLNT_CALL_EXT(rh, ext, proc, xargs, argsp, xres, resp, secs) \ clnt_call_private(rh, ext, proc, xargs, \ argsp, xres, resp, secs) -#endif /* * enum clnt_stat @@ -259,21 +228,12 @@ enum clnt_stat clnt_call_private(CLIENT *, struct rpc_callextra *, rpcproc_t, * void *resp; * struct timeval timeout; */ -#ifdef _KERNEL #define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs) \ clnt_call_private(rh, NULL, proc, xargs, \ argsp, xres, resp, secs) #define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \ clnt_call_private(rh, NULL, proc, xargs, \ argsp, xres, resp, secs) -#else -#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)) -#endif /* * void @@ -339,7 +299,6 @@ enum clnt_stat clnt_call_private(CLIENT *, struct rpc_callextra *, rpcproc_t, #define CLSET_ASYNC 19 #define CLSET_CONNECT 20 /* Use connect() for UDP. (int) */ -#ifdef _KERNEL /* * Kernel control operations. The default msleep string is "rpcrecv", * and sleeps are non-interruptible by default. @@ -362,8 +321,6 @@ struct rpc_reconupcall { void *arg; }; #define CLSET_RECONUPCALL 33 /* Reconnect upcall */ -#endif - /* * void @@ -402,8 +359,6 @@ struct rpc_reconupcall { * belong to the nettype namespace (/etc/netconfig). */ __BEGIN_DECLS -#ifdef _KERNEL - /* * struct socket *so; -- socket * struct sockaddr *svcaddr; -- servers address @@ -440,156 +395,6 @@ extern CLIENT *clnt_vc_create(struct socket *so, extern CLIENT *clnt_reconnect_create(struct netconfig *nconf, struct sockaddr *svcaddr, rpcprog_t program, rpcvers_t version, size_t sendsz, size_t recvsz); - -#else - -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 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); -#endif - __END_DECLS @@ -626,96 +431,6 @@ struct rpc_createerr { struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */ }; -#ifdef _KERNEL extern struct rpc_createerr rpc_createerr; -#else -__BEGIN_DECLS -extern struct rpc_createerr *__rpc_createerr(void); -__END_DECLS -#define rpc_createerr (*(__rpc_createerr())) -#endif - -#ifndef _KERNEL -/* - * 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 #endif /* !_RPC_CLNT_H_ */ diff --git a/sys/rpc/svc.h b/sys/rpc/svc.h index 43a388984c00..d8a8d0139cc4 100644 --- a/sys/rpc/svc.h +++ b/sys/rpc/svc.h @@ -40,14 +40,12 @@ #define _RPC_SVC_H #include <sys/cdefs.h> -#ifdef _KERNEL #include <sys/queue.h> #include <sys/_lock.h> #include <sys/_mutex.h> #include <sys/_sx.h> #include <sys/condvar.h> #include <sys/sysctl.h> -#endif /* * This interface must manage two items concerning remote procedure calling: @@ -95,7 +93,6 @@ struct __rpc_svcxprt; struct mbuf; struct xp_ops { -#ifdef _KERNEL /* receive incoming requests */ bool_t (*xp_recv)(struct __rpc_svcxprt *, struct rpc_msg *, struct sockaddr **, struct mbuf **); @@ -110,34 +107,11 @@ struct xp_ops { void (*xp_destroy)(struct __rpc_svcxprt *); /* catch-all function */ bool_t (*xp_control)(struct __rpc_svcxprt *, const u_int, void *); -#else - /* 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, void *); - /* 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, void *); - /* destroy this struct */ - void (*xp_destroy)(struct __rpc_svcxprt *); -#endif }; -#ifndef _KERNEL -struct xp_ops2 { - /* catch-all function */ - bool_t (*xp_control)(struct __rpc_svcxprt *, const u_int, void *); -}; -#endif - -#ifdef _KERNEL struct __rpc_svcpool; struct __rpc_svcgroup; struct __rpc_svcthread; -#endif /* * Server side transport handle. In the kernel, transports have a @@ -151,7 +125,6 @@ struct __rpc_svcthread; * end for callbacks). */ typedef struct __rpc_svcxprt { -#ifdef _KERNEL volatile u_int xp_refs; struct sx xp_lock; struct __rpc_svcpool *xp_pool; /* owning pool (see below) */ @@ -186,24 +159,6 @@ typedef struct __rpc_svcxprt { uid_t xp_uid; gid_t *xp_gidp; int xp_doneddp; -#else - int xp_fd; - u_short xp_port; /* associated port number */ - const struct xp_ops *xp_ops; - int xp_addrlen; /* length of remote address */ - struct sockaddr_in xp_raddr; /* remote addr. (backward ABI compat) */ - /* XXX - fvdl stick this here for ABI backward compat reasons */ - const struct xp_ops2 *xp_ops2; - char *xp_tp; /* transport provider device name */ - char *xp_netid; /* network token */ - struct netbuf xp_ltaddr; /* local transport address */ - struct netbuf xp_rtaddr; /* remote transport address */ - 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 */ - void *xp_p3; /* private: for use by svc lib */ - int xp_type; /* transport type */ -#endif } SVCXPRT; /* @@ -211,16 +166,9 @@ typedef struct __rpc_svcxprt { */ typedef struct __rpc_svcauth { const struct svc_auth_ops { -#ifdef _KERNEL int (*svc_ah_wrap)(struct __rpc_svcauth *, struct mbuf **); int (*svc_ah_unwrap)(struct __rpc_svcauth *, struct mbuf **); void (*svc_ah_release)(struct __rpc_svcauth *); -#else - int (*svc_ah_wrap)(struct __rpc_svcauth *, XDR *, - xdrproc_t, caddr_t); - int (*svc_ah_unwrap)(struct __rpc_svcauth *, XDR *, - xdrproc_t, caddr_t); -#endif } *svc_ah_ops; void *svc_ah_private; } SVCAUTH; @@ -233,8 +181,6 @@ typedef struct __rpc_svcxprt_ext { SVCAUTH xp_auth; /* interface to auth methods */ } SVCXPRT_EXT; -#ifdef _KERNEL - /* * The services list * Each entry represents a set of procedures (an rpc program). @@ -399,27 +345,6 @@ typedef struct __rpc_svcpool { SVCGROUP sp_groups[SVC_MAXGROUPS]; /* Thread/port groups. */ } SVCPOOL; -#else - -/* - * Service request - */ -struct svc_req { - uint32_t rq_prog; /* service program number */ - uint32_t rq_vers; /* service protocol version */ - uint32_t rq_proc; /* the desired procedure */ - struct opaque_auth rq_cred; /* raw creds from the wire */ - void *rq_clntcred; /* read only cooked cred */ - SVCXPRT *rq_xprt; /* associated transport */ -}; - -/* - * Approved way of getting address of caller - */ -#define svc_getrpccaller(x) (&(x)->xp_rtaddr) - -#endif - /* * Operations defined on an SVCXPRT handle * @@ -428,8 +353,6 @@ struct svc_req { * xdrproc_t xargs; * void * argsp; */ -#ifdef _KERNEL - #define SVC_ACQUIRE(xprt) \ refcount_acquire(&(xprt)->xp_refs) @@ -456,43 +379,6 @@ struct svc_req { #define SVC_CONTROL(xprt, rq, in) \ (*(xprt)->xp_ops->xp_control)((xprt), (rq), (in)) -#else - -#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) - -#define SVC_CONTROL(xprt, rq, in) \ - (*(xprt)->xp_ops2->xp_control)((xprt), (rq), (in)) - -#endif - #define SVC_EXT(xprt) \ ((SVCXPRT_EXT *) xprt->xp_p3) @@ -502,19 +388,12 @@ struct svc_req { /* * Operations defined on an SVCAUTH handle */ -#ifdef _KERNEL #define SVCAUTH_WRAP(auth, mp) \ ((auth)->svc_ah_ops->svc_ah_wrap(auth, mp)) #define SVCAUTH_UNWRAP(auth, mp) \ ((auth)->svc_ah_ops->svc_ah_unwrap(auth, mp)) #define SVCAUTH_RELEASE(auth) \ ((auth)->svc_ah_ops->svc_ah_release(auth)) -#else -#define SVCAUTH_WRAP(auth, xdrs, xfunc, xwhere) \ - ((auth)->svc_ah_ops->svc_ah_wrap(auth, xdrs, xfunc, xwhere)) -#define SVCAUTH_UNWRAP(auth, xdrs, xfunc, xwhere) \ - ((auth)->svc_ah_ops->svc_ah_unwrap(auth, xdrs, xfunc, xwhere)) -#endif /* * Service registration @@ -542,14 +421,9 @@ __END_DECLS */ __BEGIN_DECLS -#ifdef _KERNEL extern void svc_unreg(SVCPOOL *, const rpcprog_t, const rpcvers_t); -#else -extern void svc_unreg(const rpcprog_t, const rpcvers_t); -#endif __END_DECLS -#ifdef _KERNEL /* * Service connection loss registration * @@ -573,7 +447,6 @@ __END_DECLS __BEGIN_DECLS extern void svc_loss_unreg(SVCPOOL *, void (*)(SVCXPRT *)); __END_DECLS -#endif /* * Transport registration. @@ -596,8 +469,6 @@ extern void xprt_unregister(SVCXPRT *); extern void __xprt_unregister_unlocked(SVCXPRT *); __END_DECLS -#ifdef _KERNEL - /* * Called when a transport has pending requests. */ @@ -608,8 +479,6 @@ extern void xprt_inactive_locked(SVCXPRT *); extern void xprt_inactive_self(SVCXPRT *); __END_DECLS -#endif - /* * 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 @@ -637,7 +506,6 @@ __END_DECLS */ __BEGIN_DECLS -#ifdef _KERNEL extern bool_t svc_sendreply(struct svc_req *, xdrproc_t, void *); extern bool_t svc_sendreply_mbuf(struct svc_req *, struct mbuf *); extern void svcerr_decode(struct svc_req *); @@ -647,16 +515,6 @@ extern void svcerr_progvers(struct svc_req *, rpcvers_t, rpcvers_t); extern void svcerr_auth(struct svc_req *, enum auth_stat); extern void svcerr_noprog(struct svc_req *); extern void svcerr_systemerr(struct svc_req *); -#else -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 *); -#endif extern int rpc_reg(rpcprog_t, rpcvers_t, rpcproc_t, char *(*)(char *), xdrproc_t, xdrproc_t, char *); @@ -673,20 +531,6 @@ __END_DECLS * "in-place" results of a select system call (see select, section 2). */ -#ifndef _KERNEL -/* - * Global keeper of rpc service descriptors in use - * dynamic; must be inspected before each call to select - */ -extern int svc_maxfd; -#ifdef FD_SETSIZE -extern fd_set svc_fdset; -#define svc_fds svc_fdset.fds_bits[0] /* compatibility */ -#else -extern int svc_fds; -#endif /* def FD_SETSIZE */ -#endif - /* * a small program implemented by the svc_rpc implementation itself; * also see clnt.h for protocol numbers. @@ -698,22 +542,11 @@ __END_DECLS __BEGIN_DECLS extern SVCXPRT *svc_xprt_alloc(void); extern void svc_xprt_free(SVCXPRT *); -#ifndef _KERNEL -extern void svc_getreq(int); -extern void svc_getreqset(fd_set *); -extern void svc_getreq_common(int); -struct pollfd; -extern void svc_getreq_poll(struct pollfd *, int); -extern void svc_run(void); -extern void svc_exit(void); -#else extern void svc_run(SVCPOOL *); extern void svc_exit(SVCPOOL *); extern bool_t svc_getargs(struct svc_req *, xdrproc_t, void *); extern bool_t svc_freeargs(struct svc_req *, xdrproc_t, void *); extern void svc_freereq(struct svc_req *); - -#endif __END_DECLS /* @@ -728,8 +561,6 @@ __END_DECLS __BEGIN_DECLS -#ifdef _KERNEL - /* * Create a new service pool. */ @@ -812,110 +643,6 @@ extern SVCXPRT *svc_tli_create(SVCPOOL *, const struct netconfig *, * const size_t sendsz; -- max sendsize * const size_t recvsz; -- max recvsize */ - -#else /* !_KERNEL */ - -/* - * Transport independent svc_create routine. - */ -extern int svc_create(void (*)(struct svc_req *, SVCXPRT *), - const rpcprog_t, const rpcvers_t, const char *); -/* - * void (*dispatch)(); -- dispatch routine - * const rpcprog_t prognum; -- program number - * const rpcvers_t versnum; -- version number - * const char *nettype; -- network type - */ - - -/* - * Generic server creation routine. It takes a netconfig structure - * instead of a nettype. - */ - -extern SVCXPRT *svc_tp_create(void (*)(struct svc_req *, SVCXPRT *), - const rpcprog_t, const rpcvers_t, - const struct netconfig *); - /* - * void (*dispatch)(); -- dispatch routine - * const rpcprog_t prognum; -- program number - * const rpcvers_t versnum; -- version number - * const struct netconfig *nconf; -- netconfig structure - */ - -/* - * Generic TLI create routine - */ -extern SVCXPRT *svc_tli_create(const int, const struct netconfig *, - const struct t_bind *, const u_int, - const u_int); -/* - * const int fd; -- connection end point - * const struct netconfig *nconf; -- netconfig structure for network - * const struct t_bind *bindaddr; -- local bind address - * const u_int sendsz; -- max sendsize - * const u_int recvsz; -- max recvsize - */ - -/* - * 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 *); - -extern SVCXPRT *svc_dg_create(const int, const u_int, const u_int); - /* - * const int fd; -- open connection - * const u_int sendsize; -- max send size - * const u_int recvsize; -- max recv size - */ - - -/* - * the routine takes any *open* connection - * descriptor as its first input and is used for open connections. - */ -extern SVCXPRT *svc_fd_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_fd_create(). - */ -extern SVCXPRT *svcunixfd_create(int, u_int, u_int); - -/* - * Memory based rpc (for speed check and testing) - */ -extern SVCXPRT *svc_raw_create(void); - -/* - * svc_dg_enable_cache() enables the cache on dg transports. - */ -int svc_dg_enablecache(SVCXPRT *, const u_int); - -int __rpc_get_local_uid(SVCXPRT *_transp, uid_t *_uid); - -#endif /* !_KERNEL */ - __END_DECLS -#ifndef _KERNEL -/* for backward compatibility */ -#include <rpc/svc_soc.h> -#endif - #endif /* !_RPC_SVC_H */