1eda14cbcSMatt Macy /* 2eda14cbcSMatt Macy * CDDL HEADER START 3eda14cbcSMatt Macy * 4eda14cbcSMatt Macy * The contents of this file are subject to the terms of the 5eda14cbcSMatt Macy * Common Development and Distribution License (the "License"). 6eda14cbcSMatt Macy * You may not use this file except in compliance with the License. 7eda14cbcSMatt Macy * 8eda14cbcSMatt Macy * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*271171e0SMartin Matuska * or https://opensource.org/licenses/CDDL-1.0. 10eda14cbcSMatt Macy * See the License for the specific language governing permissions 11eda14cbcSMatt Macy * and limitations under the License. 12eda14cbcSMatt Macy * 13eda14cbcSMatt Macy * When distributing Covered Code, include this CDDL HEADER in each 14eda14cbcSMatt Macy * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15eda14cbcSMatt Macy * If applicable, add the following below this CDDL HEADER, with the 16eda14cbcSMatt Macy * fields enclosed by brackets "[]" replaced with your own identifying 17eda14cbcSMatt Macy * information: Portions Copyright [yyyy] [name of copyright owner] 18eda14cbcSMatt Macy * 19eda14cbcSMatt Macy * CDDL HEADER END 20eda14cbcSMatt Macy */ 21eda14cbcSMatt Macy /* 22eda14cbcSMatt Macy * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. 23eda14cbcSMatt Macy * Copyright 2010 Nexenta Systems, Inc. All rights reserved. 24eda14cbcSMatt Macy * Copyright (c) 2013, 2015 by Delphix. All rights reserved. 25eda14cbcSMatt Macy */ 26eda14cbcSMatt Macy 27eda14cbcSMatt Macy #ifndef _ZFS_DELEG_H 2816038816SMartin Matuska #define _ZFS_DELEG_H extern __attribute__((visibility("default"))) 29eda14cbcSMatt Macy 30eda14cbcSMatt Macy #include <sys/fs/zfs.h> 31eda14cbcSMatt Macy 32eda14cbcSMatt Macy #ifdef __cplusplus 33eda14cbcSMatt Macy extern "C" { 34eda14cbcSMatt Macy #endif 35eda14cbcSMatt Macy 36eda14cbcSMatt Macy #define ZFS_DELEG_SET_NAME_CHR '@' /* set name lead char */ 37eda14cbcSMatt Macy #define ZFS_DELEG_FIELD_SEP_CHR '$' /* field separator */ 38eda14cbcSMatt Macy 39eda14cbcSMatt Macy /* 40eda14cbcSMatt Macy * Max name length for a delegation attribute 41eda14cbcSMatt Macy */ 42eda14cbcSMatt Macy #define ZFS_MAX_DELEG_NAME 128 43eda14cbcSMatt Macy 44eda14cbcSMatt Macy #define ZFS_DELEG_LOCAL 'l' 45eda14cbcSMatt Macy #define ZFS_DELEG_DESCENDENT 'd' 46eda14cbcSMatt Macy #define ZFS_DELEG_NA '-' 47eda14cbcSMatt Macy 48eda14cbcSMatt Macy typedef enum { 49eda14cbcSMatt Macy ZFS_DELEG_NOTE_CREATE, 50eda14cbcSMatt Macy ZFS_DELEG_NOTE_DESTROY, 51eda14cbcSMatt Macy ZFS_DELEG_NOTE_SNAPSHOT, 52eda14cbcSMatt Macy ZFS_DELEG_NOTE_ROLLBACK, 53eda14cbcSMatt Macy ZFS_DELEG_NOTE_CLONE, 54eda14cbcSMatt Macy ZFS_DELEG_NOTE_PROMOTE, 55eda14cbcSMatt Macy ZFS_DELEG_NOTE_RENAME, 56eda14cbcSMatt Macy ZFS_DELEG_NOTE_SEND, 57eda14cbcSMatt Macy ZFS_DELEG_NOTE_RECEIVE, 58eda14cbcSMatt Macy ZFS_DELEG_NOTE_ALLOW, 59eda14cbcSMatt Macy ZFS_DELEG_NOTE_USERPROP, 60eda14cbcSMatt Macy ZFS_DELEG_NOTE_MOUNT, 61eda14cbcSMatt Macy ZFS_DELEG_NOTE_SHARE, 62eda14cbcSMatt Macy ZFS_DELEG_NOTE_USERQUOTA, 63eda14cbcSMatt Macy ZFS_DELEG_NOTE_GROUPQUOTA, 64eda14cbcSMatt Macy ZFS_DELEG_NOTE_USERUSED, 65eda14cbcSMatt Macy ZFS_DELEG_NOTE_GROUPUSED, 66eda14cbcSMatt Macy ZFS_DELEG_NOTE_USEROBJQUOTA, 67eda14cbcSMatt Macy ZFS_DELEG_NOTE_GROUPOBJQUOTA, 68eda14cbcSMatt Macy ZFS_DELEG_NOTE_USEROBJUSED, 69eda14cbcSMatt Macy ZFS_DELEG_NOTE_GROUPOBJUSED, 70eda14cbcSMatt Macy ZFS_DELEG_NOTE_HOLD, 71eda14cbcSMatt Macy ZFS_DELEG_NOTE_RELEASE, 72eda14cbcSMatt Macy ZFS_DELEG_NOTE_DIFF, 73eda14cbcSMatt Macy ZFS_DELEG_NOTE_BOOKMARK, 74eda14cbcSMatt Macy ZFS_DELEG_NOTE_LOAD_KEY, 75eda14cbcSMatt Macy ZFS_DELEG_NOTE_CHANGE_KEY, 76eda14cbcSMatt Macy ZFS_DELEG_NOTE_PROJECTUSED, 77eda14cbcSMatt Macy ZFS_DELEG_NOTE_PROJECTQUOTA, 78eda14cbcSMatt Macy ZFS_DELEG_NOTE_PROJECTOBJUSED, 79eda14cbcSMatt Macy ZFS_DELEG_NOTE_PROJECTOBJQUOTA, 80eda14cbcSMatt Macy ZFS_DELEG_NOTE_NONE 81eda14cbcSMatt Macy } zfs_deleg_note_t; 82eda14cbcSMatt Macy 83eda14cbcSMatt Macy typedef struct zfs_deleg_perm_tab { 84a0b956f5SMartin Matuska const char *z_perm; 85eda14cbcSMatt Macy zfs_deleg_note_t z_note; 86eda14cbcSMatt Macy } zfs_deleg_perm_tab_t; 87eda14cbcSMatt Macy 88e92ffd9bSMartin Matuska _ZFS_DELEG_H const zfs_deleg_perm_tab_t zfs_deleg_perm_tab[]; 89eda14cbcSMatt Macy 9016038816SMartin Matuska _ZFS_DELEG_H int zfs_deleg_verify_nvlist(nvlist_t *nvlist); 9116038816SMartin Matuska _ZFS_DELEG_H void zfs_deleg_whokey(char *attr, zfs_deleg_who_type_t type, 92eda14cbcSMatt Macy char checkflag, void *data); 9316038816SMartin Matuska _ZFS_DELEG_H const char *zfs_deleg_canonicalize_perm(const char *perm); 94eda14cbcSMatt Macy 95eda14cbcSMatt Macy #ifdef __cplusplus 96eda14cbcSMatt Macy } 97eda14cbcSMatt Macy #endif 98eda14cbcSMatt Macy 99eda14cbcSMatt Macy #endif /* _ZFS_DELEG_H */ 100