xref: /illumos-gate/usr/src/uts/common/nfs/nfs_acl.h (revision 27242a7c)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*27242a7cSthurlow  * Common Development and Distribution License (the "License").
6*27242a7cSthurlow  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22*27242a7cSthurlow  *	Copyright 2006 Sun Microsystems, Inc.
237c478bd9Sstevel@tonic-gate  *	All rights reserved.
247c478bd9Sstevel@tonic-gate  *	Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate #ifndef _NFS_NFS_ACL_H
287c478bd9Sstevel@tonic-gate #define	_NFS_NFS_ACL_H
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
337c478bd9Sstevel@tonic-gate extern "C" {
347c478bd9Sstevel@tonic-gate #endif
357c478bd9Sstevel@tonic-gate 
367c478bd9Sstevel@tonic-gate #define	NFS_ACL_MAX_ENTRIES	1024
377c478bd9Sstevel@tonic-gate 
387c478bd9Sstevel@tonic-gate typedef ushort_t o_mode;
397c478bd9Sstevel@tonic-gate 
407c478bd9Sstevel@tonic-gate struct aclent {
417c478bd9Sstevel@tonic-gate 	int type;
427c478bd9Sstevel@tonic-gate 	uid32_t id;
437c478bd9Sstevel@tonic-gate 	o_mode perm;
447c478bd9Sstevel@tonic-gate };
457c478bd9Sstevel@tonic-gate typedef struct aclent aclent;
467c478bd9Sstevel@tonic-gate 
477c478bd9Sstevel@tonic-gate #define	NA_USER_OBJ	0x1
487c478bd9Sstevel@tonic-gate #define	NA_USER		0x2
497c478bd9Sstevel@tonic-gate #define	NA_GROUP_OBJ	0x4
507c478bd9Sstevel@tonic-gate #define	NA_GROUP	0x8
517c478bd9Sstevel@tonic-gate #define	NA_CLASS_OBJ	0x10
527c478bd9Sstevel@tonic-gate #define	NA_OTHER_OBJ	0x20
537c478bd9Sstevel@tonic-gate #define	NA_ACL_DEFAULT	0x1000
547c478bd9Sstevel@tonic-gate 
557c478bd9Sstevel@tonic-gate #define	NA_READ		0x4
567c478bd9Sstevel@tonic-gate #define	NA_WRITE	0x2
577c478bd9Sstevel@tonic-gate #define	NA_EXEC		0x1
587c478bd9Sstevel@tonic-gate 
597c478bd9Sstevel@tonic-gate struct secattr {
607c478bd9Sstevel@tonic-gate 	uint32 mask;
617c478bd9Sstevel@tonic-gate 	int aclcnt;
627c478bd9Sstevel@tonic-gate 	struct {
637c478bd9Sstevel@tonic-gate 		uint_t aclent_len;
647c478bd9Sstevel@tonic-gate 		aclent *aclent_val;
657c478bd9Sstevel@tonic-gate 	} aclent;
667c478bd9Sstevel@tonic-gate 	int dfaclcnt;
677c478bd9Sstevel@tonic-gate 	struct {
687c478bd9Sstevel@tonic-gate 		uint_t dfaclent_len;
697c478bd9Sstevel@tonic-gate 		aclent *dfaclent_val;
707c478bd9Sstevel@tonic-gate 	} dfaclent;
717c478bd9Sstevel@tonic-gate };
727c478bd9Sstevel@tonic-gate typedef struct secattr secattr;
737c478bd9Sstevel@tonic-gate 
747c478bd9Sstevel@tonic-gate #define	NA_ACL		0x1
757c478bd9Sstevel@tonic-gate #define	NA_ACLCNT	0x2
767c478bd9Sstevel@tonic-gate #define	NA_DFACL	0x4
777c478bd9Sstevel@tonic-gate #define	NA_DFACLCNT	0x8
787c478bd9Sstevel@tonic-gate 
797c478bd9Sstevel@tonic-gate struct GETACL2args {
807c478bd9Sstevel@tonic-gate 	fhandle_t fh;
817c478bd9Sstevel@tonic-gate 	uint32 mask;
827c478bd9Sstevel@tonic-gate };
837c478bd9Sstevel@tonic-gate typedef struct GETACL2args GETACL2args;
847c478bd9Sstevel@tonic-gate 
857c478bd9Sstevel@tonic-gate struct GETACL2resok {
867c478bd9Sstevel@tonic-gate 	struct nfsfattr attr;
877c478bd9Sstevel@tonic-gate 	vsecattr_t acl;
887c478bd9Sstevel@tonic-gate };
897c478bd9Sstevel@tonic-gate typedef struct GETACL2resok GETACL2resok;
907c478bd9Sstevel@tonic-gate 
917c478bd9Sstevel@tonic-gate struct GETACL2res {
927c478bd9Sstevel@tonic-gate 	enum nfsstat status;
937c478bd9Sstevel@tonic-gate 	union {
947c478bd9Sstevel@tonic-gate 		GETACL2resok ok;
957c478bd9Sstevel@tonic-gate 	} res_u;
967c478bd9Sstevel@tonic-gate };
977c478bd9Sstevel@tonic-gate typedef struct GETACL2res GETACL2res;
987c478bd9Sstevel@tonic-gate 
997c478bd9Sstevel@tonic-gate struct SETACL2args {
1007c478bd9Sstevel@tonic-gate 	fhandle_t fh;
1017c478bd9Sstevel@tonic-gate 	vsecattr_t acl;
1027c478bd9Sstevel@tonic-gate };
1037c478bd9Sstevel@tonic-gate typedef struct SETACL2args SETACL2args;
1047c478bd9Sstevel@tonic-gate 
1057c478bd9Sstevel@tonic-gate struct SETACL2resok {
1067c478bd9Sstevel@tonic-gate 	struct nfsfattr attr;
1077c478bd9Sstevel@tonic-gate };
1087c478bd9Sstevel@tonic-gate typedef struct SETACL2resok SETACL2resok;
1097c478bd9Sstevel@tonic-gate 
1107c478bd9Sstevel@tonic-gate struct SETACL2res {
1117c478bd9Sstevel@tonic-gate 	enum nfsstat status;
1127c478bd9Sstevel@tonic-gate 	union {
1137c478bd9Sstevel@tonic-gate 		SETACL2resok ok;
1147c478bd9Sstevel@tonic-gate 	} res_u;
1157c478bd9Sstevel@tonic-gate };
1167c478bd9Sstevel@tonic-gate typedef struct SETACL2res SETACL2res;
1177c478bd9Sstevel@tonic-gate 
1187c478bd9Sstevel@tonic-gate struct GETATTR2args {
1197c478bd9Sstevel@tonic-gate 	fhandle_t fh;
1207c478bd9Sstevel@tonic-gate };
1217c478bd9Sstevel@tonic-gate typedef struct GETATTR2args GETATTR2args;
1227c478bd9Sstevel@tonic-gate 
1237c478bd9Sstevel@tonic-gate struct GETATTR2resok {
1247c478bd9Sstevel@tonic-gate 	struct nfsfattr attr;
1257c478bd9Sstevel@tonic-gate };
1267c478bd9Sstevel@tonic-gate typedef struct GETATTR2resok GETATTR2resok;
1277c478bd9Sstevel@tonic-gate 
1287c478bd9Sstevel@tonic-gate struct GETATTR2res {
1297c478bd9Sstevel@tonic-gate 	enum nfsstat status;
1307c478bd9Sstevel@tonic-gate 	union {
1317c478bd9Sstevel@tonic-gate 		GETATTR2resok ok;
1327c478bd9Sstevel@tonic-gate 	} res_u;
1337c478bd9Sstevel@tonic-gate };
1347c478bd9Sstevel@tonic-gate typedef struct GETATTR2res GETATTR2res;
1357c478bd9Sstevel@tonic-gate 
1367c478bd9Sstevel@tonic-gate struct ACCESS2args {
1377c478bd9Sstevel@tonic-gate 	fhandle_t fh;
1387c478bd9Sstevel@tonic-gate 	uint32 access;
1397c478bd9Sstevel@tonic-gate };
1407c478bd9Sstevel@tonic-gate typedef struct ACCESS2args ACCESS2args;
1417c478bd9Sstevel@tonic-gate 
1427c478bd9Sstevel@tonic-gate #define	ACCESS2_READ	0x1
1437c478bd9Sstevel@tonic-gate #define	ACCESS2_LOOKUP	0x2
1447c478bd9Sstevel@tonic-gate #define	ACCESS2_MODIFY	0x4
1457c478bd9Sstevel@tonic-gate #define	ACCESS2_EXTEND	0x8
1467c478bd9Sstevel@tonic-gate #define	ACCESS2_DELETE	0x10
1477c478bd9Sstevel@tonic-gate #define	ACCESS2_EXECUTE	0x20
1487c478bd9Sstevel@tonic-gate 
1497c478bd9Sstevel@tonic-gate struct ACCESS2resok {
1507c478bd9Sstevel@tonic-gate 	struct nfsfattr attr;
1517c478bd9Sstevel@tonic-gate 	uint32 access;
1527c478bd9Sstevel@tonic-gate };
1537c478bd9Sstevel@tonic-gate typedef struct ACCESS2resok ACCESS2resok;
1547c478bd9Sstevel@tonic-gate 
1557c478bd9Sstevel@tonic-gate struct ACCESS2res {
1567c478bd9Sstevel@tonic-gate 	enum nfsstat status;
1577c478bd9Sstevel@tonic-gate 	union {
1587c478bd9Sstevel@tonic-gate 		ACCESS2resok ok;
1597c478bd9Sstevel@tonic-gate 	} res_u;
1607c478bd9Sstevel@tonic-gate };
1617c478bd9Sstevel@tonic-gate typedef struct ACCESS2res ACCESS2res;
1627c478bd9Sstevel@tonic-gate 
1637c478bd9Sstevel@tonic-gate struct GETXATTRDIR2args {
1647c478bd9Sstevel@tonic-gate 	fhandle_t fh;
1657c478bd9Sstevel@tonic-gate 	bool_t create;
1667c478bd9Sstevel@tonic-gate };
1677c478bd9Sstevel@tonic-gate typedef struct GETXATTRDIR2args GETXATTRDIR2args;
1687c478bd9Sstevel@tonic-gate 
1697c478bd9Sstevel@tonic-gate struct GETXATTRDIR2resok {
1707c478bd9Sstevel@tonic-gate 	fhandle_t fh;
1717c478bd9Sstevel@tonic-gate 	struct nfsfattr attr;
1727c478bd9Sstevel@tonic-gate };
1737c478bd9Sstevel@tonic-gate typedef struct GETXATTRDIR2resok GETXATTRDIR2resok;
1747c478bd9Sstevel@tonic-gate 
1757c478bd9Sstevel@tonic-gate struct GETXATTRDIR2res {
1767c478bd9Sstevel@tonic-gate 	enum nfsstat status;
1777c478bd9Sstevel@tonic-gate 	union {
1787c478bd9Sstevel@tonic-gate 		GETXATTRDIR2resok ok;
1797c478bd9Sstevel@tonic-gate 	} res_u;
1807c478bd9Sstevel@tonic-gate };
1817c478bd9Sstevel@tonic-gate typedef struct GETXATTRDIR2res GETXATTRDIR2res;
1827c478bd9Sstevel@tonic-gate 
1837c478bd9Sstevel@tonic-gate struct GETACL3args {
1847c478bd9Sstevel@tonic-gate 	nfs_fh3 fh;
1857c478bd9Sstevel@tonic-gate 	uint32 mask;
1867c478bd9Sstevel@tonic-gate };
1877c478bd9Sstevel@tonic-gate typedef struct GETACL3args GETACL3args;
1887c478bd9Sstevel@tonic-gate 
1897c478bd9Sstevel@tonic-gate struct GETACL3resok {
1907c478bd9Sstevel@tonic-gate 	post_op_attr attr;
1917c478bd9Sstevel@tonic-gate 	vsecattr_t acl;
1927c478bd9Sstevel@tonic-gate };
1937c478bd9Sstevel@tonic-gate typedef struct GETACL3resok GETACL3resok;
1947c478bd9Sstevel@tonic-gate 
1957c478bd9Sstevel@tonic-gate struct GETACL3resfail {
1967c478bd9Sstevel@tonic-gate 	post_op_attr attr;
1977c478bd9Sstevel@tonic-gate };
1987c478bd9Sstevel@tonic-gate typedef struct GETACL3resfail GETACL3resfail;
1997c478bd9Sstevel@tonic-gate 
2007c478bd9Sstevel@tonic-gate struct GETACL3res {
2017c478bd9Sstevel@tonic-gate 	nfsstat3 status;
2027c478bd9Sstevel@tonic-gate 	union {
2037c478bd9Sstevel@tonic-gate 		GETACL3resok ok;
2047c478bd9Sstevel@tonic-gate 		GETACL3resfail fail;
2057c478bd9Sstevel@tonic-gate 	} res_u;
2067c478bd9Sstevel@tonic-gate };
2077c478bd9Sstevel@tonic-gate typedef struct GETACL3res GETACL3res;
2087c478bd9Sstevel@tonic-gate 
2097c478bd9Sstevel@tonic-gate struct SETACL3args {
2107c478bd9Sstevel@tonic-gate 	nfs_fh3 fh;
2117c478bd9Sstevel@tonic-gate 	vsecattr_t acl;
2127c478bd9Sstevel@tonic-gate };
2137c478bd9Sstevel@tonic-gate typedef struct SETACL3args SETACL3args;
2147c478bd9Sstevel@tonic-gate 
2157c478bd9Sstevel@tonic-gate struct SETACL3resok {
2167c478bd9Sstevel@tonic-gate 	post_op_attr attr;
2177c478bd9Sstevel@tonic-gate };
2187c478bd9Sstevel@tonic-gate typedef struct SETACL3resok SETACL3resok;
2197c478bd9Sstevel@tonic-gate 
2207c478bd9Sstevel@tonic-gate struct SETACL3resfail {
2217c478bd9Sstevel@tonic-gate 	post_op_attr attr;
2227c478bd9Sstevel@tonic-gate };
2237c478bd9Sstevel@tonic-gate typedef struct SETACL3resfail SETACL3resfail;
2247c478bd9Sstevel@tonic-gate 
2257c478bd9Sstevel@tonic-gate struct SETACL3res {
2267c478bd9Sstevel@tonic-gate 	nfsstat3 status;
2277c478bd9Sstevel@tonic-gate 	union {
2287c478bd9Sstevel@tonic-gate 		SETACL3resok ok;
2297c478bd9Sstevel@tonic-gate 		SETACL3resfail fail;
2307c478bd9Sstevel@tonic-gate 	} res_u;
2317c478bd9Sstevel@tonic-gate };
2327c478bd9Sstevel@tonic-gate typedef struct SETACL3res SETACL3res;
2337c478bd9Sstevel@tonic-gate 
2347c478bd9Sstevel@tonic-gate struct GETXATTRDIR3args {
2357c478bd9Sstevel@tonic-gate 	nfs_fh3 fh;
2367c478bd9Sstevel@tonic-gate 	bool_t create;
2377c478bd9Sstevel@tonic-gate };
2387c478bd9Sstevel@tonic-gate typedef struct GETXATTRDIR3args GETXATTRDIR3args;
2397c478bd9Sstevel@tonic-gate 
2407c478bd9Sstevel@tonic-gate struct GETXATTRDIR3resok {
2417c478bd9Sstevel@tonic-gate 	nfs_fh3 fh;
2427c478bd9Sstevel@tonic-gate 	post_op_attr attr;
2437c478bd9Sstevel@tonic-gate };
2447c478bd9Sstevel@tonic-gate typedef struct GETXATTRDIR3resok GETXATTRDIR3resok;
2457c478bd9Sstevel@tonic-gate 
2467c478bd9Sstevel@tonic-gate struct GETXATTRDIR3res {
2477c478bd9Sstevel@tonic-gate 	nfsstat3 status;
2487c478bd9Sstevel@tonic-gate 	union {
2497c478bd9Sstevel@tonic-gate 		GETXATTRDIR3resok ok;
2507c478bd9Sstevel@tonic-gate 	} res_u;
2517c478bd9Sstevel@tonic-gate };
2527c478bd9Sstevel@tonic-gate typedef struct GETXATTRDIR3res GETXATTRDIR3res;
2537c478bd9Sstevel@tonic-gate 
2547c478bd9Sstevel@tonic-gate #define	NFS_ACL_PROGRAM	((rpcprog_t)(100227))
2557c478bd9Sstevel@tonic-gate #define	NFS_ACL_VERSMIN	((rpcvers_t)(2))
2567c478bd9Sstevel@tonic-gate #define	NFS_ACL_VERSMAX	((rpcvers_t)(3))
2577c478bd9Sstevel@tonic-gate 
2587c478bd9Sstevel@tonic-gate #define	NFS_ACL_V2		((rpcvers_t)(2))
2597c478bd9Sstevel@tonic-gate #define	ACLPROC2_NULL		((rpcproc_t)(0))
2607c478bd9Sstevel@tonic-gate #define	ACLPROC2_GETACL		((rpcproc_t)(1))
2617c478bd9Sstevel@tonic-gate #define	ACLPROC2_SETACL		((rpcproc_t)(2))
2627c478bd9Sstevel@tonic-gate #define	ACLPROC2_GETATTR	((rpcproc_t)(3))
2637c478bd9Sstevel@tonic-gate #define	ACLPROC2_ACCESS		((rpcproc_t)(4))
2647c478bd9Sstevel@tonic-gate #define	ACLPROC2_GETXATTRDIR	((rpcproc_t)(5))
2657c478bd9Sstevel@tonic-gate 
2667c478bd9Sstevel@tonic-gate #define	NFS_ACL_V3		((rpcvers_t)(3))
2677c478bd9Sstevel@tonic-gate #define	ACLPROC3_NULL		((rpcproc_t)(0))
2687c478bd9Sstevel@tonic-gate #define	ACLPROC3_GETACL		((rpcproc_t)(1))
2697c478bd9Sstevel@tonic-gate #define	ACLPROC3_SETACL		((rpcproc_t)(2))
2707c478bd9Sstevel@tonic-gate #define	ACLPROC3_GETXATTRDIR	((rpcproc_t)(3))
2717c478bd9Sstevel@tonic-gate 
2727c478bd9Sstevel@tonic-gate #ifdef _KERNEL
2737c478bd9Sstevel@tonic-gate /* the xdr functions */
2747c478bd9Sstevel@tonic-gate extern bool_t xdr_uid(XDR *, uid32_t *);
2757c478bd9Sstevel@tonic-gate extern bool_t xdr_o_mode(XDR *, o_mode *);
2767c478bd9Sstevel@tonic-gate extern bool_t xdr_aclent(XDR *, aclent_t *);
2777c478bd9Sstevel@tonic-gate extern bool_t xdr_secattr(XDR *, vsecattr_t *);
2787c478bd9Sstevel@tonic-gate 
2797c478bd9Sstevel@tonic-gate extern bool_t xdr_GETACL2args(XDR *, GETACL2args *);
2807c478bd9Sstevel@tonic-gate extern bool_t xdr_fastGETACL2args(XDR *, GETACL2args **);
2817c478bd9Sstevel@tonic-gate extern bool_t xdr_GETACL2resok(XDR *, GETACL2resok *);
2827c478bd9Sstevel@tonic-gate extern bool_t xdr_GETACL2res(XDR *, GETACL2res *);
2837c478bd9Sstevel@tonic-gate extern bool_t xdr_SETACL2args(XDR *, SETACL2args *);
2847c478bd9Sstevel@tonic-gate extern bool_t xdr_SETACL2resok(XDR *, SETACL2resok *);
2857c478bd9Sstevel@tonic-gate #ifdef _LITTLE_ENDIAN
2867c478bd9Sstevel@tonic-gate extern bool_t xdr_fastSETACL2resok(XDR *, SETACL2resok *);
2877c478bd9Sstevel@tonic-gate #endif
2887c478bd9Sstevel@tonic-gate extern bool_t xdr_SETACL2res(XDR *, SETACL2res *);
2897c478bd9Sstevel@tonic-gate #ifdef _LITTLE_ENDIAN
2907c478bd9Sstevel@tonic-gate extern bool_t xdr_fastSETACL2res(XDR *, SETACL2res *);
2917c478bd9Sstevel@tonic-gate #endif
2927c478bd9Sstevel@tonic-gate extern bool_t xdr_GETATTR2args(XDR *, GETATTR2args *);
2937c478bd9Sstevel@tonic-gate extern bool_t xdr_fastGETATTR2args(XDR *, GETATTR2args **);
2947c478bd9Sstevel@tonic-gate extern bool_t xdr_GETATTR2resok(XDR *, GETATTR2resok *);
2957c478bd9Sstevel@tonic-gate #ifdef _LITTLE_ENDIAN
2967c478bd9Sstevel@tonic-gate extern bool_t xdr_fastGETATTR2resok(XDR *, GETATTR2resok *);
2977c478bd9Sstevel@tonic-gate #endif
2987c478bd9Sstevel@tonic-gate extern bool_t xdr_GETATTR2res(XDR *, GETATTR2res *);
2997c478bd9Sstevel@tonic-gate #ifdef _LITTLE_ENDIAN
3007c478bd9Sstevel@tonic-gate extern bool_t xdr_fastGETATTR2res(XDR *, GETATTR2res *);
3017c478bd9Sstevel@tonic-gate #endif
3027c478bd9Sstevel@tonic-gate extern bool_t xdr_ACCESS2args(XDR *, ACCESS2args *);
3037c478bd9Sstevel@tonic-gate extern bool_t xdr_fastACCESS2args(XDR *, ACCESS2args **);
3047c478bd9Sstevel@tonic-gate extern bool_t xdr_ACCESS2resok(XDR *, ACCESS2resok *);
3057c478bd9Sstevel@tonic-gate #ifdef _LITTLE_ENDIAN
3067c478bd9Sstevel@tonic-gate extern bool_t xdr_fastACCESS2resok(XDR *, ACCESS2resok *);
3077c478bd9Sstevel@tonic-gate #endif
3087c478bd9Sstevel@tonic-gate extern bool_t xdr_ACCESS2res(XDR *, ACCESS2res *);
3097c478bd9Sstevel@tonic-gate #ifdef _LITTLE_ENDIAN
3107c478bd9Sstevel@tonic-gate extern bool_t xdr_fastACCESS2res(XDR *, ACCESS2res *);
3117c478bd9Sstevel@tonic-gate #endif
3127c478bd9Sstevel@tonic-gate extern bool_t xdr_GETXATTRDIR2args(XDR *, GETXATTRDIR2args *);
3137c478bd9Sstevel@tonic-gate extern bool_t xdr_GETXATTRDIR2res(XDR *, GETXATTRDIR2res *);
3147c478bd9Sstevel@tonic-gate 
3157c478bd9Sstevel@tonic-gate extern bool_t xdr_GETACL3args(XDR *, GETACL3args *);
3167c478bd9Sstevel@tonic-gate extern bool_t xdr_GETACL3resok(XDR *, GETACL3resok *);
3177c478bd9Sstevel@tonic-gate extern bool_t xdr_GETACL3resfail(XDR *, GETACL3resfail *);
3187c478bd9Sstevel@tonic-gate extern bool_t xdr_GETACL3res(XDR *, GETACL3res *);
3197c478bd9Sstevel@tonic-gate extern bool_t xdr_SETACL3args(XDR *, SETACL3args *);
3207c478bd9Sstevel@tonic-gate extern bool_t xdr_SETACL3resok(XDR *, SETACL3resok *);
3217c478bd9Sstevel@tonic-gate extern bool_t xdr_SETACL3resfail(XDR *, SETACL3resfail *);
3227c478bd9Sstevel@tonic-gate extern bool_t xdr_SETACL3res(XDR *, SETACL3res *);
3237c478bd9Sstevel@tonic-gate extern bool_t xdr_GETXATTRDIR3args(XDR *, GETXATTRDIR3args *);
3247c478bd9Sstevel@tonic-gate extern bool_t xdr_GETXATTRDIR3res(XDR *, GETXATTRDIR3res *);
3257c478bd9Sstevel@tonic-gate 
3267c478bd9Sstevel@tonic-gate #endif
3277c478bd9Sstevel@tonic-gate 
3287c478bd9Sstevel@tonic-gate #ifdef _KERNEL
3297c478bd9Sstevel@tonic-gate /* the service procedures */
3307c478bd9Sstevel@tonic-gate extern void acl2_getacl(GETACL2args *, GETACL2res *,
3317c478bd9Sstevel@tonic-gate 			struct exportinfo *, struct svc_req *, cred_t *);
332*27242a7cSthurlow extern void *acl2_getacl_getfh(GETACL2args *);
3337c478bd9Sstevel@tonic-gate extern void acl2_getacl_free(GETACL2res *);
3347c478bd9Sstevel@tonic-gate extern void acl2_setacl(SETACL2args *, SETACL2res *,
3357c478bd9Sstevel@tonic-gate 			struct exportinfo *, struct svc_req *, cred_t *);
336*27242a7cSthurlow extern void *acl2_setacl_getfh(SETACL2args *);
3377c478bd9Sstevel@tonic-gate extern void acl2_getattr(GETATTR2args *, GETATTR2res *,
3387c478bd9Sstevel@tonic-gate 			struct exportinfo *, struct svc_req *, cred_t *);
339*27242a7cSthurlow extern void *acl2_getattr_getfh(GETATTR2args *);
3407c478bd9Sstevel@tonic-gate extern void acl2_access(ACCESS2args *, ACCESS2res *,
3417c478bd9Sstevel@tonic-gate 			struct exportinfo *, struct svc_req *, cred_t *);
342*27242a7cSthurlow extern void *acl2_access_getfh(ACCESS2args *);
3437c478bd9Sstevel@tonic-gate extern void acl2_getxattrdir(GETXATTRDIR2args *, GETXATTRDIR2res *,
3447c478bd9Sstevel@tonic-gate 			struct exportinfo *, struct svc_req *, cred_t *);
345*27242a7cSthurlow extern void *acl2_getxattrdir_getfh(GETXATTRDIR2args *);
3467c478bd9Sstevel@tonic-gate 
3477c478bd9Sstevel@tonic-gate extern void acl3_getacl(GETACL3args *, GETACL3res *,
3487c478bd9Sstevel@tonic-gate 			struct exportinfo *, struct svc_req *, cred_t *);
349*27242a7cSthurlow extern void *acl3_getacl_getfh(GETACL3args *);
3507c478bd9Sstevel@tonic-gate extern void acl3_getacl_free(GETACL3res *);
3517c478bd9Sstevel@tonic-gate extern void acl3_setacl(SETACL3args *, SETACL3res *,
3527c478bd9Sstevel@tonic-gate 			struct exportinfo *, struct svc_req *, cred_t *);
353*27242a7cSthurlow extern void *acl3_setacl_getfh(SETACL3args *);
3547c478bd9Sstevel@tonic-gate extern void acl3_getxattrdir(GETXATTRDIR3args *, GETXATTRDIR3res *,
3557c478bd9Sstevel@tonic-gate 			struct exportinfo *, struct svc_req *, cred_t *);
356*27242a7cSthurlow extern void *acl3_getxattrdir_getfh(GETXATTRDIR3args *);
3577c478bd9Sstevel@tonic-gate 
3587c478bd9Sstevel@tonic-gate #endif
3597c478bd9Sstevel@tonic-gate 
3607c478bd9Sstevel@tonic-gate #ifdef _KERNEL
3617c478bd9Sstevel@tonic-gate /* the client side procedures */
3627c478bd9Sstevel@tonic-gate extern int acl_getacl2(vnode_t *, vsecattr_t *, int, cred_t *);
3637c478bd9Sstevel@tonic-gate extern int acl_setacl2(vnode_t *, vsecattr_t *, int, cred_t *);
3647c478bd9Sstevel@tonic-gate extern int acl_getattr2_otw(vnode_t *, vattr_t *, cred_t *);
3657c478bd9Sstevel@tonic-gate extern int acl_access2(vnode_t *, int, int, cred_t *);
3667c478bd9Sstevel@tonic-gate extern int acl_getxattrdir2(vnode_t *, vnode_t **, bool_t, cred_t *, int);
3677c478bd9Sstevel@tonic-gate extern int acl_getacl3(vnode_t *, vsecattr_t *, int, cred_t *);
3687c478bd9Sstevel@tonic-gate extern int acl_setacl3(vnode_t *, vsecattr_t *, int, cred_t *);
3697c478bd9Sstevel@tonic-gate extern int acl_getxattrdir3(vnode_t *, vnode_t **, bool_t, cred_t *, int);
3707c478bd9Sstevel@tonic-gate extern int acl2call(mntinfo_t *, rpcproc_t, xdrproc_t, caddr_t, xdrproc_t,
3717c478bd9Sstevel@tonic-gate 			caddr_t, cred_t *, int *, enum nfsstat *, int,
3727c478bd9Sstevel@tonic-gate 			failinfo_t *);
3737c478bd9Sstevel@tonic-gate extern int acl3call(mntinfo_t *, rpcproc_t, xdrproc_t, caddr_t, xdrproc_t,
3747c478bd9Sstevel@tonic-gate 			caddr_t, cred_t *, int *, nfsstat3 *, int,
3757c478bd9Sstevel@tonic-gate 			failinfo_t *);
3767c478bd9Sstevel@tonic-gate extern void nfs_acl_free(vsecattr_t *);
3777c478bd9Sstevel@tonic-gate #endif
3787c478bd9Sstevel@tonic-gate 
3797c478bd9Sstevel@tonic-gate #ifdef _KERNEL
3807c478bd9Sstevel@tonic-gate /* server and client data structures */
3817c478bd9Sstevel@tonic-gate extern kstat_named_t	*aclproccnt_v2_ptr;
3827c478bd9Sstevel@tonic-gate extern kstat_named_t	*aclproccnt_v3_ptr;
3837c478bd9Sstevel@tonic-gate 
3847c478bd9Sstevel@tonic-gate extern char		*aclnames_v2[];
3857c478bd9Sstevel@tonic-gate extern uchar_t		acl_call_type_v2[];
3867c478bd9Sstevel@tonic-gate extern uchar_t		acl_ss_call_type_v2[];
3877c478bd9Sstevel@tonic-gate extern uchar_t		acl_timer_type_v2[];
3887c478bd9Sstevel@tonic-gate 
3897c478bd9Sstevel@tonic-gate extern char		*aclnames_v3[];
3907c478bd9Sstevel@tonic-gate extern uchar_t		acl_call_type_v3[];
3917c478bd9Sstevel@tonic-gate extern uchar_t		acl_ss_call_type_v3[];
3927c478bd9Sstevel@tonic-gate extern uchar_t		acl_timer_type_v3[];
3937c478bd9Sstevel@tonic-gate #endif
3947c478bd9Sstevel@tonic-gate 
3957c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
3967c478bd9Sstevel@tonic-gate }
3977c478bd9Sstevel@tonic-gate #endif
3987c478bd9Sstevel@tonic-gate 
3997c478bd9Sstevel@tonic-gate #endif	/* _NFS_NFS_ACL_H */
400