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 (c) 1991, 1999 by Sun Microsystems, Inc.
24 * All rights reserved.
27 #ident "%Z%%M% %I% %E% SMI" /* SunOS */
29 #include <sys/types.h>
30 #include <sys/errno.h>
31 #include <sys/tiuser.h>
35 #include <rpc/types.h>
39 #include <rpc/rpc_msg.h>
41 #include "snoop_nfs.h"
44 #include <sys/param.h>
45 #include <rpcsvc/nfs_prot.h>
48 #define MIN(a, b) ((a) < (b) ? (a) : (b))
51 extern jmp_buf xdr_err
;
53 static void nfscall3(int);
54 static void nfsreply3(int);
55 static char *perms(int);
56 static char *filetype(int);
57 static char *sum_access(void);
58 static char *sum_readdirres(void);
59 static char *sum_readdirplusres(void);
60 static char *sum_createhow(void);
61 static char *sum_stablehow(void);
62 static void detail_sattr3(void);
63 static void detail_diropargs3(void);
64 static void detail_readdirres(void);
65 static void detail_readdirplusres(void);
66 static void detail_fattr3(void);
67 static void detail_access(void);
68 static void detail_mode(int);
69 static void detail_wcc_attr(void);
70 static void detail_pre_op_attr(char *);
71 static void detail_wcc_data(char *);
72 static void skip_postop(void);
73 static void skip_wcc_data(void);
74 static void skip_sattr3(void);
77 #define SET_TO_SERVER_TIME 1
78 #define SET_TO_CLIENT_TIME 2
84 #define ACCESS3_READ 0x0001
85 #define ACCESS3_LOOKUP 0x0002
86 #define ACCESS3_MODIFY 0x0004
87 #define ACCESS3_EXTEND 0x0008
88 #define ACCESS3_DELETE 0x0010
89 #define ACCESS3_EXECUTE 0x0020
95 #define NF3REG 1 /* regular file */
96 #define NF3DIR 2 /* directory */
97 #define NF3BLK 3 /* block special */
98 #define NF3CHR 4 /* character special */
99 #define NF3LNK 5 /* symbolic link */
100 #define NF3SOCK 6 /* unix domain socket */
101 #define NF3FIFO 7 /* named pipe */
103 #define NFS3_FHSIZE 64
105 static char *procnames_short
[] = {
123 "READDIRPLUS3", /* 17 */
126 "PATHCONF3", /* 20 */
130 static char *procnames_long
[] = {
131 "Null procedure", /* 0 */
132 "Get file attributes", /* 1 */
133 "Set file attributes", /* 2 */
134 "Look up file name", /* 3 */
135 "Check access permission", /* 4 */
136 "Read from symbolic link", /* 5 */
137 "Read from file", /* 6 */
138 "Write to file", /* 7 */
139 "Create file", /* 8 */
140 "Make directory", /* 9 */
141 "Make symbolic link", /* 10 */
142 "Make special file", /* 11 */
143 "Remove file", /* 12 */
144 "Remove directory", /* 13 */
147 "Read from directory", /* 16 */
148 "Read from directory - plus", /* 17 */
149 "Get filesystem statistics", /* 18 */
150 "Get filesystem information", /* 19 */
151 "Get POSIX information", /* 20 */
152 "Commit to stable storage", /* 21 */
158 interpret_nfs3(flags
, type
, xid
, vers
, proc
, data
, len
)
159 int flags
, type
, xid
, vers
, proc
;
164 char buff
[NFS_MAXPATHLEN
+ 1]; /* protocol allows longer */
169 if (proc
< 0 || proc
> MAXPROC
)
173 line
= get_sum_line();
176 (void) sprintf(line
, "NFS C %s",
177 procnames_short
[proc
]);
178 line
+= strlen(line
);
180 case NFSPROC3_GETATTR
:
181 case NFSPROC3_READLINK
:
182 case NFSPROC3_FSSTAT
:
183 case NFSPROC3_FSINFO
:
184 case NFSPROC3_PATHCONF
:
185 (void) sprintf(line
, sum_nfsfh3());
187 case NFSPROC3_SETATTR
:
188 (void) sprintf(line
, sum_nfsfh3());
190 case NFSPROC3_READDIR
:
192 off
= getxdr_u_longlong();
193 (void) getxdr_u_longlong();
194 sz
= getxdr_u_long();
195 (void) sprintf(line
, "%s Cookie=%llu for %lu",
198 case NFSPROC3_READDIRPLUS
:
200 off
= getxdr_u_longlong();
201 (void) getxdr_u_longlong();
202 sz
= getxdr_u_long();
204 "%s Cookie=%llu for %lu/%lu",
205 fh
, off
, sz
, getxdr_u_long());
207 case NFSPROC3_ACCESS
:
209 (void) sprintf(line
, "%s (%s)",
212 case NFSPROC3_LOOKUP
:
213 case NFSPROC3_REMOVE
:
217 (void) sprintf(line
, "%s %s",
218 fh
, getxdr_string(buff
,
221 case NFSPROC3_CREATE
:
223 name
= getxdr_string(buff
, NFS_MAXPATHLEN
);
224 (void) sprintf(line
, "%s (%s) %s",
225 fh
, sum_createhow(), name
);
229 name
= getxdr_string(buff
, NFS_MAXPATHLEN
);
231 (void) sprintf(line
, "%s (%s) %s",
232 fh
, filetype(how
), name
);
236 off
= getxdr_u_longlong();
237 sz
= getxdr_u_long();
238 (void) sprintf(line
, "%s at %llu for %lu",
243 off
= getxdr_u_longlong();
244 sz
= getxdr_u_long();
245 (void) sprintf(line
, "%s at %llu for %lu (%s)",
246 fh
, off
, sz
, sum_stablehow());
248 case NFSPROC3_SYMLINK
:
250 (void) sprintf(line
, "%s %s",
251 fh
, getxdr_string(buff
,
254 line
+= strlen(line
);
255 (void) sprintf(line
, " to %s",
256 getxdr_string(buff
, NFS_MAXPATHLEN
));
258 case NFSPROC3_RENAME
:
260 (void) sprintf(line
, "%s %s",
261 fh
, getxdr_string(buff
,
263 line
+= strlen(line
);
265 (void) sprintf(line
, " to%s %s",
266 fh
, getxdr_string(buff
,
271 (void) sprintf(line
, "%s", fh
);
272 line
+= strlen(line
);
274 (void) sprintf(line
, " to%s %s",
275 fh
, getxdr_string(buff
,
278 case NFSPROC3_COMMIT
:
280 off
= getxdr_u_longlong();
281 sz
= getxdr_u_long();
282 (void) sprintf(line
, "%s at %llu for %lu",
289 check_retransmit(line
, xid
);
291 (void) sprintf(line
, "NFS R %s ",
292 procnames_short
[proc
]);
293 line
+= strlen(line
);
295 case NFSPROC3_LOOKUP
:
296 if (sum_nfsstat3(line
) == NFS3_OK
)
297 (void) strcat(line
, sum_nfsfh3());
299 case NFSPROC3_CREATE
:
301 case NFSPROC3_SYMLINK
:
303 if (sum_nfsstat3(line
) == NFS3_OK
) {
309 case NFSPROC3_READLINK
:
310 if (sum_nfsstat3(line
) == NFS3_OK
) {
311 line
+= strlen(line
);
313 (void) sprintf(line
, " (Path=%s)",
318 case NFSPROC3_GETATTR
:
319 case NFSPROC3_SETATTR
:
320 case NFSPROC3_REMOVE
:
322 case NFSPROC3_RENAME
:
324 case NFSPROC3_FSSTAT
:
325 case NFSPROC3_FSINFO
:
326 case NFSPROC3_PATHCONF
:
327 (void) sum_nfsstat3(line
);
329 case NFSPROC3_ACCESS
:
330 if (sum_nfsstat3(line
) == NFS3_OK
) {
331 line
+= strlen(line
);
333 (void) sprintf(line
, " (%s)",
338 if (sum_nfsstat3(line
) == NFS3_OK
) {
339 line
+= strlen(line
);
341 sz
= getxdr_u_long();
342 (void) sprintf(line
, " %d (%s)",
343 sz
, sum_stablehow());
346 case NFSPROC3_READDIR
:
347 if (sum_nfsstat3(line
) == NFS3_OK
)
348 (void) strcat(line
, sum_readdirres());
351 if (sum_nfsstat3(line
) == NFS3_OK
) {
352 line
+= strlen(line
);
354 (void) sprintf(line
, " (%lu bytes)",
357 (void) strcat(line
, " EOF");
360 case NFSPROC3_READDIRPLUS
:
361 if (sum_nfsstat3(line
) == NFS3_OK
)
363 sum_readdirplusres());
365 case NFSPROC3_COMMIT
:
366 (void) sum_nfsstat3(line
);
374 if (flags
& F_DTAIL
) {
375 show_header("NFS: ", "Sun NFS", len
);
377 (void) sprintf(get_line(0, 0), "Proc = %d (%s)",
378 proc
, procnames_long
[proc
]);
388 * Print out version 3 NFS call packets
397 case NFSPROC3_GETATTR
:
398 case NFSPROC3_READLINK
:
399 case NFSPROC3_FSINFO
:
400 case NFSPROC3_FSSTAT
:
401 case NFSPROC3_PATHCONF
:
404 case NFSPROC3_SETATTR
:
408 (void) showxdr_date_ns("Guard = %s");
410 case NFSPROC3_LOOKUP
:
411 case NFSPROC3_REMOVE
:
415 case NFSPROC3_ACCESS
:
423 case NFSPROC3_CREATE
:
427 showxdr_hex(8, "Guard = %s");
429 (void) sprintf(get_line(0, 0), "Method = %s",
430 h
== UNCHECKED
? "Unchecked" : "Guarded");
437 (void) sprintf(get_line(0, 0), "File type = %s",
443 showxdr_u_long("Major = %lu");
444 showxdr_u_long("Minor = %lu");
454 (void) showxdr_u_longlong("Offset = %llu");
455 (void) showxdr_u_long("Size = %lu");
456 (void) sprintf(get_line(0, 0), "Stable = %s",
459 case NFSPROC3_RENAME
:
467 case NFSPROC3_SYMLINK
:
470 (void) showxdr_string(MAXPATHLEN
, "Path = %s");
472 case NFSPROC3_READDIR
:
474 (void) showxdr_u_longlong("Cookie = %llu");
475 (void) showxdr_hex(8, "Verifier = %s");
476 (void) showxdr_u_long("Count = %lu");
478 case NFSPROC3_READDIRPLUS
:
480 (void) showxdr_u_longlong("Cookie = %llu");
481 (void) showxdr_hex(8, "Verifier = %s");
482 (void) showxdr_u_long("Dircount = %lu");
483 (void) showxdr_u_long("Maxcount = %lu");
486 case NFSPROC3_COMMIT
:
488 (void) showxdr_u_longlong("Offset = %llu");
489 (void) showxdr_long("Count = %lu");
497 * Print out version 3 NFS reply packets
506 case NFSPROC3_GETATTR
:
507 if (detail_nfsstat3() == NFS3_OK
) {
511 case NFSPROC3_SETATTR
:
512 (void) detail_nfsstat3();
516 if (detail_nfsstat3() == NFS3_OK
) {
518 (void) showxdr_u_long("Count = %lu bytes written");
519 (void) sprintf(get_line(0, 0), "Stable = %s",
521 (void) showxdr_hex(8, "Verifier = %s");
525 case NFSPROC3_LOOKUP
:
526 if (detail_nfsstat3() == NFS3_OK
) {
528 detail_post_op_attr("(object)");
530 detail_post_op_attr("(directory)");
532 case NFSPROC3_CREATE
:
534 case NFSPROC3_SYMLINK
:
536 if (detail_nfsstat3() == NFS3_OK
) {
540 (void) sprintf(get_line(0, 0),
541 "(No file handle available)");
542 detail_post_op_attr("");
546 case NFSPROC3_READLINK
:
547 if (detail_nfsstat3() == NFS3_OK
) {
548 detail_post_op_attr("");
549 (void) showxdr_string(MAXPATHLEN
, "Path = %s");
551 detail_post_op_attr("");
554 if (detail_nfsstat3() == NFS3_OK
) {
555 detail_post_op_attr("");
556 (void) showxdr_u_long("Count = %lu bytes read");
557 (void) showxdr_bool("End of file = %s");
559 detail_post_op_attr("");
561 case NFSPROC3_ACCESS
:
562 if (detail_nfsstat3() == NFS3_OK
) {
563 detail_post_op_attr("");
564 (void) sprintf(get_line(0, 0), "Access = %s",
567 detail_post_op_attr("");
569 case NFSPROC3_REMOVE
:
571 (void) detail_nfsstat3();
574 case NFSPROC3_RENAME
:
575 (void) detail_nfsstat3();
576 detail_wcc_data("(from directory)");
577 detail_wcc_data("(to directory)");
580 (void) detail_nfsstat3();
581 detail_post_op_attr("");
584 case NFSPROC3_READDIR
:
585 if (detail_nfsstat3() == NFS3_OK
) {
588 detail_post_op_attr("");
590 case NFSPROC3_READDIRPLUS
:
591 if (detail_nfsstat3() == NFS3_OK
) {
592 detail_readdirplusres();
594 detail_post_op_attr("");
596 case NFSPROC3_FSSTAT
:
597 if (detail_nfsstat3() == NFS3_OK
) {
598 detail_post_op_attr("");
599 (void) showxdr_u_longlong(
600 "Total space = %llu bytes");
601 (void) showxdr_u_longlong(
602 "Available space = %llu bytes");
603 (void) showxdr_u_longlong(
604 "Available space - this user = %llu bytes");
605 (void) showxdr_u_longlong(
606 "Total file slots = %llu");
607 (void) showxdr_u_longlong(
608 "Available file slots = %llu");
609 (void) showxdr_u_longlong(
610 "Available file slots - this user = %llu");
611 (void) showxdr_u_long("Invariant time = %lu sec");
613 detail_post_op_attr("");
615 case NFSPROC3_FSINFO
:
616 if (detail_nfsstat3() == NFS3_OK
) {
617 detail_post_op_attr("");
618 (void) show_line("Read transfer sizes:");
619 (void) showxdr_u_long(" Maximum = %lu bytes");
620 (void) showxdr_u_long(" Preferred = %lu bytes");
621 (void) showxdr_u_long(
622 " Suggested multiple = %lu bytes");
623 (void) show_line("Write transfer sizes:");
624 (void) showxdr_u_long(" Maximum = %lu bytes");
625 (void) showxdr_u_long(" Preferred = %lu bytes");
626 (void) showxdr_u_long(
627 " Suggested multiple = %lu bytes");
628 (void) show_line("Directory read size:");
629 (void) showxdr_u_long(" Preferred = %lu bytes");
630 (void) show_line("File system limits:");
631 (void) showxdr_u_longlong(
632 " Max file size = %llu bytes");
633 (void) showxdr_date_ns(
634 " Server minimum time discrimination = %s sec");
635 bits
= showxdr_u_long("Properties = 0x%02x");
636 (void) sprintf(get_line(0, 0), " %s",
637 getflag(bits
, FSF3_LINK
,
638 "Hard links supported",
639 "(hard links not supported)"));
640 (void) sprintf(get_line(0, 0), " %s",
641 getflag(bits
, FSF3_SYMLINK
,
642 "Symbolic links supported",
643 "(symbolic links not supported)"));
644 (void) sprintf(get_line(0, 0), " %s",
645 getflag(bits
, FSF3_HOMOGENEOUS
,
646 "Pathconf cannot vary per file",
647 "(pathconf can vary per file)"));
648 (void) sprintf(get_line(0, 0), " %s",
649 getflag(bits
, FSF3_CANSETTIME
,
650 "Server can always set file times",
651 "(server cannot always set file times)"));
653 detail_post_op_attr("");
655 case NFSPROC3_PATHCONF
:
656 if (detail_nfsstat3() == NFS3_OK
) {
657 detail_post_op_attr("");
658 (void) showxdr_u_long("Link max = %lu");
659 (void) showxdr_u_long("Name max = %lu");
660 (void) showxdr_bool("No trunc = %s");
661 (void) showxdr_bool("Chown restricted = %s");
662 (void) showxdr_bool("Case insensitive = %s");
663 (void) showxdr_bool("Case preserving = %s");
665 detail_post_op_attr("");
667 case NFSPROC3_COMMIT
:
668 if (detail_nfsstat3() == NFS3_OK
) {
670 (void) showxdr_hex(8, "Verifier = %s");
684 (void) showxdr_string(MAXPATHLEN
, "File name = %s");
694 status
= getxdr_long();
696 case NFS3_OK
: p
= "OK"; break;
697 case NFS3ERR_PERM
: p
= "Not owner"; break;
698 case NFS3ERR_NOENT
: p
= "No such file or directory"; break;
699 case NFS3ERR_IO
: p
= "I/O error"; break;
700 case NFS3ERR_NXIO
: p
= "No such device or address"; break;
701 case NFS3ERR_ACCES
: p
= "Permission denied"; break;
702 case NFS3ERR_EXIST
: p
= "File exists"; break;
703 case NFS3ERR_XDEV
: p
= "Attempted cross-device link"; break;
704 case NFS3ERR_NODEV
: p
= "No such device"; break;
705 case NFS3ERR_NOTDIR
: p
= "Not a directory"; break;
706 case NFS3ERR_ISDIR
: p
= "Is a directory"; break;
707 case NFS3ERR_INVAL
: p
= "Invalid argument"; break;
708 case NFS3ERR_FBIG
: p
= "File too large"; break;
709 case NFS3ERR_NOSPC
: p
= "No space left on device"; break;
710 case NFS3ERR_ROFS
: p
= "Read-only file system"; break;
711 case NFS3ERR_MLINK
: p
= "Too many links"; break;
712 case NFS3ERR_NAMETOOLONG
:p
= "File name too long"; break;
713 case NFS3ERR_NOTEMPTY
: p
= "Directory not empty"; break;
714 case NFS3ERR_DQUOT
: p
= "Disc quota exceeded"; break;
715 case NFS3ERR_STALE
: p
= "Stale NFS file handle"; break;
716 case NFS3ERR_REMOTE
: p
= "Too many levels of remote in path"; break;
717 case NFS3ERR_BADHANDLE
: p
= "Illegal NFS file handle"; break;
718 case NFS3ERR_NOT_SYNC
: p
= "Update synch mismatch"; break;
719 case NFS3ERR_BAD_COOKIE
:p
= "Readdir cookie is stale"; break;
720 case NFS3ERR_NOTSUPP
: p
= "Operation not supported"; break;
721 case NFS3ERR_TOOSMALL
: p
= "Buffer/request too small"; break;
722 case NFS3ERR_SERVERFAULT
:p
= "Server fault"; break;
723 case NFS3ERR_BADTYPE
: p
= "Bad type"; break;
724 case NFS3ERR_JUKEBOX
: p
= "File is temporarily unavailable"; break;
725 default: p
= "(unknown error)"; break;
728 (void) strcpy(line
, p
);
740 status
= sum_nfsstat3(buff
);
742 (void) sprintf(get_line(pos
, getxdr_pos()), "Status = %d (%s)",
745 return ((int)status
);
753 xdr_skip(21 * 4); /* XDR size of fattr3 */
760 if (getxdr_bool() > 0)
769 if (getxdr_bool() > 0)
770 xdr_skip(4); /* mode */
771 if (getxdr_bool() > 0)
772 xdr_skip(4); /* uid */
773 if (getxdr_bool() > 0)
774 xdr_skip(4); /* gid */
775 if (getxdr_bool() > 0)
776 xdr_skip(8); /* size */
777 if (getxdr_bool() > 0)
778 xdr_skip(8); /* atime */
779 if (getxdr_bool() > 0)
780 xdr_skip(8); /* mtime */
788 static char buff
[16];
791 fh
= sum_filehandle(len
);
792 (void) sprintf(buff
, " FH=%08X", fh
);
805 fh
= sum_filehandle(len
);
807 (void) sprintf(get_line(0, 0), "File handle = [%08X]", fh
);
810 l
= MIN(len
- i
, 32);
811 (void) showxdr_hex(l
, " %s");
820 static char buff
[64];
822 bits
= getxdr_u_long();
825 if (bits
& ACCESS3_READ
)
826 (void) strcat(buff
, "read,");
827 if (bits
& ACCESS3_LOOKUP
)
828 (void) strcat(buff
, "lookup,");
829 if (bits
& ACCESS3_MODIFY
)
830 (void) strcat(buff
, "modify,");
831 if (bits
& ACCESS3_EXTEND
)
832 (void) strcat(buff
, "extend,");
833 if (bits
& ACCESS3_DELETE
)
834 (void) strcat(buff
, "delete,");
835 if (bits
& ACCESS3_EXECUTE
)
836 (void) strcat(buff
, "execute,");
838 buff
[strlen(buff
) - 1] = '\0';
848 bits
= showxdr_u_long("Access bits = 0x%08x");
849 (void) sprintf(get_line(0, 0), " %s",
850 getflag(bits
, ACCESS3_READ
, "Read", "(no read)"));
851 (void) sprintf(get_line(0, 0), " %s",
852 getflag(bits
, ACCESS3_LOOKUP
, "Lookup", "(no lookup)"));
853 (void) sprintf(get_line(0, 0), " %s",
854 getflag(bits
, ACCESS3_MODIFY
, "Modify", "(no modify)"));
855 (void) sprintf(get_line(0, 0), " %s",
856 getflag(bits
, ACCESS3_EXTEND
, "Extend", "(no extend)"));
857 (void) sprintf(get_line(0, 0), " %s",
858 getflag(bits
, ACCESS3_DELETE
, "Delete", "(no delete)"));
859 (void) sprintf(get_line(0, 0), " %s",
860 getflag(bits
, ACCESS3_EXECUTE
, "Execute", "(no execute)"));
868 (void) sprintf(get_line(0, 0), " Mode = 0%o", mode
);
869 (void) sprintf(get_line(0, 0),
870 " Setuid = %d, Setgid = %d, Sticky = %d",
871 (mode
& S_ISUID
) != 0,
872 (mode
& S_ISGID
) != 0,
873 (mode
& S_ISVTX
) != 0);
874 (void) sprintf(get_line(0, 0), " Owner's permissions = %s",
875 perms(mode
>> 6 & 0x7));
876 (void) sprintf(get_line(0, 0), " Group's permissions = %s",
877 perms(mode
>> 3 & 0x7));
878 (void) sprintf(get_line(0, 0), " Other's permissions = %s",
885 uint_t fltype
, mode
, nlinks
, uid
, gid
;
887 u_longlong_t size
, used
, fsid
, fileid
;
889 fltype
= getxdr_u_long();
890 mode
= getxdr_u_long();
891 nlinks
= getxdr_u_long();
892 uid
= getxdr_u_long();
893 gid
= getxdr_u_long();
894 size
= getxdr_u_longlong();
895 used
= getxdr_u_longlong();
896 major
= getxdr_u_long();
897 minor
= getxdr_u_long();
898 fsid
= getxdr_u_longlong();
899 fileid
= getxdr_u_longlong();
901 (void) sprintf(get_line(0, 0),
902 " File type = %d (%s)",
903 fltype
, filetype(fltype
));
905 (void) sprintf(get_line(0, 0),
906 " Link count = %u, User ID = %u, Group ID = %u",
908 (void) sprintf(get_line(0, 0),
909 " File size = %llu, Used = %llu",
911 (void) sprintf(get_line(0, 0),
912 " Special: Major = %u, Minor = %u",
914 (void) sprintf(get_line(0, 0),
915 " File system id = %llu, File id = %llu",
917 (void) showxdr_date_ns(" Last access time = %s");
918 (void) showxdr_date_ns(" Modification time = %s");
919 (void) showxdr_date_ns(" Attribute change time = %s");
920 (void) show_line("");
929 detail_mode(getxdr_u_long());
931 (void) sprintf(get_line(0, 0), "Mode = (not set)");
933 (void) showxdr_long("User ID = %d");
935 (void) sprintf(get_line(0, 0), "User ID = (not set)");
937 (void) showxdr_long("Group ID = %d");
939 (void) sprintf(get_line(0, 0), "Group ID = (not set)");
941 (void) showxdr_u_longlong("Size = %llu");
943 (void) sprintf(get_line(0, 0), "Size = (not set)");
945 if ((t
= getxdr_u_long()) == SET_TO_CLIENT_TIME
)
946 (void) showxdr_date("Access time = %s (set to client time)");
947 else if (t
== SET_TO_SERVER_TIME
)
948 (void) sprintf(get_line(0, 0),
949 "Access time = (set to server time)");
951 (void) sprintf(get_line(0, 0), "Access time = (do not set)");
953 if ((t
= getxdr_u_long()) == SET_TO_CLIENT_TIME
) {
955 "Modification time = %s (set to client time)");
956 } else if (t
== SET_TO_SERVER_TIME
)
957 (void) sprintf(get_line(0, 0),
958 "Modification time = (set to server time)");
960 (void) sprintf(get_line(0, 0),
961 "Modification time = (do not set)");
962 (void) show_line("");
972 return ("Regular File");
974 return ("Directory");
976 return ("Block special");
978 return ("Character special");
980 return ("Symbolic Link");
982 return ("Unix domain socket");
984 return ("Named pipe");
997 buff
[0] = n
& 4 ? 'r' : '-';
998 buff
[1] = n
& 2 ? 'w' : '-';
999 buff
[2] = n
& 1 ? 'x' : '-';
1008 (void) showxdr_u_longlong(" Size = %llu bytes");
1009 (void) showxdr_date_ns(" Modification time = %s");
1010 (void) showxdr_date_ns(" Attribute change time = %s");
1011 (void) show_line("");
1015 detail_pre_op_attr(str
)
1019 if (getxdr_bool()) {
1020 (void) sprintf(get_line(0, 0),
1021 "Pre-operation attributes: %s", str
);
1024 (void) sprintf(get_line(0, 0),
1025 "Pre-operation attributes: %s (not available)", str
);
1029 detail_post_op_attr(str
)
1033 if (getxdr_bool()) {
1034 (void) sprintf(get_line(0, 0),
1035 "Post-operation attributes: %s", str
);
1038 (void) sprintf(get_line(0, 0),
1039 "Post-operation attributes: %s (not available)", str
);
1043 detail_wcc_data(str
)
1047 detail_pre_op_attr(str
);
1048 detail_post_op_attr(str
);
1054 static char buff
[NFS_MAXNAMLEN
+ 1]; /* protocol allows longer names */
1058 if (setjmp(xdr_err
)) {
1059 (void) sprintf(buff
, " %d+ entries (incomplete)", entries
);
1063 xdr_skip(8); /* cookieverf */
1064 while (getxdr_bool()) {
1066 xdr_skip(8); /* fileid */
1067 (void) getxdr_string(buff
, NFS_MAXNAMLEN
); /* name */
1068 xdr_skip(8); /* cookie */
1071 (void) sprintf(buff
, " %d entries (%s)",
1072 entries
, getxdr_bool() ? "No more" : "More");
1077 sum_readdirplusres()
1079 static char buff
[NFS_MAXNAMLEN
+ 1]; /* protocol allows longer */
1084 if (setjmp(xdr_err
)) {
1085 (void) sprintf(buff
, " %d+ entries (incomplete)", entries
);
1089 xdr_skip(8); /* cookieverf */
1090 while (getxdr_bool()) {
1092 xdr_skip(8); /* fileid */
1093 (void) getxdr_string(buff
, NFS_MAXNAMLEN
); /* name */
1094 xdr_skip(8); /* cookie */
1095 skip_postop(); /* post-op */
1096 if (getxdr_bool()) {
1097 skip
= getxdr_long();
1098 xdr_skip(RNDUP(skip
)); /* fhandle */
1102 (void) sprintf(buff
, " %d entries (%s)",
1103 entries
, getxdr_bool() ? "No more" : "More");
1111 u_longlong_t fileid
, cookie
;
1113 char buff
[NFS_MAXNAMLEN
+ 1]; /* protocol allows longer names */
1116 detail_post_op_attr("");
1117 (void) showxdr_hex(8, "Cookie verifier = %s");
1118 (void) show_line("");
1119 (void) sprintf(get_line(0, 0), " File id Cookie Name");
1121 if (setjmp(xdr_err
)) {
1122 (void) sprintf(get_line(0, 0),
1123 " %d+ entries. (Frame is incomplete)",
1127 while (getxdr_bool()) {
1129 fileid
= getxdr_u_longlong();
1130 name
= (char *)getxdr_string(buff
, NFS_MAXNAMLEN
);
1131 cookie
= getxdr_u_longlong();
1132 (void) sprintf(get_line(0, 0),
1133 " %10llu %10llu %s",
1134 fileid
, cookie
, name
);
1137 (void) sprintf(get_line(0, 0), " %d entries", entries
);
1138 (void) showxdr_bool("EOF = %s");
1142 detail_readdirplusres()
1147 detail_post_op_attr("");
1148 (void) showxdr_hex(8, "Cookie verifier = %s");
1149 (void) show_line("");
1151 if (setjmp(xdr_err
)) {
1152 (void) sprintf(get_line(0, 0),
1153 " %d+ entries. (Frame is incomplete)",
1157 while (getxdr_bool()) {
1159 (void) sprintf(get_line(0, 0),
1160 "------------------ entry #%d",
1162 (void) showxdr_u_longlong("File ID = %llu");
1163 (void) showxdr_string(NFS_MAXNAMLEN
, "Name = %s");
1164 (void) showxdr_u_longlong("Cookie = %llu");
1165 detail_post_op_attr("");
1169 (void) sprintf(get_line(0, 0),
1170 "(No file handle available)");
1173 (void) show_line("");
1174 (void) sprintf(get_line(0, 0), " %d entries", entries
);
1175 (void) showxdr_bool("EOF = %s");
1183 how
= getxdr_long();
1186 return ("UNCHECKED");
1190 return ("EXCLUSIVE");
1202 stable
= getxdr_long();