2012-01-29 10:22:01 +04:00
|
|
|
/* $NetBSD: perfused.h,v 1.7 2012/01/29 06:22:02 manu Exp $ */
|
2010-08-25 11:18:01 +04:00
|
|
|
|
|
|
|
/*-
|
|
|
|
* Copyright (c) 2010 Emmanuel Dreyfus. All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
|
|
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
|
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _PERFUSED_H_
|
|
|
|
#define _PERFUSED_H_
|
|
|
|
|
|
|
|
#include <puffs.h>
|
|
|
|
#include "../../lib/libperfuse/perfuse_if.h"
|
|
|
|
#include "fuse.h"
|
|
|
|
|
|
|
|
#define PERFUSE_MSG_T struct puffs_framebuf
|
|
|
|
|
2012-01-29 10:22:01 +04:00
|
|
|
#define _PATH_VAR_RUN_PERFUSE_TRACE "/var/run/perfuse%s.trace"
|
2011-12-28 21:33:52 +04:00
|
|
|
|
2010-08-25 11:18:01 +04:00
|
|
|
__BEGIN_DECLS
|
|
|
|
|
|
|
|
#ifdef PERFUSE_DEBUG
|
2011-08-31 00:17:00 +04:00
|
|
|
void perfuse_hexdump(const char *, size_t);
|
2010-08-25 11:18:01 +04:00
|
|
|
const char *perfuse_opname(int);
|
|
|
|
extern int perfuse_diagflags;
|
|
|
|
#endif /* PERFUSE_DEBUG */
|
|
|
|
|
|
|
|
int perfuse_open_sock(void);
|
2010-09-15 05:51:43 +04:00
|
|
|
void *perfuse_recv_early(int, struct sockcred *, size_t);
|
2010-08-25 11:18:01 +04:00
|
|
|
int perfuse_readframe(struct puffs_usermount *,
|
|
|
|
struct puffs_framebuf *, int, int *);
|
|
|
|
int perfuse_writeframe(struct puffs_usermount *,
|
|
|
|
struct puffs_framebuf *, int, int *);
|
|
|
|
int perfuse_cmpframe(struct puffs_usermount *,
|
|
|
|
struct puffs_framebuf *, struct puffs_framebuf *, int *);
|
|
|
|
void perfuse_gotframe(struct puffs_usermount *, struct puffs_framebuf *);
|
2011-08-31 00:17:00 +04:00
|
|
|
void perfuse_fdnotify(struct puffs_usermount *, int, int) __dead;
|
2010-08-25 11:18:01 +04:00
|
|
|
|
|
|
|
struct fuse_out_header *perfuse_get_outhdr(perfuse_msg_t *);
|
|
|
|
struct fuse_in_header *perfuse_get_inhdr(perfuse_msg_t *);
|
|
|
|
char *perfuse_get_inpayload(perfuse_msg_t *);
|
|
|
|
char *perfuse_get_outpayload(perfuse_msg_t *);
|
2011-05-30 18:50:08 +04:00
|
|
|
void perfuse_umount(struct puffs_usermount *);
|
2010-08-25 11:18:01 +04:00
|
|
|
|
|
|
|
perfuse_msg_t *perfuse_new_pb(struct puffs_usermount *,
|
|
|
|
puffs_cookie_t, int, size_t, const struct puffs_cred *);
|
|
|
|
int perfuse_xchg_pb(struct puffs_usermount *, perfuse_msg_t *, size_t,
|
|
|
|
enum perfuse_xchg_pb_reply);
|
|
|
|
|
|
|
|
__END_DECLS
|
|
|
|
|
|
|
|
#endif /* _PERFUSED_H_ */
|