xref: /titanic_51/usr/src/cmd/rmvolmgr/vold.h (revision 18c2aff776a775d34a4c9893a4c72e0434d68e36)
1*18c2aff7Sartem /*
2*18c2aff7Sartem  * CDDL HEADER START
3*18c2aff7Sartem  *
4*18c2aff7Sartem  * The contents of this file are subject to the terms of the
5*18c2aff7Sartem  * Common Development and Distribution License (the "License").
6*18c2aff7Sartem  * You may not use this file except in compliance with the License.
7*18c2aff7Sartem  *
8*18c2aff7Sartem  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*18c2aff7Sartem  * or http://www.opensolaris.org/os/licensing.
10*18c2aff7Sartem  * See the License for the specific language governing permissions
11*18c2aff7Sartem  * and limitations under the License.
12*18c2aff7Sartem  *
13*18c2aff7Sartem  * When distributing Covered Code, include this CDDL HEADER in each
14*18c2aff7Sartem  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*18c2aff7Sartem  * If applicable, add the following below this CDDL HEADER, with the
16*18c2aff7Sartem  * fields enclosed by brackets "[]" replaced with your own identifying
17*18c2aff7Sartem  * information: Portions Copyright [yyyy] [name of copyright owner]
18*18c2aff7Sartem  *
19*18c2aff7Sartem  * CDDL HEADER END
20*18c2aff7Sartem  */
21*18c2aff7Sartem /*
22*18c2aff7Sartem  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23*18c2aff7Sartem  * Use is subject to license terms.
24*18c2aff7Sartem  */
25*18c2aff7Sartem 
26*18c2aff7Sartem #ifndef	_VOLD_H
27*18c2aff7Sartem #define	_VOLD_H
28*18c2aff7Sartem 
29*18c2aff7Sartem #pragma ident	"%Z%%M%	%I%	%E% SMI"
30*18c2aff7Sartem 
31*18c2aff7Sartem #ifdef	__cplusplus
32*18c2aff7Sartem extern "C" {
33*18c2aff7Sartem #endif
34*18c2aff7Sartem 
35*18c2aff7Sartem #include <libhal.h>
36*18c2aff7Sartem 
37*18c2aff7Sartem typedef enum {
38*18c2aff7Sartem 	EJECT,
39*18c2aff7Sartem 	INSERT,
40*18c2aff7Sartem 	REMOUNT,
41*18c2aff7Sartem 	UNMOUNT,
42*18c2aff7Sartem 	CLEAR_MOUNTS,
43*18c2aff7Sartem 	CLOSETRAY
44*18c2aff7Sartem } action_t;
45*18c2aff7Sartem 
46*18c2aff7Sartem struct action_arg {
47*18c2aff7Sartem 	action_t aa_action;	/* VOLUME_ACTION */
48*18c2aff7Sartem 	char	*aa_symdev;	/* VOLUME_SYMDEV */
49*18c2aff7Sartem 	char	*aa_name;	/* VOLUME_NAME */
50*18c2aff7Sartem 	char	*aa_path;	/* special device in question (block) */
51*18c2aff7Sartem 	char	*aa_rawpath;	/* special device in question (character) */
52*18c2aff7Sartem 	char	*aa_type;	/* file system type */
53*18c2aff7Sartem 	char	*aa_media;	/* type of media */
54*18c2aff7Sartem 	char	*aa_partname;	/* iff a partition, partition name */
55*18c2aff7Sartem 	char	*aa_mountpoint;	/* path this file system mounted on */
56*18c2aff7Sartem };
57*18c2aff7Sartem 
58*18c2aff7Sartem extern int rmm_debug;
59*18c2aff7Sartem extern boolean_t rmm_vold_actions_enabled;
60*18c2aff7Sartem extern boolean_t rmm_vold_mountpoints_enabled;
61*18c2aff7Sartem 
62*18c2aff7Sartem void vold_init(int argc, char **argv);
63*18c2aff7Sartem int vold_postprocess(LibHalContext *hal_ctx, const char *udi,
64*18c2aff7Sartem     struct action_arg *aap);
65*18c2aff7Sartem int vold_rmmount(int argc, char **argv);
66*18c2aff7Sartem int volrmmount(int argc, char **argv);
67*18c2aff7Sartem int volcheck(int argc, char **argv);
68*18c2aff7Sartem 
69*18c2aff7Sartem #ifdef	__cplusplus
70*18c2aff7Sartem }
71*18c2aff7Sartem #endif
72*18c2aff7Sartem 
73*18c2aff7Sartem #endif	/* _VOLD_H */
74