libdiskmgt.h revision 46a2abf27af40eda17a3f97e79eda1aef4e3c3c8
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _LIBDISKMGT_H
#define _LIBDISKMGT_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#include <libnvpair.h>
/*
* Holds all the data regarding the device.
*/
typedef uint64_t dm_descriptor_t;
typedef enum {
DM_WHO_MKFS = 0,
typedef enum {
DM_DRIVE = 0,
typedef enum {
DM_DT_UNKNOWN = 0,
typedef enum {
DM_MT_UNKNOWN = 0,
#define DM_FILTER_END -1
/* drive stat name */
typedef enum {
/* slice stat name */
typedef enum {
/* attribute definitions */
/* drive */
#define DM_DISK_UP 1
#define DM_DISK_DOWN 0
#define DM_CLUSTERED "clustered"
#define DM_DRVTYPE "drvtype"
#define DM_FAILING "failing"
#define DM_NDNRERRS "ndevice_not_ready_errors"
#define DM_NBYTESREAD "nbytes_read"
#define DM_NBYTESWRITTEN "nbytes_written"
#define DM_NHARDERRS "nhard_errors"
#define DM_NILLREQERRS "nillegal_req_errors"
#define DM_NMEDIAERRS "nmedia_errors"
#define DM_NNODEVERRS "nno_dev_errors"
#define DM_NREADOPS "nread_ops"
#define DM_NRECOVERRS "nrecoverable_errors"
#define DM_NSOFTERRS "nsoft_errors"
#define DM_NTRANSERRS "ntransport_errors"
#define DM_NWRITEOPS "nwrite_ops"
#define DM_OPATH "opath"
#define DM_PRODUCT_ID "product_id"
#define DM_RPM "rpm"
#define DM_STATUS "status"
#define DM_SYNC_SPEED "sync_speed"
#define DM_TEMPERATURE "temperature"
#define DM_VENDOR_ID "vendor_id"
#define DM_WWN "wwn"
/* bus */
#define DM_BTYPE "btype"
#define DM_PNAME "pname"
/* controller */
#define DM_FAST "fast"
#define DM_FAST20 "fast20"
#define DM_FAST40 "fast40"
#define DM_FAST80 "fast80"
#define DM_MULTIPLEX "multiplex"
#define DM_PATH_STATE "path_state"
#define DM_CTYPE_ATA "ata"
#define DM_CTYPE_SCSI "scsi"
#define DM_CTYPE_FIBRE "fibre channel"
#define DM_CTYPE_USB "usb"
#define DM_CTYPE_UNKNOWN "unknown"
/* media */
#define DM_BLOCKSIZE "blocksize"
#define DM_FDISK "fdisk"
#define DM_MTYPE "mtype"
#define DM_NACTUALCYLINDERS "nactual_cylinders"
#define DM_NALTCYLINDERS "nalt_cylinders"
#define DM_NCYLINDERS "ncylinders"
#define DM_NHEADS "nheads"
#define DM_NPHYSCYLINDERS "nphys_cylinders"
#define DM_NACCESSIBLE "naccessible"
#define DM_LABEL "label"
/* partition */
#define DM_BCYL "bcyl"
#define DM_BHEAD "bhead"
#define DM_BOOTID "bootid"
#define DM_BSECT "bsect"
#define DM_ECYL "ecyl"
#define DM_EHEAD "ehead"
#define DM_ESECT "esect"
#define DM_PTYPE "ptype"
#define DM_RELSECT "relsect"
/* slice */
#define DM_DEVICEID "deviceid"
#define DM_DEVT "devt"
#define DM_INDEX "index"
#define DM_EFI_NAME "name"
#define DM_MOUNTPOINT "mountpoint"
#define DM_LOCALNAME "localname"
#define DM_START "start"
#define DM_TAG "tag"
#define DM_FLAG "flag"
#define DM_USED_BY "used_by"
#define DM_USED_NAME "used_name"
#define DM_USE_MOUNT "mount"
#define DM_USE_SVM "svm"
#define DM_USE_LU "lu"
#define DM_USE_DUMP "dump"
#define DM_USE_VXVM "vxvm"
#define DM_USE_FS "fs"
#define DM_USE_VFSTAB "vfstab"
#define DM_USE_EXPORTED_ZPOOL "exported_zpool"
#define DM_USE_ACTIVE_ZPOOL "active_zpool"
/* event */
#define DM_EV_NAME "name"
#define DM_EV_DTYPE "edtype"
#define DM_EV_TYPE "evtype"
#define DM_EV_TADD "add"
#define DM_EV_TREMOVE "remove"
#define DM_EV_TCHANGE "change"
/* findisks */
#define DM_CTYPE "ctype"
#define DM_LUN "lun"
#define DM_TARGET "target"
void dm_free_name(char *name);
int *errp);
int *errp);
int *errp);
int *errp);
int *errp);
int *errp);
#ifdef __cplusplus
}
#endif
#endif /* _LIBDISKMGT_H */