zfs_deleg.h revision 1.1.1.2 1 1.1 haad /*
2 1.1 haad * CDDL HEADER START
3 1.1 haad *
4 1.1 haad * The contents of this file are subject to the terms of the
5 1.1 haad * Common Development and Distribution License (the "License").
6 1.1 haad * You may not use this file except in compliance with the License.
7 1.1 haad *
8 1.1 haad * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 1.1 haad * or http://www.opensolaris.org/os/licensing.
10 1.1 haad * See the License for the specific language governing permissions
11 1.1 haad * and limitations under the License.
12 1.1 haad *
13 1.1 haad * When distributing Covered Code, include this CDDL HEADER in each
14 1.1 haad * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 1.1 haad * If applicable, add the following below this CDDL HEADER, with the
16 1.1 haad * fields enclosed by brackets "[]" replaced with your own identifying
17 1.1 haad * information: Portions Copyright [yyyy] [name of copyright owner]
18 1.1 haad *
19 1.1 haad * CDDL HEADER END
20 1.1 haad */
21 1.1 haad /*
22 1.1.1.2 haad * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 1.1 haad * Use is subject to license terms.
24 1.1 haad */
25 1.1 haad
26 1.1 haad #ifndef _ZFS_DELEG_H
27 1.1 haad #define _ZFS_DELEG_H
28 1.1 haad
29 1.1 haad #include <sys/fs/zfs.h>
30 1.1 haad
31 1.1 haad #ifdef __cplusplus
32 1.1 haad extern "C" {
33 1.1 haad #endif
34 1.1 haad
35 1.1 haad #define ZFS_DELEG_SET_NAME_CHR '@' /* set name lead char */
36 1.1 haad #define ZFS_DELEG_FIELD_SEP_CHR '$' /* field separator */
37 1.1 haad
38 1.1 haad /*
39 1.1 haad * Max name length for a delegation attribute
40 1.1 haad */
41 1.1 haad #define ZFS_MAX_DELEG_NAME 128
42 1.1 haad
43 1.1 haad #define ZFS_DELEG_LOCAL 'l'
44 1.1 haad #define ZFS_DELEG_DESCENDENT 'd'
45 1.1 haad #define ZFS_DELEG_NA '-'
46 1.1 haad
47 1.1 haad typedef enum {
48 1.1 haad ZFS_DELEG_NOTE_CREATE,
49 1.1 haad ZFS_DELEG_NOTE_DESTROY,
50 1.1 haad ZFS_DELEG_NOTE_SNAPSHOT,
51 1.1 haad ZFS_DELEG_NOTE_ROLLBACK,
52 1.1 haad ZFS_DELEG_NOTE_CLONE,
53 1.1 haad ZFS_DELEG_NOTE_PROMOTE,
54 1.1 haad ZFS_DELEG_NOTE_RENAME,
55 1.1 haad ZFS_DELEG_NOTE_RECEIVE,
56 1.1 haad ZFS_DELEG_NOTE_ALLOW,
57 1.1 haad ZFS_DELEG_NOTE_USERPROP,
58 1.1 haad ZFS_DELEG_NOTE_MOUNT,
59 1.1 haad ZFS_DELEG_NOTE_SHARE,
60 1.1.1.2 haad ZFS_DELEG_NOTE_USERQUOTA,
61 1.1.1.2 haad ZFS_DELEG_NOTE_GROUPQUOTA,
62 1.1.1.2 haad ZFS_DELEG_NOTE_USERUSED,
63 1.1.1.2 haad ZFS_DELEG_NOTE_GROUPUSED,
64 1.1.1.2 haad ZFS_DELEG_NOTE_HOLD,
65 1.1.1.2 haad ZFS_DELEG_NOTE_RELEASE,
66 1.1 haad ZFS_DELEG_NOTE_NONE
67 1.1 haad } zfs_deleg_note_t;
68 1.1 haad
69 1.1 haad typedef struct zfs_deleg_perm_tab {
70 1.1 haad char *z_perm;
71 1.1 haad zfs_deleg_note_t z_note;
72 1.1 haad } zfs_deleg_perm_tab_t;
73 1.1 haad
74 1.1 haad extern zfs_deleg_perm_tab_t zfs_deleg_perm_tab[];
75 1.1 haad
76 1.1 haad int zfs_deleg_verify_nvlist(nvlist_t *nvlist);
77 1.1 haad void zfs_deleg_whokey(char *attr, zfs_deleg_who_type_t type,
78 1.1 haad char checkflag, void *data);
79 1.1 haad const char *zfs_deleg_canonicalize_perm(const char *perm);
80 1.1 haad
81 1.1 haad #ifdef __cplusplus
82 1.1 haad }
83 1.1 haad #endif
84 1.1 haad
85 1.1 haad #endif /* _ZFS_DELEG_H */
86