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