label.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef __LABEL_H
#define __LABEL_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Header file for label manipulation
*/
/*
* This is the maximum block offset of a CD-ROM. This is calculated
* bad (invalid) partitions in a Sun label.
*/
#define PART_MAXCDROM 1310720
#define PART_INF 0xffffffff
/*
* This is a dummy label type that implements a temporary interface
* between the medium and partition classes and the label objects
* stored in the volume manager database and passed to the volume
* manager daemon's event handler.
*/
typedef struct partition_label {
char *keyp;
char *volume_namep;
#define PARTITION_LABEL 99
/*
* structure for handling labels
*/
typedef struct label {
int l_type; /* label type index (into labsw[]) */
void *l_label; /* pointer to it */
} label;
struct label_loc {
};
/*
* This is the internal interface between the label modules and the
* generic labeling code
*/
struct labsw {
char *l_ident; /* name of label */
char **l_devlist; /* devices this label live on */
};
#define MAX_LABELS 10
extern char *label_ident(int); /* string for label type */
extern int label_type(char *); /* label type from string */
/* read the label */
extern size_t label_xdrsize(int);
extern struct labsw *label_getlast(void);
extern void destroy_label(partition_label_t **);
/* the init routine to call in each "label_*.so" */
#define LABEL_SYM "label_init"
/* unnamed media names */
#define UNNAMED_PREFIX "unnamed_"
#ifdef __cplusplus
}
#endif
#endif /* __LABEL_H */