4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 1996-1999, 2003 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 %#pragma ident "%Z%%M% %I% %E% SMI"
29 const WNL_PORT = 2049;
30 const WNL_MAXDATA = 8192;
31 const WNL_MAXNAMLEN = 255;
32 const WNL_FHSIZE = 32;
33 const WNL_FIFO_DEV = -1; /* size kludge for named pipes */
36 * Indicator for native path semantics.
38 const WNL_NATIVEPATH = 0x80;
41 * Indicator for security negotiation.
43 const WNL_SEC_NEGO = 0x81;
48 const WNLMODE_FMT = 0170000; /* type of file */
49 const WNLMODE_DIR = 0040000; /* directory */
50 const WNLMODE_CHR = 0020000; /* character special */
51 const WNLMODE_BLK = 0060000; /* block special */
52 const WNLMODE_REG = 0100000; /* regular */
53 const WNLMODE_LNK = 0120000; /* symbolic link */
54 const WNLMODE_SOCK = 0140000; /* socket */
55 const WNLMODE_FIFO = 0010000; /* fifo */
61 WNL_OK= 0, /* no error */
62 WNLERR_PERM=1, /* Not owner */
63 WNLERR_NOENT=2, /* No such file or directory */
64 WNLERR_IO=5, /* I/O error */
65 WNLERR_NXIO=6, /* No such device or address */
66 WNLERR_ACCES=13, /* Permission denied */
67 WNLERR_EXIST=17, /* File exists */
68 WNLERR_XDEV=18, /* Cross-device link */
69 WNLERR_NODEV=19, /* No such device */
70 WNLERR_NOTDIR=20, /* Not a directory*/
71 WNLERR_ISDIR=21, /* Is a directory */
72 WNLERR_INVAL=22, /* Invalid argument */
73 WNLERR_FBIG=27, /* File too large */
74 WNLERR_NOSPC=28, /* No space left on device */
75 WNLERR_ROFS=30, /* Read-only file system */
76 WNLERR_OPNOTSUPP=45, /* Operation not supported */
77 WNLERR_NAMETOOLONG=63, /* File name too long */
78 WNLERR_NOTEMPTY=66, /* Directory not empty */
79 WNLERR_DQUOT=69, /* Disc quota exceeded */
80 WNLERR_STALE=70, /* Stale WNL file handle */
81 WNLERR_REMOTE=71, /* Object is remote */
82 WNLERR_WFLUSH=72 /* write cache flushed */
89 WNL_NON = 0, /* non-file */
90 WNL_REG = 1, /* regular file */
91 WNL_DIR = 2, /* directory */
92 WNL_BLK = 3, /* block special */
93 WNL_CHR = 4, /* character special */
94 WNL_LNK = 5, /* symbolic link */
95 WNL_SOCK = 6, /* unix domain sockets */
96 WNL_BAD = 7, /* unused */
97 WNL_FIFO = 8 /* named pipe */
104 opaque data[WNL_FHSIZE];
120 wnl_ftype type; /* file type */
121 unsigned mode; /* protection mode bits */
122 unsigned nlink; /* # hard links */
123 unsigned uid; /* owner user id */
124 unsigned gid; /* owner group id */
125 unsigned size; /* file size in bytes */
126 unsigned blocksize; /* prefered block size */
127 unsigned rdev; /* special device # */
128 unsigned blocks; /* Kb of disk used by file */
129 unsigned fsid; /* device # */
130 unsigned fileid; /* inode # */
131 wnl_time atime; /* time of last access */
132 wnl_time mtime; /* time of last modification */
133 wnl_time ctime; /* time of last change */
136 typedef string wnl_filename<WNL_MAXNAMLEN>;
139 * Arguments for directory operations
141 struct wnl_diropargs {
142 wnl_fh dir; /* directory file handle */
143 wnl_filename name; /* name (up to WNL_MAXNAMLEN bytes) */
146 struct wnl_diropokres {
148 wnl_fattr attributes;
152 * Results from directory operation
154 union wnl_diropres switch (wnl_stat status) {
156 wnl_diropokres wnl_diropres;
162 * Version 3 declarations and definitions.
168 const WNL3_FHSIZE = 64;
173 typedef unsigned hyper wnl_uint64;
174 typedef hyper wnl_int64;
175 typedef unsigned int wnl_uint32;
176 typedef string wnl_filename3<>;
177 typedef wnl_uint64 wnl_fileid3;
178 typedef wnl_uint32 wnl_uid3;
179 typedef wnl_uint32 wnl_gid3;
180 typedef wnl_uint64 wnl_size3;
181 typedef wnl_uint32 wnl_mode3;
203 WNL3ERR_NAMETOOLONG = 63,
204 WNL3ERR_NOTEMPTY = 66,
208 WNL3ERR_BADHANDLE = 10001,
209 WNL3ERR_NOT_SYNC = 10002,
210 WNL3ERR_BAD_COOKIE = 10003,
211 WNL3ERR_NOTSUPP = 10004,
212 WNL3ERR_TOOSMALL = 10005,
213 WNL3ERR_SERVERFAULT = 10006,
214 WNL3ERR_BADTYPE = 10007,
215 WNL3ERR_JUKEBOX = 10008
231 struct wnl_specdata3 {
232 wnl_uint32 specdata1;
233 wnl_uint32 specdata2;
240 opaque data<WNL3_FHSIZE>;
273 union wnl_post_op_attr switch (bool attributes_follow) {
275 wnl_fattr3 attributes;
280 union wln_post_op_fh3 switch (bool handle_follows) {
287 struct wnl_diropargs3 {
293 * LOOKUP: Lookup wnl_filename
295 struct WNL_LOOKUP3args {
299 struct WNL_LOOKUP3resok {
301 wnl_post_op_attr obj_attributes;
302 wnl_post_op_attr dir_attributes;
305 struct WNL_LOOKUP3resfail {
306 wnl_post_op_attr dir_attributes;
309 union WNL_LOOKUP3res switch (wnl_stat3 status) {
311 WNL_LOOKUP3resok res_ok;
313 WNL_LOOKUP3resfail res_fail;
316 const MAX_FLAVORS = 128;
320 int array[MAX_FLAVORS];
324 /* default flavor invalid and a flavor has been negotiated */
327 /* default flavor valid, no need to negotiate flavors */
330 /* array size too small */
331 SNEGO_ARRAY_TOO_SMALL = 2,
337 * Remote file service routines
339 program WNL_PROGRAM {
342 WNLPROC_NULL(void) = 0;
345 WNLPROC_LOOKUP(wnl_diropargs) = 4;
350 WNLPROC3_NULL(void) = 0;
353 WNLPROC3_LOOKUP(WNL_LOOKUP3args) = 3;
358 WNLPROC4_NULL(void) = 0;