usr/src/lib/libbsm/common/devices.h
changeset 1676 37f4a3e2bd99
parent 0 68f95e015346
child 4514 0ba804e879d8
equal deleted inserted replaced
1675:5791e75682d0 1676:37f4a3e2bd99
     1 /*
     1 /*
     2  * CDDL HEADER START
     2  * CDDL HEADER START
     3  *
     3  *
     4  * The contents of this file are subject to the terms of the
     4  * The contents of this file are subject to the terms of the
     5  * Common Development and Distribution License, Version 1.0 only
     5  * Common Development and Distribution License (the "License").
     6  * (the "License").  You may not use this file except in compliance
     6  * You may not use this file except in compliance with the License.
     7  * with the License.
       
     8  *
     7  *
     9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
     8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
    10  * or http://www.opensolaris.org/os/licensing.
     9  * or http://www.opensolaris.org/os/licensing.
    11  * See the License for the specific language governing permissions
    10  * See the License for the specific language governing permissions
    12  * and limitations under the License.
    11  * and limitations under the License.
    18  * information: Portions Copyright [yyyy] [name of copyright owner]
    17  * information: Portions Copyright [yyyy] [name of copyright owner]
    19  *
    18  *
    20  * CDDL HEADER END
    19  * CDDL HEADER END
    21  */
    20  */
    22 /*
    21 /*
    23  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
    22  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
    24  * Use is subject to license terms.
    23  * Use is subject to license terms.
    25  */
    24  */
    26 
    25 
    27 #ifndef	_BSM_DEVICES_H
    26 #ifndef	_BSM_DEVICES_H
    28 #define	_BSM_DEVICES_H
    27 #define	_BSM_DEVICES_H
    31 
    30 
    32 #ifdef	__cplusplus
    31 #ifdef	__cplusplus
    33 extern "C" {
    32 extern "C" {
    34 #endif
    33 #endif
    35 
    34 
    36 typedef struct {		/* see getdmapent(3) */
    35 #include <stdio.h>
    37 	char *dmap_devname;
    36 #include <secdb.h>
    38 	char *dmap_devtype;
    37 
    39 	char *dmap_devlist;
    38 /*
       
    39  * These are unsupported, SUN-private interfaces.
       
    40  */
       
    41 
       
    42 #define	DAOPT_AUTHS	"auths"
       
    43 #define	DAOPT_CSCRIPT	"cleanscript"
       
    44 #define	DAOPT_MINLABEL	"minlabel"
       
    45 #define	DAOPT_MAXLABEL	"maxlabel"
       
    46 #define	DAOPT_ZONE	"zone"
       
    47 #define	DA_RESERVED	"reserved"
       
    48 
       
    49 typedef struct {
       
    50 	char	*da_devname;
       
    51 	char	*da_devtype;
       
    52 	char	*da_devauth;
       
    53 	char	*da_devexec;
       
    54 	kva_t	*da_devopts;
       
    55 } devalloc_t;
       
    56 
       
    57 typedef struct {
       
    58 	char	*dmap_devname;
       
    59 	char	*dmap_devtype;
       
    60 	char	*dmap_devlist;
       
    61 	char	**dmap_devarray;
    40 } devmap_t;
    62 } devmap_t;
    41 
    63 
    42 devmap_t *getdmapent(void);
    64 int		getdadmline(char *, int, FILE *);
    43 devmap_t *getdmaptype(char *);
       
    44 devmap_t *getdmapnam(char *);
       
    45 devmap_t *getdmapdev(char *);
       
    46 void setdmapent(void);
       
    47 void enddmapent(void);
       
    48 void setdmapfile(char *);
       
    49 
    65 
    50 typedef struct {		/* see getdaent(3) */
    66 devalloc_t	*getdaent(void);
    51 	char *da_devname;
    67 devalloc_t	*getdatype(char *);
    52 	char *da_devtype;
    68 devalloc_t	*getdanam(char *);
    53 	char *da_devmin;
    69 void		setdaent(void);
    54 	char *da_devmax;
    70 void		enddaent(void);
    55 	char *da_devauth;
    71 void		freedaent(devalloc_t *);
    56 	char *da_devexec;
    72 void		setdafile(char *);
    57 } devalloc_t;
       
    58 
    73 
    59 devalloc_t *getdaent(void);
    74 devmap_t	*getdmapent(void);
    60 devalloc_t *getdatype(char *);
    75 devmap_t	*getdmaptype(char *);
    61 devalloc_t *getdanam(char *);
    76 devmap_t	*getdmapnam(char *);
    62 devalloc_t *getdadev(char *);
    77 devmap_t	*getdmapdev(char *);
    63 void setdaent(void);
    78 void		setdmapent(void);
    64 void enddaent(void);
    79 void		enddmapent(void);
    65 void setdafile(char *);
    80 void		freedmapent(devmap_t *);
       
    81 void		setdmapfile(char *);
       
    82 char		*getdmapfield(char *);
       
    83 char		*getdmapdfield(char *);
    66 
    84 
    67 #ifdef	__cplusplus
    85 #ifdef	__cplusplus
    68 }
    86 }
    69 #endif
    87 #endif
    70 
    88