Subversion Repositories shark

Rev

Rev 422 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
422 giacomo 1
/*
2
 *  include/linux/nfs4.h
3
 *
4
 *  NFSv4 protocol definitions.
5
 *
6
 *  Copyright (c) 2002 The Regents of the University of Michigan.
7
 *  All rights reserved.
8
 *
9
 *  Kendrick Smith <kmsmith@umich.edu>
10
 *  Andy Adamson   <andros@umich.edu>
11
 */
12
 
13
#ifndef _LINUX_NFS4_H
14
#define _LINUX_NFS4_H
15
 
16
#define NFS4_VERIFIER_SIZE      8
17
#define NFS4_FHSIZE             128
18
#define NFS4_MAXNAMLEN          NAME_MAX
19
 
20
#define NFS4_ACCESS_READ        0x0001
21
#define NFS4_ACCESS_LOOKUP      0x0002
22
#define NFS4_ACCESS_MODIFY      0x0004
23
#define NFS4_ACCESS_EXTEND      0x0008
24
#define NFS4_ACCESS_DELETE      0x0010
25
#define NFS4_ACCESS_EXECUTE     0x0020
26
 
27
#define NFS4_FH_PERISTENT               0x0000
28
#define NFS4_FH_NOEXPIRE_WITH_OPEN      0x0001
29
#define NFS4_FH_VOLATILE_ANY            0x0002
30
#define NFS4_FH_VOL_MIGRATION           0x0004
31
#define NFS4_FH_VOL_RENAME              0x0008
32
 
33
#define NFS4_OPEN_RESULT_CONFIRM 0x0002
34
 
35
#define NFS4_SHARE_ACCESS_READ  0x0001
36
#define NFS4_SHARE_ACCESS_WRITE 0x0002
37
#define NFS4_SHARE_ACCESS_BOTH  0x0003
38
#define NFS4_SHARE_DENY_READ    0x0001
39
#define NFS4_SHARE_DENY_WRITE   0x0002
40
 
41
#define NFS4_SET_TO_SERVER_TIME 0
42
#define NFS4_SET_TO_CLIENT_TIME 1
43
 
44
#define NFS4_ACE_ACCESS_ALLOWED_ACE_TYPE 0
45
#define NFS4_ACE_ACCESS_DENIED_ACE_TYPE  1
46
#define NFS4_ACE_SYSTEM_AUDIT_ACE_TYPE   2
47
#define NFS4_ACE_SYSTEM_ALARM_ACE_TYPE   3
48
 
49
typedef struct { char data[NFS4_VERIFIER_SIZE]; } nfs4_verifier;
50
typedef struct { char data[16]; } nfs4_stateid;
51
 
52
enum nfs_opnum4 {
53
        OP_ACCESS = 3,
54
        OP_CLOSE = 4,
55
        OP_COMMIT = 5,
56
        OP_CREATE = 6,
57
        OP_DELEGPURGE = 7,
58
        OP_DELEGRETURN = 8,
59
        OP_GETATTR = 9,
60
        OP_GETFH = 10,
61
        OP_LINK = 11,
62
        OP_LOCK = 12,
63
        OP_LOCKT = 13,
64
        OP_LOCKU = 14,
65
        OP_LOOKUP = 15,
66
        OP_LOOKUPP = 16,
67
        OP_NVERIFY = 17,
68
        OP_OPEN = 18,
69
        OP_OPENATTR = 19,
70
        OP_OPEN_CONFIRM = 20,
71
        OP_OPEN_DOWNGRADE = 21,
72
        OP_PUTFH = 22,
73
        OP_PUTPUBFH = 23,
74
        OP_PUTROOTFH = 24,
75
        OP_READ = 25,
76
        OP_READDIR = 26,
77
        OP_READLINK = 27,
78
        OP_REMOVE = 28,
79
        OP_RENAME = 29,
80
        OP_RENEW = 30,
81
        OP_RESTOREFH = 31,
82
        OP_SAVEFH = 32,
83
        OP_SECINFO = 33,
84
        OP_SETATTR = 34,
85
        OP_SETCLIENTID = 35,
86
        OP_SETCLIENTID_CONFIRM = 36,
87
        OP_VERIFY = 37,
88
        OP_WRITE = 38,
89
};
90
 
