xref: /titanic_50/usr/src/uts/common/rpc/svc.h (revision 3f7d54a6b84904c8f4d8daa4c7b577bede7df8b9)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
26 /* All Rights Reserved */
27 /*
28  * Portions of this source code were derived from Berkeley
29  * 4.3 BSD under license from the Regents of the University of
30  * California.
31  */
32 
33 /*
34  * svc.h, Server-side remote procedure call interface.
35  */
36 
37 #ifndef	_RPC_SVC_H
38 #define	_RPC_SVC_H
39 
40 #include <rpc/rpc_com.h>
41 #include <rpc/rpc_msg.h>
42 #include <sys/tihdr.h>
43 #include <sys/poll.h>
44 #include <sys/tsol/label.h>
45 
46 #ifdef	_KERNEL
47 #include <rpc/svc_auth.h>
48 #include <sys/callb.h>
49 #endif	/* _KERNEL */
50 
51 /*
52  * This interface must manage two items concerning remote procedure calling:
53  *
54  * 1) An arbitrary number of transport connections upon which rpc requests
55  * are received. They are created and registered by routines in svc_generic.c,
56  * svc_vc.c and svc_dg.c; they in turn call xprt_register and
57  * xprt_unregister.
58  *
59  * 2) An arbitrary number of locally registered services.  Services are
60  * described by the following four data: program number, version number,
61  * "service dispatch" function, a transport handle, and a boolean that
62  * indicates whether or not the exported program should be registered with a
63  * local binder service;  if true the program's number and version and the
64  * address from the transport handle are registered with the binder.
65  * These data are registered with rpcbind via svc_reg().
66  *
67  * A service's dispatch function is called whenever an rpc request comes in
68  * on a transport.  The request's program and version numbers must match
69  * those of the registered service.  The dispatch function is passed two
70  * parameters, struct svc_req * and SVCXPRT *, defined below.
71  */
72 
73 #ifdef __cplusplus
74 extern "C" {
75 #endif
76 
77 /*
78  * Server-side transport handles.
79  * The actual type definitions are below.
80  */
81 #ifdef	_KERNEL
82 typedef struct __svcmasterxprt	SVCMASTERXPRT;	/* Master transport handle */
83 typedef struct __svcxprt	SVCXPRT;	/* Per-thread clone handle */
84 typedef	struct __svcpool	SVCPOOL;	/* Kernel thread pool	   */
85 #else	/* _KERNEL */
86 typedef struct __svcxprt	SVCXPRT;	/* Server transport handle */
87 #endif	/* _KERNEL */
88 
89 /*
90  *  Prototype of error handler callback
91  */
92 #ifndef _KERNEL
93 typedef void (*svc_errorhandler_t)(const SVCXPRT* svc, const bool_t isAConn);
94 #endif
95 
96 /*
97  * Service request.
98  *
99  * PSARC 2003/523 Contract Private Interface
100  * svc_req
101  * Changes must be reviewed by Solaris File Sharing
102  * Changes must be communicated to contract-2003-523@sun.com
103  */
104 struct svc_req {
105 	rpcprog_t	rq_prog;	/* service program number */
106 	rpcvers_t	rq_vers;	/* service protocol version */
107 	rpcproc_t	rq_proc;	/* the desired procedure */
108 	struct opaque_auth rq_cred;	/* raw creds from the wire */
109 	caddr_t		rq_clntcred;	/* read only cooked cred */
110 	SVCXPRT		*rq_xprt;	/* associated transport */
111 	bslabel_t	*rq_label;	/* TSOL label of the request */
112 };
113 
114 #ifdef _KERNEL
115 struct dupreq {
116 	uint32_t	dr_xid;
117 	rpcproc_t	dr_proc;
118 	rpcvers_t	dr_vers;
119 	rpcprog_t	dr_prog;
120 	struct netbuf	dr_addr;
121 	struct netbuf	dr_resp;
122 	void		(*dr_resfree)();
123 	int		dr_status;
124 	struct dupreq	*dr_next;
125 	struct dupreq	*dr_chain;
126 };
127 
128 /*
129  * States of requests for duplicate request caching.
130  */
131 #define	DUP_NEW			0x00	/* new entry */
132 #define	DUP_INPROGRESS		0x01	/* request already going */
133 #define	DUP_DONE		0x02	/* request done */
134 #define	DUP_DROP		0x03	/* request dropped */
135 #define	DUP_ERROR		0x04	/* error in dup req cache */
136 
137 /*
138  * Prototype for a service dispatch routine.
139  */
140 typedef void (SVC_DISPATCH)(struct svc_req *, SVCXPRT *);
141 
142 /*
143  * The service provider callout.
144  * Each entry identifies a dispatch routine to be called
145  * for a given RPC program number and a version fitting
146  * into the registered range.
147  */
148 typedef struct {
149 	rpcprog_t	sc_prog;	/* RPC Program number */
150 	rpcvers_t	sc_versmin;	/* Min version number */
151 	rpcvers_t	sc_versmax;	/* Max version number */
152 	SVC_DISPATCH	*sc_dispatch;	/* Dispatch routine   */
153 } SVC_CALLOUT;
154 
155 /*
156  * Table of service provider `callouts' for an RPC
157  * transport handle. If sct_free is TRUE then transport
158  * destructor is supposed to deallocate this table.
159  */
160 typedef struct {
161 	size_t		sct_size;	/* Number of entries  */
162 	bool_t		sct_free;	/* Deallocate if true */
163 	SVC_CALLOUT	*sct_sc;	/* Callout entries    */
164 } SVC_CALLOUT_TABLE;
165 
166 struct svc_ops {
167 	bool_t	(*xp_recv)(SVCXPRT *, mblk_t *, struct rpc_msg *);
168 		/* receive incoming requests */
169 	bool_t	(*xp_getargs)(SVCXPRT *, xdrproc_t, caddr_t);
170 		/* get arguments */
171 	bool_t	(*xp_reply)(SVCXPRT *, struct rpc_msg *);
172 		/* send reply */
173 	bool_t	(*xp_freeargs)(SVCXPRT *, xdrproc_t, caddr_t);
174 		/* free mem allocated for args */
175 	void	(*xp_destroy)(SVCMASTERXPRT *);
176 		/* destroy this struct */
177 	int	(*xp_dup)(struct svc_req *, caddr_t, int,
178 				struct dupreq **, bool_t *);
179 		/* check for dup */
180 	void	(*xp_dupdone)(struct dupreq *, caddr_t, void (*)(), int, int);
181 		/* mark dup entry as completed */
182 	int32_t *(*xp_getres)(SVCXPRT *, int);
183 		/* get pointer to response buffer */
184 	void	(*xp_freeres)(SVCXPRT *);
185 		/* destroy pre-serialized response */
186 	void	(*xp_clone_destroy)(SVCXPRT *);
187 		/* destroy a clone xprt */
188 	void	(*xp_start)(SVCMASTERXPRT *);
189 		/* `ready-to-receive' */
190 	void	(*xp_clone_xprt)(SVCXPRT *, SVCXPRT *);
191 		/* transport specific clone function */
192 };
193 #else	/* _KERNEL */
194 /*
195  *	Service control requests
196  */
197 #define	SVCGET_VERSQUIET	1
198 #define	SVCSET_VERSQUIET	2
199 #define	SVCGET_XID		4
200 #define	SVCSET_KEEPALIVE	5
201 #define	SVCSET_CONNMAXREC	6
202 #define	SVCGET_CONNMAXREC	7
203 #define	SVCGET_RECVERRHANDLER	8
204 #define	SVCSET_RECVERRHANDLER	9
205 
206 enum xprt_stat {
207 	XPRT_DIED,
208 	XPRT_MOREREQS,
209 	XPRT_IDLE
210 };
211 
212 struct xp_ops {
213 #ifdef	__STDC__
214 	bool_t	(*xp_recv)(SVCXPRT *, struct rpc_msg *);
215 		/* receive incoming requests */
216 	enum xprt_stat (*xp_stat)(SVCXPRT *);
217 		/* get transport status */
218 	bool_t	(*xp_getargs)(SVCXPRT *, xdrproc_t, caddr_t);
219 		/* get arguments */
220 	bool_t	(*xp_reply)(SVCXPRT *,	struct rpc_msg *);
221 		/* send reply */
222 	bool_t	(*xp_freeargs)(SVCXPRT *, xdrproc_t, caddr_t);
223 		/* free mem allocated for args */
224 	void	(*xp_destroy)(SVCXPRT *);
225 		/* destroy this struct */
226 	bool_t	(*xp_control)(SVCXPRT *, const uint_t,	void *);
227 		/* catch-all control function */
228 #else	/* __STDC__ */
229 	bool_t	(*xp_recv)(); /* receive incoming requests */
230 	enum xprt_stat (*xp_stat)(); /* get transport status */
231 	bool_t	(*xp_getargs)(); /* get arguments */
232 	bool_t	(*xp_reply)(); /* send reply */
233 	bool_t	(*xp_freeargs)(); /* free mem allocated for args */
234 	void	(*xp_destroy)(); /* destroy this struct */
235 	bool_t	(*xp_control)(); /* catch-all control function */
236 #endif	/* __STDC__ */
237 };
238 #endif	/* _KERNEL */
239 
240 #ifdef	_KERNEL
241 /*
242  * SVCPOOL
243  * Kernel RPC server-side thread pool structure.
244  */
245 typedef struct __svcxprt_qnode __SVCXPRT_QNODE;	/* Defined in svc.c */
246 
247 struct __svcpool {
248 	/*
249 	 * Thread pool variables.
250 	 *
251 	 * The pool's thread lock p_thread_lock protects:
252 	 * - p_threads, p_detached_threads, p_reserved_threads and p_closing
253 	 * The pool's request lock protects:
254 	 * - p_asleep, p_drowsy, p_reqs, p_walkers, p_req_cv.
255 	 * The following fields are `initialized constants':
256 	 * - p_id, p_stksize, p_timeout.
257 	 * Access to p_next and p_prev is protected by the pool
258 	 * list lock.
259 	 */
260 	SVCPOOL		*p_next;		/* Next pool in the list  */
261 	SVCPOOL		*p_prev;		/* Prev pool in the list  */
262 	int		p_id;			/* Pool id		  */
263 	int		p_threads;		/* Non-detached threads	  */
264 	int		p_detached_threads;	/* Detached threads	  */
265 	int		p_maxthreads;		/* Max threads in the pool */
266 	int		p_redline;		/* `Redline' for the pool */
267 	int		p_reserved_threads;	/* Reserved threads	  */
268 	kmutex_t	p_thread_lock;		/* Thread lock		  */
269 	int		p_asleep;		/* Asleep threads	  */
270 	int		p_drowsy;		/* Drowsy flag		  */
271 	kcondvar_t 	p_req_cv;		/* svc_poll() sleep var.  */
272 	clock_t		p_timeout;		/* svc_poll() timeout	  */
273 	kmutex_t	p_req_lock;		/* Request lock		  */
274 	int		p_reqs;			/* Pending requests	  */
275 	int		p_walkers;		/* Walking threads	  */
276 	int		p_max_same_xprt;	/* Max reqs from the xprt */
277 	int		p_stksize;		/* Stack size for svc_run */
278 	bool_t		p_closing : 1;		/* Pool is closing	  */
279 
280 	/*
281 	 * Thread creator variables.
282 	 * The `creator signaled' flag is turned on when a signal is send
283 	 * to the creator thread (to create a new service thread). The
284 	 * creator clears when the thread is created. The protocol is not
285 	 * to signal the creator thread when the flag is on. However,
286 	 * a new thread should signal the creator if there are more
287 	 * requests in the queue.
288 	 *
289 	 * When the pool is closing (ie it has been already unregistered from
290 	 * the pool list) the last thread on the last transport should turn
291 	 * the p_creator_exit flag on. This tells the creator thread to
292 	 * free the pool structure and exit.
293 	 */
294 	bool_t		p_creator_signaled : 1;	/* Create requested flag  */
295 	bool_t		p_creator_exit : 1;	/* If true creator exits  */
296 	kcondvar_t	p_creator_cv;		/* Creator cond. variable */
297 	kmutex_t	p_creator_lock;		/* Creator lock		  */
298 
299 	/*
300 	 * Doubly linked list containing `registered' master transport handles.
301 	 * There is no special structure for a list node. Instead the
302 	 * SVCMASTERXPRT structure has the xp_next and xp_prev fields.
303 	 *
304 	 * The p_lrwlock protects access to xprt->xp_next and xprt->xp_prev.
305 	 * A service thread should also acquire a reader lock before accessing
306 	 * any transports it is no longer linked to (to prevent them from
307 	 * being destroyed).
308 	 *
309 	 * The list lock governs also the `pool is closing' flag.
310 	 */
311 	size_t		p_lcount;		/* Current count	  */
312 	SVCMASTERXPRT	*p_lhead;		/* List head		  */
313 	krwlock_t	p_lrwlock;		/* R/W lock		  */
314 
315 	/*
316 	 * Circular linked list for the `xprt-ready' queue (FIFO).
317 	 * Must be initialized with svc_xprt_qinit() before it is used.
318 	 *
319 	 * The writer's end is protected by the pool's request lock
320 	 * (pool->p_req_lock). The reader's end is protected by q_end_lock.
321 	 *
322 	 * When the queue is full the p_qoverflow flag is raised. It stays
323 	 * on until all the pending request are drained.
324 	 */
325 	size_t		p_qsize;		/* Number of queue nodes  */
326 	int		p_qoverflow : 1;	/* Overflow flag	  */
327 	__SVCXPRT_QNODE *p_qbody;		/* Queue body (array)	  */
328 	__SVCXPRT_QNODE *p_qtop;		/* Writer's end of FIFO   */
329 	__SVCXPRT_QNODE *p_qend;		/* Reader's end of FIFO	  */
330 	kmutex_t	p_qend_lock;		/* Reader's end lock	  */
331 
332 	/*
333 	 * Userspace thread creator variables.
334 	 * Thread creation is actually done in userland, via a thread
335 	 * that is parked in the kernel. When that thread is signaled,
336 	 * it returns back down to the daemon from whence it came and
337 	 * does the lwp create.
338 	 *
339 	 * A parallel "creator" thread runs in the kernel. That is the
340 	 * thread that will signal for the user thread to return to
341 	 * userland and do its work.
342 	 *
343 	 * Since the thread doesn't always exist (there could be a race
344 	 * if two threads are created in rapid succession), we set
345 	 * p_signal_create_thread to FALSE when we're ready to accept work.
346 	 *
347 	 * p_user_exit is set to true when the service pool is about
348 	 * to close. This is done so that the user creation thread
349 	 * can be informed and cleanup any userland state.
350 	 */
351 
352 	bool_t		p_signal_create_thread : 1; /* Create requested flag  */
353 	bool_t		p_user_exit : 1;	/* If true creator exits  */
354 	bool_t		p_user_waiting : 1;	/* Thread waiting for work */
355 	kcondvar_t	p_user_cv;		/* Creator cond. variable */
356 	kmutex_t	p_user_lock;		/* Creator lock		  */
357 	void		(*p_offline)();		/* callout for unregister */
358 	void		(*p_shutdown)();	/* callout for shutdown */
359 };
360 
361 /*
362  * Server side transport handle (SVCMASTERXPRT).
363  * xprt->xp_req_lock governs the following fields in xprt:
364  *		xp_req_head, xp_req_tail.
365  * xprt->xp_thread_lock governs the following fields in xprt:
366  *		xp_threads, xp_detached_threads.
367  *
368  * xp_req_tail is only valid if xp_req_head is non-NULL
369  *
370  * The xp_threads count is the number of attached threads.  These threads
371  * are able to handle new requests, and it is expected that they will not
372  * block for a very long time handling a given request. The
373  * xp_detached_threads count is the number of threads that have detached
374  * themselves from the transport. These threads can block indefinitely
375  * while handling a request.  Once they complete the request, they exit.
376  *
377  * A kernel service provider may register a callback function "closeproc"
378  * for a transport.  When the transport is closing the last exiting attached
379  * thread - xp_threads goes to zero - it calls the callback function, passing
380  * it a reference to the transport.  This call is made with xp_thread_lock
381  * held, so any cleanup bookkeeping it does should be done quickly.
382  *
383  * When the transport is closing the last exiting thread is supposed
384  * to destroy/free the data structure.
385  */
386 typedef struct __svcxprt_common {
387 	struct file	*xpc_fp;
388 	struct svc_ops	*xpc_ops;
389 	queue_t		*xpc_wq;	/* queue to write onto		*/
390 	cred_t		*xpc_cred;	/* cached cred for server to use */
391 	int32_t		xpc_type;	/* transport type		*/
392 	int		xpc_msg_size;	/* TSDU or TIDU size		*/
393 	struct netbuf	xpc_rtaddr;	/* remote transport address	*/
394 	struct netbuf	xpc_lcladdr;	/* local transport address	*/
395 	char		*xpc_netid;	/* network token		*/
396 	SVC_CALLOUT_TABLE *xpc_sct;
397 } __SVCXPRT_COMMON;
398 
399 #define	xp_fp		xp_xpc.xpc_fp
400 #define	xp_ops		xp_xpc.xpc_ops
401 #define	xp_wq		xp_xpc.xpc_wq
402 #define	xp_cred		xp_xpc.xpc_cred
403 #define	xp_type		xp_xpc.xpc_type
404 #define	xp_msg_size	xp_xpc.xpc_msg_size
405 #define	xp_rtaddr	xp_xpc.xpc_rtaddr
406 #define	xp_lcladdr	xp_xpc.xpc_lcladdr
407 #define	xp_sct		xp_xpc.xpc_sct
408 #define	xp_netid	xp_xpc.xpc_netid
409 
410 struct __svcmasterxprt {
411 	SVCMASTERXPRT 	*xp_next;	/* Next transport in the list	*/
412 	SVCMASTERXPRT 	*xp_prev;	/* Prev transport in the list	*/
413 	__SVCXPRT_COMMON xp_xpc;	/* Fields common with the clone	*/
414 	SVCPOOL		*xp_pool;	/* Pointer to the pool		*/
415 	mblk_t		*xp_req_head;	/* Request queue head		*/
416 	mblk_t		*xp_req_tail;	/* Request queue tail		*/
417 	kmutex_t	xp_req_lock;	/* Request lock			*/
418 	int		xp_threads;	/* Current num. of attached threads */
419 	int		xp_detached_threads; /* num. of detached threads */
420 	kmutex_t	xp_thread_lock;	/* Thread count lock		*/
421 	void		(*xp_closeproc)(const SVCMASTERXPRT *);
422 					/* optional; see comments above	*/
423 	struct netbuf	xp_addrmask;	/* address mask			*/
424 
425 	caddr_t		xp_p2;		/* private: for use by svc ops  */
426 };
427 
428 /*
429  * Service thread `clone' transport handle (SVCXPRT)
430  *
431  * PSARC 2003/523 Contract Private Interface
432  * SVCXPRT
433  * Changes must be reviewed by Solaris File Sharing
434  * Changes must be communicated to contract-2003-523@sun.com
435  *
436  * The xp_p2buf buffer is used as the storage for a transport type
437  * specific structure. It is private for the svc ops for a given
438  * transport type.
439  */
440 
441 #define	SVC_P2LEN   128
442 
443 struct __svcxprt {
444 	__SVCXPRT_COMMON xp_xpc;
445 	SVCMASTERXPRT	*xp_master;	/* back ptr to master		*/
446 
447 	/* The following fileds are on a per-thread basis */
448 	callb_cpr_t	*xp_cprp;	/* unused padding for Contract	*/
449 	bool_t		xp_reserved : 1; /* is thread reserved?		*/
450 	bool_t		xp_detached : 1; /* is thread detached?		*/
451 	int		xp_same_xprt;	/* Reqs from the same xprt	*/
452 
453 	/* The following fields are used on a per-request basis */
454 	struct opaque_auth xp_verf;	/* raw response verifier	*/
455 	SVCAUTH		xp_auth;	/* auth flavor of current req	*/
456 	void		*xp_cookie;	/* a cookie			*/
457 	uint32_t	xp_xid;		/* id				*/
458 	XDR		xp_xdrin;	/* input xdr stream		*/
459 	XDR		xp_xdrout;	/* output xdr stream		*/
460 
461 	/* Private for svc ops */
462 	char		xp_p2buf[SVC_P2LEN]; /* udp_data or cots_data_t */
463 						/* or clone_rdma_data_t */
464 };
465 #else	/* _KERNEL */
466 struct __svcxprt {
467 	int		xp_fd;
468 #define	xp_sock		xp_fd
469 	ushort_t	xp_port;
470 	/*
471 	 * associated port number.
472 	 * Obsolete, but still used to
473 	 * specify whether rendezvouser
474 	 * or normal connection
475 	 */
476 	struct	xp_ops	*xp_ops;
477 	int		xp_addrlen;	/* length of remote addr. Obsoleted */
478 	char		*xp_tp;		/* transport provider device name */
479 	char		*xp_netid;	/* network token */
480 	struct netbuf	xp_ltaddr;	/* local transport address */
481 	struct netbuf	xp_rtaddr;	/* remote transport address */
482 	char		xp_raddr[16];	/* remote address. Now obsoleted */
483 	struct opaque_auth xp_verf;	/* raw response verifier */
484 	caddr_t		xp_p1;		/* private: for use by svc ops */
485 	caddr_t		xp_p2;		/* private: for use by svc ops */
486 	caddr_t		xp_p3;		/* private: for use by svc lib */
487 	int		xp_type;	/* transport type */
488 	/*
489 	 * callback on client death
490 	 * First parameter is the current structure,
491 	 * Second parameter :
492 	 *	- FALSE for the service listener
493 	 *	- TRUE for a real connected socket
494 	 */
495 	svc_errorhandler_t xp_closeclnt;
496 };
497 #endif	/* _KERNEL */
498 
499 /*
500  *  Approved way of getting address of caller,
501  *  address mask, and netid of transport.
502  */
503 #define	svc_getrpccaller(x) (&(x)->xp_rtaddr)
504 #ifdef _KERNEL
505 #define	svc_getcaller(x) (&(x)->xp_rtaddr.buf)
506 #define	svc_getaddrmask(x) (&(x)->xp_master->xp_addrmask)
507 #define	svc_getnetid(x) ((x)->xp_netid)
508 #endif	/* _KERNEL */
509 
510 /*
511  * Operations defined on an SVCXPRT handle
512  */
513 
514 #ifdef	_KERNEL
515 
516 #define	SVC_CLONE_XPRT(src_xprt, dst_xprt) \
517 	if ((src_xprt)->xp_ops->xp_clone_xprt) \
518 		(*(src_xprt)->xp_ops->xp_clone_xprt) \
519 		    (src_xprt, dst_xprt)
520 
521 #define	SVC_RECV(clone_xprt, mp, msg) \
522 	(*(clone_xprt)->xp_ops->xp_recv)((clone_xprt), (mp), (msg))
523 
524 /*
525  * PSARC 2003/523 Contract Private Interface
526  * SVC_GETARGS
527  * Changes must be reviewed by Solaris File Sharing
528  * Changes must be communicated to contract-2003-523@sun.com
529  */
530 #define	SVC_GETARGS(clone_xprt, xargs, argsp) \
531 	(*(clone_xprt)->xp_ops->xp_getargs)((clone_xprt), (xargs), (argsp))
532 
533 #define	SVC_REPLY(clone_xprt, msg) \
534 	(*(clone_xprt)->xp_ops->xp_reply) ((clone_xprt), (msg))
535 
536 #define	SVC_FREEARGS(clone_xprt, xargs, argsp) \
537 	(*(clone_xprt)->xp_ops->xp_freeargs)((clone_xprt), (xargs), (argsp))
538 
539 #define	SVC_GETRES(clone_xprt, size) \
540 	(*(clone_xprt)->xp_ops->xp_getres)((clone_xprt), (size))
541 
542 #define	SVC_FREERES(clone_xprt)	\
543 	(*(clone_xprt)->xp_ops->xp_freeres)(clone_xprt)
544 
545 #define	SVC_DESTROY(xprt) \
546 	(*(xprt)->xp_ops->xp_destroy)(xprt)
547 
548 /*
549  * PSARC 2003/523 Contract Private Interfaces
550  * SVC_DUP, SVC_DUPDONE, SVC_DUP_EXT, SVC_DUPDONE_EXT
551  * Changes must be reviewed by Solaris File Sharing
552  * Changes must be communicated to contract-2003-523@sun.com
553  *
554  * SVC_DUP and SVC_DUPDONE are defined here for backward compatibility.
555  */
556 #define	SVC_DUP_EXT(clone_xprt, req, res, size, drpp, dupcachedp) \
557 	(*(clone_xprt)->xp_ops->xp_dup)(req, res, size, drpp, dupcachedp)
558 
559 #define	SVC_DUPDONE_EXT(clone_xprt, dr, res, resfree, size, status) \
560 	(*(clone_xprt)->xp_ops->xp_dupdone)(dr, res, resfree, size, status)
561 
562 #define	SVC_DUP(clone_xprt, req, res, size, drpp) \
563 	(*(clone_xprt)->xp_ops->xp_dup)(req, res, size, drpp, NULL)
564 
565 #define	SVC_DUPDONE(clone_xprt, dr, res, size, status) \
566 	(*(clone_xprt)->xp_ops->xp_dupdone)(dr, res, NULL, size, status)
567 
568 #define	SVC_CLONE_DESTROY(clone_xprt) \
569 	(*(clone_xprt)->xp_ops->xp_clone_destroy)(clone_xprt)
570 
571 
572 #define	SVC_START(xprt) \
573 	(*(xprt)->xp_ops->xp_start)(xprt)
574 
575 #else	/* _KERNEL */
576 
577 #define	SVC_RECV(xprt, msg) \
578 	(*(xprt)->xp_ops->xp_recv)((xprt), (msg))
579 #define	svc_recv(xprt, msg) \
580 	(*(xprt)->xp_ops->xp_recv)((xprt), (msg))
581 
582 #define	SVC_STAT(xprt) \
583 	(*(xprt)->xp_ops->xp_stat)(xprt)
584 #define	svc_stat(xprt) \
585 	(*(xprt)->xp_ops->xp_stat)(xprt)
586 
587 #define	SVC_GETARGS(xprt, xargs, argsp) \
588 	(*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp))
589 #define	svc_getargs(xprt, xargs, argsp)	\
590 	(*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp))
591 
592 #define	SVC_REPLY(xprt, msg) \
593 	(*(xprt)->xp_ops->xp_reply) ((xprt), (msg))
594 #define	svc_reply(xprt, msg) \
595 	(*(xprt)->xp_ops->xp_reply) ((xprt), (msg))
596 
597 #define	SVC_FREEARGS(xprt, xargs, argsp) \
598 	(*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp))
599 #define	svc_freeargs(xprt, xargs, argsp) \
600 	(*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp))
601 
602 #define	SVC_GETRES(xprt, size) \
603 	(*(xprt)->xp_ops->xp_getres)((xprt), (size))
604 #define	svc_getres(xprt, size) \
605 	(*(xprt)->xp_ops->xp_getres)((xprt), (size))
606 
607 #define	SVC_FREERES(xprt) \
608 	(*(xprt)->xp_ops->xp_freeres)(xprt)
609 #define	svc_freeres(xprt) \
610 	(*(xprt)->xp_ops->xp_freeres)(xprt)
611 
612 #define	SVC_DESTROY(xprt) \
613 	(*(xprt)->xp_ops->xp_destroy)(xprt)
614 #define	svc_destroy(xprt) \
615 	(*(xprt)->xp_ops->xp_destroy)(xprt)
616 
617 /*
618  * PSARC 2003/523 Contract Private Interface
619  * SVC_CONTROL
620  * Changes must be reviewed by Solaris File Sharing
621  * Changes must be communicated to contract-2003-523@sun.com
622  */
623 #define	SVC_CONTROL(xprt, rq, in) \
624 	(*(xprt)->xp_ops->xp_control)((xprt), (rq), (in))
625 #endif	/* _KERNEL */
626 
627 /*
628  * Pool id's reserved for NFS, NLM, and the NFSv4 callback program.
629  */
630 #define	NFS_SVCPOOL_ID		0x01
631 #define	NLM_SVCPOOL_ID		0x02
632 #define	NFS_CB_SVCPOOL_ID	0x03
633 #define	RDC_SVCPOOL_ID		0x05	/* SNDR, PSARC 2001/699 */
634 
635 struct svcpool_args {
636 	uint32_t	id;		/* Pool id */
637 	uint32_t	maxthreads;	/* Max threads in the pool */
638 	uint32_t	redline;	/* `Redline' for the pool */
639 	uint32_t	qsize;		/* `xprt-ready' queue size */
640 	uint32_t	timeout;	/* svc_poll() timeout */
641 	uint32_t	stksize;	/* svc_run() stack size */
642 	uint32_t	max_same_xprt;	/* Max reqs from the same xprt */
643 };
644 
645 
646 #ifdef	_KERNEL
647 /*
648  * Transport registration and thread pool creation.
649  */
650 extern int	svc_xprt_register(SVCMASTERXPRT *, int);
651 extern void	svc_xprt_unregister(SVCMASTERXPRT *);
652 extern int	svc_pool_create(struct svcpool_args *);
653 extern int	svc_wait(int);
654 extern int	svc_do_run(int);
655 #define	SVCPSET_SHUTDOWN_PROC	1
656 #define	SVCPSET_UNREGISTER_PROC	2
657 extern int	svc_pool_control(int, int, void *);
658 #else	/* _KERNEL */
659 #ifdef	__STDC__
660 extern bool_t	rpc_reg(const rpcprog_t, const rpcvers_t, const rpcproc_t,
661 			char *(*)(char *), const xdrproc_t, const xdrproc_t,
662 			const char *);
663 
664 /*
665  * Service registration
666  *
667  * svc_reg(xprt, prog, vers, dispatch, nconf)
668  *	const SVCXPRT *xprt;
669  *	const rpcprog_t prog;
670  *	const rpcvers_t vers;
671  *	const void (*dispatch)();
672  *	const struct netconfig *nconf;
673  */
674 extern bool_t	svc_reg(const SVCXPRT *, const rpcprog_t, const rpcvers_t,
675 			void (*)(struct svc_req *, SVCXPRT *),
676 			const struct netconfig *);
677 
678 /*
679  * Service authentication registration
680  *
681  * svc_auth_reg(cred_flavor, handler)
682  *    int cred_flavor;
683  *    enum auth_stat (*handler)();
684  */
685 extern int	svc_auth_reg(int, enum auth_stat (*)());
686 
687 /*
688  * Service un-registration
689  *
690  * svc_unreg(prog, vers)
691  *	const rpcprog_t prog;
692  *	const rpcvers_t vers;
693  */
694 extern void	svc_unreg(const rpcprog_t, const rpcvers_t);
695 
696 /*
697  * Transport registration/unregistration.
698  *
699  * xprt_register(xprt)
700  *	const SVCXPRT *xprt;
701  *
702  * xprt_unregister(xprt)
703  *	const SVCXPRT *xprt;
704  */
705 extern void	xprt_register(const SVCXPRT *);
706 extern void	xprt_unregister(const SVCXPRT *);
707 #else	/* __STDC__ */
708 extern bool_t	rpc_reg();
709 extern bool_t	svc_reg();
710 extern bool_t	svc_auth_reg();
711 extern void	svc_unreg();
712 extern void	xprt_register();
713 extern void	xprt_unregister();
714 #endif /* __STDC__ */
715 #endif	/* _KERNEL */
716 
717 
718 /*
719  * When the service routine is called, it must first check to see if it
720  * knows about the procedure;  if not, it should call svcerr_noproc
721  * and return.  If so, it should deserialize its arguments via
722  * SVC_GETARGS (defined above).  If the deserialization does not work,
723  * svcerr_decode should be called followed by a return.  Successful
724  * decoding of the arguments should be followed the execution of the
725  * procedure's code and a call to svc_sendreply.
726  *
727  * Also, if the service refuses to execute the procedure due to too-
728  * weak authentication parameters, svcerr_weakauth should be called.
729  * Note: do not confuse access-control failure with weak authentication!
730  *
731  * NB: In pure implementations of rpc, the caller always waits for a reply
732  * msg.  This message is sent when svc_sendreply is called.
733  * Therefore pure service implementations should always call
734  * svc_sendreply even if the function logically returns void;  use
735  * xdr.h - xdr_void for the xdr routine.  HOWEVER, connectionful rpc allows
736  * for the abuse of pure rpc via batched calling or pipelining.  In the
737  * case of a batched call, svc_sendreply should NOT be called since
738  * this would send a return message, which is what batching tries to avoid.
739  * It is the service/protocol writer's responsibility to know which calls are
740  * batched and which are not.  Warning: responding to batch calls may
741  * deadlock the caller and server processes!
742  */
743 #ifdef	__STDC__
744 extern bool_t	svc_sendreply(const SVCXPRT *, const xdrproc_t,	const caddr_t);
745 extern void	svcerr_decode(const SVCXPRT *);
746 extern void	svcerr_weakauth(const SVCXPRT *);
747 extern void	svcerr_noproc(const SVCXPRT *);
748 extern void	svcerr_progvers(const SVCXPRT *, const rpcvers_t,
749     const rpcvers_t);
750 extern void	svcerr_auth(const SVCXPRT *, const enum auth_stat);
751 extern void	svcerr_noprog(const SVCXPRT *);
752 extern void	svcerr_systemerr(const SVCXPRT *);
753 extern void	svcerr_badcred(const SVCXPRT *);
754 #else	/* __STDC__ */
755 extern bool_t	svc_sendreply();
756 extern void	svcerr_decode();
757 extern void	svcerr_weakauth();
758 extern void	svcerr_noproc();
759 extern void	svcerr_progvers();
760 extern void	svcerr_auth();
761 extern void	svcerr_noprog();
762 extern void	svcerr_systemerr();
763 extern void	svcerr_badcred();
764 #endif	/* __STDC__ */
765 
766 #ifdef	_KERNEL
767 /*
768  * Kernel RPC functions.
769  */
770 extern void	svc_init(void);
771 extern void	svc_cots_init(void);
772 extern void	svc_clts_init(void);
773 extern void	mt_kstat_init(void);
774 extern void	mt_kstat_fini(void);
775 extern int	svc_tli_kcreate(struct file *, uint_t, char *,
776 				struct netbuf *, SVCMASTERXPRT **,
777 				SVC_CALLOUT_TABLE *,
778 				void (*closeproc)(const SVCMASTERXPRT *),
779 				int, bool_t);
780 extern int	svc_clts_kcreate(struct file *, uint_t, struct T_info_ack *,
781 				SVCMASTERXPRT **);
782 extern int	svc_cots_kcreate(struct file *, uint_t, struct T_info_ack *,
783 				SVCMASTERXPRT **);
784 extern void	svc_queuereq(queue_t *, mblk_t *);
785 extern void	svc_queueclean(queue_t *);
786 extern void	svc_queueclose(queue_t *);
787 extern int	svc_reserve_thread(SVCXPRT *);
788 extern void	svc_unreserve_thread(SVCXPRT *);
789 extern callb_cpr_t *svc_detach_thread(SVCXPRT *);
790 
791 /*
792  * For RDMA based kRPC.
793  * "rdma_xprt_record" is a reference to master transport handles
794  * in kRPC thread pools. This is an easy way of tracking and shuting
795  * down rdma based kRPC transports on demand.
796  * "rdma_xprt_group" is a list of RDMA based mster transport handles
797  * or records in a kRPC thread pool.
798  */
799 typedef struct rdma_xprt_record		rdma_xprt_record_t;
800 struct rdma_xprt_record {
801 	int			rtr_type;	/* Type of rdma; IB/VI/RDDP */
802 	SVCMASTERXPRT		*rtr_xprt_ptr;	/* Ptr to master xprt handle */
803 	rdma_xprt_record_t	*rtr_next;	/* Ptr to next record */
804 };
805 
806 typedef struct {
807 	int			rtg_count;	/* Number transport records */
808 	int			rtg_poolid;	/* Pool Id for this group */
809 	rdma_xprt_record_t	*rtg_listhead;	/* Head of the records list */
810 } rdma_xprt_group_t;
811 
812 extern int	svc_rdma_kcreate(char *, SVC_CALLOUT_TABLE *, int,
813 			rdma_xprt_group_t *);
814 extern void	svc_rdma_kstop(SVCMASTERXPRT *);
815 extern void	svc_rdma_kdestroy(SVCMASTERXPRT *);
816 extern void	rdma_stop(rdma_xprt_group_t *);
817 
818 /*
819  * GSS cleanup method.
820  */
821 extern void	rpc_gss_cleanup(SVCXPRT *);
822 #else	/* _KERNEL */
823 /*
824  * Lowest level dispatching -OR- who owns this process anyway.
825  * Somebody has to wait for incoming requests and then call the correct
826  * service routine.  The routine svc_run does infinite waiting; i.e.,
827  * svc_run never returns.
828  * Since another (co-existant) package may wish to selectively wait for
829  * incoming calls or other events outside of the rpc architecture, the
830  * routine svc_getreq_poll is provided.  It must be passed pollfds, the
831  * "in-place" results of a poll call (see poll, section 2).
832  */
833 
834 /*
835  * Global keeper of rpc service descriptors in use
836  * dynamic; must be inspected before each call to select or poll
837  */
838 extern pollfd_t	*svc_pollfd;
839 extern int	svc_max_pollfd;
840 extern fd_set	svc_fdset;
841 #if !defined(_LP64) && FD_SETSIZE > 1024
842 extern fd_set	_new_svc_fdset;
843 #ifdef __PRAGMA_REDEFINE_EXTNAME
844 #pragma redefine_extname	svc_fdset	_new_svc_fdset
845 #else   /* __PRAGMA_REDEFINE_EXTNAME */
846 #define	svc_fdset	_new_svc_fdset
847 #endif  /* __PRAGMA_REDEFINE_EXTNAME */
848 #endif	/* LP64 && FD_SETSIZE > 1024 */
849 #define	svc_fds svc_fdset.fds_bits[0]	/* compatibility */
850 
851 /*
852  * A small program implemented by the svc_rpc implementation itself.
853  * Also see clnt.h for protocol numbers.
854  */
855 #ifdef __STDC__
856 extern void	svc_getreq(int);
857 extern void	svc_getreq_common(const int);
858 extern void	svc_getreqset(fd_set *); /* takes fdset instead of int */
859 extern void	svc_getreq_poll(struct pollfd *, const int);
860 extern void	svc_run(void);
861 extern void	svc_exit(void);
862 #else	/* __STDC__ */
863 extern void	rpctest_service();
864 extern void	svc_getreqset();
865 extern void	svc_getreq();
866 extern void	svc_getreq_common();
867 extern void	svc_getreqset();	 /* takes fdset instead of int */
868 extern void	svc_getreq_poll();
869 extern void	svc_run();
870 extern void	svc_exit();
871 #endif	/* __STDC__ */
872 
873 /*
874  *  Functions used to manage user file descriptors
875  */
876 typedef int svc_input_id_t;
877 typedef void (*svc_callback_t)(svc_input_id_t id, int fd,
878 				unsigned int events, void* cookie);
879 
880 #ifdef __STDC__
881 extern svc_input_id_t svc_add_input(int fd, unsigned int events,
882 				svc_callback_t user_callback,
883 				void* cookie);
884 extern int svc_remove_input(svc_input_id_t id);
885 #else	/* __STDC__ */
886 extern svc_input_id_t svc_add_input();
887 extern int	svc_remove_input();
888 #endif
889 
890 /*
891  * These are the existing service side transport implementations.
892  *
893  * Transport independent svc_create routine.
894  */
895 #ifdef __STDC__
896 extern int	svc_create(void (*)(struct svc_req *, SVCXPRT *),
897 				const rpcprog_t, const rpcvers_t,
898 				const char *);
899 	/*
900 	 * 	void (*dispatch)();		-- dispatch routine
901 	 *	const rpcprog_t prognum;	-- program number
902 	 *	const rpcvers_t versnum;	-- version number
903 	 *	const char *nettype;		-- network type
904 	 */
905 
906 /*
907  * Generic server creation routine. It takes a netconfig structure
908  * instead of a nettype.
909  */
910 extern SVCXPRT	*svc_tp_create(void (*)(struct svc_req *, SVCXPRT *),
911 				const rpcprog_t, const rpcvers_t,
912 				const struct netconfig *);
913 	/*
914 	 * void (*dispatch)();			-- dispatch routine
915 	 * const rpcprog_t prognum;		-- program number
916 	 * const rpcvers_t versnum;		-- version number
917 	 * const struct netconfig *nconf;	-- netconfig structure
918 	 */
919 
920 /*
921  * Generic TLI create routine
922  */
923 extern  SVCXPRT	*svc_tli_create(const int, const struct netconfig *,
924 				const struct t_bind *, const uint_t,
925 				const uint_t);
926 	/*
927 	 *	const int fd;			-- connection end point
928 	 *	const struct netconfig *nconf;	-- netconfig structure
929 	 *	const struct t_bind *bindaddr;	-- local bind address
930 	 *	const uint_t sendsz;		-- max sendsize
931 	 *	const uint_t recvsz;		-- max recvsize
932 	 */
933 
934 /*
935  * Connectionless and connectionful create routines.
936  */
937 extern SVCXPRT	*svc_vc_create(const int, const uint_t, const uint_t);
938 	/*
939 	 *	const int fd;			-- open connection end point
940 	 *	const uint_t sendsize;		-- max send size
941 	 *	const uint_t recvsize;		-- max recv size
942 	 */
943 
944 extern SVCXPRT	*svc_dg_create(const int, const uint_t, const uint_t);
945 	/*
946 	 * const int fd;			-- open connection
947 	 * const uint_t sendsize;		-- max send size
948 	 * const uint_t recvsize;		-- max recv size
949 	 */
950 
951 /*
952  * the routine takes any *open* TLI file
953  * descriptor as its first input and is used for open connections.
954  */
955 extern  SVCXPRT	*svc_fd_create(const int, const uint_t, const uint_t);
956 	/*
957 	 * 	const int fd;			-- open connection end point
958 	 * 	const uint_t sendsize;		-- max send size
959 	 * 	const uint_t recvsize;		-- max recv size
960 	 */
961 
962 /*
963  * Memory based rpc (for speed check and testing)
964  */
965 extern SVCXPRT	*svc_raw_create(void);
966 
967 /*
968  * Creation of service over doors transport.
969  */
970 extern SVCXPRT	*svc_door_create(void (*)(struct svc_req *, SVCXPRT *),
971 				const rpcprog_t, const rpcvers_t,
972 				const uint_t);
973 	/*
974 	 * 	void (*dispatch)();		-- dispatch routine
975 	 *	const rpcprog_t prognum;	-- program number
976 	 *	const rpcvers_t versnum;	-- version number
977 	 *	const uint_t sendsize;		-- send buffer size
978 	 */
979 
980 /*
981  * Service control interface
982  */
983 extern	bool_t	svc_control(SVCXPRT *, const uint_t, void *);
984 	/*
985 	 *	SVCXPRT *svc;			-- service to manipulate
986 	 *	const uint_t req;		-- request
987 	 *	void *info;			-- argument to request
988 	 */
989 
990 /*
991  * svc_dg_enable_cache() enables the cache on dg transports.
992  */
993 extern int svc_dg_enablecache(SVCXPRT *, const uint_t);
994 #else	/* __STDC__ */
995 extern int	svc_create();
996 extern SVCXPRT	*svc_tp_create();
997 extern SVCXPRT	*svc_tli_create();
998 extern SVCXPRT	*svc_vc_create();
999 extern SVCXPRT	*svc_dg_create();
1000 extern SVCXPRT	*svc_fd_create();
1001 extern SVCXPRT	*svc_raw_create();
1002 extern SVCXPRT	*svc_door_create();
1003 extern int svc_dg_enablecache();
1004 #endif	/* __STDC__ */
1005 
1006 extern boolean_t is_multilevel(rpcprog_t);
1007 
1008 #ifdef	PORTMAP
1009 /* For backward compatibility */
1010 #include <rpc/svc_soc.h>
1011 #endif	/* PORTMAP */
1012 
1013 /*
1014  * For user level MT hot server functions
1015  */
1016 
1017 /*
1018  * Different MT modes
1019  */
1020 #define	RPC_SVC_MT_NONE		0	/* default, single-threaded */
1021 #define	RPC_SVC_MT_AUTO		1	/* automatic MT mode */
1022 #define	RPC_SVC_MT_USER		2	/* user MT mode */
1023 
1024 #ifdef	__STDC__
1025 extern void	svc_done(SVCXPRT *);
1026 #else
1027 extern void	svc_done();
1028 #endif	/* __STDC__ */
1029 
1030 /*
1031  * Obtaining local credentials.
1032  */
1033 typedef struct __svc_local_cred_t {
1034 	uid_t	euid;	/* effective uid */
1035 	gid_t	egid;	/* effective gid */
1036 	uid_t	ruid;	/* real uid */
1037 	gid_t	rgid;	/* real gid */
1038 	pid_t	pid;	/* caller's pid, or -1 if not available */
1039 } svc_local_cred_t;
1040 
1041 #ifdef __STDC__
1042 struct ucred_s;
1043 extern void	svc_fd_negotiate_ucred(int);
1044 extern int	svc_getcallerucred(const SVCXPRT *, struct ucred_s **);
1045 extern bool_t	svc_get_local_cred(SVCXPRT *, svc_local_cred_t *);
1046 #else
1047 extern void	svc_fd_negotiate_ucred();
1048 extern int	svc_getcallerucred();
1049 extern bool_t	svc_get_local_cred();
1050 #endif	/* __STDC__ */
1051 
1052 /*
1053  * Private interfaces and structures for user level duplicate request caching.
1054  * The interfaces and data structures are not committed and subject to
1055  * change in future releases. Currently only intended for use by automountd.
1056  */
1057 struct dupreq {
1058 	uint32_t	dr_xid;
1059 	rpcproc_t	dr_proc;
1060 	rpcvers_t	dr_vers;
1061 	rpcprog_t	dr_prog;
1062 	struct netbuf	dr_addr;
1063 	struct netbuf	dr_resp;
1064 	int		dr_status;
1065 	time_t		dr_time;
1066 	uint_t		dr_hash;
1067 	struct dupreq	*dr_next;
1068 	struct dupreq	*dr_prev;
1069 	struct dupreq	*dr_chain;
1070 	struct dupreq	*dr_prevchain;
1071 };
1072 
1073 /*
1074  * The fixedtime state is defined if we want to expand the routines to
1075  * handle and encompass fixed size caches.
1076  */
1077 #define	DUPCACHE_FIXEDTIME	0
1078 
1079 /*
1080  * States of requests for duplicate request caching.
1081  * These are the same as defined for the kernel.
1082  */
1083 #define	DUP_NEW			0x00	/* new entry */
1084 #define	DUP_INPROGRESS		0x01	/* request already going */
1085 #define	DUP_DONE		0x02	/* request done */
1086 #define	DUP_DROP		0x03	/* request dropped */
1087 #define	DUP_ERROR		0x04	/* error in dup req cache */
1088 
1089 #ifdef __STDC__
1090 extern bool_t	__svc_dupcache_init(void *, int, char **);
1091 extern int	__svc_dup(struct svc_req *, caddr_t *, uint_t *, char *);
1092 extern int	__svc_dupdone(struct svc_req *, caddr_t, uint_t, int, char *);
1093 extern bool_t	__svc_vc_dupcache_init(SVCXPRT *, void *, int);
1094 extern int	__svc_vc_dup(struct svc_req *, caddr_t *, uint_t *);
1095 extern int	__svc_vc_dupdone(struct svc_req *, caddr_t, uint_t, int);
1096 #else
1097 extern bool_t	__svc_dupcache_init();
1098 extern int	__svc_dup();
1099 extern int	__svc_dupdone();
1100 extern bool_t	__svc_vc_dupcache_init();
1101 extern int	__svc_vc_dup();
1102 extern int	__svc_vc_dupdone();
1103 #endif	/* __STDC__ */
1104 #endif	/* _KERNEL */
1105 
1106 #ifdef	_KERNEL
1107 /*
1108  * Private interfaces and structures for SVCXPRT cloning.
1109  * The interfaces and data structures are not committed and subject to
1110  * change in future releases.
1111  */
1112 extern SVCXPRT *svc_clone_init(void);
1113 extern void svc_clone_free(SVCXPRT *);
1114 extern void svc_clone_link(SVCMASTERXPRT *, SVCXPRT *, SVCXPRT *);
1115 extern void svc_clone_unlink(SVCXPRT *);
1116 #endif	/* _KERNEL */
1117 
1118 #ifdef	__cplusplus
1119 }
1120 #endif
1121 
1122 #endif	/* !_RPC_SVC_H */
1123