From Jesper Peterson:
[obnox/wireshark/wip.git] / packet-nfsauth.c
1 /* packet-nfsauth.c
2  * Stubs for Sun's NFS AUTH RPC service
3  *
4  * Ronnie Sahlberg
5  *
6  * $Id: packet-nfsauth.c,v 1.4 2002/11/01 00:48:38 sahlberg Exp $
7  *
8  * Ethereal - Network traffic analyzer
9  * By Gerald Combs <gerald@ethereal.com>
10  * Copyright 1998 Gerald Combs
11  *
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public License
14  * as published by the Free Software Foundation; either version 2
15  * of the License, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
25  */
26
27 #ifdef HAVE_CONFIG_H
28 #include "config.h"
29 #endif
30
31
32
33 #include "packet-rpc.h"
34
35 static int proto_nfsauth = -1;
36 static int hf_nfsauth_procedure_v1 = -1;
37
38 static gint ett_nfsauth = -1;
39
40 #define NFSAUTH_PROGRAM 100231
41
42 #define NFSAUTHPROC_NULL                0
43 #define NFSAUTH1_ACCESS                 1
44 /* proc number, "proc name", dissect_request, dissect_reply */
45 /* NULL as function pointer means: type of arguments is "void". */
46 static const vsff nfsauth1_proc[] = {
47         { NFSAUTHPROC_NULL,     "NULL",
48                 NULL,   NULL },
49         { NFSAUTH1_ACCESS,      "ACCESS",
50                 NULL,   NULL },
51         { 0,    NULL,   NULL,   NULL }
52 };
53 static const value_string nfsauth1_proc_vals[] = {
54         { NFSAUTHPROC_NULL,     "NULL" },
55         { NFSAUTH1_ACCESS,      "ACCESS" },
56         { 0,    NULL }
57 };
58
59
60 void
61 proto_register_nfsauth(void)
62 {
63         static hf_register_info hf[] = {
64                 { &hf_nfsauth_procedure_v1, {
65                         "V1 Procedure", "nfsauth.procedure_v1", FT_UINT32, BASE_DEC,
66                         VALS(nfsauth1_proc_vals), 0, "V1 Procedure", HFILL }},
67         };
68
69         static gint *ett[] = {
70                 &ett_nfsauth,
71         };
72
73         proto_nfsauth = proto_register_protocol("NFSAUTH", "NFSAUTH", "nfsauth");
74         proto_register_field_array(proto_nfsauth, hf, array_length(hf));
75         proto_register_subtree_array(ett, array_length(ett));
76 }
77
78 void
79 proto_reg_handoff_nfsauth(void)
80 {
81         /* Register the protocol as RPC */
82         rpc_init_prog(proto_nfsauth, NFSAUTH_PROGRAM, ett_nfsauth);
83         /* Register the procedure tables */
84         rpc_init_proc_table(NFSAUTH_PROGRAM, 1, nfsauth1_proc, hf_nfsauth_procedure_v1);
85 }