xref: /illumos-gate/usr/src/lib/libbsm/common/devices.h (revision 1da57d551424de5a9d469760be7c4b4d4f10a755)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
545916cd2Sjpk  * Common Development and Distribution License (the "License").
645916cd2Sjpk  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22*10ddde3aSaj  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate #ifndef	_BSM_DEVICES_H
277c478bd9Sstevel@tonic-gate #define	_BSM_DEVICES_H
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
307c478bd9Sstevel@tonic-gate extern "C" {
317c478bd9Sstevel@tonic-gate #endif
327c478bd9Sstevel@tonic-gate 
3345916cd2Sjpk #include <stdio.h>
3445916cd2Sjpk #include <secdb.h>
3545916cd2Sjpk 
3645916cd2Sjpk 
3745916cd2Sjpk #define	DAOPT_AUTHS	"auths"
38*10ddde3aSaj #define	DAOPT_CLASS	"class"
3945916cd2Sjpk #define	DAOPT_CSCRIPT	"cleanscript"
4045916cd2Sjpk #define	DAOPT_MINLABEL	"minlabel"
4145916cd2Sjpk #define	DAOPT_MAXLABEL	"maxlabel"
42*10ddde3aSaj #define	DAOPT_XDISPLAY	"xdpy"
4345916cd2Sjpk #define	DAOPT_ZONE	"zone"
4445916cd2Sjpk #define	DA_RESERVED	"reserved"
4545916cd2Sjpk 
46*10ddde3aSaj /*
47*10ddde3aSaj  * These are unsupported, SUN-private interfaces.
48*10ddde3aSaj  */
49*10ddde3aSaj 
5045916cd2Sjpk typedef struct {
5145916cd2Sjpk 	char	*da_devname;
5245916cd2Sjpk 	char	*da_devtype;
5345916cd2Sjpk 	char	*da_devauth;
5445916cd2Sjpk 	char	*da_devexec;
5545916cd2Sjpk 	kva_t	*da_devopts;
5645916cd2Sjpk } devalloc_t;
5745916cd2Sjpk 
5845916cd2Sjpk typedef struct {
597c478bd9Sstevel@tonic-gate 	char	*dmap_devname;
607c478bd9Sstevel@tonic-gate 	char	*dmap_devtype;
617c478bd9Sstevel@tonic-gate 	char	*dmap_devlist;
6245916cd2Sjpk 	char	**dmap_devarray;
637c478bd9Sstevel@tonic-gate } devmap_t;
647c478bd9Sstevel@tonic-gate 
6545916cd2Sjpk int		getdadmline(char *, int, FILE *);
6645916cd2Sjpk 
6745916cd2Sjpk devalloc_t	*getdaent(void);
6845916cd2Sjpk devalloc_t	*getdatype(char *);
6945916cd2Sjpk devalloc_t	*getdanam(char *);
7045916cd2Sjpk void		setdaent(void);
7145916cd2Sjpk void		enddaent(void);
7245916cd2Sjpk void		freedaent(devalloc_t *);
7345916cd2Sjpk void		setdafile(char *);
7445916cd2Sjpk 
757c478bd9Sstevel@tonic-gate devmap_t	*getdmapent(void);
767c478bd9Sstevel@tonic-gate devmap_t	*getdmaptype(char *);
777c478bd9Sstevel@tonic-gate devmap_t	*getdmapnam(char *);
787c478bd9Sstevel@tonic-gate devmap_t	*getdmapdev(char *);
797c478bd9Sstevel@tonic-gate void		setdmapent(void);
807c478bd9Sstevel@tonic-gate void		enddmapent(void);
8145916cd2Sjpk void		freedmapent(devmap_t *);
827c478bd9Sstevel@tonic-gate void		setdmapfile(char *);
8345916cd2Sjpk char		*getdmapfield(char *);
8445916cd2Sjpk char		*getdmapdfield(char *);
857c478bd9Sstevel@tonic-gate 
867c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
877c478bd9Sstevel@tonic-gate }
887c478bd9Sstevel@tonic-gate #endif
897c478bd9Sstevel@tonic-gate 
907c478bd9Sstevel@tonic-gate #endif	/* _BSM_DEVICES_H */
91