xref: /onnv-gate/usr/src/cmd/hal/tools/hal-storage-shared.h (revision 2912:85ea316d9c18)
1*2912Sartem /***************************************************************************
2*2912Sartem  * CVSID: $Id: hal-storage-mount.c,v 1.7 2006/06/21 00:44:03 david Exp $
3*2912Sartem  *
4*2912Sartem  * hal-storage-mount.c : Mount wrapper
5*2912Sartem  *
6*2912Sartem  * Copyright (C) 2006 David Zeuthen, <david@fubar.dk>
7*2912Sartem  *
8*2912Sartem  * This program is free software; you can redistribute it and/or modify
9*2912Sartem  * it under the terms of the GNU General Public License as published by
10*2912Sartem  * the Free Software Foundation; either version 2 of the License, or
11*2912Sartem  * (at your option) any later version.
12*2912Sartem  *
13*2912Sartem  * This program is distributed in the hope that it will be useful,
14*2912Sartem  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15*2912Sartem  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16*2912Sartem  * GNU General Public License for more details.
17*2912Sartem  *
18*2912Sartem  * You should have received a copy of the GNU General Public License
19*2912Sartem  * along with this program; if not, write to the Free Software
20*2912Sartem  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
21*2912Sartem  *
22*2912Sartem  **************************************************************************/
23*2912Sartem 
24*2912Sartem #ifndef HAL_STORAGE_SHARED_H
25*2912Sartem #define HAL_STORAGE_SHARED_H
26*2912Sartem 
27*2912Sartem #include <libhal.h>
28*2912Sartem #include <libhal-storage.h>
29*2912Sartem #ifdef HAVE_POLKIT
30*2912Sartem #include <libpolkit.h>
31*2912Sartem #endif
32*2912Sartem #ifdef sun
33*2912Sartem #include <bsm/adt.h>
34*2912Sartem #include <bsm/adt_event.h>
35*2912Sartem #endif
36*2912Sartem 
37*2912Sartem /*#define DEBUG*/
38*2912Sartem #define DEBUG
39*2912Sartem 
40*2912Sartem gboolean mtab_open (gpointer *handle);
41*2912Sartem char *mtab_next (gpointer handle, char **mount_point);
42*2912Sartem void mtab_close (gpointer handle);
43*2912Sartem 
44*2912Sartem gboolean fstab_open (gpointer *handle);
45*2912Sartem char *fstab_next (gpointer handle, char **mount_point);
46*2912Sartem void fstab_close (gpointer handle);
47*2912Sartem 
48*2912Sartem gboolean lock_hal_mtab (void);
49*2912Sartem void unlock_hal_mtab (void);
50*2912Sartem 
51*2912Sartem void unknown_error (const char *detail);
52*2912Sartem 
53*2912Sartem void handle_unmount (LibHalContext *hal_ctx,
54*2912Sartem #ifdef HAVE_POLKIT
55*2912Sartem 		     LibPolKitContext *pol_ctx,
56*2912Sartem #endif
57*2912Sartem 		     const char *udi,
58*2912Sartem 		     LibHalVolume *volume, LibHalDrive *drive, const char *device,
59*2912Sartem 		     const char *invoked_by_uid, const char *invoked_by_syscon_name,
60*2912Sartem 		     gboolean option_lazy, gboolean option_force,
61*2912Sartem 		     DBusConnection *system_bus);
62*2912Sartem 
63*2912Sartem void handle_eject (LibHalContext *hal_ctx,
64*2912Sartem #ifdef HAVE_POLKIT
65*2912Sartem 		   LibPolKitContext *pol_ctx,
66*2912Sartem #endif
67*2912Sartem 		   const char *udi,
68*2912Sartem 		   LibHalDrive *drive, const char *device,
69*2912Sartem 		   const char *invoked_by_uid, const char *invoked_by_syscon_name,
70*2912Sartem 		   gboolean closetray, DBusConnection *system_bus);
71*2912Sartem 
72*2912Sartem #ifdef sun
73*2912Sartem char *auth_from_privilege(const char *privilege);
74*2912Sartem adt_export_data_t *get_audit_export_data(DBusConnection *bus, const char *invoked_by_syscon_name,
75*2912Sartem     size_t *data_size);
76*2912Sartem void audit_volume(const adt_export_data_t *imported_state, au_event_t event_id, int result,
77*2912Sartem     const char *auth_used, const char *mount_point, const char *device, const char *options);
78*2912Sartem #endif /* sun */
79*2912Sartem 
80*2912Sartem #endif /* HAL_STORAGE_SHARED_H */
81*2912Sartem 
82