perfused.h revision 1.6 1 1.6 manu /* $NetBSD: perfused.h,v 1.6 2011/12/28 17:33:53 manu Exp $ */
2 1.1 manu
3 1.1 manu /*-
4 1.1 manu * Copyright (c) 2010 Emmanuel Dreyfus. All rights reserved.
5 1.1 manu *
6 1.1 manu * Redistribution and use in source and binary forms, with or without
7 1.1 manu * modification, are permitted provided that the following conditions
8 1.1 manu * are met:
9 1.1 manu * 1. Redistributions of source code must retain the above copyright
10 1.1 manu * notice, this list of conditions and the following disclaimer.
11 1.1 manu * 2. Redistributions in binary form must reproduce the above copyright
12 1.1 manu * notice, this list of conditions and the following disclaimer in the
13 1.1 manu * documentation and/or other materials provided with the distribution.
14 1.1 manu *
15 1.1 manu * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
16 1.1 manu * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17 1.1 manu * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18 1.1 manu * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
19 1.1 manu * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 1.1 manu * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 1.1 manu * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 1.1 manu * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 1.1 manu * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 1.1 manu * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 1.1 manu * POSSIBILITY OF SUCH DAMAGE.
26 1.1 manu */
27 1.1 manu
28 1.1 manu #ifndef _PERFUSED_H_
29 1.1 manu #define _PERFUSED_H_
30 1.1 manu
31 1.1 manu #include <puffs.h>
32 1.1 manu #include "../../lib/libperfuse/perfuse_if.h"
33 1.1 manu #include "fuse.h"
34 1.1 manu
35 1.1 manu #define PERFUSE_MSG_T struct puffs_framebuf
36 1.1 manu
37 1.6 manu #define _PATH_VAR_RUN_PERFUSE_TRACE "/var/run/perfuse.trace"
38 1.6 manu
39 1.1 manu __BEGIN_DECLS
40 1.1 manu
41 1.1 manu #ifdef PERFUSE_DEBUG
42 1.5 joerg void perfuse_hexdump(const char *, size_t);
43 1.1 manu const char *perfuse_opname(int);
44 1.1 manu extern int perfuse_diagflags;
45 1.1 manu #endif /* PERFUSE_DEBUG */
46 1.1 manu
47 1.1 manu int perfuse_open_sock(void);
48 1.3 manu void *perfuse_recv_early(int, struct sockcred *, size_t);
49 1.1 manu int perfuse_readframe(struct puffs_usermount *,
50 1.1 manu struct puffs_framebuf *, int, int *);
51 1.1 manu int perfuse_writeframe(struct puffs_usermount *,
52 1.1 manu struct puffs_framebuf *, int, int *);
53 1.1 manu int perfuse_cmpframe(struct puffs_usermount *,
54 1.1 manu struct puffs_framebuf *, struct puffs_framebuf *, int *);
55 1.1 manu void perfuse_gotframe(struct puffs_usermount *, struct puffs_framebuf *);
56 1.5 joerg void perfuse_fdnotify(struct puffs_usermount *, int, int) __dead;
57 1.1 manu
58 1.1 manu struct fuse_out_header *perfuse_get_outhdr(perfuse_msg_t *);
59 1.1 manu struct fuse_in_header *perfuse_get_inhdr(perfuse_msg_t *);
60 1.1 manu char *perfuse_get_inpayload(perfuse_msg_t *);
61 1.1 manu char *perfuse_get_outpayload(perfuse_msg_t *);
62 1.4 manu void perfuse_umount(struct puffs_usermount *);
63 1.1 manu
64 1.1 manu perfuse_msg_t *perfuse_new_pb(struct puffs_usermount *,
65 1.1 manu puffs_cookie_t, int, size_t, const struct puffs_cred *);
66 1.1 manu int perfuse_xchg_pb(struct puffs_usermount *, perfuse_msg_t *, size_t,
67 1.1 manu enum perfuse_xchg_pb_reply);
68 1.1 manu
69 1.1 manu __END_DECLS
70 1.1 manu
71 1.1 manu #endif /* _PERFUSED_H_ */
72