1139747Simp/*	$NetBSD: svc.h,v 1.17 2000/06/02 22:57:56 fvdl Exp $	*/
24Srgrimes
34Srgrimes/*-
44Srgrimes * SPDX-License-Identifier: BSD-3-Clause
58876Srgrimes *
64Srgrimes * Copyright (c) 2009, Sun Microsystems, Inc.
74Srgrimes * All rights reserved.
84Srgrimes *
94Srgrimes * Redistribution and use in source and binary forms, with or without
104Srgrimes * modification, are permitted provided that the following conditions are met:
118876Srgrimes * - Redistributions of source code must retain the above copyright notice,
128876Srgrimes *   this list of conditions and the following disclaimer.
134Srgrimes * - Redistributions in binary form must reproduce the above copyright notice,
144Srgrimes *   this list of conditions and the following disclaimer in the documentation
158876Srgrimes *   and/or other materials provided with the distribution.
164Srgrimes * - Neither the name of Sun Microsystems, Inc. nor the names of its
178876Srgrimes *   contributors may be used to endorse or promote products derived
184Srgrimes *   from this software without specific prior written permission.
194Srgrimes *
204Srgrimes * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
214Srgrimes * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
228876Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
234Srgrimes * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
244Srgrimes * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
254Srgrimes * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
264Srgrimes * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
274Srgrimes * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
284Srgrimes * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
294Srgrimes * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
304Srgrimes * POSSIBILITY OF SUCH DAMAGE.
314Srgrimes */
324Srgrimes
33116176Sobrien/*
34116176Sobrien * svc.h, Server-side remote procedure call interface.
35116176Sobrien *
36116176Sobrien * Copyright (C) 1986-1993 by Sun Microsystems, Inc.
372056Swollman */
3842654Sjdp
3986998Sdd#ifndef _RPC_SVC_H
40131952Smarcel#define _RPC_SVC_H
4186998Sdd#include <sys/cdefs.h>
4286998Sdd
4317848Spst/*
4486998Sdd * This interface must manage two items concerning remote procedure calling:
452056Swollman *
4649558Sphk * 1) An arbitrary number of transport connections upon which rpc requests
47126399Sphk * are received.  The two most notable transports are TCP and UDP;  they are
4812734Sbde * created and registered by routines in svc_tcp.c and svc_udp.c, respectively;
492056Swollman * they in turn call xprt_register and xprt_unregister.
5012473Sbde *
514Srgrimes * 2) An arbitrary number of locally registered services.  Services are
524Srgrimes * described by the following four data: program number, version number,
534Srgrimes * "service dispatch" function, a transport handle, and a boolean that
54118990Smarcel * indicates whether or not the exported program should be registered with a
5579418Sjulian * local binder service;  if true the program's number and version and the
564Srgrimes * port number from the transport handle are registered with the binder.
574Srgrimes * These data are registered with the rpc svc system via svc_register.
584Srgrimes *
594Srgrimes * A service's dispatch function is called whenever an rpc request comes in
604Srgrimes * on a transport.  The request's program and version numbers must match
6118296Sbde * those of the registered service.  The dispatch function is passed two
624Srgrimes * parameters, struct svc_req * and SVCXPRT *, defined below.
634Srgrimes */
644Srgrimes
654Srgrimes/*
6678161Speter *      Service control requests
6778161Speter */
6878161Speter#define SVCGET_VERSQUIET	1
6912515Sphk#define SVCSET_VERSQUIET	2
70132002Smarcel#define SVCGET_CONNMAXREC	3
7186998Sdd#define SVCSET_CONNMAXREC	4
7285944Speter
73132482Smarcel/*
74150819Srwatson * Operations for rpc_control().
75126399Sphk */
7617848Spst#define RPC_SVC_CONNMAXREC_SET  0	/* set max rec size, enable nonblock */
77148919Sobrien#define RPC_SVC_CONNMAXREC_GET  1
78148919Sobrien
79148919Sobrienenum xprt_stat {
8018296Sbde	XPRT_DIED,
81148919Sobrien	XPRT_MOREREQS,
82148919Sobrien	XPRT_IDLE
83148919Sobrien};
84148919Sobrien
85148919Sobrien/*
86156412Sjhb * Server side transport handle
87156412Sjhb */
88156412Sjhbtypedef struct __rpc_svcxprt {
89156412Sjhb	int		xp_fd;
90148919Sobrien#define	xp_sock		xp_fd
91156412Sjhb	u_short		xp_port;	 /* associated port number */
92148919Sobrien	const struct xp_ops {
93148919Sobrien	    /* receive incoming requests */
94148919Sobrien	    bool_t	(*xp_recv)(struct __rpc_svcxprt *, struct rpc_msg *);
95148919Sobrien	    /* get transport status */
96148919Sobrien	    enum xprt_stat (*xp_stat)(struct __rpc_svcxprt *);
97148919Sobrien	    /* get arguments */
98156412Sjhb	    bool_t	(*xp_getargs)(struct __rpc_svcxprt *, xdrproc_t,
99156412Sjhb				void *);
100156412Sjhb	    /* send reply */
101156412Sjhb	    bool_t	(*xp_reply)(struct __rpc_svcxprt *, struct rpc_msg *);
102156412Sjhb	    /* free mem allocated for args */
103156412Sjhb	    bool_t	(*xp_freeargs)(struct __rpc_svcxprt *, xdrproc_t,
104156412Sjhb				void *);
105148919Sobrien	    /* destroy this struct */
106148919Sobrien	    void	(*xp_destroy)(struct __rpc_svcxprt *);
107148919Sobrien	} *xp_ops;
108148919Sobrien	int		xp_addrlen;	 /* length of remote address */
109148919Sobrien	struct sockaddr_in xp_raddr;	 /* remote addr. (backward ABI compat) */
110148919Sobrien	/* XXX - fvdl stick this here for ABI backward compat reasons */
111148919Sobrien	const struct xp_ops2 {
112148919Sobrien		/* catch-all function */
113148919Sobrien		bool_t  (*xp_control)(struct __rpc_svcxprt *, const u_int,
114148919Sobrien				void *);
115148919Sobrien	} *xp_ops2;
116148919Sobrien	char		*xp_tp;		 /* transport provider device name */
117148919Sobrien	char		*xp_netid;	 /* network token */
118148919Sobrien	struct netbuf	xp_ltaddr;	 /* local transport address */
119148919Sobrien	struct netbuf	xp_rtaddr;	 /* remote transport address */
120148919Sobrien	struct opaque_auth xp_verf;	 /* raw response verifier */
121148919Sobrien	void		*xp_p1;		 /* private: for use by svc ops */
122148919Sobrien	void		*xp_p2;		 /* private: for use by svc ops */
123148919Sobrien	void		*xp_p3;		 /* private: for use by svc lib */
124148919Sobrien	int		xp_type;	 /* transport type */
125148919Sobrien} SVCXPRT;
126148919Sobrien
127148919Sobrien/*
128151622Sjhb * Interface to server-side authentication flavors.
129148919Sobrien */
130151622Sjhbtypedef struct __rpc_svcauth {
131148919Sobrien	struct svc_auth_ops {
132156412Sjhb		int   (*svc_ah_wrap)(struct __rpc_svcauth *, XDR *,
133148919Sobrien		    xdrproc_t, caddr_t);
134148919Sobrien		int   (*svc_ah_unwrap)(struct __rpc_svcauth *, XDR *,
135148919Sobrien		    xdrproc_t, caddr_t);
136148919Sobrien	} *svc_ah_ops;
137148919Sobrien	void *svc_ah_private;
138148919Sobrien} SVCAUTH;
139148919Sobrien
140148919Sobrien/*
141148919Sobrien * Server transport extensions (accessed via xp_p3).
142156412Sjhb */
143156412Sjhbtypedef struct __rpc_svcxprt_ext {
144156412Sjhb	int		xp_flags;	/* versquiet */
145156412Sjhb	SVCAUTH		xp_auth;	/* interface to auth methods */
146156412Sjhb} SVCXPRT_EXT;
147156412Sjhb
148148919Sobrien/*
149148919Sobrien * Service request
1504Srgrimes */
1514Srgrimesstruct svc_req {
1524Srgrimes	u_int32_t	rq_prog;	/* service program number */
1534Srgrimes	u_int32_t	rq_vers;	/* service protocol version */
1544Srgrimes	u_int32_t	rq_proc;	/* the desired procedure */
15512515Sphk	struct opaque_auth rq_cred;	/* raw creds from the wire */
1564Srgrimes	void		*rq_clntcred;	/* read only cooked cred */
1574Srgrimes	SVCXPRT		*rq_xprt;	/* associated transport */
1584Srgrimes};
1594Srgrimes
1604Srgrimes/*
1614Srgrimes *  Approved way of getting address of caller
1624Srgrimes */
1634Srgrimes#define svc_getrpccaller(x) (&(x)->xp_rtaddr)
1644Srgrimes/*
1654Srgrimes *  Approved way of getting address of callee
1664Srgrimes */
1674Srgrimes#define svc_getrpccallee(x) (&(x)->xp_ltaddr)
1684Srgrimes
1694Srgrimes/*
1704Srgrimes * Operations defined on an SVCXPRT handle
1714Srgrimes *
1724Srgrimes * SVCXPRT		*xprt;
1734Srgrimes * struct rpc_msg	*msg;
1744Srgrimes * xdrproc_t		 xargs;
1754Srgrimes * void *		 argsp;
1764Srgrimes */
1774Srgrimes#define SVC_RECV(xprt, msg)				\
178156412Sjhb	(*(xprt)->xp_ops->xp_recv)((xprt), (msg))
179156412Sjhb#define svc_recv(xprt, msg)				\
180156412Sjhb	(*(xprt)->xp_ops->xp_recv)((xprt), (msg))
181156412Sjhb
182156412Sjhb#define SVC_STAT(xprt)					\
18392756Salfred	(*(xprt)->xp_ops->xp_stat)(xprt)
184156412Sjhb#define svc_stat(xprt)					\
18512473Sbde	(*(xprt)->xp_ops->xp_stat)(xprt)
1864Srgrimes
187156412Sjhb#define SVC_GETARGS(xprt, xargs, argsp)			\
1884Srgrimes	(*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp))
189156412Sjhb#define svc_getargs(xprt, xargs, argsp)			\
190156412Sjhb	(*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp))
1914Srgrimes
192156412Sjhb#define SVC_REPLY(xprt, msg)				\
1934Srgrimes	(*(xprt)->xp_ops->xp_reply) ((xprt), (msg))
194156412Sjhb#define svc_reply(xprt, msg)				\
1954Srgrimes	(*(xprt)->xp_ops->xp_reply) ((xprt), (msg))
196156412Sjhb
197156412Sjhb#define SVC_FREEARGS(xprt, xargs, argsp)		\
1984Srgrimes	(*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp))
199156412Sjhb#define svc_freeargs(xprt, xargs, argsp)		\
200156412Sjhb	(*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp))
201156412Sjhb
2024Srgrimes#define SVC_DESTROY(xprt)				\
203156412Sjhb	(*(xprt)->xp_ops->xp_destroy)(xprt)
204156412Sjhb#define svc_destroy(xprt)				\
205156412Sjhb	(*(xprt)->xp_ops->xp_destroy)(xprt)
206156412Sjhb
2074Srgrimes#define SVC_CONTROL(xprt, rq, in)			\
2084Srgrimes	(*(xprt)->xp_ops2->xp_control)((xprt), (rq), (in))
2094Srgrimes
210156412Sjhb#define SVC_EXT(xprt)					\
211156412Sjhb	((SVCXPRT_EXT *) xprt->xp_p3)
2124Srgrimes
2134Srgrimes#define SVC_AUTH(xprt)					\
214156412Sjhb	(SVC_EXT(xprt)->xp_auth)
215156412Sjhb
216156412Sjhb/*
217156412Sjhb * Operations defined on an SVCAUTH handle
218156412Sjhb */
219156412Sjhb#define SVCAUTH_WRAP(auth, xdrs, xfunc, xwhere)		\
220156412Sjhb	((auth)->svc_ah_ops->svc_ah_wrap(auth, xdrs, xfunc, xwhere))
2214Srgrimes#define SVCAUTH_UNWRAP(auth, xdrs, xfunc, xwhere)	\
2224Srgrimes	((auth)->svc_ah_ops->svc_ah_unwrap(auth, xdrs, xfunc, xwhere))
223156412Sjhb
22418296Sbde/*
225156412Sjhb * Service registration
226156412Sjhb *
227156412Sjhb * svc_reg(xprt, prog, vers, dispatch, nconf)
228156412Sjhb *	const SVCXPRT *xprt;
229156412Sjhb *	const rpcprog_t prog;
230156412Sjhb *	const rpcvers_t vers;
231156412Sjhb *	const void (*dispatch)(struct svc_req *, SVCXPRT *);
232156412Sjhb *	const struct netconfig *nconf;
233156412Sjhb */
234156412Sjhb
235156412Sjhb__BEGIN_DECLS
236156412Sjhbextern bool_t	svc_reg(SVCXPRT *, const rpcprog_t, const rpcvers_t,
237156412Sjhb			void (*)(struct svc_req *, SVCXPRT *),
238156412Sjhb			const struct netconfig *);
239156412Sjhb__END_DECLS
240156412Sjhb
24118296Sbde/*
242156412Sjhb * Service un-registration
243156412Sjhb *
244156412Sjhb * svc_unreg(prog, vers)
245156412Sjhb *	const rpcprog_t prog;
246156412Sjhb *	const rpcvers_t vers;
247156412Sjhb */
248156412Sjhb
249156412Sjhb__BEGIN_DECLS
25018296Sbdeextern void	svc_unreg(const rpcprog_t, const rpcvers_t);
2514Srgrimes__END_DECLS
252156412Sjhb
2534Srgrimes/*
2544Srgrimes * Transport registration.
2554Srgrimes *
2564Srgrimes * xprt_register(xprt)
2574Srgrimes *	SVCXPRT *xprt;
2584Srgrimes */
2594Srgrimes__BEGIN_DECLS
26012515Sphkextern void	xprt_register(SVCXPRT *);
261156412Sjhb__END_DECLS
262156412Sjhb
2634Srgrimes/*
2644Srgrimes * Transport un-register
26518296Sbde *
2664Srgrimes * xprt_unregister(xprt)
267156412Sjhb *	SVCXPRT *xprt;
2684Srgrimes */
2694Srgrimes__BEGIN_DECLS
2704Srgrimesextern void	xprt_unregister(SVCXPRT *);
271156412Sjhb__END_DECLS
27218296Sbde
273156412Sjhb
274156412Sjhb/*
27518296Sbde * When the service routine is called, it must first check to see if it
27618296Sbde * knows about the procedure;  if not, it should call svcerr_noproc
27718296Sbde * and return.  If so, it should deserialize its arguments via
2784Srgrimes * SVC_GETARGS (defined above).  If the deserialization does not work,
2794Srgrimes * svcerr_decode should be called followed by a return.  Successful
28012515Sphk * decoding of the arguments should be followed the execution of the
281156412Sjhb * procedure's code and a call to svc_sendreply.
2824Srgrimes *
283156412Sjhb * Also, if the service refuses to execute the procedure due to too-
2844Srgrimes * weak authentication parameters, svcerr_weakauth should be called.
2854Srgrimes * Note: do not confuse access-control failure with weak authentication!
2864Srgrimes *
2874Srgrimes * NB: In pure implementations of rpc, the caller always waits for a reply
2884Srgrimes * msg.  This message is sent when svc_sendreply is called.
289798Swollman * Therefore pure service implementations should always call
2904Srgrimes * svc_sendreply even if the function logically returns void;  use
2914Srgrimes * xdr.h - xdr_void for the xdr routine.  HOWEVER, tcp based rpc allows
2924Srgrimes * for the abuse of pure rpc via batched calling or pipelining.  In the
2934Srgrimes * case of a batched call, svc_sendreply should NOT be called since
2944Srgrimes * this would send a return message, which is what batching tries to avoid.
2954Srgrimes * It is the service/protocol writer's responsibility to know which calls are
2964Srgrimes * batched and which are not.  Warning: responding to batch calls may
2974Srgrimes * deadlock the caller and server processes!
2984Srgrimes */
2994Srgrimes
3004Srgrimes__BEGIN_DECLS
3014Srgrimesextern bool_t	svc_sendreply(SVCXPRT *, xdrproc_t, void *);
30210348Sbdeextern void	svcerr_decode(SVCXPRT *);
3034Srgrimesextern void	svcerr_weakauth(SVCXPRT *);
3044Srgrimesextern void	svcerr_noproc(SVCXPRT *);
3054Srgrimesextern void	svcerr_progvers(SVCXPRT *, rpcvers_t, rpcvers_t);
3064Srgrimesextern void	svcerr_auth(SVCXPRT *, enum auth_stat);
3074Srgrimesextern void	svcerr_noprog(SVCXPRT *);
3084Srgrimesextern void	svcerr_systemerr(SVCXPRT *);
3094Srgrimesextern int	rpc_reg(rpcprog_t, rpcvers_t, rpcproc_t,
3104Srgrimes			char *(*)(char *), xdrproc_t, xdrproc_t,
3114Srgrimes			char *);
3124Srgrimes__END_DECLS
3134Srgrimes
3144Srgrimes/*
3154Srgrimes * Lowest level dispatching -OR- who owns this process anyway.
3164Srgrimes * Somebody has to wait for incoming requests and then call the correct
3174Srgrimes * service routine.  The routine svc_run does infinite waiting; i.e.,
3184Srgrimes * svc_run never returns.
3194Srgrimes * Since another (co-existent) package may wish to selectively wait for
3204Srgrimes * incoming calls or other events outside of the rpc architecture, the
3214Srgrimes * routine svc_getreq is provided.  It must be passed readfds, the
3224Srgrimes * "in-place" results of a select system call (see select, section 2).
3234Srgrimes */
3244Srgrimes
3254Srgrimes/*
3264Srgrimes * Global keeper of rpc service descriptors in use
3274Srgrimes * dynamic; must be inspected before each call to select
328156412Sjhb */
3294Srgrimesextern int svc_maxfd;
3304Srgrimes#ifdef FD_SETSIZE
3314Srgrimesextern fd_set svc_fdset;
3324Srgrimes#define svc_fds svc_fdset.fds_bits[0]	/* compatibility */
3334Srgrimes#else
334156412Sjhbextern int svc_fds;
3354Srgrimes#endif /* def FD_SETSIZE */
3364Srgrimes
337156412Sjhb/*
3384Srgrimes * A set of null auth methods used by any authentication protocols
3394Srgrimes * that don't need to inspect or modify the message body.
3404Srgrimes */
3414Srgrimesextern SVCAUTH _svc_auth_null;
3424Srgrimes
3434Srgrimes/*
3444Srgrimes * a small program implemented by the svc_rpc implementation itself;
3454Srgrimes * also see clnt.h for protocol numbers.
3464Srgrimes */
3474Srgrimes__BEGIN_DECLS
3484Srgrimesextern void rpctest_service(void);
3494Srgrimes__END_DECLS
3504Srgrimes
3514Srgrimes__BEGIN_DECLS
3524Srgrimesextern SVCXPRT *svc_xprt_alloc(void);
3534Srgrimesextern void	svc_xprt_free(SVCXPRT *);
3544Srgrimesextern void	svc_getreq(int);
3554Srgrimesextern void	svc_getreqset(fd_set *);
3564Srgrimesextern void	svc_getreq_common(int);
3574Srgrimesstruct pollfd;
3584Srgrimesextern void	svc_getreq_poll(struct pollfd *, int);
3594Srgrimes
3604Srgrimesextern void	svc_run(void);
3614Srgrimesextern void	svc_exit(void);
3624Srgrimes__END_DECLS
3634Srgrimes
3644Srgrimes/*
3654Srgrimes * Socket to use on svcxxx_create call to get default socket
3664Srgrimes */
3674Srgrimes#define	RPC_ANYSOCK	-1
3684Srgrimes#define RPC_ANYFD	RPC_ANYSOCK
3694Srgrimes
3704Srgrimes/*
3714Srgrimes * These are the existing service side transport implementations
3724Srgrimes */
3734Srgrimes
3744Srgrimes__BEGIN_DECLS
3754Srgrimes/*
3764Srgrimes * Transport independent svc_create routine.
3774Srgrimes */
3784Srgrimesextern int svc_create(void (*)(struct svc_req *, SVCXPRT *),
3794Srgrimes			   const rpcprog_t, const rpcvers_t, const char *);
3804Srgrimes/*
3814Srgrimes *      void (*dispatch)(struct svc_req *, SVCXPRT *);
3824Srgrimes *      const rpcprog_t prognum;        -- program number
3834Srgrimes *      const rpcvers_t versnum;        -- version number
3844Srgrimes *      const char *nettype;            -- network type
3854Srgrimes */
3864Srgrimes
3874Srgrimes
3884Srgrimes/*
3894Srgrimes * Generic server creation routine. It takes a netconfig structure
3904Srgrimes * instead of a nettype.
3914Srgrimes */
3924Srgrimes
3934Srgrimesextern SVCXPRT *svc_tp_create(void (*)(struct svc_req *, SVCXPRT *),
3944Srgrimes				   const rpcprog_t, const rpcvers_t,
395160312Sjhb				   const struct netconfig *);
3964Srgrimes        /*
397160312Sjhb         * void (*dispatch)(struct svc_req *, SVCXPRT *);
3984Srgrimes         * const rpcprog_t prognum;       -- program number
3994Srgrimes         * const rpcvers_t versnum;       -- version number
4004Srgrimes         * const struct netconfig *nconf; -- netconfig structure
4014Srgrimes         */
4024Srgrimes
4034Srgrimes
4044Srgrimes/*
4054Srgrimes * Generic TLI create routine
4064Srgrimes */
4074Srgrimesextern SVCXPRT *svc_tli_create(const int, const struct netconfig *,
4084Srgrimes			       const struct t_bind *, const u_int,
4094Srgrimes			       const u_int);
4104Srgrimes/*
4114Srgrimes *      const int fd;                   -- connection end point
4124Srgrimes *      const struct netconfig *nconf;  -- netconfig structure for network
4134Srgrimes *      const struct t_bind *bindaddr;  -- local bind address
4144Srgrimes *      const u_int sendsz;             -- max sendsize
4154Srgrimes *      const u_int recvsz;             -- max recvsize
4164Srgrimes */
4174Srgrimes
4184Srgrimes/*
4194Srgrimes * Connectionless and connectionful create routines
4204Srgrimes */
4214Srgrimes
42233296Sbdeextern SVCXPRT *svc_vc_create(const int, const u_int, const u_int);
42333296Sbde/*
42433296Sbde *      const int fd;                           -- open connection end point
42533296Sbde *      const u_int sendsize;                   -- max send size
4266204Sphk *      const u_int recvsize;                   -- max recv size
427160505Sjhb */
4287170Sdg
4296204Sphk/*
4306204Sphk * Added for compatibility to old rpc 4.0. Obsoleted by svc_vc_create().
4316204Sphk */
4324Srgrimesextern SVCXPRT *svcunix_create(int, u_int, u_int, char *);
4334Srgrimes
4344Srgrimesextern SVCXPRT *svc_dg_create(const int, const u_int, const u_int);
4354Srgrimes        /*
4364Srgrimes         * const int fd;                                -- open connection
4374Srgrimes         * const u_int sendsize;                        -- max send size
4384Srgrimes         * const u_int recvsize;                        -- max recv size
4394Srgrimes         */
4404Srgrimes
4414Srgrimes
4424Srgrimes/*
4434Srgrimes * the routine takes any *open* connection
4444Srgrimes * descriptor as its first input and is used for open connections.
4454Srgrimes */
4464Srgrimesextern SVCXPRT *svc_fd_create(const int, const u_int, const u_int);
4474Srgrimes/*
448156412Sjhb *      const int fd;                           -- open connection end point
4494Srgrimes *      const u_int sendsize;                   -- max send size
4504Srgrimes *      const u_int recvsize;                   -- max recv size
4514Srgrimes */
4524Srgrimes
4534Srgrimes/*
454103746Smarkm * Added for compatibility to old rpc 4.0. Obsoleted by svc_fd_create().
4554Srgrimes */
4564Srgrimesextern SVCXPRT *svcunixfd_create(int, u_int, u_int);
45779884Skris
4584Srgrimes/*
459131952Smarcel * Memory based rpc (for speed check and testing)
4604Srgrimes */
4614Srgrimesextern SVCXPRT *svc_raw_create(void);
4624Srgrimes
4634Srgrimes/*
4644Srgrimes * svc_dg_enable_cache() enables the cache on dg transports.
4654Srgrimes */
4664Srgrimesint svc_dg_enablecache(SVCXPRT *, const u_int);
467147745Smarcel
468147745Smarcelint __rpc_get_local_uid(SVCXPRT *_transp, uid_t *_uid);
469147745Smarcel
470147745Smarcel__END_DECLS
471147745Smarcel
472147745Smarcel
473147745Smarcel/* for backward compatibility */
474147745Smarcel#include <rpc/svc_soc.h>
475147745Smarcel
476147745Smarcel#endif /* !_RPC_SVC_H */
477147745Smarcel