FIXUP: WIP: verification_trailer
[wireshark-wip.git] / epan / dissectors / packet-rstat.c
blobb7003174f45d6a971ffa00601184d372a7e6b4bd
1 /* packet-rstat.c
2 * Stubs for Sun's remote statistics RPC service
4 * Guy Harris <guy@alum.mit.edu>
6 * $Id$
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
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.
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.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 #include "config.h"
31 #include "packet-rpc.h"
33 static int proto_rstat = -1;
34 static int hf_rstat_procedure_v1 = -1;
35 static int hf_rstat_procedure_v2 = -1;
36 static int hf_rstat_procedure_v3 = -1;
37 static int hf_rstat_procedure_v4 = -1;
39 static gint ett_rstat = -1;
41 #define RSTAT_PROGRAM 100001
43 #define RSTATPROC_NULL 0
44 #define RSTATPROC_STATS 1
45 #define RSTATPROC_HAVEDISK 2
47 /* proc number, "proc name", dissect_request, dissect_reply */
48 /* NULL as function pointer means: type of arguments is "void". */
49 static const vsff rstat1_proc[] = {
50 { RSTATPROC_NULL, "NULL",
51 NULL, NULL },
52 { RSTATPROC_STATS, "STATS",
53 NULL, NULL },
54 { RSTATPROC_HAVEDISK, "HAVEDISK",
55 NULL, NULL },
56 { 0, NULL, NULL, NULL }
58 static const value_string rstat1_proc_vals[] = {
59 { RSTATPROC_NULL, "NULL" },
60 { RSTATPROC_STATS, "STATS" },
61 { RSTATPROC_HAVEDISK, "HAVEDISK" },
62 { 0, NULL }
65 static const vsff rstat2_proc[] = {
66 { RSTATPROC_NULL, "NULL",
67 NULL, NULL },
68 { RSTATPROC_STATS, "STATS",
69 NULL, NULL },
70 { RSTATPROC_HAVEDISK, "HAVEDISK",
71 NULL, NULL },
72 { 0, NULL, NULL, NULL }
74 static const value_string rstat2_proc_vals[] = {
75 { RSTATPROC_NULL, "NULL" },
76 { RSTATPROC_STATS, "STATS" },
77 { RSTATPROC_HAVEDISK, "HAVEDISK" },
78 { 0, NULL }
81 static const vsff rstat3_proc[] = {
82 { RSTATPROC_NULL, "NULL",
83 NULL, NULL },
84 { RSTATPROC_STATS, "STATS",
85 NULL, NULL },
86 { RSTATPROC_HAVEDISK, "HAVEDISK",
87 NULL, NULL },
88 { 0, NULL, NULL, NULL }
90 static const value_string rstat3_proc_vals[] = {
91 { RSTATPROC_NULL, "NULL" },
92 { RSTATPROC_STATS, "STATS" },
93 { RSTATPROC_HAVEDISK, "HAVEDISK" },
94 { 0, NULL }
97 static const vsff rstat4_proc[] = {
98 { RSTATPROC_NULL, "NULL",
99 NULL, NULL },
100 { RSTATPROC_STATS, "STATS",
101 NULL, NULL },
102 { RSTATPROC_HAVEDISK, "HAVEDISK",
103 NULL, NULL },
104 { 0, NULL, NULL, NULL }
106 static const value_string rstat4_proc_vals[] = {
107 { RSTATPROC_NULL, "NULL" },
108 { RSTATPROC_STATS, "STATS" },
109 { RSTATPROC_HAVEDISK, "HAVEDISK" },
110 { 0, NULL }
113 void
114 proto_register_rstat(void)
116 static hf_register_info hf[] = {
117 { &hf_rstat_procedure_v1, {
118 "V1 Procedure", "rstat.procedure_v1", FT_UINT32, BASE_DEC,
119 VALS(rstat1_proc_vals), 0, NULL, HFILL }},
120 { &hf_rstat_procedure_v2, {
121 "V2 Procedure", "rstat.procedure_v2", FT_UINT32, BASE_DEC,
122 VALS(rstat2_proc_vals), 0, NULL, HFILL }},
123 { &hf_rstat_procedure_v3, {
124 "V3 Procedure", "rstat.procedure_v3", FT_UINT32, BASE_DEC,
125 VALS(rstat3_proc_vals), 0, NULL, HFILL }},
126 { &hf_rstat_procedure_v4, {
127 "V4 Procedure", "rstat.procedure_v4", FT_UINT32, BASE_DEC,
128 VALS(rstat4_proc_vals), 0, NULL, HFILL }}
131 static gint *ett[] = {
132 &ett_rstat,
135 proto_rstat = proto_register_protocol("RSTAT", "RSTAT", "rstat");
136 proto_register_field_array(proto_rstat, hf, array_length(hf));
137 proto_register_subtree_array(ett, array_length(ett));
140 void
141 proto_reg_handoff_rstat(void)
143 /* Register the protocol as RPC */
144 rpc_init_prog(proto_rstat, RSTAT_PROGRAM, ett_rstat);
145 /* Register the procedure tables */
146 rpc_init_proc_table(RSTAT_PROGRAM, 1, rstat1_proc, hf_rstat_procedure_v1);
147 rpc_init_proc_table(RSTAT_PROGRAM, 2, rstat2_proc, hf_rstat_procedure_v2);
148 rpc_init_proc_table(RSTAT_PROGRAM, 3, rstat3_proc, hf_rstat_procedure_v3);
149 rpc_init_proc_table(RSTAT_PROGRAM, 4, rstat4_proc, hf_rstat_procedure_v4);