zfs_deleg.h revision 1.1.1.2.44.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.1.2.44.1 pgoyette * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
23 1.1.1.2.44.1 pgoyette * Copyright 2010 Nexenta Systems, Inc. All rights reserved.
24 1.1.1.2.44.1 pgoyette * Copyright (c) 2013 by Delphix. All rights reserved.
25 1.1 haad */
26 1.1 haad
27 1.1 haad #ifndef _ZFS_DELEG_H
28 1.1 haad #define _ZFS_DELEG_H
29 1.1 haad
30 1.1 haad #include <sys/fs/zfs.h>
31 1.1 haad
32 1.1 haad #ifdef __cplusplus
33 1.1 haad extern "C" {
34 1.1 haad #endif
35 1.1 haad
36 1.1 haad #define ZFS_DELEG_SET_NAME_CHR '@' /* set name lead char */
37 1.1 haad #define ZFS_DELEG_FIELD_SEP_CHR '$' /* field separator */
38 1.1 haad
39 1.1 haad /*
40 1.1 haad * Max name length for a delegation attribute
41 1.1 haad */
42 1.1 haad #define ZFS_MAX_DELEG_NAME 128
43 1.1 haad
44 1.1 haad #define ZFS_DELEG_LOCAL 'l'
45 1.1 haad #define ZFS_DELEG_DESCENDENT 'd'
46 1.1 haad #define ZFS_DELEG_NA '-'
47 1.1 haad
48 1.1 haad typedef enum {
49 1.1 haad ZFS_DELEG_NOTE_CREATE,
50 1.1 haad ZFS_DELEG_NOTE_DESTROY,
51 1.1 haad ZFS_DELEG_NOTE_SNAPSHOT,
52 1.1 haad ZFS_DELEG_NOTE_ROLLBACK,
53 1.1 haad ZFS_DELEG_NOTE_CLONE,
54 1.1 haad ZFS_DELEG_NOTE_PROMOTE,
55 1.1 haad ZFS_DELEG_NOTE_RENAME,
56 1.1.1.2.44.1 pgoyette ZFS_DELEG_NOTE_SEND,
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.1.2 haad ZFS_DELEG_NOTE_USERQUOTA,
63 1.1.1.2 haad ZFS_DELEG_NOTE_GROUPQUOTA,
64 1.1.1.2 haad ZFS_DELEG_NOTE_USERUSED,
65 1.1.1.2 haad ZFS_DELEG_NOTE_GROUPUSED,
66 1.1.1.2 haad ZFS_DELEG_NOTE_HOLD,
67 1.1.1.2 haad ZFS_DELEG_NOTE_RELEASE,
68 1.1.1.2.44.1 pgoyette ZFS_DELEG_NOTE_DIFF,
69 1.1.1.2.44.1 pgoyette ZFS_DELEG_NOTE_BOOKMARK,
70 1.1 haad ZFS_DELEG_NOTE_NONE
71 1.1 haad } zfs_deleg_note_t;
72 1.1 haad
73 1.1 haad typedef struct zfs_deleg_perm_tab {
74 1.1 haad char *z_perm;
75 1.1 haad zfs_deleg_note_t z_note;
76 1.1 haad } zfs_deleg_perm_tab_t;
77 1.1 haad
78 1.1 haad extern zfs_deleg_perm_tab_t zfs_deleg_perm_tab[];
79 1.1 haad
80 1.1 haad int zfs_deleg_verify_nvlist(nvlist_t *nvlist);
81 1.1 haad void zfs_deleg_whokey(char *attr, zfs_deleg_who_type_t type,
82 1.1 haad char checkflag, void *data);
83 1.1 haad const char *zfs_deleg_canonicalize_perm(const char *perm);
84 1.1 haad
85 1.1 haad #ifdef __cplusplus
86 1.1 haad }
87 1.1 haad #endif
88 1.1 haad
89 1.1 haad #endif /* _ZFS_DELEG_H */
90