1 /* packet-nfs.h (c) 1999 Uwe Girlich */
3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 1998 Gerald Combs
7 * SPDX-License-Identifier: GPL-2.0-or-later
10 #ifndef __PACKET_NFS_H__
11 #define __PACKET_NFS_H__
13 #include "packet-rpc.h"
15 #define NFS_PROGRAM 100003
16 #define NFS_CB_PROGRAM 0x40000000
21 #define NFS3_COOKIEVERFSIZE 8
22 #define NFS3_CREATEVERFSIZE 8
23 #define NFS3_WRITEVERFSIZE 8
35 * NFSv4 error codes used in code, as opposed to UI
38 #define NFS4ERR_DENIED 10010
39 #define NFS4ERR_CLID_INUSE 10017
40 #define NFS4ERR_OFFLOAD_NO_REQS 10094
53 #define NF4NAMEDATTR 9
56 * Since NFSv4 "operations" are handled differently than previous NFS
57 * versions, these tokens are necessary.
59 #define NFS4_OP_ACCESS 3
60 #define NFS4_OP_CLOSE 4
61 #define NFS4_OP_COMMIT 5
62 #define NFS4_OP_CREATE 6
63 #define NFS4_OP_DELEGPURGE 7
64 #define NFS4_OP_DELEGRETURN 8
65 #define NFS4_OP_GETATTR 9
66 #define NFS4_OP_GETFH 10
67 #define NFS4_OP_LINK 11
68 #define NFS4_OP_LOCK 12
69 #define NFS4_OP_LOCKT 13
70 #define NFS4_OP_LOCKU 14
71 #define NFS4_OP_LOOKUP 15
72 #define NFS4_OP_LOOKUPP 16
73 #define NFS4_OP_NVERIFY 17
74 #define NFS4_OP_OPEN 18
75 #define NFS4_OP_OPENATTR 19
76 #define NFS4_OP_OPEN_CONFIRM 20
77 #define NFS4_OP_OPEN_DOWNGRADE 21
78 #define NFS4_OP_PUTFH 22
79 #define NFS4_OP_PUTPUBFH 23
80 #define NFS4_OP_PUTROOTFH 24
81 #define NFS4_OP_READ 25
82 #define NFS4_OP_READDIR 26
83 #define NFS4_OP_READLINK 27
84 #define NFS4_OP_REMOVE 28
85 #define NFS4_OP_RENAME 29
86 #define NFS4_OP_RENEW 30
87 #define NFS4_OP_RESTOREFH 31
88 #define NFS4_OP_SAVEFH 32
89 #define NFS4_OP_SECINFO 33
90 #define NFS4_OP_SETATTR 34
91 #define NFS4_OP_SETCLIENTID 35
92 #define NFS4_OP_SETCLIENTID_CONFIRM 36
93 #define NFS4_OP_VERIFY 37
94 #define NFS4_OP_WRITE 38
95 #define NFS4_OP_RELEASE_LOCKOWNER 39
97 #define NFS4_OP_BACKCHANNEL_CTL 40
98 #define NFS4_OP_BIND_CONN_TO_SESSION 41
99 #define NFS4_OP_EXCHANGE_ID 42
100 #define NFS4_OP_CREATE_SESSION 43
101 #define NFS4_OP_DESTROY_SESSION 44
102 #define NFS4_OP_FREE_STATEID 45
103 #define NFS4_OP_GET_DIR_DELEGATION 46
104 #define NFS4_OP_GETDEVINFO 47
105 #define NFS4_OP_GETDEVLIST 48
106 #define NFS4_OP_LAYOUTCOMMIT 49
107 #define NFS4_OP_LAYOUTGET 50
108 #define NFS4_OP_LAYOUTRETURN 51
109 #define NFS4_OP_SECINFO_NO_NAME 52
110 #define NFS4_OP_SEQUENCE 53
111 #define NFS4_OP_SET_SSV 54
112 #define NFS4_OP_TEST_STATEID 55
113 #define NFS4_OP_WANT_DELEGATION 56
114 #define NFS4_OP_DESTROY_CLIENTID 57
115 #define NFS4_OP_RECLAIM_COMPLETE 58
116 /* Minor version 2 */
117 #define NFS4_OP_ALLOCATE 59
118 #define NFS4_OP_COPY 60
119 #define NFS4_OP_COPY_NOTIFY 61
120 #define NFS4_OP_DEALLOCATE 62
121 #define NFS4_OP_IO_ADVISE 63
122 #define NFS4_OP_LAYOUTERROR 64
123 #define NFS4_OP_LAYOUTSTATS 65
124 #define NFS4_OP_OFFLOAD_CANCEL 66
125 #define NFS4_OP_OFFLOAD_STATUS 67
126 #define NFS4_OP_READ_PLUS 68
127 #define NFS4_OP_SEEK 69
128 #define NFS4_OP_WRITE_SAME 70
129 #define NFS4_OP_CLONE 71
130 #define NFS4_OP_GETXATTR 72
131 #define NFS4_OP_SETXATTR 73
132 #define NFS4_OP_LISTXATTRS 74
133 #define NFS4_OP_REMOVEXATTR 75
134 #define NFS4_LAST_OP 75
135 #define NFS4_OP_ILLEGAL 10044
138 * NFSv41 callback ops
140 #define NFS4_OP_CB_GETATTR 3
141 #define NFS4_OP_CB_RECALL 4
142 #define NFS4_OP_CB_LAYOUTRECALL 5
143 #define NFS4_OP_CB_NOTIFY 6
144 #define NFS4_OP_CB_PUSH_DELEG 7
145 #define NFS4_OP_CB_RECALL_ANY 8
146 #define NFS4_OP_CB_RECALLABLE_OBJ_AVAIL 9
147 #define NFS4_OP_CB_RECALL_SLOT 10
148 #define NFS4_OP_CB_SEQUENCE 11
149 #define NFS4_OP_CB_WANTS_CANCELLED 12
150 #define NFS4_OP_CB_NOTIFY_LOCK 13
151 #define NFS4_OP_CB_NOTIFY_DEVICEID 14
152 #define NFS4_OP_CB_OFFLOAD 15
153 #define NFS4_OP_CB_ILLEGAL 10044
169 #define EXCLUSIVE4_1 3
171 /* for access mask */
172 #define NFS_ACCESS_MASK_READ 0x001
173 #define NFS_ACCESS_MASK_LOOKUP 0x002
174 #define NFS_ACCESS_MASK_MODIFY 0x004
175 #define NFS_ACCESS_MASK_EXTEND 0x008
176 #define NFS_ACCESS_MASK_DELETE 0x010
177 #define NFS_ACCESS_MASK_EXECUTE 0x020
178 #define NFS_ACCESS_MASK_XATTR_READ 0x040
179 #define NFS_ACCESS_MASK_XATTR_WRITE 0x080
180 #define NFS_ACCESS_MASK_XATTR_LIST 0x100
182 /* pNFS layout types */
183 #define LAYOUT4_NO_LAYOUT_TYPE 0
184 #define LAYOUT4_NFSV4_1_FILES 1
185 #define LAYOUT4_OSD2_OBJECTS 2
186 #define LAYOUT4_BLOCK_VOLUME 3
187 #define LAYOUT4_FLEX_FILES 4
188 #define LAYOUT4_SCSI 5
190 #define NFL4_UFLG_MASK 0x0000003F
191 #define NFL4_UFLG_DENSE 0x00000001
192 #define NFL4_UFLG_COMMIT_THRU_MDS 0x00000002
193 #define NFL4_UFLG_STRIPE_UNIT_SIZE_MASK 0xFFFFFFC0
195 /* GET_DIR_DELEGATION non-fatal status */
197 #define GDD4_UNAVAIL 1
204 #define NL4_NETADDR 3
206 extern bool nfs_file_name_snooping
;
207 extern void nfs_name_snoop_add_name(int xid
, tvbuff_t
*tvb
, int name_offset
, int name_len
,
208 int parent_offset
, int parent_len
, const char *name
);
209 extern bool nfs_fhandle_reqrep_matching
;
210 extern int dissect_fhandle(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_tree
*tree
,
211 const char *name
, uint32_t *hash
, rpc_call_info_value
*civ
);
212 extern void dissect_fhandle_hidden(packet_info
*pinfo
, proto_tree
*tree
, int frame
);
213 extern int dissect_nfs3_fh(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_tree
*tree
,
214 const char *name
, uint32_t *hash
, rpc_call_info_value
*civ
);
215 extern int dissect_nfs3_post_op_attr(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_tree
*tree
,
217 extern int dissect_nfs2_fattr(tvbuff_t
*tvb
, int offset
, proto_tree
*tree
, const char* name
);
218 extern proto_tree
* display_access_items(tvbuff_t
* tvb
, int offset
, packet_info
* pinfo
,
219 proto_tree
* tree
, uint32_t amask
, char mtype
, int version
,
220 wmem_strbuf_t
* optext
, const char* label
);
221 extern int dissect_access_reply(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_tree
* tree
,
222 int version
, wmem_strbuf_t
*optext
, rpc_call_info_value
*civ
);
223 extern int hf_nfs_status
;
225 #endif /* packet-nfs.h */