home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1999 March B
/
SCO_CASTOR4RRT.iso
/
vxvm
/
root.2
/
usr
/
include
/
volipc.h
/
volipc
Wrap
Text File
|
1998-08-19
|
43KB
|
985 lines
/*
* Copyright (c) 1998 The Santa Cruz Operation, Inc.. All Rights Reserved.
*
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF THE
* SANTA CRUZ OPERATION INC.
*
* The copyright notice above does not evidence any actual or intended
* publication of such source code.
*/
/* @(#)lib.vxvm:libvxvm/common/libvxvm/volipc.h 1.2 3/3/97 04:27:40 - lib.vxvm:libvxvm/common/libvxvm/volipc.h */
#ident "@(#)lib.vxvm:libvxvm/common/libvxvm/volipc.h 1.2"
/*
* Copyright(C)1996 VERITAS Software Corporation. ALL RIGHTS RESERVED.
* UNPUBLISHED -- RIGHTS RESERVED UNDER THE COPYRIGHT
* LAWS OF THE UNITED STATES. USE OF A COPYRIGHT NOTICE
* IS PRECAUTIONARY ONLY AND DOES NOT IMPLY PUBLICATION
* OR DISCLOSURE.
*
* THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION AND
* TRADE SECRETS OF VERITAS SOFTWARE. USE, DISCLOSURE,
* OR REPRODUCTION IS PROHIBITED WITHOUT THE PRIOR
* EXPRESS WRITTEN PERMISSION OF VERITAS SOFTWARE.
*
* RESTRICTED RIGHTS LEGEND
* USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT IS
* SUBJECT TO RESTRICTIONS AS SET FORTH IN SUBPARAGRAPH
* (C) (1) (ii) OF THE RIGHTS IN TECHNICAL DATA AND
* COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013.
* VERITAS SOFTWARE
* 1600 PLYMOUTH STREET, MOUNTAIN VIEW, CA 94043
*/
#ifndef _VOLIPC_H
#define _VOLIPC_H
#include <vxvm/voldefs.h>
#include <vxvm/voldefault.h>
#include <vxvm/volioctl.h>
#include <vxvm/volerrno.h>
#include <volintf.h>
/*
* volipc.h - vold/client communication header file
*
* A mounted stream is used as the rendezvous point for vold/client IPC.
* After rendezvous, all messages back and forth are preceded by a long
* that specifies the number of bytes that are contained in the message
* (not including the length). The first long in the message contains
* a frame start magic number. The last long contains a frame end magic
* number.
*/
/* mounted stream or named pipe rendezvous points */
#ifndef VOLD_REQUEST_FILE
#define VOLD_REQUEST_FILE "/etc/vx/vold_request" /* normal file */
#endif
#ifndef VOLD_DIAG_FILE
#define VOLD_DIAG_FILE "/etc/vx/vold_diag" /* file for diag mode */
#endif
/* socket IPC rendezvous ports */
#ifndef VOLD_REQUEST_IP_PORT
#define VOLD_REQUEST_IP_PORT "volmgr_request" /* normal port */
#endif
#ifndef VOLD_DIAG_IP_PORT
#define VOLD_DIAG_IP_PORT "volmgr_diag" /* port for diag mode */
#endif
/*
* pseudo-names used to get the diag and request portals
*
* These names can be passed to vol_set_rendezvous(), on the client
* side, or to vold_add_portal(), on the vold side. These functions
* interpret these names to imply the IP ports or files listed above.
*/
#define VOLD_REQUEST_PORTAL "*request*" /* normal request portal */
#define VOLD_DIAG_PORTAL "*diag*" /* diag mode request portal */
/*
* path to daemon binaries
*/
#define VOLD_PATH "/sbin/vxconfigd" /* pathname of vold */
#define VOLIOD_PATH "/sbin/vxiod" /* pathname of voliod */
/*
* values and structures that are used for both sides of the interface
* between /dev/volcontrol and /dev/volconfig.
*/
/*
* volume manager operation codes
*
* Operations for which no response is expected are flagged with
* "no response".
*/
typedef enum volop { /* volume manager command number */
MIN_VOLOP, /* sentinel value, must be first */
VOLOP_CONNECT, /* connection request, no response */
VOLOP_VOL_DIAG, /* diagnostic request */
VOLOP_VOL_INFO, /* obtain vold info */
VOLOP_VOL_ID, /* get configuration id */
VOLOP_VOL_TRANS, /* start a transaction */
VOLOP_VOL_COMMIT, /* commit a transaction */
VOLOP_VOL_CRETRY, /* retry of a commit */
VOLOP_VOL_CACK, /* acknowledge commit completion, no response */
VOLOP_VOL_ABORT, /* abort a transaction */
VOLOP_SD_CREAT, /* create a subdisk */
VOLOP_PLEX_CREAT, /* create a plex */
VOLOP_VOL_CREAT, /* create a volume */
VOLOP_SD_DELETE, /* delete a subdisk */
VOLOP_PLEX_DELETE, /* delete a plex */
VOLOP_VOL_DELETE, /* delete a volume */
VOLOP_SD_ASSOC, /* associate a subdisk with a plex */
VOLOP_PLEX_ASSOC, /* associate a plex with a volume */
VOLOP_SD_DIS, /* disassociate a subdisk with a plex */
VOLOP_PLEX_DIS, /* disassociate a plex with a volume */
VOLOP_SD_CHANGE, /* change a subdisk */
VOLOP_PLEX_CHANGE, /* change a plex */
VOLOP_VOL_CHANGE, /* change a volume */
VOLOP_VOL_SUMMARY, /* get summary of the configuration */
VOLOP_VOL_NAME, /* get list of record names */
VOLOP_SD_GET, /* get a subdisk record */
VOLOP_PLEX_GET, /* get a plex record */
VOLOP_VOL_GET, /* get a volume record */
VOLOP_VOL_GET_PLEX, /* get plexes associated with volume */
VOLOP_PLEX_GET_SD, /* get subdisks associated with plex */
VOLOP_SEARCH, /* search through a configuration */
VOLOP_SD_AS_LOG, /* associate a log subdisk to a plex */
VOLOP_UNIQUE, /* generate a unique name */
VOLOP_MAKE_NAME, /* generate unique name from a template */
VOLOP_RENAME, /* rename a record */
VOLOP_DELETE, /* delete any type of record, by name */
VOLOP_DELETE_RID, /* delete any type of record, by record ID */
VOLOP_SD_CREAT_FROM, /* create a subdisk record from another */
VOLOP_DM_CREAT, /* create a disk media record */
VOLOP_DG_CREAT, /* create a disk group configuration record */
VOLOP_DM_DELETE, /* delete a disk media record */
VOLOP_DM_CHANGE, /* change a disk media record */
VOLOP_DG_CHANGE, /* change a disk group configuration record */
VOLOP_DM_GET, /* get a disk media record */
VOLOP_DG_GET, /* get a disk group configuration record */
VOLOP_DG_GET_IMPORT_ID, /* get a disk group record by import id */
VOLOP_DA_CREAT, /* create a new disk access record */
VOLOP_DA_GET, /* get a disk access record */
VOLOP_DA_CHANGE, /* change a disk access record */
VOLOP_DA_DELETE, /* delete a disk access record */
VOLOP_DG_SET_CURRENT, /* set the current disk group name */
VOLOP_DG_SET_CURRENT_ID,/* set the current disk group by unique id */
VOLOP_DG_GETCFG, /* get the current disk group configuration */
VOLOP_DG_GETCFG_ALL, /* get all disk group configurations */
VOLOP_DG_GETCFG_NAME, /* get disk group configuration, by name */
VOLOP_DG_GETCFG_ID, /* get disk group configuration, by unique id */
VOLOP_DG_GETCFG_DISK, /* get configuration from a disk */
VOLOP_DG_GETCFG_DIFF, /* get differences from an old configuration */
VOLOP_DG_GETCFG_SEARCH, /* get records matching a pattern */
VOLOP_GET, /* get a record by name */
VOLOP_GET_RID, /* get a record by record ID */
VOLOP_GET_HIER, /* get the hierarchy related to a record */
VOLOP_GET_HIER_RID, /* get a hierarchy, based on a record ID */
VOLOP_DG_LOCATE, /* locate disk group containing records */
VOLOP_DG_GET_FREE, /* list all free space for a disk group */
VOLOP_DG_IMPORT, /* import a disk group */
VOLOP_DG_DEPORT, /* import a disk group */
VOLOP_DG_DEPORT_ID, /* import a disk group, named by group id */
VOLOP_DM_AS_DA, /* associate disk media and access records */
VOLOP_DM_DIS_DA, /* dissociate disk media and access records */
VOLOP_DA_FIND, /* convert a disk name to a disk access name */
VOLOP_DISK_INIT, /* initialize a disk */
VOLOP_DISK_DEFINE, /* define a disk */
VOLOP_DISK_GET_ATTRS, /* get disk header information */
VOLOP_DISK_OP, /* switchout disk operation */
VOLOP_CHANGE_NOTIFY, /* change requested notifications */
VOLOP_VOLBOOT_INIT, /* initialize volboot file */
VOLOP_VOLBOOT_HOSTID, /* change hostid in volboot file */
VOLOP_VOLBOOT_ADD_DISK, /* add disk to volboot file */
VOLOP_VOLBOOT_RM_DISK, /* add disk to volboot file */
VOLOP_VOLBOOT_GET, /* get volboot file contents */
VOLOP_VOLD_ENABLE, /* enable vold */
VOLOP_VOLD_DISABLE, /* disable vold */
VOLOP_VOLD_STATUS, /* operating status of vold */
VOLOP_VOLD_STOP, /* kill vold */
VOLOP_DG_GET_INFO_NAME, /* get miscellaneous disk group information */
VOLOP_DG_GET_INFO_ID, /* get disk group info by disk group ID */
VOLOP_DG_FLUSH_NAME, /* flush a disk group */
VOLOP_DG_FLUSH_ID, /* flush a disk group, by disk group ID */
VOLOP_VOLDCTL_OP, /* arbitrary vold operation */
VOLOP_DM_REPL_DA, /* repldisk request */
VOLOP_SD_AS_STRIPE, /* associated with stripe/RAID5 plex */
VOLOP_DISK_REONLINE_ALL,/* reonline all online, non-imported disks */
VOLOP_LICENSE_CHECK, /* check/initialize valid licenses */
VOLOP_RESERVE10, /* reserved for future use */
VOLOP_RESERVE9, /* reserved for future use */
VOLOP_RESERVE8, /* reserved for future use */
VOLOP_RESERVE7, /* reserved for future use */
VOLOP_RESERVE6, /* reserved for future use */
VOLOP_RESERVE5, /* reserved for future use */
VOLOP_RESERVE4, /* reserved for future use */
VOLOP_RESERVE3, /* reserved for future use */
VOLOP_RESERVE2, /* reserved for future use */
VOLOP_RESERVE1, /* reserved for future use */
MAX_CLIENT_VOLOP, /* client ops must be less than this */
/* vold-internal operations, no response is returned for these */
MIN_INTERNAL_VOLOP, /* start of internal operations */
VOLOP_DISCONNECT, /* client disconnected */
VOLOP_DROPPED, /* client dopped for I/O error */
VOLOP_NULL, /* null getrequest event */
MAX_INTERNAL_VOLOP /* sentinel value, must be last */
} volop_t;
/* protocol version number of vold/client interface */
#define VOLD_VERSION_1_1 2
#define VOLD_VERSION_1_2 3
#define VOLD_VERSION_2_0 4
#define VOLD_VERSION_2_2 5
#define VOLD_VERSION_2_3 6
#define VOLD_VERSION VOLD_VERSION_2_3
/* maximum number of bytes in a request to the volume daemon */
#define VOLD_MAX_REQUEST 65536
/*
* errors that can be returned from vold request functions, that will
* be stored in vol_errno
*/
#define VE_OK 0 /* Volume error 0 */
/* private client errors */
#define VE_SYS 1 /* System error occurred in the client */
#define VE_AGAIN 2 /* Configuration daemon is not accessible */
#define VE_PROTO 3 /* Protocol error with configuration daemon */
#define VE_LOST 4 /* Commit status lost */
#define VE_WOULDBLOCK 5 /* Operation would block */
/* errors returned to clients by vold library functions */
#define VE_BADMSG 10 /* Bad message format in request */
#define VE_BADPROTOV 11 /* Configuration daemon can't speak protocol version */
#define VE_NOMEM 12 /* Memory allocation failure */
#define VE_REQ2BIG 13 /* Configuration request too large */
/* errors returned to clients by vold program */
/* errors for which vold does implicit abort, or that imply no transaction */
#define START_VE_ABORT 20
#define VE_NOTRANS 20 /* Operation requires transaction */
#define VE_TIMEOUT 21 /* Transaction locks timed out */
#define VE_RESTART 22 /* Commit aborted, restart transaction */
#define VE_DB_RESTART 23 /* I/O errors left too few configuration copies */
#define VE_VOLDERR 24 /* Internal configuration daemon error */
#define VE_REPLAY 25 /* Unexpected kernel error in configuration update */
#define VE_NOMEM_ABORT 26 /* Out of memory, transaction aborted */
#define VE_LOGIO_FAIL 27 /* Failed to create logging daemon */
#define VE_DG_DISABLED 28 /* Disk group is disabled */
#define STOP_VE_ABORT 39
/*
* miscellaneous diagnostic errors
*/
#define VE_DIAG_VOLBOOT 40 /* Error in volboot file */
#define VE_DIAG_DBASE 41 /* Error in disk group configuration copies */
#define VE_DIAG_DGLOG 42 /* Error in root disk group logs */
#define VE_DIAG_PORTAL 43 /* Cannot create portal */
#define VE_DIAG_ENABLED 44 /* Vold is currently enabled */
#define VE_DIAG_DISABLED 45 /* Vold is currently disabled */
#define VE_DIAG_BOOT 46 /* Vold is currently in boot mode */
#define VE_DIAG_KERNEL 47 /* Communication failure with kernel */
#define VE_DIAG_CYCLE 48 /* No convergence between disk group and disk list */
/*
* errors for volboot files
*/
#define VE_VB_NOENT 50 /* Volboot file not found */
#define VE_VB_SYS 51 /* System error in volboot file */
#define VE_VB_FORMAT 52 /* Format error in volboot file */
#define VE_VB_NOSPC 53 /* Out of space in volboot file */
#define VE_VB_SHORT 54 /* Short read in volboot file */
#define VE_VB_UNLOADED 55 /* Volboot file not loaded */
/* miscellaneous errors */
#define VE_INPROGRESS 60 /* Transaction already in progress */
#define VE_DISABLED 61 /* Disabled/unimplemented feature */
#define VE_NOSUPPORT 62 /* Operation is not supported */
#define VE_LOCK 63 /* Could not obtain requested lock */
#define VE_NOLOCK 64 /* Required lock not held in transaction */
#define VE_NO_DLOCK 65 /* Required data lock not held in transaction */
#define VE_EXIST 66 /* Record already exists in disk group */
#define VE_NOENT 67 /* Record not in disk group */
#define VE_CONFIG 68 /* Disk group configuration has changed */
#define VE_SRCHFAIL 69 /* Unexpected failure in search operation */
#define VE_BUSY 70 /* Volume or plex device is open or mounted */
#define VE_INVAL 71 /* Invalid data in request */
#define VE_NEG_COUNT 72 /* Negative count field in request */
#define VE_NEG_SIZE 73 /* Negative length, width, or offset */
#define VE_WRONG_PORT 74 /* Operation not supported on portal */
#define VE_BADNAME 75 /* Bad record name */
#define VE_NOT_DIS 76 /* Operation requires a disabled volume */
#define VE_ENABLED 77 /* Operation requires an enabled plex */
#define VE_NO_ASSOC 78 /* Operation requires an associated record */
#define VE_ASSOC 79 /* Record is associated */
#define VE_SECTOR 80 /* Length/size not multiple of a sector */
#define VE_VOL_DEV 81 /* Device for disk is a volume */
#define VE_HOLE 82 /* Plex is not compact */
#define VE_DIFF_SIZE 83 /* Subdisks have different sizes */
#define VE_NONE_ASSOC 84 /* No subdisks associated with plex */
#define VE_FULL_ASSOC 85 /* Record cannot have more associations */
#define VE_INVAL_RTYPE 86 /* Invalid record type for operation */
#define VE_NOT_SUBDISK 87 /* Record is not a subdisk */
#define VE_NOT_PLEX 88 /* Record is not a plex */
#define VE_NOT_VOL 89 /* Record is not a volume */
#define VE_NOT_DM 90 /* Not a disk media record */
#define VE_NOT_DG 91 /* Not a disk group record */
#define VE_NOT_DA 92 /* Not a disk access record */
#define VE_IS_DG 93 /* Operation not allowed on a disk group */
#define VE_MAX_VOL 94 /* Too many volumes */
#define VE_MAX_PLEX 95 /* Too many plexes */
#define VE_OVERLAP 96 /* Subdisk overlaps with another subdisk */
#define VE_TOO_SMALL 97 /* Record length is too small */
#define VE_SD_WIDTH 98 /* Subdisk length not multiple of stripe width */
#define VE_INVAL_FIELD 99 /* Invalid attribute specification */
#define VE_ST_WIDTH 100 /* Invalid plex stripe width field */
#define VE_OVERFLOW 101 /* Operation overflows maximum offsets */
#define VE_LOG_SD_SMALL 102 /* Log subdisk is too small for volume */
#define VE_LOG_SMALL 103 /* Log length too small for logging type */
#define VE_LOG_LARGE 104 /* Log length too large for logging type */
#define VE_HAS_LOG 105 /* Plex has a log subdisk */
#define VE_RANGE 106 /* Field value is out of range */
#define VE_NO_DG 107 /* Disk group does not exist */
#define VE_DG_MISMATCH 108 /* Request crosses disk group boundary */
#define VE_NOT_ROOTDG 109 /* Request allowed only in root disk group */
#define VE_PUB_BOUNDS 110 /* Outside of public partition */
#define VE_BAD_DISK 111 /* Disk is not usable */
#define VE_VOL_INVALID 112 /* Volume is unusable */
#define VE_PATH_STAT 113 /* Device path not valid */
#define VE_PATH_NBLKDEV 114 /* Device node not block special */
#define VE_NOROOTDG 115 /* Root disk group is not enabled */
#define VE_NODATYPE 116 /* Disk access type not recognized */
#define VE_DAOFFLINE 117 /* Disk device is offline */
#define VE_REC_TOOBIG 118 /* Record store size is too large */
#define VE_SD_BAD 119 /* Subdisk is unusable */
#define VE_PLEX_BAD 120 /* Plex contains unusable subdisk */
#define VE_NOT_EMPTY 121 /* Disk or disk group is not empty */
#define VE_DG_EXIST 122 /* Disk group exists and is imported */
#define VE_DGCREATED 123 /* Operation not allowed on created disk group */
#define VE_DG_LOG_FULL 124 /* Configuration too large for disk group log */
#define VE_DG_LOG_SMALL 125 /* Disk log too small for disk group configuration */
#define VE_DG_IMPORTED 126 /* Disk group already imported */
#define VE_DB_REC_ERROR 127 /* Error in configuration record */
#define VE_DB_TOO_BIG 128 /* Configuration too large for configuration copies */
#define VE_DGNOTCREATED 129 /* Disk group creation not complete */
#define VE_LOG_BAD 130 /* No valid log copies in disk group */
#define VE_ROOTDG 131 /* Operation not allowed on root disk group */
#define VE_LAST_DISK 132 /* Cannot remove last disk in disk group */
#define VE_LAST_CONFIG 133 /* Cannot remove last disk group configuration copy */
#define VE_LAST_LOG 134 /* Cannot remove last disk group log copy */
#define VE_DB_FULL 135 /* No more space in disk group configuration */
#define VE_DB_NOENT 136 /* Database file not found */
#define VE_DB_SYS 137 /* System error in configuration copy */
#define VE_DB_FORMAT 138 /* Format error in configuration copy */
#define VE_DB_VERSION 139 /* Configuration format version not supported */
#define VE_DB_NOSPC 140 /* Configuration is full */
#define VE_DB_SHORT 141 /* Short read in configuration copy */
#define VE_DB_READ 142 /* Disk read failure */
#define VE_DB_WRITE 143 /* Disk write failure */
#define VE_DB_AS_BAD 144 /* Association not resolved */
#define VE_DB_ASCNT_BAD 145 /* Association count is incorrect */
#define VE_DB_MINORS 146 /* Too many minor numbers for volume or plex */
#define VE_DB_DUP_MINOR 147 /* Duplicate minor number */
#define VE_DB_MAGIC 148 /* Invalid magic number */
#define VE_DB_BLKNO 149 /* Invalid block number */
#define VE_DB_NOMATCH 150 /* No valid disk found containing disk group */
#define VE_DB_DUPLICATE 151 /* Duplicate record in configuration */
#define VE_DB_INCONSISTENT 152 /* Configuration records are inconsistent */
#define VE_DB_NO_DGREC 153 /* No diskgroup record in configuration */
#define VE_DB_BAD_TEMP 154 /* Temp and perm configurations don't match */
#define VE_DB_CHANGED 155 /* Configuration changed during recovery */
#define VE_ROOTDG_NO_CONFIGS 156 /* Rootdg disk group has no configuration copies */
#define VE_ROOTDG_NO_LOGS 157 /* Rootdg disk group has no log copies */
#define VE_KERN_KNOENT 158 /* Expected record not found in kernel */
#define VE_KERN_DBNOENT 159 /* Record in kernel not in configuration */
#define VE_KERN_KDIFF 160 /* Configuration record does not match kernel */
#define VE_KERN_INCONSISTENT 161 /* Kernel and on-disk configurations don't match */
#define VE_PUB_SIZE 162 /* Disk public region is too small */
#define VE_PRIV_SIZE 163 /* Disk private region is too small */
#define VE_PRIV_FULL 164 /* Disk private region is full */
#define VE_PRIV_FORMAT 165 /* Format error in disk private region */
#define VE_PRIV_HEADMATCH 166 /* Disk has inconsistent disk headers */
#define VE_PRIV_NOHEADER 167 /* Disk header not found */
#define VE_PRIV_INVAL 168 /* Disk private region contents are invalid */
#define VE_PRIV_VERSION 169 /* Disk private region version not supported */
#define VE_PRIV_INCONSISTENT 170 /* Disks for disk group are inconsistent */
#define VE_FIELD_NOREINIT 171 /* Attribute cannot be changed with a reinit */
#define VE_DISK_INITED 172 /* Disk already initialized */
#define VE_DISK_ALIASED 173 /* Disk header indicates aliased partitions */
#define VE_DISK_SHARED 174 /* Disk is sharable, operation not supported */
#define VE_DISK_WRONGHOST 175 /* Disk is in use by another host */
#define VE_DUP_DA 176 /* Duplicate device */
#define VE_MISSING_PUB 177 /* Disk VTOC does not list public partition */
#define VE_MISSING_PRIV 178 /* Disk VTOC does not list private partition */
#define VE_DUP_PUB 179 /* Disk VTOC has duplicate public partition */
#define VE_DUP_PRIV 180 /* Disk VTOC has duplicate private partition */
#define VE_BAD_SCTR_SIZE 181 /* Disk sector size is not supported */
#define VE_NO_CONFIGS 182 /* Disk group has no valid configuration copies */
#define VE_DISK_NOT_FOUND 183 /* Disk for disk group not found */
#define VE_DISK_OTHER_DG 184 /* Disk for disk group in other disk group */
#define MAX_VE_1_2 184 /* Largest vol_errno supported under VxVM 1.2 */
#define VE_BADCOLUMN 185 /* Stripe column number too large for plex */
#define VE_NOTRAIDVOL 186 /* Volume does not have a RAID read policy */
#define VE_RAIDVOL 187 /* Volume has a RAID read policy */
#define VE_TOOMANYRAID 188 /* Volume already has one RAID plex */
#define VE_STORAGE 189 /* Volume has the storage attribute */
#define VE_LIC 190 /* License has expired or is not available for operation */
#define VE_LIC_FILE 191 /* Could not create license file or directory */
#define VE_NOTSTORAGE 192 /* Volume does not have the storage attribute */
#define VE_SUBVOLUME 193 /* Subdisk is defined on a volume */
#define VE_NOTSUBVOLUME 194 /* Subdisk is not defined on a volume */
#define VE_VOLTOOSMALL 195 /* Volume length too small to hold subdisks */
#define VE_HASSUBVOLUME 196 /* One or more subdisks defined on volume */
#define VE_BADRAIDCHANGE 197 /* Raid volume would be unusable */
#define VE_BADRAID 198 /* Raid volume is unusable */
#define VE_PLEX_DIS 199 /* Plex is disabled */
#define VE_DISK_BADSEL 200 /* Operation not supported on simple or populated disks*/
#define VE_DISK_SPARE 201 /* Operation not allowed on a spare disk */
#define VE_DG_NO_STORE 202 /* Non-stored rootdg, operation not allowed */
#define VE_OVERLAP_DA 203 /* Overlapping partitions detected */
#define VE_MPTH_DISABLE 204 /* Record is subsumed by a multipath disk */
#define VE_DG_NM_EXIST 205 /* Name conflicts with imported diskgroup */
/*
* structures and values that are used or consumed on the client
* utility side (the volcontrol side) of the /dev/volcontrol
* /dev/volconfig interface
*/
/*
* define a name array for convenience
*/
typedef char volname_t[NAME_SZ];
/*
* structure sent by clients for initial volume daemon connection
*
* This special structure is sent along with a VOLOP_CONNECT operation
* code as the first message sent from a connected client to vold.
*/
struct vol_conreq_1_1 { /* pre-1.2 structure */
pid_t vrq_pid; /* requesting pid */
long vrq_version; /* protocol version of client */
long vrq_client_id; /* if nonzero, request this client ID */
};
struct vol_conreq { /* 1.2 structure */
pid_t vrq_pid; /* requesting pid */
long vrq_version; /* protocol version of client */
long vrq_client_id; /* if nonzero, request this client ID */
ulong_t vrq_flags; /* flags pertaining to request */
volrid_t vrq_import_id; /* import-ID of current disk group */
};
#define VRQ_FLAG_RECONNECT 0x0001 /* this is a reconnection */
#define VRQ_FLAG_NOTIFY 0x0002 /* notification service connection */
struct vol_change_notify {
ulong_t want; /* desired event types */
size_t ndgwant; /* reserved, currently always zero */
};
struct vol_notify_conreq {
struct vol_conreq base; /* base conreq structure */
struct vol_change_notify note; /* notification information */
};
/*
* structure returned to client for initial volume daemon connection
*
* This is the response data returned for the VOLOP_CONNECT request.
* The library itself (on the vold side) automatically sends this response,
* with no intervention being required by vold.
*/
struct vol_conresp_1_2 {
long vrp_version; /* daemon protocol version */
long vrp_client_id; /* assigned client ID */
ulong_t vrp_flags; /* flags returned to client */
};
struct vol_conresp {
long vrp_version; /* daemon protocol version */
long vrp_client_id; /* assigned client ID */
ulong_t vrp_flags; /* flags returned to client */
struct volinfo vrp_volinfo; /* volinfo structure from vold */
};
#define VOLD_FLAG_KSTUB 0x00000001 /* vold -xstub option specified */
#define VOLD_FLAG_LIC_MIRROR 0x00000010 /* licensed for mirroring */
#define VOLD_FLAG_LIC_STRIPE 0x00000020 /* licensed for striping */
#define VOLD_FLAG_LIC_CONCAT 0x00000040 /* licensed for concatenation */
#define VOLD_FLAG_LIC_RAID5 0x00000080 /* licensed for RAID-5 */
#define VOLD_FLAG_LIC_SPAN 0x00000100 /* licensed for spanning */
#define VOLD_FLAG_LIC_ORM 0x00000200
#define VOLD_FLAG_LIC_FULL 0x000003f0 /* all licensed features available */
/*
* upper 16 bits of the vold flags word is reserved for special OEM uses
*/
#ifdef SOLARIS
#define VOLD_FLAG_SSA_RESTRICT 0x010000 /* special SPARCStorage Array license */
#endif /* SOLARIS */
/* magic numbers used at the start and end of any vold request or response */
#define VIPC_MAGIC1 0x56435354 /* (VFST) frame start magic number */
#define VIPC_MAGIC2 0x5646454e /* (VFEN) frame end magic number */
#define VIPC_MAGIC3 0x56465253 /* (VFRS) section end magic number */
/* bits defining what kinds of locks are requested in a vol_lock structure */
#define VL_RECORD ((short)0x0001) /* lock record in database */
#define VL_DATA ((short)0x0002) /* lock data in volume */
#define VL_RECURSE ((short)0x0004) /* lock related subcomponents */
#define VL_NAME ((short)0x0008) /* lock for creation */
#define VL_HIER ((short)0x0010) /* lock a vol/plex/sd hierarchy */
#define VL_DM_ALL ((short)0x0020) /* lock everything related to disk */
#define VL_ALL ((short)0x0040) /* lock everything in the disk group */
#define VL_BLOCK ((short)0x0080) /* block waiting for lock */
#define VL_RID ((short)0x0100) /* lock by record ID, not name */
#define VL_NO_DMLOCK ((short)0x0200) /* do not auto-lock disk for sd lock */
#define VL_DA_RECORD ((short)0x0400) /* name is for a disk device */
#define VL_DA_RECURSE ((short)0x0800) /* lock associated disk device */
#define VL_UNUSED ((short)0x1000) /* defined but unused in VxVM 1.2 */
#define VL_SV_ALL ((short)0x2000) /* lock subvolumes on locked volumes */
#define VL_ALL_LOCK_BITS ((short)0x3fff) /* all defined lock bits */
/* database record lock request structure */
struct vol_lock {
union {
volname_t vl_u_name; /* record to be locked */
volrid_t vl_u_rid; /* record ID to lock */
} vl_u;
short vl_locks; /* bitmask of lock attributes */
int vl_errno; /* error found obtaining lock */
};
#define vl_name vl_u.vl_u_name
#define vl_rid vl_u.vl_u_rid
/* possible error values in vl_errno */
#define VLE_OK 0 /* successful lock */
#define VLE_BADNAME 1 /* invalid record name */
#define VLE_NOENT 2 /* specified name does not exist */
#define VLE_LOCKED 3 /* lock was already set */
#define VLE_NOTVOLUME 4 /* data lock request and record not volume */
#define VLE_INVAL 5 /* invalid lock request */
/*
* structure used in the header of a VOLOP_SEARCH request
*/
struct vol_search {
long vs_types; /* record types for search */
long vs_sdcnt; /* count of subdisks buffers */
long vs_plexcnt; /* count of plexes buffers */
long vs_volcnt; /* count of volumes buffers */
long vs_patlen; /* length of compiled pattern */
};
/* bits defined in vs_types */
#define VST_SUBDISK 0x0001
#define VST_PLEX 0x0002
#define VST_VOL 0x0004
#define VST_ANY 0x0007
/*
* structure included at the beginning of a response to a VOLOP_SEARCH request
*/
struct vol_resp_search {
long vs_sdrcnt; /* count of matched subdisks */
long vs_plexrcnt; /* count of matched plexes */
long vs_volrcnt; /* count of matched volumes */
};
/*
* specific types of records in the volume manager configuration database
*
* Used by vold_match(), vold_find_record() and vold internal tables
* to identify a particular type of record.
*/
typedef enum vol_rec_type {
MIN_VOL_REC_TYPE, /* sentinel value, must be first */
VOL_VOLUME, /* record is a volume */
VOL_PLEX, /* record is a plex */
VOL_SUBDISK, /* record is a subdisk */
VOL_DISK_MEDIA, /* record is a disk media */
VOL_DISK_GROUP, /* record is a disk group */
VOL_DISK_ACCESS, /* record is a disk access record */
MAX_VOL_REC_TYPE /* sentinel value, must be last */
} vol_rec_t;
/*
* Decode the size of a search pattern from the pattern.
*/
#define VOLPATSIZE(pat) ((((pat)[0] & 0xff) << 8) + ((pat)[1] & 0xff))
#define MIN_VOLPATSIZE 3
/*
* maximum size for the bytes in a compiled pattern
*
* This must be less than 32K because jumps within patterns are
* encoded as signed two byte offsets.
*/
#define VOLPATMAX ((1 << 15) - 1)
/*
* types of records in the volume manager configuration database
*
* This is used in the VOLOP_VOL_NAME request (from vol_name()).
* It is also used internally by some functions that operate on the
* client side by do not interact with the volume daemon.
*/
typedef enum vol_object {
MIN_VOL_OBJECT, /* sentinel value, must be first */
VOLOBJ_ANY, /* pseudo record type, for any record */
VOLOBJ_SUBDISK, /* subdisk record */
VOLOBJ_PLEX, /* plex record */
VOLOBJ_VOLUME, /* volume record */
/* The following are pseudo records for use in vol_name() */
VOLOBJ_DIS_PLEX, /* disassociated plex */
VOLOBJ_DIS_SUBDISK, /* disassociated subdisk */
/* new object types */
VOLOBJ_UNKNOWN, /* unknown object */
VOLOBJ_DISK_MEDIA, /* disk media record */
VOLOBJ_DISK_GROUP, /* disk group record */
VOLOBJ_DISK_ACCESS, /* disk access record */
VOLOBJ_HOST, /* host record */
VOLOBJ_INFO, /* info record */
MAX_VOL_OBJECT /* sentinel value, must be last */
} vol_object_t;
/*
* dg_config - structure returned by the dg_getconfig library functions
*
* The extended attribute pointers are reserved for use by future
* volume manager functionality. It is not yet supported, and
* these pointers will always be zero for the base release 1.2
* library.
*/
struct vxa_buf {
int dummy;
};
struct dg_config {
volseqno_t dgc_config_tid; /* tid of last commit */
struct dgrec dgc_dg_rec; /* diskgroup record */
struct vxa_buf *dgc_dg_txattr; /* temporary extended attrs */
struct vxa_buf *dgc_dg_pxattr; /* persistent exteded attrs */
size_t dgc_nvol; /* number of volume records */
volrid_t *dgc_vol_rids; /* volume record IDs */
volname_t *dgc_vol_names; /* volume record names */
struct volrec *dgc_vol_recs; /* volume records */
struct vxa_buf *dgc_vol_txattr; /* temporary extended attrs */
struct vxa_buf *dgc_vol_pxattr; /* persistent extended attrs */
size_t dgc_nplex; /* number of plex records */
volrid_t *dgc_plex_rids; /* plex record IDs */
volname_t *dgc_plex_names; /* plex record names */
struct plexrec *dgc_plex_recs; /* plex records */
struct vxa_buf *dgc_plex_txattr; /* temporary extended attrs */
struct vxa_buf *dgc_plex_pxattr; /* persistent extended attrs */
size_t dgc_nsd; /* number of subdisk records */
volrid_t *dgc_sd_rids; /* subdisk record IDs */
volname_t *dgc_sd_names; /* plex record names */
struct sdrec *dgc_sd_recs; /* subdisk records */
struct vxa_buf *dgc_sd_txattr; /* temporary extended attrs */
struct vxa_buf *dgc_sd_pxattr; /* persistent extended attrs */
size_t dgc_ndm; /* number of disk records */
volrid_t *dgc_dm_rids; /* disk record IDs */
volname_t *dgc_dm_names; /* plex record names */
struct dmrec *dgc_dm_recs; /* disk records */
struct vxa_buf *dgc_dm_txattr; /* temporary extended attrs */
struct vxa_buf *dgc_dm_pxattr; /* persistent extended attrs */
size_t dgc_nda; /* number of diskdev records */
volrid_t *dgc_da_rids; /* diskdev record IDs */
volname_t *dgc_da_names; /* plex record names */
struct darec *dgc_da_recs; /* diskdev records */
struct vxa_buf *dgc_da_txattr; /* temporary extended attrs */
struct vxa_buf *dgc_da_pxattr; /* persistent extended attrs */
/*
* the remaining fields are not yet supported
*/
size_t dgc_nhost; /* number of host records */
volrid_t *dgc_host_rids; /* host record IDs */
char **dgc_host_names; /* host record names */
struct vxa_buf *dgc_host_txattr; /* temporary extended attrs */
struct vxa_buf *dgc_host_pxattr; /* persistent extended attrs */
size_t dgc_ninfo; /* number of info records */
volrid_t *dgc_info_rids; /* info record IDs */
char **dgc_info_names; /* info record names */
struct vxa_buf *dgc_info_txattr; /* temporary extended attrs */
struct vxa_buf *dgc_info_pxattr; /* persistent extended attrs */
};
/*
* dg_config_vec - structure returned by dg_getconfig_all
*/
struct dg_config_vec {
size_t dgcv_ndg; /* structures in dgcv_dg */
struct dg_config *dgcv_dg[1/*ndg*/]; /* contents of diskgroups */
};
/*
* types of information desired in calls to the dg_getconfig functions
*/
#define DG_WANT_VOL 0x0001 /* want volumes */
#define DG_WANT_SD 0x0002 /* want subdisks */
#define DG_WANT_PLEX 0x0004 /* want plexes */
#define DG_WANT_DM 0x0008 /* want disk media */
#define DG_WANT_DG 0x0010 /* want disk groups */
#define DG_WANT_DA 0x0020 /* want disk access records */
#define DG_WANT_HOST 0x0040 /* want hosts */
#define DG_WANT_INFO 0x0080 /* want info records */
#define DG_WANT_RID 0x0100 /* want record IDs */
#define DG_WANT_NAME 0x0200 /* want record names */
#define DG_WANT_REC 0x0400 /* want record contents */
#define DG_WANT_XATTR 0x0800 /* want extended attrs */
#define DG_WANT_DISABLED 0x1000 /* want disabled groups */
/*
* in the following combination macros, leave out host and info records
* and extended attributes, because they are not yet supported
*/
#define DG_WANT_ALL_TYPES (DG_WANT_VOL | DG_WANT_SD | DG_WANT_PLEX | \
DG_WANT_DM | DG_WANT_DG)
#define DG_WANT_ALL_RID (DG_WANT_ALL_TYPES | DG_WANT_RID)
#define DG_WANT_ALL_NAME (DG_WANT_ALL_TYPES | DG_WANT_NAME)
#define DG_WANT_ALL_REC (DG_WANT_ALL_TYPES | DG_WANT_REC)
#define DG_WANT_ALL (DG_WANT_ALL_RID | DG_WANT_NAME | DG_WANT_REC)
#define DG_WANT_EVERYTHING (DG_WANT_ALL | DG_WANT_DA)
/*
* flags for the dg_import operation
*/
#define DG_IMPORT_ALL_DISKS 0x0001 /* must find all disks */
#define DG_IMPORT_CLEAR_LOCKS 0x0002 /* remove any host ID locks */
#define DG_IMPORT_NO_AUTO_REIMPORT 0x4 /* don't auto reimport */
#define DG_IMPORT_FLAG_MASK 0x0007 /* all defined flag bits */
/*
* structure defining the disk group for particular records
*
* An array of these structures is returned by the dg_locate call.
*/
struct dg_locate {
volname_t dgl_dg_name; /* group containing record */
ulong_t dgl_flags; /* pertinent flags */
};
#define DGL_NOENT 0x0001 /* record not in any group */
#define DGL_MORE 0x0002 /* in more than one group */
/*
* structure defining free space within a disk group
*
* For region entries that have a non-empty device_tag field, all
* entries with the same device_tag value should be considered to be
* on the same physical device. For region entries that have an empty
* device_tag field, the diskname field distinguishes different physical
* devices. There are no specific guarantees that diskname and
* device_tag names are distinct from each other, and there are also no
* guarantees that identical device_tag and diskname fields correspond
* to the same physical device.
*/
struct dg_free_region {
volname_t dgfr_device_tag; /* tag grouping disk records */
volname_t dgfr_dm_name; /* name of disk media record */
volname_t dgfr_da_name; /* name of disk access record */
voff_t dgfr_offset; /* offset to free space */
voff_t dgfr_len; /* length of free space */
ulong_t dgfr_flags; /* flags pertaining to region */
};
struct dg_free {
size_t dgf_nregion; /* number of free regions */
struct dg_free_region dgf_regions[1/*dgf_nregion*/];
};
#define DGFR_FLAG_VOLATILE 0x0001 /* region is on reserved disk */
#define DGFR_FLAG_RESERVE 0x0002 /* region is on volatile disk */
#define DGFR_FLAG_SPARE 0x0004 /* spare disk for disk group */
#define DGFR_FLAG_VOLUME 0x0008 /* backing is a volume */
/*
* structure returned by dg_get_info(), containing information on
* the state of a disk group, and of its configuration copies
*/
struct dg_misc_info {
size_t _dgi_baselen; /* base structure length */
char *dgi_name; /* name of disk group */
char *dgi_dgid; /* unique ID of disk group */
volrid_t dgi_import_id; /* import ID of disk group */
volseqno_t dgi_config_tid; /* last committed tid */
ulong_t dgi_flags; /* miscellaneous flags */
size_t dgi_nconfig; /* number of config copies */
size_t dgi_nlog; /* number of log copies */
size_t dgi_config_len; /* length of configuration */
size_t dgi_config_free; /* free blks in configuration */
size_t dgi_temp_config_len; /* length of temp config */
size_t dgi_log_len; /* length of disk group log */
struct dg_config_info *dgi_config_info; /* config copy information */
struct dg_log_info *dgi_log_info; /* log copy information */
long dgi_nconfig_enable; /* #configs to enable */
long dgi_nlog_enable; /* #logs to enable */
};
#define DG_MISC_FLAG_DISABLED 0x0001 /* disk group is disabled */
#define DG_MISC_FLAG_SHARED 0x0002 /* disk group is shared */
#define DG_MISC_FLAG_READONLY 0x0004 /* disk group is read-only */
struct dg_config_info {
volname_t dgci_da_name; /* da record for config copy */
size_t dgci_copy; /* copy number for config */
size_t dgci_len; /* length of config copy */
ulong_t dgci_flags; /* flags for config copy */
ulong_t dgci_state; /* state of the config copy */
volseqno_t dgci_config_tid; /* last committed tid */
volseqno_t dgci_pending_tid; /* pending tid */
int dgci_vol_errno; /* internal volume errno */
int dgci_sys_errno; /* kernel errno */
off_t dgci_err_blockno; /* block number of error */
};
#define DG_CFG_FLAG_ONLINE 0x0001 /* copy is active, valid */
#define DG_CFG_FLAG_OFFLINE 0x0002 /* copy is offline */
#define DG_CFG_FLAG_DISABLED 0x0004 /* copy is disabled */
/*
* NOTE: This state numbers must the DBASE_* states from vold/dbase.h
*/
#define DG_CFG_STATE_UNKNOWN 0x0000 /* state is unknown */
#define DG_CFG_STATE_CLEAN 0x0001 /* no pending operations */
#define DG_CFG_STATE_CHANGE 0x0002 /* log changes to database */
#define DG_CFG_STATE_COMMIT 0x0003 /* will commit */
#define DG_CFG_STATE_ABORT 0x0004 /* will abort */
#define DG_CFG_STATE_NEW 0x0005 /* copy is uninitialized */
#define DG_CFG_STATE_STALE 0x0006 /* database copy is stale */
#define DG_CFG_STATE_IOFAIL 0x0007 /* stale due to I/O failure */
#define DG_CFG_STATE_OFFLINE 0x0008 /* database copy is offline */
#define DG_CFG_STATE_ERROR 0x000f /* internal offline state */
struct dg_log_info {
volname_t dgli_da_name; /* da record for log */
size_t dgli_copy; /* copy number for log copy */
size_t dgli_len; /* length of log copy */
ulong_t dgli_flags; /* flags for log copy */
};
#define DG_LOG_FLAG_INVALID 0x0001 /* log copy is unusable */
#define DG_LOG_FLAG_DISABLED 0x0002 /* log copy is disabled */
/*
* structure returned by vxvm_get and vxvm_get_rid functions
*/
struct vxvm_record {
struct vxvm_record *vxr_next; /* next record pointer */
struct vxvm_record *vxr_prev; /* next record pointer */
struct vxvm_record *vxr_next_sib; /* next sibling pointer */
struct vxvm_record *vxr_prev_sib; /* next sibling pointer */
struct vxvm_record *vxr_assoc; /* parent association */
struct vxvm_record *vxr_aslist; /* child associations */
struct vxvm_record *vxr_log; /* associated log */
VOID *vxr_private; /* reserved for utilities */
ulong_t vxr_private_flags; /* reserved for utilities */
vol_object_t vxr_type; /* type of record */
volrid_t vxr_rid; /* record ID of record */
size_t _vxr_namesize; /* name size, with nul byte */
size_t _vxr_recsize; /* raw record size */
ulong_t vxr_change_mask; /* reserved for future use */
char *vxr_name; /* name of record */
struct vxa_buf *vxr_txattr; /* reserved for future use */
struct vxa_buf *vxr_pxattr; /* reserved for future use */
union vxvm_u { /* raw configuration record */
struct volrec vol;
struct plexrec plex;
struct sdrec sd;
struct dmrec dm;
struct darec da;
struct dgrec dg;
} *vxr_p;
};
/* Offset of a field within a structure */
#define OFFS(t, e) offsetof(t, e)
/*
* VSIZEOF - size of structure that ends in a variable length array
*
* Inputs:
* type type, such as 'struct volrec'
* elem the name of the last element in the record, which is
* assumed to be an array. If this is a double-dimensioned
* array, the element name must be followed by [0]
* cnt count of array elements to include in the structure
* size.
*/
#define VSIZEOF(type,elem,cnt) (OFFS(type,elem[cnt]))
/*
* Use SETIOVEC to setup an iovec_t variable given a pointer to
* an object for which the sizeof operator will correctly determine
* the length of the object.
*
* Example usage:
* iovec_t resp[2];
* struct foo foovar;
* ...
* SETIOVEC(resp[0], &foovar);
*
* The code above will initialize the first iovec structure in
* the resp array to point to the variable foovar, with the
* appropriate size.
*
* NOTE: This macro cannot be used to initialize an iovec structure
* to point to the entire contents for an array variable.
*/
#define SETIOVEC(vec, strp) ((vec).iov_base = (caddr_t)(strp), \
(vec).iov_len = sizeof(*(strp)))
/* defines for vol_sscan_number() */
#define VOL_NUM_SCTRS 0x0001 /* default multiplier is sectors */
#define VOL_NUM_BLOCKS 0x0002 /* default multiplier is blocks */
#define VOL_NUM_R_SCTRS 0x0004 /* return multiple of sectors */
#define VOL_NUM_R_MULT 0x0008 /* return multiple of arbitrary value */
#define VOL_NUM_SUM 0x0010 /* sum multiple numbers together */
/* maximum size of buffers for vofftostr, volseqnotostr, and volridtostr */
#define MAXVOFFSTR 24
#define MAXVOLSEQNOSTR 24
#define MAXVOLRIDSTR 24
#if defined(__STDC__)
extern void vol_perror(const char *);
extern char *vol_strerror(int);
extern int vol_set_name(char *, const char *, size_t);
extern mode_t vol_mode(const char *, char **, mode_t);
extern voff_t vol_sscan_number(const char *, char **, int, ...);
extern voff_t vol_number(const char *, char **); /* backward compatibility */
extern voff_t strtovoff(const char *, char **);
extern char *vofftostr(voff_t, char *);
extern volseqno_t strtovolseqno(const char *, char **);
extern volrid_t strtovolrid(const char *, char **);
extern char *volseqnotostr(volseqno_t, char *);
extern char *volridtostr(volrid_t, char *);
extern ulong_t vol_hash(const char *);
#else /* not __STDC__ */
extern void vol_perror();
extern char *vol_strerror();
extern int vol_set_name();
extern mode_t vol_mode();
extern voff_t vol_sscan_number();
extern voff_t vol_number(); /* backward compatibility */
extern voff_t strtovoff();
extern char *vofftostr();
extern volseqno_t strtovolseqno();
extern volrid_t strtovolrid();
extern char *volseqnotostr();
extern char *volridtostr();
extern ulong_t vol_hash();
#endif /* __STDC__ */
#endif /* _VOLIPC_H */