1 /* packet-nfs.h (c) 1999 Uwe Girlich */
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #ifndef __PACKET_NFS_H__
24 #define __PACKET_NFS_H__
26 #include "packet-rpc.h"
28 #define NFS_PROGRAM 100003
33 #define NFS3_COOKIEVERFSIZE 8
34 #define NFS3_CREATEVERFSIZE 8
35 #define NFS3_WRITEVERFSIZE 8
47 * NFSv4 error codes used in code, as opposed to UI
50 #define NFS4ERR_DENIED 10010
51 #define NFS4ERR_CLID_INUSE 10017
64 #define NF4NAMEDATTR 9
67 * Since NFSv4 "operations" are handled differently than previous NFS
68 * versions, these tokens are necessary.
70 #define NFS4_OP_ACCESS 3
71 #define NFS4_OP_CLOSE 4
72 #define NFS4_OP_COMMIT 5
73 #define NFS4_OP_CREATE 6
74 #define NFS4_OP_DELEGPURGE 7
75 #define NFS4_OP_DELEGRETURN 8
76 #define NFS4_OP_GETATTR 9
77 #define NFS4_OP_GETFH 10
78 #define NFS4_OP_LINK 11
79 #define NFS4_OP_LOCK 12
80 #define NFS4_OP_LOCKT 13
81 #define NFS4_OP_LOCKU 14
82 #define NFS4_OP_LOOKUP 15
83 #define NFS4_OP_LOOKUPP 16
84 #define NFS4_OP_NVERIFY 17
85 #define NFS4_OP_OPEN 18
86 #define NFS4_OP_OPENATTR 19
87 #define NFS4_OP_OPEN_CONFIRM 20
88 #define NFS4_OP_OPEN_DOWNGRADE 21
89 #define NFS4_OP_PUTFH 22
90 #define NFS4_OP_PUTPUBFH 23
91 #define NFS4_OP_PUTROOTFH 24
92 #define NFS4_OP_READ 25
93 #define NFS4_OP_READDIR 26
94 #define NFS4_OP_READLINK 27
95 #define NFS4_OP_REMOVE 28
96 #define NFS4_OP_RENAME 29
97 #define NFS4_OP_RENEW 30
98 #define NFS4_OP_RESTOREFH 31
99 #define NFS4_OP_SAVEFH 32
100 #define NFS4_OP_SECINFO 33
101 #define NFS4_OP_SETATTR 34
102 #define NFS4_OP_SETCLIENTID 35
103 #define NFS4_OP_SETCLIENTID_CONFIRM 36
104 #define NFS4_OP_VERIFY 37
105 #define NFS4_OP_WRITE 38
106 #define NFS4_OP_RELEASE_LOCKOWNER 39
107 /* Minor version 1 */
108 #define NFS4_OP_BACKCHANNEL_CTL 40
109 #define NFS4_OP_BIND_CONN_TO_SESSION 41
110 #define NFS4_OP_EXCHANGE_ID 42
111 #define NFS4_OP_CREATE_SESSION 43
112 #define NFS4_OP_DESTROY_SESSION 44
113 #define NFS4_OP_FREE_STATEID 45
114 #define NFS4_OP_GET_DIR_DELEGATION 46
115 #define NFS4_OP_GETDEVINFO 47
116 #define NFS4_OP_GETDEVLIST 48
117 #define NFS4_OP_LAYOUTCOMMIT 49
118 #define NFS4_OP_LAYOUTGET 50
119 #define NFS4_OP_LAYOUTRETURN 51
120 #define NFS4_OP_SECINFO_NO_NAME 52
121 #define NFS4_OP_SEQUENCE 53
122 #define NFS4_OP_SET_SSV 54
123 #define NFS4_OP_TEST_STATEID 55
124 #define NFS4_OP_WANT_DELEGATION 56
125 #define NFS4_OP_DESTROY_CLIENTID 57
126 #define NFS4_OP_RECLAIM_COMPLETE 58
128 #define NFS4_OP_ILLEGAL 10044
131 * NFSv41 callback ops
133 #define NFS4_OP_CB_GETATTR 3
134 #define NFS4_OP_CB_RECALL 4
135 #define NFS4_OP_CB_LAYOUTRECALL 5
136 #define NFS4_OP_CB_NOTIFY 6
137 #define NFS4_OP_CB_PUSH_DELEG 7
138 #define NFS4_OP_CB_RECALL_ANY 8
139 #define NFS4_OP_CB_RECALLABLE_OBJ_AVAIL 9
140 #define NFS4_OP_CB_RECALL_SLOT 10
141 #define NFS4_OP_CB_SEQUENCE 11
142 #define NFS4_OP_CB_WANTS_CANCELLED 12
143 #define NFS4_OP_CB_NOTIFY_LOCK 13
144 #define NFS4_OP_CB_NOTIFY_DEVICEID 14
145 #define NFS4_OP_CB_ILLEGAL 10044
161 #define EXCLUSIVE4_1 3
163 /* for access mask */
164 #define NFS_ACCESS_MASK_READ 0x01
165 #define NFS_ACCESS_MASK_LOOKUP 0x02
166 #define NFS_ACCESS_MASK_MODIFY 0x04
167 #define NFS_ACCESS_MASK_EXTEND 0x08
168 #define NFS_ACCESS_MASK_DELETE 0x10
169 #define NFS_ACCESS_MASK_EXECUTE 0x20
171 /* pNFS layout types */
172 #define LAYOUT4_NFSV4_1_FILES 1
173 #define LAYOUT4_OSD2_OBJECTS 2
174 #define LAYOUT4_BLOCK_VOLUME 3
176 extern gboolean nfs_file_name_snooping
;
177 extern void nfs_name_snoop_add_name(int xid
, tvbuff_t
*tvb
, int name_offset
, int name_len
,
178 int parent_offset
, int parent_len
, const char *name
);
179 extern gboolean nfs_fhandle_reqrep_matching
;
180 extern int dissect_fhandle(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_tree
*tree
,
181 const char *name
, guint32
*hash
, rpc_call_info_value
*civ
);
182 extern void dissect_fhandle_hidden(packet_info
*pinfo
, proto_tree
*tree
, int frame
);
183 extern int dissect_nfs3_fh(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_tree
*tree
,
184 const char *name
, guint32
*hash
, rpc_call_info_value
*civ
);
185 extern int dissect_nfs3_post_op_attr(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_tree
*tree
,
187 extern int dissect_nfs2_fattr(tvbuff_t
*tvb
, int offset
, proto_tree
*tree
, const char* name
);
188 extern proto_tree
* display_access_items(tvbuff_t
* tvb
, int offset
, packet_info
* pinfo
,
189 proto_tree
* tree
, guint32 amask
, char mtype
, int version
,
190 GString
* optext
, const char* label
);
191 extern int dissect_access_reply(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_tree
* tree
,
192 int version
, GString
*optext
, rpc_call_info_value
*civ
);
193 extern int hf_nfs_status
;
195 #endif /* packet-nfs.h */