Path: blob/main/sys/contrib/openzfs/include/zfs_namecheck.h
48254 views
// SPDX-License-Identifier: CDDL-1.01/*2* CDDL HEADER START3*4* The contents of this file are subject to the terms of the5* Common Development and Distribution License (the "License").6* You may not use this file except in compliance with the License.7*8* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE9* or https://opensource.org/licenses/CDDL-1.0.10* See the License for the specific language governing permissions11* and limitations under the License.12*13* When distributing Covered Code, include this CDDL HEADER in each14* file and include the License file at usr/src/OPENSOLARIS.LICENSE.15* If applicable, add the following below this CDDL HEADER, with the16* fields enclosed by brackets "[]" replaced with your own identifying17* information: Portions Copyright [yyyy] [name of copyright owner]18*19* CDDL HEADER END20*/21/*22* Copyright 2009 Sun Microsystems, Inc. All rights reserved.23* Use is subject to license terms.24*/25/*26* Copyright (c) 2013, 2016 by Delphix. All rights reserved.27*/2829#ifndef _ZFS_NAMECHECK_H30#define _ZFS_NAMECHECK_H extern __attribute__((visibility("default")))3132#ifdef __cplusplus33extern "C" {34#endif3536typedef enum {37NAME_ERR_LEADING_SLASH, /* name begins with leading slash */38NAME_ERR_EMPTY_COMPONENT, /* name contains an empty component */39NAME_ERR_TRAILING_SLASH, /* name ends with a slash */40NAME_ERR_INVALCHAR, /* invalid character found */41NAME_ERR_MULTIPLE_DELIMITERS, /* multiple '@'/'#' delimiters found */42NAME_ERR_NOLETTER, /* pool doesn't begin with a letter */43NAME_ERR_RESERVED, /* entire name is reserved */44NAME_ERR_DISKLIKE, /* reserved disk name (c[0-9].*) */45NAME_ERR_TOOLONG, /* name is too long */46NAME_ERR_SELF_REF, /* reserved self path name ('.') */47NAME_ERR_PARENT_REF, /* reserved parent path name ('..') */48NAME_ERR_NO_AT, /* permission set is missing '@' */49NAME_ERR_NO_POUND, /* permission set is missing '#' */50} namecheck_err_t;5152#define ZFS_PERMSET_MAXLEN 645354_ZFS_NAMECHECK_H int zfs_max_dataset_nesting;5556_ZFS_NAMECHECK_H int get_dataset_depth(const char *);57_ZFS_NAMECHECK_H int pool_namecheck(const char *, namecheck_err_t *, char *);58_ZFS_NAMECHECK_H int entity_namecheck(const char *, namecheck_err_t *, char *);59_ZFS_NAMECHECK_H int dataset_namecheck(const char *, namecheck_err_t *, char *);60_ZFS_NAMECHECK_H int snapshot_namecheck(const char *, namecheck_err_t *,61char *);62_ZFS_NAMECHECK_H int bookmark_namecheck(const char *, namecheck_err_t *,63char *);64_ZFS_NAMECHECK_H int dataset_nestcheck(const char *);65_ZFS_NAMECHECK_H int mountpoint_namecheck(const char *, namecheck_err_t *);66_ZFS_NAMECHECK_H int zfs_component_namecheck(const char *, namecheck_err_t *,67char *);68_ZFS_NAMECHECK_H int permset_namecheck(const char *, namecheck_err_t *,69char *);7071#ifdef __cplusplus72}73#endif7475#endif /* _ZFS_NAMECHECK_H */767778