xref: /titanic_44/usr/src/uts/common/nfs/nfs_dispatch.h (revision c36bd4ef54329d6af405a11302d4d4bbf1bc65c7)
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, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 
23 /*
24  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
25  * Use is subject to license terms.
26  */
27 
28 /*
29  *	Copyright (c) 1983,1984,1985,1986,1987,1988,1989  AT&T.
30  *	All rights reserved.
31  *	Use is subject to license terms.
32  */
33 
34 
35 #ifndef _NFS_DISPATCH_H
36 #define	_NFS_DISPATCH_H
37 
38 #pragma ident	"%Z%%M%	%I%	%E% SMI"
39 
40 #ifdef	__cplusplus
41 extern "C" {
42 #endif
43 
44 /*
45  * RPC dispatch table
46  * Indexed by version, proc
47  */
48 
49 struct rpcdisp {
50 	void	  (*dis_proc)();	/* proc to call */
51 	xdrproc_t dis_xdrargs;		/* xdr routine to get args */
52 	xdrproc_t dis_fastxdrargs;	/* `fast' xdr routine to get args */
53 	int	  dis_argsz;		/* sizeof args */
54 	xdrproc_t dis_xdrres;		/* xdr routine to put results */
55 	xdrproc_t dis_fastxdrres;	/* `fast' xdr routine to put results */
56 	int	  dis_ressz;		/* size of results */
57 	void	  (*dis_resfree)();	/* frees space allocated by proc */
58 	int	  dis_flags;		/* flags, see below */
59 	fhandle_t *(*dis_getfh)();	/* returns the fhandle for the req */
60 };
61 
62 #define	RPC_IDEMPOTENT	0x1	/* idempotent or not */
63 /*
64  * Be very careful about which NFS procedures get the RPC_ALLOWANON bit.
65  * Right now, it this bit is on, we ignore the results of per NFS request
66  * access control.
67  */
68 #define	RPC_ALLOWANON	0x2	/* allow anonymous access */
69 #define	RPC_MAPRESP	0x4	/* use mapped response buffer */
70 #define	RPC_AVOIDWORK	0x8	/* do work avoidance for dups */
71 #define	RPC_PUBLICFH_OK	0x10	/* allow use of public filehandle */
72 
73 struct rpc_disptable {
74 	int dis_nprocs;
75 	char **dis_procnames;
76 	kstat_named_t **dis_proccntp;
77 	struct rpcdisp *dis_table;
78 };
79 
80 void	rpc_null(caddr_t *, caddr_t *);
81 
82 #ifdef	__cplusplus
83 }
84 #endif
85 
86 #endif /* _NFS_DISPATCH_H */
87