91
/*
92
 * Note: NF4BAD is not actually part of the protocol; it is just used
93
 * internally by nfsd.
94
 */
95
enum nfs_ftype4 {
96
        NF4BAD          = 0,
97
        NF4REG          = 1,    /* Regular File */
98
        NF4DIR          = 2,    /* Directory */
99
        NF4BLK          = 3,    /* Special File - block device */
100
        NF4CHR          = 4,    /* Special File - character device */
101
        NF4LNK          = 5,    /* Symbolic Link */
102
        NF4SOCK         = 6,    /* Special File - socket */
103
        NF4FIFO         = 7,    /* Special File - fifo */
104
        NF4ATTRDIR      = 8,    /* Attribute Directory */
105
        NF4NAMEDATTR    = 9     /* Named Attribute */
106
};
107
 
108
enum open_claim_type4 {
109
        NFS4_OPEN_CLAIM_NULL = 0,
110
        NFS4_OPEN_CLAIM_PREVIOUS = 1,
111
        NFS4_OPEN_CLAIM_DELEGATE_CUR = 2,
112
        NFS4_OPEN_CLAIM_DELEGATE_PREV = 3
113
};
114
 
115
enum opentype4 {
116
        NFS4_OPEN_NOCREATE = 0,
117
        NFS4_OPEN_CREATE = 1
118
};
119
 
120
enum createmode4 {
121
        NFS4_CREATE_UNCHECKED = 0,
122
        NFS4_CREATE_GUARDED = 1,
123
        NFS4_CREATE_EXCLUSIVE = 2
124
};
125
 
126
enum limit_by4 {
127
        NFS4_LIMIT_SIZE = 1,
128
        NFS4_LIMIT_BLOCKS = 2
129
};
130
 
131
enum open_delegation_type4 {
132
        NFS4_OPEN_DELEGATE_NONE = 0,
133
        NFS4_OPEN_DELEGATE_READ = 1,
134
        NFS4_OPEN_DELEGATE_WRITE = 2
135
};
136
 
137
enum lock_type4 {
138
        NFS4_UNLOCK_LT = 0,
139
        NFS4_READ_LT = 1,
140
        NFS4_WRITE_LT = 2,
141
        NFS4_READW_LT = 3,
142
        NFS4_WRITEW_LT = 4
143
};
144
 
145
 
146
/* Mandatory Attributes */
147
#define FATTR4_WORD0_SUPPORTED_ATTRS    (1)
148
#define FATTR4_WORD0_TYPE               (1 << 1)
149
#define FATTR4_WORD0_FH_EXPIRE_TYPE     (1 << 2)
150
#define FATTR4_WORD0_CHANGE             (1 << 3)
151
#define FATTR4_WORD0_SIZE               (1 << 4)
152
#define FATTR4_WORD0_LINK_SUPPORT       (1 << 5)
153
#define FATTR4_WORD0_SYMLINK_SUPPORT    (1 << 6)
154
#define FATTR4_WORD0_NAMED_ATTR         (1 << 7)
155
#define FATTR4_WORD0_FSID               (1 << 8)
156
#define FATTR4_WORD0_UNIQUE_HANDLES     (1 << 9)
157
#define FATTR4_WORD0_LEASE_TIME         (1 << 10)
158
#define FATTR4_WORD0_RDATTR_ERROR       (1 << 11)
159
 
