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