2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A/*
2N/A * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
2N/A */
2N/A
2N/A#ifndef _LIBFSTYP_H
2N/A#define _LIBFSTYP_H
2N/A
2N/A/*
2N/A * libfstyp: filesystem identification library
2N/A */
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/A#include <sys/types.h>
2N/A#include <libnvpair.h>
2N/A
2N/Atypedef struct fstyp_handle *fstyp_handle_t;
2N/A
2N/Aenum {
2N/A FSTYP_ERR_OK = 0,
2N/A FSTYP_ERR_NO_MATCH, /* no matches */
2N/A FSTYP_ERR_MULT_MATCH, /* multiple matches */
2N/A FSTYP_ERR_HANDLE, /* invalid handle */
2N/A FSTYP_ERR_OFFSET, /* invalid or unsupported offset */
2N/A FSTYP_ERR_NO_PARTITION, /* partition not found */
2N/A FSTYP_ERR_NOP, /* no such operation */
2N/A FSTYP_ERR_DEV_OPEN, /* cannot open device */
2N/A FSTYP_ERR_IO, /* I/O error */
2N/A FSTYP_ERR_NOMEM, /* out of memory */
2N/A FSTYP_ERR_MOD_NOT_FOUND, /* requested fs module not found */
2N/A FSTYP_ERR_MOD_DIR_OPEN, /* cannot open directory */
2N/A FSTYP_ERR_MOD_OPEN, /* cannot open module */
2N/A FSTYP_ERR_MOD_VERSION, /* invalid module version */
2N/A FSTYP_ERR_MOD_INVALID, /* invalid module */
2N/A FSTYP_ERR_NAME_TOO_LONG /* fs name exceeds FSTYPSZ */
2N/A};
2N/A
2N/A/*
2N/A * generic attribute names
2N/A *
2N/A * gen_clean (DATA_TYPE_BOOLEAN_VALUE)
2N/A * gen_guid (DATA_TYPE_STRING)
2N/A * gen_version (DATA_TYPE_STRING)
2N/A * gen_volume_label (DATA_TYPE_STRING)
2N/A */
2N/A
2N/Aint fstyp_init(int fd, off64_t offset, char *module_dir,
2N/A fstyp_handle_t *handle);
2N/Avoid fstyp_fini(fstyp_handle_t handle);
2N/Aint fstyp_ident(fstyp_handle_t handle, const char *fsname,
2N/A const char **ident);
2N/Aint fstyp_get_attr(fstyp_handle_t handle, nvlist_t **attr);
2N/Aint fstyp_dump(fstyp_handle_t handle, FILE *fout, FILE *ferr);
2N/Aconst char *fstyp_strerror(fstyp_handle_t handle, int error);
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _LIBFSTYP_H */