160
/* Recommended Attributes */
161
#define FATTR4_WORD0_ACL                (1 << 12)
162
#define FATTR4_WORD0_ACLSUPPORT         (1 << 13)
163
#define FATTR4_WORD0_ARCHIVE            (1 << 14)
164
#define FATTR4_WORD0_CANSETTIME         (1 << 15)
165
#define FATTR4_WORD0_CASE_INSENSITIVE   (1 << 16)
166
#define FATTR4_WORD0_CASE_PRESERVING    (1 << 17)
167
#define FATTR4_WORD0_CHOWN_RESTRICTED   (1 << 18)
168
#define FATTR4_WORD0_FILEHANDLE         (1 << 19)
169
#define FATTR4_WORD0_FILEID             (1 << 20)
170
#define FATTR4_WORD0_FILES_AVAIL        (1 << 21)
171
#define FATTR4_WORD0_FILES_FREE         (1 << 22)
172
#define FATTR4_WORD0_FILES_TOTAL        (1 << 23)
173
#define FATTR4_WORD0_FS_LOCATIONS       (1 << 24)
174
#define FATTR4_WORD0_HIDDEN             (1 << 25)
175
#define FATTR4_WORD0_HOMOGENEOUS        (1 << 26)
176
#define FATTR4_WORD0_MAXFILESIZE        (1 << 27)
177
#define FATTR4_WORD0_MAXLINK            (1 << 28)
178
#define FATTR4_WORD0_MAXNAME            (1 << 29)
179
#define FATTR4_WORD0_MAXREAD            (1 << 30)
180
#define FATTR4_WORD0_MAXWRITE           (1 << 31)
181
#define FATTR4_WORD1_MIMETYPE           (1)
182
#define FATTR4_WORD1_MODE               (1 << 1)
183
#define FATTR4_WORD1_NO_TRUNC           (1 << 2)
184
#define FATTR4_WORD1_NUMLINKS           (1 << 3)
185
#define FATTR4_WORD1_OWNER              (1 << 4)
186
#define FATTR4_WORD1_OWNER_GROUP        (1 << 5)
187
#define FATTR4_WORD1_QUOTA_HARD         (1 << 6)
188
#define FATTR4_WORD1_QUOTA_SOFT         (1 << 7)
189
#define FATTR4_WORD1_QUOTA_USED         (1 << 8)
190
#define FATTR4_WORD1_RAWDEV             (1 << 9)
191
#define FATTR4_WORD1_SPACE_AVAIL        (1 << 10)
192
#define FATTR4_WORD1_SPACE_FREE         (1 << 11)
193
#define FATTR4_WORD1_SPACE_TOTAL        (1 << 12)
194
#define FATTR4_WORD1_SPACE_USED         (1 << 13)
195
#define FATTR4_WORD1_SYSTEM             (1 << 14)
196
#define FATTR4_WORD1_TIME_ACCESS        (1 << 15)
197
#define FATTR4_WORD1_TIME_ACCESS_SET    (1 << 16)
198
#define FATTR4_WORD1_TIME_BACKUP        (1 << 17)
199
#define FATTR4_WORD1_TIME_CREATE        (1 << 18)
200
#define FATTR4_WORD1_TIME_DELTA         (1 << 19)
201
#define FATTR4_WORD1_TIME_METADATA      (1 << 20)
202
#define FATTR4_WORD1_TIME_MODIFY        (1 << 21)
203
#define FATTR4_WORD1_TIME_MODIFY_SET    (1 << 22)
204
 
205
#define NFSPROC4_NULL 0
206
#define NFSPROC4_COMPOUND 1
207
#define NFS4_MINOR_VERSION 0
208
#define NFS4_DEBUG 1
209
 
210
#ifdef __KERNEL__
211
 
212
/* Index of predefined Linux client operations */
213
 
214
enum {
215
        NFSPROC4_CLNT_NULL = 0,         /* Unused */
216
        NFSPROC4_CLNT_COMPOUND,         /* Soon to be unused */
217
        NFSPROC4_CLNT_READ,
218
        NFSPROC4_CLNT_WRITE,
219
        NFSPROC4_CLNT_COMMIT,
220
        NFSPROC4_CLNT_OPEN,
221
        NFSPROC4_CLNT_OPEN_CONFIRM,
222
        NFSPROC4_CLNT_CLOSE,
223
        NFSPROC4_CLNT_SETATTR,
224
};
225
 
226
#endif
227
#endif
228
 
229
/*
230
 * Local variables:
231
 *  c-basic-offset: 8
232
 * End:
233
 */