child-delete: Reply as usual when concurrently rekeying the IKE_SA
[strongswan.git] / src / dumm / cowfs.h
1 /*
2 * Copyright (C) 2009 Tobias Brunner
3 * Copyright (C) 2007 Martin Willi
4 * Hochschule fuer Technik Rapperswil
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 */
16
17 #ifndef COWFS_H
18 #define COWFS_H
19
20 #include <library.h>
21
22 typedef struct cowfs_t cowfs_t;
23
24 /**
25 * cowfs - Copy on write FUSE filesystem.
26 *
27 */
28 struct cowfs_t {
29
30 /**
31 * Adds an additional copy on write overlay.
32 *
33 * If the path was already added as overlay, it is moved to the top.
34 *
35 * @param path path of the overlay
36 * @return FALSE, if failed
37 */
38 bool (*add_overlay)(cowfs_t *this, char *path);
39
40 /**
41 * Remove the specified copy on write overlay.
42 *
43 * @param path path of the overlay
44 * @return FALSE, if not found
45 */
46 bool (*del_overlay)(cowfs_t *this, char *path);
47
48 /**
49 * Remove the most recently added copy on write overlay.
50 *
51 * @return FALSE, if no overlay was found
52 */
53 bool (*pop_overlay)(cowfs_t *this);
54
55 /**
56 * Stop, umount and destroy a cowfs FUSE filesystem.
57 */
58 void (*destroy) (cowfs_t *this);
59 };
60
61 /**
62 * Mount a cowfs FUSE filesystem.
63 *
64 * @param master read only master file system directory
65 * @param host copy on write host directory
66 * @param mount mountpoint where union is mounted
67 * @return instance, or NULL if FUSE initialization failed
68 */
69 cowfs_t *cowfs_create(char *master, char *host, char *mount);
70
71 #endif /* COWFS_H */
72