xref: /illumos-gate/usr/src/lib/lib9p/common/backend/backend.h (revision 6dde88b51419b99fe0aab8e56184c693945826b8)
1 /*
2  * Copyright 2016 Jakub Klama <jceel@FreeBSD.org>
3  * All rights reserved
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted providing that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
18  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
22  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
23  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24  * POSSIBILITY OF SUCH DAMAGE.
25  *
26  */
27 
28 
29 #ifndef LIB9P_BACKEND_H
30 #define LIB9P_BACKEND_H
31 
32 struct l9p_backend {
33 	void *softc;
34 	void (*freefid)(void *, struct l9p_fid *);
35 	int (*attach)(void *, struct l9p_request *);
36 	int (*clunk)(void *, struct l9p_fid *);
37 	int (*create)(void *, struct l9p_request *);
38 	int (*open)(void *, struct l9p_request *);
39 	int (*read)(void *, struct l9p_request *);
40 	int (*remove)(void *, struct l9p_fid *);
41 	int (*stat)(void *, struct l9p_request *);
42 	int (*walk)(void *, struct l9p_request *);
43 	int (*write)(void *, struct l9p_request *);
44 	int (*wstat)(void *, struct l9p_request *);
45 	int (*statfs)(void *, struct l9p_request *);
46 	int (*lopen)(void *, struct l9p_request *);
47 	int (*lcreate)(void *, struct l9p_request *);
48 	int (*symlink)(void *, struct l9p_request *);
49 	int (*mknod)(void *, struct l9p_request *);
50 	int (*rename)(void *, struct l9p_request *);
51 	int (*readlink)(void *, struct l9p_request *);
52 	int (*getattr)(void *, struct l9p_request *);
53 	int (*setattr)(void *, struct l9p_request *);
54 	int (*xattrwalk)(void *, struct l9p_request *);
55 	int (*xattrcreate)(void *, struct l9p_request *);
56 	int (*xattrread)(void *, struct l9p_request *);
57 	int (*xattrwrite)(void *, struct l9p_request *);
58 	int (*xattrclunk)(void *, struct l9p_fid *);
59 	int (*readdir)(void *, struct l9p_request *);
60 	int (*fsync)(void *, struct l9p_request *);
61 	int (*lock)(void *, struct l9p_request *);
62 	int (*getlock)(void *, struct l9p_request *);
63 	int (*link)(void *, struct l9p_request *);
64 	int (*mkdir)(void *, struct l9p_request *);
65 	int (*renameat)(void *, struct l9p_request *);
66 	int (*unlinkat)(void *, struct l9p_request *);
67 };
68 
69 #endif  /* LIB9P_BACKEND_H */
70