netatalk 4.5.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
include/atalk/volume.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 1990,1994 Regents of The University of Michigan.
3 * All Rights Reserved. See COPYRIGHT.
4 */
5
6#ifndef ATALK_VOLUME_H
7#define ATALK_VOLUME_H 1
8
9#include <stdint.h>
10#include <sys/types.h>
11
12#include <atalk/cnid.h>
13#include <atalk/globals.h>
14#include <atalk/hash.h>
15#include <atalk/unicode.h>
16#include <atalk/vfs.h>
17
18#define AFPVOL_U8MNAMELEN 255
19#define AFPVOL_MACNAMELEN 27
20
21 typedef uint64_t VolSpace;
22
23/* Forward declaration — full definition in atalk/spotlight.h */
24 struct sl_backend_ops;
25
26/* This should belong in a file.h */
27 struct extmap {
28 char *em_ext;
29 char em_creator[4];
30 char em_type[4];
31};
32
33 struct vol {
34 struct vol *v_next;
35 AFPObj *v_obj;
36 uint16_t v_vid;
37 int v_flags;
38 char *v_path;
39 struct dir *v_root;
40 time_t v_mtime;
41
42 charset_t v_volcharset;
43 charset_t v_maccharset;
44 uint16_t v_mtou_flags;
45 uint16_t v_utom_flags;
46 /* FIXME: should be a u_int32_t ? */
47 long v_kTextEncoding;
48 size_t max_filename;
49 char *v_veto;
50 int v_adouble;
51 int v_ad_options;
52 const char *(*ad_path)(const char *, int);
53 struct _cnid_db *v_cdb;
54 char v_stamp[ADEDLEN_PRIVSYN];
55 VolSpace v_limitsize;
56 mode_t v_umask;
57 mode_t v_dperm;
59 mode_t v_fperm;
61 ucs2_t *v_u8mname;
62 ucs2_t *v_macname;
63 ucs2_t *v_name;
64
65 /* get/set volparams */
66 time_t v_ctime;
67 dev_t v_dev;
68
69 /* adouble VFS indirection */
70 struct vfs_ops *vfs;
71 const struct vfs_ops *vfs_modules[4];
72 int v_vfs_ea;
73
74 /* misc */
75 char *v_gvs;
76 void *v_nfsclient;
77 int v_nfs;
78 VolSpace v_tm_used;
79 time_t v_tm_cachetime;
81 VolSpace v_appended;
82
83 /* only when opening/closing volumes or in error */
84 int v_casefold;
85 char *v_configname;
86 char *v_localname;
88 char *v_volcodepage;
89 char *v_maccodepage;
90 char *v_password;
91 char *v_cnidscheme;
92 char *v_dbpath;
93 char *v_cnidserver;
94 char *v_cnidport;
95 char *v_legacyicon;
96 unsigned char *v_icon_rfork;
97 size_t v_icon_rfork_len;
98#if 0
99 int v_hide; /* new volume wait until old volume is closed */
100 int v_new; /* volume deleted but there's a new one
101 * with the same name */
102#endif
103 int v_deleted;
104 char *v_sl_backend_name;
105 const struct sl_backend_ops *v_sl_backend;
106#if 0
107 char *v_root_preexec;
108#endif
109 char *v_preexec;
110#if 0
111 char *v_root_postexec;
112#endif
113 char *v_postexec;
114#if 0
115 int v_root_preexec_close;
116#endif
117 int v_preexec_close;
118 char *v_uuid;
119 int v_qfd;
120 uint32_t v_ignattr;
121};
122
124 typedef enum {
125 LV_DEFAULT = 0,
126 LV_ALL = 1,
127 LV_FORCE = 2
128} lv_flags_t;
129
130/* volume flags */
131#define AFPVOL_OPEN (1<<0)
132
133/* flags for quota 0xxx0 */
134#define AFPVOL_GVSMASK (7<<2)
135#define AFPVOL_NONE (0<<2)
136#if 0
137/* Previously used for Andrew File System */
138#define AFPVOL_AFSGVS (1<<2)
139#endif
140#define AFPVOL_USTATFS (1<<3)
141#define AFPVOL_UQUOTA (1<<4)
142
143#define AFPVOL_NOV2TOEACONV (1 << 5)
144#define AFPVOL_SPOTLIGHT (1 << 6)
145#define AFPVOL_EA_SAMBA (1 << 7)
146#define AFPVOL_RO (1 << 8)
147#define AFPVOL_CHMOD_PRESERVE_ACL (1 << 9)
148#define AFPVOL_CHMOD_IGNORE (1 << 10)
149#define AFPVOL_FORCE_STICKY_XATTR (1 << 11)
150#define AFPVOL_LIMITSIZE (1 << 12)
151#define AFPVOL_A2VOL (1 << 13)
152#define AFPVOL_NOSTAT (1 << 16)
154#define AFPVOL_UNIX_PRIV (1 << 17)
155#define AFPVOL_NODEV (1 << 18)
159#define AFPVOL_EILSEQ (1 << 20)
161#define AFPVOL_INV_DOTS (1 << 22)
162#define AFPVOL_TM (1 << 23)
163#define AFPVOL_ACLS (1 << 24)
164#define AFPVOL_SEARCHDB (1 << 25)
165#define AFPVOL_NONETIDS (1 << 26)
166#define AFPVOL_FOLLOWSYM (1 << 27)
167#define AFPVOL_DELVETO (1 << 28)
168
169/* Extended Attributes vfs indirection */
170#define AFPVOL_EA_NONE 0
171#define AFPVOL_EA_AUTO 1
172#define AFPVOL_EA_SYS 2
173#define AFPVOL_EA_AD 3
174
175/* FPGetSrvrParms options */
176#define AFPSRVR_CONFIGINFO (1 << 0)
177#define AFPSRVR_PASSWD (1 << 7)
178
179/* handle casefolding */
180#define AFPVOL_MTOUUPPER (1 << 0)
181#define AFPVOL_MTOULOWER (1 << 1)
182#define AFPVOL_UTOMUPPER (1 << 2)
183#define AFPVOL_UTOMLOWER (1 << 3)
184#define AFPVOL_UMLOWER (AFPVOL_MTOULOWER | AFPVOL_UTOMLOWER)
185#define AFPVOL_UMUPPER (AFPVOL_MTOUUPPER | AFPVOL_UTOMUPPER)
186#define AFPVOL_UUPPERMLOWER (AFPVOL_MTOUUPPER | AFPVOL_UTOMLOWER)
187#define AFPVOL_ULOWERMUPPER (AFPVOL_MTOULOWER | AFPVOL_UTOMUPPER)
188#define AFPVOL_CASESENS (1 << 4)
189
190#define AFPVOLSIG_FLAT 0x0001
191#define AFPVOLSIG_FIX 0x0002
192#define AFPVOLSIG_VAR 0x0003
193#define AFPVOLSIG_DEFAULT AFPVOLSIG_FIX
194
195/* volume attributes */
196#define VOLPBIT_ATTR_RO (1 << 0)
197#define VOLPBIT_ATTR_PASSWD (1 << 1)
198#define VOLPBIT_ATTR_FILEID (1 << 2)
199#define VOLPBIT_ATTR_CATSEARCH (1 << 3)
200#define VOLPBIT_ATTR_BLANKACCESS (1 << 4)
201#define VOLPBIT_ATTR_UNIXPRIV (1 << 5)
202#define VOLPBIT_ATTR_UTF8 (1 << 6)
203#define VOLPBIT_ATTR_NONETIDS (1 << 7)
204#define VOLPBIT_ATTR_PRIVPARENT (1 << 8)
205#define VOLPBIT_ATTR_NOTFILEXCHG (1 << 9)
206#define VOLPBIT_ATTR_EXT_ATTRS (1 << 10)
207#define VOLPBIT_ATTR_ACLS (1 << 11)
208#define VOLPBIT_ATTR_CASESENS (1 << 12)
209#define VOLPBIT_ATTR_TM (1 << 13)
210
211#define VOLPBIT_ATTR 0
212#define VOLPBIT_SIG 1
213#define VOLPBIT_CDATE 2
214#define VOLPBIT_MDATE 3
215#define VOLPBIT_BDATE 4
216#define VOLPBIT_VID 5
217#define VOLPBIT_BFREE 6
218#define VOLPBIT_BTOTAL 7
219#define VOLPBIT_NAME 8
220/* handle > 4GB volumes */
221#define VOLPBIT_XBFREE 9
222#define VOLPBIT_XBTOTAL 10
223#define VOLPBIT_BSIZE 11
224
225#define utf8_encoding(obj) ((obj)->afp_version >= 30)
226
227#define vol_nodev(vol) (((vol)->v_flags & AFPVOL_NODEV) ? 1 : 0)
228#define vol_unix_priv(vol) ((vol)->v_obj->afp_version >= 30 && ((vol)->v_flags & AFPVOL_UNIX_PRIV))
229#define vol_inv_dots(vol) (((vol)->v_flags & AFPVOL_INV_DOTS) ? 1 : 0)
230#define vol_syml_opt(vol) (((vol)->v_flags & AFPVOL_FOLLOWSYM) ? 0 : O_NOFOLLOW)
231#define vol_chmod_opt(vol) (((vol)->v_flags & AFPVOL_CHMOD_PRESERVE_ACL) ? O_NETATALK_ACL : \
232 ((vol)->v_flags & AFPVOL_CHMOD_IGNORE) ? O_IGNORE : 0)
233
234#endif
ADEDLEN_PRIVSYN
#define ADEDLEN_PRIVSYN
Definition adouble.h:112
cnid.h
globals.h
hash.h
lv_flags_t
lv_flags_t
Definition include/atalk/volume.h:124
LV_DEFAULT
@ LV_DEFAULT
Definition include/atalk/volume.h:125
LV_ALL
@ LV_ALL
Definition include/atalk/volume.h:126
LV_FORCE
@ LV_FORCE
Definition include/atalk/volume.h:127
VolSpace
uint64_t VolSpace
Definition include/atalk/volume.h:21
AFPObj
Definition globals.h:166
_cnid_db
Definition cnid.h:65
dir
Definition include/atalk/directory.h:56
extmap
Definition include/atalk/volume.h:27
extmap::em_ext
char * em_ext
Definition include/atalk/volume.h:28
extmap::em_type
char em_type[4]
Definition include/atalk/volume.h:30
extmap::em_creator
char em_creator[4]
Definition include/atalk/volume.h:29
sl_backend_ops
Definition spotlight.h:118
vfs_ops
Definition vfs.h:98
vol
Definition include/atalk/volume.h:33
vol::v_sl_backend
const struct sl_backend_ops * v_sl_backend
Definition include/atalk/volume.h:105
vol::v_postexec
char * v_postexec
Definition include/atalk/volume.h:113
vol::v_nfsclient
void * v_nfsclient
Definition include/atalk/volume.h:76
vol::v_volcodepage
char * v_volcodepage
Definition include/atalk/volume.h:88
vol::v_name
ucs2_t * v_name
Definition include/atalk/volume.h:63
vol::v_password
char * v_password
Definition include/atalk/volume.h:90
vol::v_dev
dev_t v_dev
Definition include/atalk/volume.h:67
vol::v_utom_flags
uint16_t v_utom_flags
Definition include/atalk/volume.h:45
vol::v_root
struct dir * v_root
Definition include/atalk/volume.h:39
vol::v_u8mname
ucs2_t * v_u8mname
Definition include/atalk/volume.h:61
vol::v_vid
uint16_t v_vid
Definition include/atalk/volume.h:36
vol::v_tm_cachetime
time_t v_tm_cachetime
Definition include/atalk/volume.h:79
vol::v_flags
int v_flags
Definition include/atalk/volume.h:37
vol::v_ad_options
int v_ad_options
Definition include/atalk/volume.h:51
vol::v_adouble
int v_adouble
Definition include/atalk/volume.h:50
vol::v_obj
AFPObj * v_obj
Definition include/atalk/volume.h:35
vol::v_path
char * v_path
Definition include/atalk/volume.h:38
vol::v_veto
char * v_veto
Definition include/atalk/volume.h:49
vol::v_volcharset
charset_t v_volcharset
Definition include/atalk/volume.h:42
vol::v_cnidport
char * v_cnidport
Definition include/atalk/volume.h:94
vol::v_appended
VolSpace v_appended
Definition include/atalk/volume.h:81
vol::v_limitsize
VolSpace v_limitsize
Definition include/atalk/volume.h:55
vol::v_preexec_close
int v_preexec_close
Definition include/atalk/volume.h:117
vol::v_cnidserver
char * v_cnidserver
Definition include/atalk/volume.h:93
vol::v_dperm
mode_t v_dperm
Definition include/atalk/volume.h:57
vol::v_legacyicon
char * v_legacyicon
Definition include/atalk/volume.h:95
vol::vfs
struct vfs_ops * vfs
Definition include/atalk/volume.h:70
vol::v_icon_rfork_len
size_t v_icon_rfork_len
Definition include/atalk/volume.h:97
vol::v_maccodepage
char * v_maccodepage
Definition include/atalk/volume.h:89
vol::v_nfs
int v_nfs
Definition include/atalk/volume.h:77
vol::v_icon_rfork
unsigned char * v_icon_rfork
Definition include/atalk/volume.h:96
vol::vfs_modules
const struct vfs_ops * vfs_modules[4]
Definition include/atalk/volume.h:71
vol::v_localname
char * v_localname
Definition include/atalk/volume.h:86
vol::v_configname
char * v_configname
Definition include/atalk/volume.h:85
vol::v_macname
ucs2_t * v_macname
Definition include/atalk/volume.h:62
vol::v_fperm
mode_t v_fperm
Definition include/atalk/volume.h:59
vol::v_sl_backend_name
char * v_sl_backend_name
Definition include/atalk/volume.h:104
vol::v_maccharset
charset_t v_maccharset
Definition include/atalk/volume.h:43
vol::v_mtou_flags
uint16_t v_mtou_flags
Definition include/atalk/volume.h:44
vol::max_filename
size_t max_filename
Definition include/atalk/volume.h:48
vol::v_kTextEncoding
long v_kTextEncoding
Definition include/atalk/volume.h:47
vol::v_umask
mode_t v_umask
Definition include/atalk/volume.h:56
vol::v_tm_used
VolSpace v_tm_used
Definition include/atalk/volume.h:78
vol::v_preexec
char * v_preexec
Definition include/atalk/volume.h:109
vol::v_gvs
char * v_gvs
Definition include/atalk/volume.h:75
vol::v_cnidscheme
char * v_cnidscheme
Definition include/atalk/volume.h:91
vol::v_mtime
time_t v_mtime
Definition include/atalk/volume.h:40
vol::v_ctime
time_t v_ctime
Definition include/atalk/volume.h:66
vol::v_next
struct vol * v_next
Definition include/atalk/volume.h:34
vol::v_deleted
int v_deleted
Definition include/atalk/volume.h:103
vol::v_vfs_ea
int v_vfs_ea
Definition include/atalk/volume.h:72
vol::v_dbpath
char * v_dbpath
Definition include/atalk/volume.h:92
vol::v_uuid
char * v_uuid
Definition include/atalk/volume.h:118
vol::v_cdb
struct _cnid_db * v_cdb
Definition include/atalk/volume.h:53
vol::v_ignattr
uint32_t v_ignattr
Definition include/atalk/volume.h:120
vol::v_qfd
int v_qfd
Definition include/atalk/volume.h:119
vol::v_casefold
int v_casefold
Definition include/atalk/volume.h:84
vol::v_stamp
char v_stamp[ADEDLEN_PRIVSYN]
Definition include/atalk/volume.h:54
unicode.h
ucs2_t
#define ucs2_t
Definition unicode.h:8
charset_t
charset_t
Definition unicode.h:57
vfs.h