xref: /titanic_52/usr/src/uts/common/nfs/nfs_dispatch.h (revision b6c3f7863936abeae522e48a13887dddeb691a45)
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 /*
23  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*
28  *	Copyright (c) 1983,1984,1985,1986,1987,1988,1989  AT&T.
29  *	All rights reserved.
30  *	Use is subject to license terms.
31  */
32 
33 
34 #ifndef _NFS_DISPATCH_H
35 #define	_NFS_DISPATCH_H
36 
37 #pragma ident	"%Z%%M%	%I%	%E% SMI"
38 
39 #ifdef	__cplusplus
40 extern "C" {
41 #endif
42 
43 /*
44  * RPC dispatch table
45  * Indexed by version, proc
46  */
47 
48 typedef struct rpcdisp {
49 	void	  (*dis_proc)();	/* proc to call */
50 	xdrproc_t dis_xdrargs;		/* xdr routine to get args */
51 	xdrproc_t dis_fastxdrargs;	/* `fast' xdr routine to get args */
52 	int	  dis_argsz;		/* sizeof args */
53 	xdrproc_t dis_xdrres;		/* xdr routine to put results */
54 	xdrproc_t dis_fastxdrres;	/* `fast' xdr routine to put results */
55 	int	  dis_ressz;		/* size of results */
56 	void	  (*dis_resfree)();	/* frees space allocated by proc */
57 	int	  dis_flags;		/* flags, see below */
58 	void	  *(*dis_getfh)();	/* returns the fhandle for the req */
59 } rpcdisp_t;
60 
61 #define	RPC_IDEMPOTENT	0x1	/* idempotent or not */
62 /*
63  * Be very careful about which NFS procedures get the RPC_ALLOWANON bit.
64  * Right now, it this bit is on, we ignore the results of per NFS request
65  * access control.
66  */
67 #define	RPC_ALLOWANON	0x2	/* allow anonymous access */
68 #define	RPC_MAPRESP	0x4	/* use mapped response buffer */
69 #define	RPC_AVOIDWORK	0x8	/* do work avoidance for dups */
70 #define	RPC_PUBLICFH_OK	0x10	/* allow use of public filehandle */
71 
72 typedef struct rpc_disptable {
73 	int dis_nprocs;
74 	char **dis_procnames;
75 	kstat_named_t **dis_proccntp;
76 	struct rpcdisp *dis_table;
77 } rpc_disptable_t;
78 
79 void	rpc_null(caddr_t *, caddr_t *);
80 
81 #ifdef	__cplusplus
82 }
83 #endif
84 
85 #endif /* _NFS_DISPATCH_H */
86