• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * This header was generated from the Linux kernel headers by update_headers.py,
3  * to provide necessary information from kernel to userspace, such as constants,
4  * structures, and macros, and thus, contains no copyrightable information.
5  */
6 #ifndef _UAPI_CODA_HEADER_
7 #define _UAPI_CODA_HEADER_
8 #if defined(__NetBSD__) || \
9   ((defined(DJGPP) || defined(__CYGWIN32__)) && !defined(KERNEL))
10 #include <sys/types.h>
11 #endif
12 #ifndef CODA_MAXSYMLINKS
13 #define CODA_MAXSYMLINKS 10
14 #endif
15 #if defined(DJGPP) || defined(__CYGWIN32__)
16 #ifdef KERNEL
17 typedef unsigned long u_long;
18 typedef unsigned int u_int;
19 typedef unsigned short u_short;
20 typedef u_long ino_t;
21 typedef u_long dev_t;
22 typedef void * caddr_t;
23 #ifdef DOS
24 typedef unsigned __int64 u_quad_t;
25 #else
26 typedef unsigned long long u_quad_t;
27 #endif
28 #define inline
29 struct timespec {
30         long       ts_sec;
31         long       ts_nsec;
32 };
33 #else
34 #include <sys/time.h>
35 typedef unsigned long long u_quad_t;
36 #endif
37 #endif
38 #if defined(__linux__)
39 #include <linux/time.h>
40 #define cdev_t u_quad_t
41 #ifndef __KERNEL__
42 #if !defined(_UQUAD_T_) && (!defined(__GLIBC__) || __GLIBC__ < 2)
43 #define _UQUAD_T_ 1
44 typedef unsigned long long u_quad_t;
45 #endif
46 #endif
47 #else
48 #define cdev_t dev_t
49 #endif
50 #ifdef __CYGWIN32__
51 struct timespec {
52         time_t  tv_sec;
53         long    tv_nsec;
54 };
55 #endif
56 #ifndef __BIT_TYPES_DEFINED__
57 #define __BIT_TYPES_DEFINED__
58 typedef signed char	      int8_t;
59 typedef unsigned char	    u_int8_t;
60 typedef short		     int16_t;
61 typedef unsigned short	   u_int16_t;
62 typedef int		     int32_t;
63 typedef unsigned int	   u_int32_t;
64 #endif
65 #define CODA_MAXNAMLEN   255
66 #define CODA_MAXPATHLEN  1024
67 #define CODA_MAXSYMLINK  10
68 #define	C_O_READ	0x001
69 #define	C_O_WRITE       0x002
70 #define C_O_TRUNC       0x010
71 #define C_O_EXCL	0x100
72 #define C_O_CREAT	0x200
73 
74 #define C_M_READ  00400
75 #define C_M_WRITE 00200
76 #define C_A_C_OK    8
77 #define C_A_R_OK    4
78 #define C_A_W_OK    2
79 #define C_A_X_OK    1
80 #define C_A_F_OK    0
81 #ifndef _VENUS_DIRENT_T_
82 #define _VENUS_DIRENT_T_ 1
83 struct venus_dirent {
84         u_int32_t d_fileno;
85         u_int16_t d_reclen;
86         u_int8_t  d_type;
87         u_int8_t  d_namlen;
88         char	  d_name[CODA_MAXNAMLEN + 1];
89 };
90 #undef DIRSIZ
91 #define DIRSIZ(dp)      ((sizeof (struct venus_dirent) - (CODA_MAXNAMLEN+1)) + \
92                          (((dp)->d_namlen+1 + 3) &~ 3))
93 #define	CDT_UNKNOWN	 0
94 #define	CDT_FIFO	 1
95 #define	CDT_CHR		 2
96 #define	CDT_DIR		 4
97 #define	CDT_BLK		 6
98 #define	CDT_REG		 8
99 #define	CDT_LNK		10
100 #define	CDT_SOCK	12
101 #define	CDT_WHT		14
102 #define	IFTOCDT(mode)	(((mode) & 0170000) >> 12)
103 #define	CDTTOIF(dirtype)	((dirtype) << 12)
104 #endif
105 #ifndef _VUID_T_
106 #define _VUID_T_
107 typedef u_int32_t vuid_t;
108 typedef u_int32_t vgid_t;
109 #endif
110 struct CodaFid {
111 	u_int32_t opaque[4];
112 };
113 #define coda_f2i(fid)\
114 	(fid ? (fid->opaque[3] ^ (fid->opaque[2]<<10) ^ (fid->opaque[1]<<20) ^ fid->opaque[0]) : 0)
115 #ifndef _VENUS_VATTR_T_
116 #define _VENUS_VATTR_T_
117 enum coda_vtype	{ C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFIFO, C_VBAD };
118 struct coda_vattr {
119 	long     	va_type;
120 	u_short		va_mode;
121 	short		va_nlink;
122 	vuid_t		va_uid;
123 	vgid_t		va_gid;
124 	long		va_fileid;
125 	u_quad_t	va_size;
126 	long		va_blocksize;
127 	struct timespec	va_atime;
128 	struct timespec	va_mtime;
129 	struct timespec	va_ctime;
130 	u_long		va_gen;
131 	u_long		va_flags;
132 	cdev_t	        va_rdev;
133 	u_quad_t	va_bytes;
134 	u_quad_t	va_filerev;
135 };
136 #endif
137 struct coda_statfs {
138     int32_t f_blocks;
139     int32_t f_bfree;
140     int32_t f_bavail;
141     int32_t f_files;
142     int32_t f_ffree;
143 };
144 #define CODA_ROOT	2
145 #define CODA_OPEN_BY_FD	3
146 #define CODA_OPEN	4
147 #define CODA_CLOSE	5
148 #define CODA_IOCTL	6
149 #define CODA_GETATTR	7
150 #define CODA_SETATTR	8
151 #define CODA_ACCESS	9
152 #define CODA_LOOKUP	10
153 #define CODA_CREATE	11
154 #define CODA_REMOVE	12
155 #define CODA_LINK	13
156 #define CODA_RENAME	14
157 #define CODA_MKDIR	15
158 #define CODA_RMDIR	16
159 #define CODA_SYMLINK	18
160 #define CODA_READLINK	19
161 #define CODA_FSYNC	20
162 #define CODA_VGET	22
163 #define CODA_SIGNAL	23
164 #define CODA_REPLACE	 24
165 #define CODA_FLUSH       25
166 #define CODA_PURGEUSER   26
167 #define CODA_ZAPFILE     27
168 #define CODA_ZAPDIR      28
169 #define CODA_PURGEFID    30
170 #define CODA_OPEN_BY_PATH 31
171 #define CODA_RESOLVE     32
172 #define CODA_REINTEGRATE 33
173 #define CODA_STATFS	 34
174 #define CODA_STORE	 35
175 #define CODA_RELEASE	 36
176 #define CODA_NCALLS 37
177 #define DOWNCALL(opcode) (opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID)
178 #define VC_MAXDATASIZE	    8192
179 #define VC_MAXMSGSIZE      sizeof(union inputArgs)+sizeof(union outputArgs) +\
180                             VC_MAXDATASIZE
181 #define CIOC_KERNEL_VERSION _IOWR('c', 10, size_t)
182 #define CODA_KERNEL_VERSION 3
183 struct coda_in_hdr {
184     u_int32_t opcode;
185     u_int32_t unique;
186     pid_t pid;
187     pid_t pgid;
188     vuid_t uid;
189 };
190 struct coda_out_hdr {
191     u_int32_t opcode;
192     u_int32_t unique;
193     u_int32_t result;
194 };
195 struct coda_root_out {
196     struct coda_out_hdr oh;
197     struct CodaFid VFid;
198 };
199 struct coda_root_in {
200     struct coda_in_hdr in;
201 };
202 struct coda_open_in {
203     struct coda_in_hdr ih;
204     struct CodaFid VFid;
205     int	flags;
206 };
207 struct coda_open_out {
208     struct coda_out_hdr oh;
209     cdev_t	dev;
210     ino_t	inode;
211 };
212 struct coda_store_in {
213     struct coda_in_hdr ih;
214     struct CodaFid VFid;
215     int	flags;
216 };
217 struct coda_store_out {
218     struct coda_out_hdr out;
219 };
220 struct coda_release_in {
221     struct coda_in_hdr ih;
222     struct CodaFid VFid;
223     int	flags;
224 };
225 struct coda_release_out {
226     struct coda_out_hdr out;
227 };
228 struct coda_close_in {
229     struct coda_in_hdr ih;
230     struct CodaFid VFid;
231     int	flags;
232 };
233 struct coda_close_out {
234     struct coda_out_hdr out;
235 };
236 struct coda_ioctl_in {
237     struct coda_in_hdr ih;
238     struct CodaFid VFid;
239     int	cmd;
240     int	len;
241     int	rwflag;
242     char *data;
243 };
244 struct coda_ioctl_out {
245     struct coda_out_hdr oh;
246     int	len;
247     caddr_t	data;
248 };
249 struct coda_getattr_in {
250     struct coda_in_hdr ih;
251     struct CodaFid VFid;
252 };
253 struct coda_getattr_out {
254     struct coda_out_hdr oh;
255     struct coda_vattr attr;
256 };
257 struct coda_setattr_in {
258     struct coda_in_hdr ih;
259     struct CodaFid VFid;
260     struct coda_vattr attr;
261 };
262 struct coda_setattr_out {
263     struct coda_out_hdr out;
264 };
265 struct coda_access_in {
266     struct coda_in_hdr ih;
267     struct CodaFid VFid;
268     int	flags;
269 };
270 struct coda_access_out {
271     struct coda_out_hdr out;
272 };
273 #define CLU_CASE_SENSITIVE     0x01
274 #define CLU_CASE_INSENSITIVE   0x02
275 struct  coda_lookup_in {
276     struct coda_in_hdr ih;
277     struct CodaFid VFid;
278     int         name;
279     int         flags;
280 };
281 struct coda_lookup_out {
282     struct coda_out_hdr oh;
283     struct CodaFid VFid;
284     int	vtype;
285 };
286 struct coda_create_in {
287     struct coda_in_hdr ih;
288     struct CodaFid VFid;
289     struct coda_vattr attr;
290     int excl;
291     int mode;
292     int 	name;
293 };
294 struct coda_create_out {
295     struct coda_out_hdr oh;
296     struct CodaFid VFid;
297     struct coda_vattr attr;
298 };
299 struct coda_remove_in {
300     struct coda_in_hdr ih;
301     struct CodaFid VFid;
302     int name;
303 };
304 struct coda_remove_out {
305     struct coda_out_hdr out;
306 };
307 struct coda_link_in {
308     struct coda_in_hdr ih;
309     struct CodaFid sourceFid;
310     struct CodaFid destFid;
311     int tname;
312 };
313 struct coda_link_out {
314     struct coda_out_hdr out;
315 };
316 struct coda_rename_in {
317     struct coda_in_hdr ih;
318     struct CodaFid sourceFid;
319     int 	srcname;
320     struct CodaFid destFid;
321     int 	destname;
322 };
323 struct coda_rename_out {
324     struct coda_out_hdr out;
325 };
326 struct coda_mkdir_in {
327     struct coda_in_hdr ih;
328     struct CodaFid VFid;
329     struct coda_vattr attr;
330     int	   name;
331 };
332 struct coda_mkdir_out {
333     struct coda_out_hdr oh;
334     struct CodaFid VFid;
335     struct coda_vattr attr;
336 };
337 struct coda_rmdir_in {
338     struct coda_in_hdr ih;
339     struct CodaFid VFid;
340     int name;
341 };
342 struct coda_rmdir_out {
343     struct coda_out_hdr out;
344 };
345 struct coda_symlink_in {
346     struct coda_in_hdr ih;
347     struct CodaFid VFid;
348     int srcname;
349     struct coda_vattr attr;
350     int tname;
351 };
352 struct coda_symlink_out {
353     struct coda_out_hdr out;
354 };
355 struct coda_readlink_in {
356     struct coda_in_hdr ih;
357     struct CodaFid VFid;
358 };
359 struct coda_readlink_out {
360     struct coda_out_hdr oh;
361     int	count;
362     caddr_t	data;
363 };
364 struct coda_fsync_in {
365     struct coda_in_hdr ih;
366     struct CodaFid VFid;
367 };
368 struct coda_fsync_out {
369     struct coda_out_hdr out;
370 };
371 struct coda_vget_in {
372     struct coda_in_hdr ih;
373     struct CodaFid VFid;
374 };
375 struct coda_vget_out {
376     struct coda_out_hdr oh;
377     struct CodaFid VFid;
378     int	vtype;
379 };
380 struct coda_purgeuser_out {
381     struct coda_out_hdr oh;
382     vuid_t uid;
383 };
384 struct coda_zapfile_out {
385     struct coda_out_hdr oh;
386     struct CodaFid CodaFid;
387 };
388 
389 struct coda_zapdir_out {
390     struct coda_out_hdr oh;
391     struct CodaFid CodaFid;
392 };
393 
394 struct coda_purgefid_out {
395     struct coda_out_hdr oh;
396     struct CodaFid CodaFid;
397 };
398 
399 struct coda_replace_out {
400     struct coda_out_hdr oh;
401     struct CodaFid NewFid;
402     struct CodaFid OldFid;
403 };
404 struct coda_open_by_fd_in {
405     struct coda_in_hdr ih;
406     struct CodaFid VFid;
407     int        flags;
408 };
409 struct coda_open_by_fd_out {
410     struct coda_out_hdr oh;
411     int fd;
412 #ifdef __KERNEL__
413     struct file *fh;
414 #endif
415 };
416 struct coda_open_by_path_in {
417     struct coda_in_hdr ih;
418     struct CodaFid VFid;
419     int	flags;
420 };
421 struct coda_open_by_path_out {
422     struct coda_out_hdr oh;
423 	int path;
424 };
425 struct coda_statfs_in {
426     struct coda_in_hdr in;
427 };
428 struct coda_statfs_out {
429     struct coda_out_hdr oh;
430     struct coda_statfs stat;
431 };
432 #define CODA_NOCACHE          0x80000000
433 union inputArgs {
434     struct coda_in_hdr ih;
435     struct coda_open_in coda_open;
436     struct coda_store_in coda_store;
437     struct coda_release_in coda_release;
438     struct coda_close_in coda_close;
439     struct coda_ioctl_in coda_ioctl;
440     struct coda_getattr_in coda_getattr;
441     struct coda_setattr_in coda_setattr;
442     struct coda_access_in coda_access;
443     struct coda_lookup_in coda_lookup;
444     struct coda_create_in coda_create;
445     struct coda_remove_in coda_remove;
446     struct coda_link_in coda_link;
447     struct coda_rename_in coda_rename;
448     struct coda_mkdir_in coda_mkdir;
449     struct coda_rmdir_in coda_rmdir;
450     struct coda_symlink_in coda_symlink;
451     struct coda_readlink_in coda_readlink;
452     struct coda_fsync_in coda_fsync;
453     struct coda_vget_in coda_vget;
454     struct coda_open_by_fd_in coda_open_by_fd;
455     struct coda_open_by_path_in coda_open_by_path;
456     struct coda_statfs_in coda_statfs;
457 };
458 union outputArgs {
459     struct coda_out_hdr oh;
460     struct coda_root_out coda_root;
461     struct coda_open_out coda_open;
462     struct coda_ioctl_out coda_ioctl;
463     struct coda_getattr_out coda_getattr;
464     struct coda_lookup_out coda_lookup;
465     struct coda_create_out coda_create;
466     struct coda_mkdir_out coda_mkdir;
467     struct coda_readlink_out coda_readlink;
468     struct coda_vget_out coda_vget;
469     struct coda_purgeuser_out coda_purgeuser;
470     struct coda_zapfile_out coda_zapfile;
471     struct coda_zapdir_out coda_zapdir;
472     struct coda_purgefid_out coda_purgefid;
473     struct coda_replace_out coda_replace;
474     struct coda_open_by_fd_out coda_open_by_fd;
475     struct coda_open_by_path_out coda_open_by_path;
476     struct coda_statfs_out coda_statfs;
477 };
478 union coda_downcalls {
479 
480 
481     struct coda_purgeuser_out purgeuser;
482     struct coda_zapfile_out zapfile;
483     struct coda_zapdir_out zapdir;
484     struct coda_purgefid_out purgefid;
485     struct coda_replace_out replace;
486 };
487 #define PIOCPARM_MASK 0x0000ffff
488 struct ViceIoctl {
489         void __user *in;
490         void __user *out;
491         u_short in_size;
492         u_short out_size;
493 };
494 struct PioctlData {
495         const char __user *path;
496         int follow;
497         struct ViceIoctl vi;
498 };
499 #define CODA_CONTROL		".CONTROL"
500 #define CODA_CONTROLLEN		8
501 #define CTL_INO			-1
502 #define CODA_MOUNT_VERSION 1
503 struct coda_mount_data {
504 	int		version;
505 	int		fd;
506 };
507 #endif
508