zfs_deleg.h revision 1.1.1.1 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 haad * Copyright 2008 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 #pragma ident "%Z%%M% %I% %E% SMI"
30 1.1 haad
31 1.1 haad #include <sys/fs/zfs.h>
32 1.1 haad
33 1.1 haad #ifdef __cplusplus
34 1.1 haad extern "C" {
35 1.1 haad #endif
36 1.1 haad
37 1.1 haad #define ZFS_DELEG_SET_NAME_CHR '@' /* set name lead char */
38 1.1 haad #define ZFS_DELEG_FIELD_SEP_CHR '$' /* field separator */
39 1.1 haad
40 1.1 haad /*
41 1.1 haad * Max name length for a delegation attribute
42 1.1 haad */
43 1.1 haad #define ZFS_MAX_DELEG_NAME 128
44 1.1 haad
45 1.1 haad #define ZFS_DELEG_LOCAL 'l'
46 1.1 haad #define ZFS_DELEG_DESCENDENT 'd'
47 1.1 haad #define ZFS_DELEG_NA '-'
48 1.1 haad
49 1.1 haad typedef enum {
50 1.1 haad ZFS_DELEG_NOTE_CREATE,
51 1.1 haad ZFS_DELEG_NOTE_DESTROY,
52 1.1 haad ZFS_DELEG_NOTE_SNAPSHOT,
53 1.1 haad ZFS_DELEG_NOTE_ROLLBACK,
54 1.1 haad ZFS_DELEG_NOTE_CLONE,
55 1.1 haad ZFS_DELEG_NOTE_PROMOTE,
56 1.1 haad ZFS_DELEG_NOTE_RENAME,
57 1.1 haad ZFS_DELEG_NOTE_RECEIVE,
58 1.1 haad ZFS_DELEG_NOTE_ALLOW,
59 1.1 haad ZFS_DELEG_NOTE_USERPROP,
60 1.1 haad ZFS_DELEG_NOTE_MOUNT,
61 1.1 haad ZFS_DELEG_NOTE_SHARE,
62 1.1 haad ZFS_DELEG_NOTE_NONE
63 1.1 haad } zfs_deleg_note_t;
64 1.1 haad
65 1.1 haad typedef struct zfs_deleg_perm_tab {
66 1.1 haad char *z_perm;
67 1.1 haad zfs_deleg_note_t z_note;
68 1.1 haad } zfs_deleg_perm_tab_t;
69 1.1 haad
70 1.1 haad extern zfs_deleg_perm_tab_t zfs_deleg_perm_tab[];
71 1.1 haad
72 1.1 haad int zfs_deleg_verify_nvlist(nvlist_t *nvlist);
73 1.1 haad void zfs_deleg_whokey(char *attr, zfs_deleg_who_type_t type,
74 1.1 haad char checkflag, void *data);
75 1.1 haad const char *zfs_deleg_canonicalize_perm(const char *perm);
76 1.1 haad
77 1.1 haad #ifdef __cplusplus
78 1.1 haad }
79 1.1 haad #endif
80 1.1 haad
81 1.1 haad #endif /* _ZFS_DELEG_H */
82