Wireshark 4.5.0
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 <[email protected]>
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#define NFS_CB_PROGRAM 0x40000000
17
18#define FHSIZE 32
19
20/* verifier */
21#define NFS3_COOKIEVERFSIZE 8
22#define NFS3_CREATEVERFSIZE 8
23#define NFS3_WRITEVERFSIZE 8
24
25/* for ftype3 */
26#define NF3REG 1
27#define NF3DIR 2
28#define NF3BLK 3
29#define NF3CHR 4
30#define NF3LNK 5
31#define NF3SOCK 6
32#define NF3FIFO 7
33
34/*
35 * NFSv4 error codes used in code, as opposed to UI
36 */
37#define NFS4_OK 0
38#define NFS4ERR_DENIED 10010
39#define NFS4ERR_CLID_INUSE 10017
40#define NFS4ERR_OFFLOAD_NO_REQS 10094
41
42/*
43 * NFSv4 file types
44 */
45#define NF4REG 1
46#define NF4DIR 2
47#define NF4BLK 3
48#define NF4CHR 4
49#define NF4LNK 5
50#define NF4SOCK 6
51#define NF4FIFO 7
52#define NF4ATTRDIR 8
53#define NF4NAMEDATTR 9
54
55/*
56 * Since NFSv4 "operations" are handled differently than previous NFS
57 * versions, these tokens are necessary.
58 */
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
96/* Minor version 1 */
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
136
137/*
138 * NFSv41 callback ops
139 */
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
154
155/* for write */
156#define UNSTABLE 0
157#define DATA_SYNC 1
158#define FILE_SYNC 2
159
160/* for create */
161#define UNCHECKED 0
162#define GUARDED 1
163#define EXCLUSIVE 2
164
165/* for create4 */
166#define UNCHECKED4 0
167#define GUARDED4 1
168#define EXCLUSIVE4 2
169#define EXCLUSIVE4_1 3
170
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
181
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
189
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
194
195/* GET_DIR_DELEGATION non-fatal status */
196#define GDD4_OK 0
197#define GDD4_UNAVAIL 1
198
199/* NFSv4.2 */
200
201/* netloc types */
202#define NL4_NAME 1
203#define NL4_URL 2
204#define NL4_NETADDR 3
205
206extern bool nfs_file_name_snooping;
207extern 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);
209extern bool nfs_fhandle_reqrep_matching;
210extern 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);
212extern void dissect_fhandle_hidden(packet_info *pinfo, proto_tree *tree, int frame);
213extern 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);
215extern int dissect_nfs3_post_op_attr(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
216 const char* name);
217extern int dissect_nfs2_fattr(tvbuff_t *tvb, int offset, proto_tree *tree, const char* name);
218extern 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);
221extern 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);
223extern int hf_nfs_status;
224
225#endif /* packet-nfs.h */
226
Definition packet_info.h:43
Definition proto.h:903
Definition packet-rpc.h:109
Definition wmem_strbuf.h:42
Definition tvbuff-int.h:35