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