]> arthur.barton.de Git - netatalk.git/blob - include/atalk/vfs.h
Extended Attributes support via files in .AppleDouble.
[netatalk.git] / include / atalk / vfs.h
1 /*
2    Copyright (c) 2004 Didier Gautheron
3  
4    This program is free software; you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation; either version 2 of the License, or
7    (at your option) any later version.
8  
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13  
14    You should have received a copy of the GNU General Public License
15    along with this program; if not, write to the Free Software
16    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18    vfs layer for afp
19 */
20
21 #ifndef ATALK_VFS_H
22 #define ATALK_VFS_H
23
24 #ifdef HAVE_CONFIG_H
25 #include "config.h"
26 #endif /* HAVE_CONFIG_H */
27
28 #ifdef HAVE_NFSv4_ACLS
29 #include <sys/acl.h>
30 #endif
31
32 #include <atalk/adouble.h>
33 #include <atalk/volume.h>
34
35 struct vfs_ops {
36     /* low level adouble fn */
37     char *(*ad_path)(const char *, int);
38
39     /* */
40     int (*validupath)(const struct vol *, const char *);
41     int (*rf_chown)(const struct vol *, const char *path, uid_t owner, gid_t group);
42     int (*rf_renamedir)(const struct vol *, const char *oldpath, const char *newpath);
43     int (*rf_deletecurdir)(const struct vol *);
44     int (*rf_setfilmode)(const struct vol *, const char * name, mode_t mode, struct stat *st);
45     int (*rf_setdirmode)(const struct vol *, const char * name, mode_t mode, struct stat *st);
46     int (*rf_setdirunixmode)(const struct vol *, const char * name, mode_t mode, struct stat *st);
47
48     int (*rf_setdirowner)(const struct vol *, const char *path, uid_t owner, gid_t group);
49
50     int (*rf_deletefile)(const struct vol *, const char * );
51     int (*rf_renamefile)(const struct vol *, const char *oldpath, const char *newpath);
52 #ifdef HAVE_NFSv4_ACLS
53     int (*rf_acl)(const struct vol *, const char *path, int cmd, int count, ace_t *aces);
54     int (*rf_remove_acl)(const struct vol *, const char *path, int dir);
55 #endif
56
57     /* Extended Attributes */
58     int (*get_easize)(const struct vol * restrict, char * restrict rbuf, int * restrict rbuflen, const char * restrict uname, int oflag, const char * restrict attruname);
59     int (*get_eacontent)(const struct vol * restrict , char * restrict rbuf, int * restrict rbuflen, const char * restrict uname, int oflag, const char * restrict attruname, int maxreply);
60     int (*list_eas)(const struct vol * restrict , char * restrict attrnamebuf, int * restrict buflen, const char * restrict uname, int oflag);
61     int (*set_ea)(const struct vol * restrict , const char * restrict uname, const char * restrict attruname, const char * restrict ibuf, size_t attrsize, int oflag);
62     int (*remove_ea)(const struct vol * restrict , const char * restrict uname, const char * restrict attruname, int oflag);
63 };
64
65 extern void initvol_vfs(struct vol * restrict vol);
66
67 /* VFS inderected funcs ... : */
68 /* ...default adouble EAs */
69 extern int get_easize(const struct vol * restrict vol, char * restrict rbuf, int * restrict rbuflen, const char * restrict uname, int oflag, const char * restrict attruname);
70 extern int get_eacontent(const struct vol * restrict vol, char * restrict rbuf, int * restrict rbuflen, const char * restrict uname, int oflag, const char * restrict attruname, int maxreply);
71 extern int list_eas(const struct vol * restrict vol, char * restrict attrnamebuf, int * restrict buflen, const char * restrict uname, int oflag);
72 extern int set_ea(const struct vol * restrict vol, const char * restrict uname, const char * restrict attruname, const char * restrict ibuf, size_t attrsize, int oflag);
73 extern int remove_ea(const struct vol * restrict vol, const char * restrict uname, const char * restrict attruname, int oflag);
74
75 /* ... Solaris native EAs */
76 #ifdef HAVE_SOLARIS_EAS
77 extern int sol_get_easize(const struct vol * restrict vol, char * restrict rbuf, int * restrict rbuflen, const char * restrict uname, int oflag, const char * restrict attruname);
78 extern int sol_get_eacontent(const struct vol * restrict vol, char * restrict rbuf, int * restrict rbuflen, const char * restrict uname, int oflag, char * restrict attruname, int maxreply);
79 extern int sol_list_eas(const struct vol * restrict vol, char * restrict attrnamebuf, int * restrict buflen, const char * restrict uname, int oflag);
80 extern int sol_set_ea(const struct vol * restrict vol, const char * restrict uname, const char * restrict attruname, const char * restrict ibuf,size_t attrsize, int oflag);
81 extern int sol_remove_ea(const struct vol * restrict vol, const char * restrict uname, const char * restrict attruname, int oflag);
82 #endif /* HAVE_SOLARIS_EAS */
83
84 /* Solaris NFSv4 ACL stuff */
85 #ifdef HAVE_NFSv4_ACLS
86 extern int get_nfsv4_acl(const char *name, ace_t **retAces);
87 extern int remove_acl(const char *name);
88 #endif /* HAVE_NFSv4_ACLS */
89
90 #endif /* ATALK_VFS_H */