dc445ed7e61179435b34e2b2c9aee06105881505
[obnox/wireshark/wip.git] / packet-nfsacl.c
1 /* packet-nfsacl.c
2  * Stubs for Sun's NFS ACL RPC service (runs on port 2049, and is presumably
3  * handled by the same kernel server code that handles NFS)
4  *
5  * Guy Harris <guy@alum.mit.edu>
6  *
7  * $Id: packet-nfsacl.c,v 1.4 2002/10/23 21:17:02 guy Exp $
8  *
9  * Ethereal - Network traffic analyzer
10  * By Gerald Combs <gerald@ethereal.com>
11  * Copyright 1998 Gerald Combs
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
26  */
27
28 #ifdef HAVE_CONFIG_H
29 #include "config.h"
30 #endif
31
32
33
34 #include "packet-rpc.h"
35
36 static int proto_nfsacl = -1;
37
38 static gint ett_nfsacl = -1;
39
40 #define NFSACL_PROGRAM  100227
41
42 #define NFSACLPROC_NULL         0
43
44 #define NFSACLPROC2_GETACL      1
45 #define NFSACLPROC2_SETACL      2
46 #define NFSACLPROC2_GETATTR     3
47 #define NFSACLPROC2_ACCESS      4
48
49 #define NFSACLPROC3_GETACL      1
50 #define NFSACLPROC3_SETACL      2
51
52 /* proc number, "proc name", dissect_request, dissect_reply */
53 /* NULL as function pointer means: type of arguments is "void". */
54 static const vsff nfsacl1_proc[] = {
55         { NFSACLPROC_NULL,      "NULL",
56                 NULL,   NULL },
57         { 0,    NULL,   NULL,   NULL }
58 };
59
60 static const vsff nfsacl2_proc[] = {
61         { NFSACLPROC_NULL,      "NULL",
62                 NULL,   NULL },
63         { NFSACLPROC2_GETACL,   "GETACL",
64                 NULL,   NULL },
65         { NFSACLPROC2_SETACL,   "SETACL",
66                 NULL,   NULL },
67         { NFSACLPROC2_GETATTR,  "GETATTR",
68                 NULL,   NULL },
69         { NFSACLPROC2_ACCESS,   "ACCESS",
70                 NULL,   NULL },
71         { 0,    NULL,   NULL,   NULL }
72 };
73
74 static const vsff nfsacl3_proc[] = {
75         { NFSACLPROC_NULL,      "NULL",
76                 NULL,   NULL },
77         { NFSACLPROC3_GETACL,   "GETACL",
78                 NULL,   NULL },
79         { NFSACLPROC3_SETACL,   "SETACL",
80                 NULL,   NULL },
81         { 0,    NULL,   NULL,   NULL }
82 };
83
84 void
85 proto_register_nfsacl(void)
86 {
87 #if 0
88         static hf_register_info hf[] = {
89         };
90 #endif
91
92         static gint *ett[] = {
93                 &ett_nfsacl,
94         };
95
96         proto_nfsacl = proto_register_protocol("NFSACL", "NFSACL", "nfsacl");
97 #if 0
98         proto_register_field_array(proto_nfsacl, hf, array_length(hf));
99 #endif
100         proto_register_subtree_array(ett, array_length(ett));
101 }
102
103 void
104 proto_reg_handoff_nfsacl(void)
105 {
106         /* Register the protocol as RPC */
107         rpc_init_prog(proto_nfsacl, NFSACL_PROGRAM, ett_nfsacl);
108         /* Register the procedure tables */
109         rpc_init_proc_table(NFSACL_PROGRAM, 1, nfsacl1_proc, -1);
110         rpc_init_proc_table(NFSACL_PROGRAM, 2, nfsacl2_proc, -1);
111         rpc_init_proc_table(NFSACL_PROGRAM, 3, nfsacl3_proc, -1);
112 }