Updates from Ed Warnicke.
[obnox/wireshark/wip.git] / packet-nfs.h
1 /* packet-nfs.h (c) 1999 Uwe Girlich */
2 /* $Id: packet-nfs.h,v 1.7 2000/12/01 00:38:18 guy Exp $ */
3
4 #ifndef __PACKET_NFS_H__
5 #define __PACKET_NFS_H__
6
7 #include "packet-rpc.h"
8
9 #define NFS_PROGRAM 100003
10
11 #define FHSIZE 32
12
13 /* verifier */
14 #define NFS3_COOKIEVERFSIZE 8
15 #define NFS3_CREATEVERFSIZE 8
16 #define NFS3_WRITEVERFSIZE 8
17
18 /* for ftype3 */
19 #define NF3REG  1
20 #define NF3DIR  2
21 #define NF3BLK  3
22 #define NF3CHR  4
23 #define NF3LNK  5
24 #define NF3SOCK 6
25 #define NF3FIFO 7
26
27 /*
28  * NFSv4 error codes used in code, as opposed to UI
29  */
30 #define NFS4_OK 0
31 #define NFS4ERR_DENIED 10010
32 #define NFS4ERR_CLID_INUSE 10017
33
34 /*
35  * NFSv4 file types
36  */
37 #define NF4REG                  1
38 #define NF4DIR                  2
39 #define NF4BLK                  3
40 #define NF4CHR                  4
41 #define NF4LNK                  5
42 #define NF4SOCK         6
43 #define NF4FIFO         7
44 #define NF4ATTRDIR      8
45 #define NF4NAMEDATTR    9
46
47 /*
48  * Since NFSv4 "operations" are handled differently than previous NFS
49  * versions, these tokens are necessary.
50  */
51 #define NFS4_OP_ACCESS                                          3
52 #define NFS4_OP_CLOSE                                           4
53 #define NFS4_OP_COMMIT                                          5
54 #define NFS4_OP_CREATE                                          6
55 #define NFS4_OP_DELEGPURGE                                      7
56 #define NFS4_OP_DELEGRETURN                             8
57 #define NFS4_OP_GETATTR                                         9
58 #define NFS4_OP_GETFH                                           10
59 #define NFS4_OP_LINK                                                    11
60 #define NFS4_OP_LOCK                                                    12
61 #define NFS4_OP_LOCKT                                           13
62 #define NFS4_OP_LOCKU                                           14
63 #define NFS4_OP_LOOKUP                                          15
64 #define NFS4_OP_LOOKUPP                                         16
65 #define NFS4_OP_NVERIFY                                         17
66 #define NFS4_OP_OPEN                                                    18
67 #define NFS4_OP_OPENATTR                                        19
68 #define NFS4_OP_OPEN_CONFIRM                            20
69 #define NFS4_OP_OPEN_DOWNGRADE                  21
70 #define NFS4_OP_PUTFH                                           22
71 #define NFS4_OP_PUTPUBFH                                        23
72 #define NFS4_OP_PUTROOTFH                                       24
73 #define NFS4_OP_READ                                                    25
74 #define NFS4_OP_READDIR                                         26
75 #define NFS4_OP_READLINK                                        27
76 #define NFS4_OP_REMOVE                                          28
77 #define NFS4_OP_RENAME                                          29
78 #define NFS4_OP_RENEW                                           30
79 #define NFS4_OP_RESTOREFH                                       31
80 #define NFS4_OP_SAVEFH                                          32
81 #define NFS4_OP_SECINFO                                         33
82 #define NFS4_OP_SETATTR                                         34
83 #define NFS4_OP_SETCLIENTID                             35
84 #define NFS4_OP_SETCLIENTID_CONFIRM             36
85 #define NFS4_OP_VERIFY                                          37
86 #define NFS4_OP_WRITE                                           38
87
88 /* for write */
89 #define UNSTABLE 0
90 #define DATA_SYNC 1
91 #define FILE_SYNC 2
92
93 /* for create */
94 #define UNCHECKED 0
95 #define GUARDED 1
96 #define EXCLUSIVE 2
97
98
99 /* the RPC mount protocol needs both function to decode a MNT reply */
100 int dissect_fhandle(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name);
101 int dissect_nfs_fh3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name);
102
103 #endif /* packet-nfs.h */
104