| Wireshark 4.7.3 The Wireshark network protocol analyzer

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