From Michael Tuexen: update for the ASAP dissector which provides
[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.2 2002/05/16 08:57:12 sahlberg 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 #ifdef HAVE_SYS_TYPES_H
34 #include <sys/types.h>
35 #endif
36
37
38 #include "packet-rpc.h"
39
40 static int proto_nfsacl = -1;
41
42 static gint ett_nfsacl = -1;
43
44 #define NFSACL_PROGRAM  100227
45
46 #define NFSACLPROC_NULL         0
47
48 #define NFSACLPROC2_GETACL      1
49 #define NFSACLPROC2_SETACL      2
50 #define NFSACLPROC2_GETATTR     3
51 #define NFSACLPROC2_ACCESS      4
52
53 #define NFSACLPROC3_GETACL      1
54 #define NFSACLPROC3_SETACL      2
55
56 /* proc number, "proc name", dissect_request, dissect_reply */
57 /* NULL as function pointer means: type of arguments is "void". */
58 static const vsff nfsacl1_proc[] = {
59         { NFSACLPROC_NULL,      "NULL",
60                 NULL,   NULL },
61         { 0,    NULL,   NULL,   NULL }
62 };
63
64 static const vsff nfsacl2_proc[] = {
65         { NFSACLPROC_NULL,      "NULL",
66                 NULL,   NULL },
67         { NFSACLPROC2_GETACL,   "GETACL",
68                 NULL,   NULL },
69         { NFSACLPROC2_SETACL,   "SETACL",
70                 NULL,   NULL },
71         { NFSACLPROC2_GETATTR,  "GETATTR",
72                 NULL,   NULL },
73         { NFSACLPROC2_ACCESS,   "ACCESS",
74                 NULL,   NULL },
75         { 0,    NULL,   NULL,   NULL }
76 };
77
78 static const vsff nfsacl3_proc[] = {
79         { NFSACLPROC_NULL,      "NULL",
80                 NULL,   NULL },
81         { NFSACLPROC3_GETACL,   "GETACL",
82                 NULL,   NULL },
83         { NFSACLPROC3_SETACL,   "SETACL",
84                 NULL,   NULL },
85         { 0,    NULL,   NULL,   NULL }
86 };
87
88 void
89 proto_register_nfsacl(void)
90 {
91 #if 0
92         static hf_register_info hf[] = {
93         };
94 #endif
95
96         static gint *ett[] = {
97                 &ett_nfsacl,
98         };
99
100         proto_nfsacl = proto_register_protocol("NFSACL", "NFSACL", "nfsacl");
101 #if 0
102         proto_register_field_array(proto_nfsacl, hf, array_length(hf));
103 #endif
104         proto_register_subtree_array(ett, array_length(ett));
105 }
106
107 void
108 proto_reg_handoff_nfsacl(void)
109 {
110         /* Register the protocol as RPC */
111         rpc_init_prog(proto_nfsacl, NFSACL_PROGRAM, ett_nfsacl);
112         /* Register the procedure tables */
113         rpc_init_proc_table(NFSACL_PROGRAM, 1, nfsacl1_proc);
114         rpc_init_proc_table(NFSACL_PROGRAM, 2, nfsacl2_proc);
115         rpc_init_proc_table(NFSACL_PROGRAM, 3, nfsacl3_proc);
116 }