Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-rstat.c
blob6390d2085f26f3acd90b21f2895402af6f7d7eb6
1 /* packet-rstat.c
2 * Stubs for Sun's remote statistics RPC service
4 * Guy Harris <guy@alum.mit.edu>
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * SPDX-License-Identifier: GPL-2.0-or-later
13 #include "config.h"
15 #include "packet-rpc.h"
17 void proto_register_rstat(void);
18 void proto_reg_handoff_rstat(void);
20 static int proto_rstat;
21 static int hf_rstat_procedure_v1;
22 static int hf_rstat_procedure_v2;
23 static int hf_rstat_procedure_v3;
24 static int hf_rstat_procedure_v4;
26 static int ett_rstat;
28 #define RSTAT_PROGRAM 100001
30 #define RSTATPROC_NULL 0
31 #define RSTATPROC_STATS 1
32 #define RSTATPROC_HAVEDISK 2
34 /* proc number, "proc name", dissect_request, dissect_reply */
35 static const vsff rstat1_proc[] = {
36 { RSTATPROC_NULL, "NULL",
37 dissect_rpc_void, dissect_rpc_void },
38 { RSTATPROC_STATS, "STATS",
39 dissect_rpc_unknown, dissect_rpc_unknown },
40 { RSTATPROC_HAVEDISK, "HAVEDISK",
41 dissect_rpc_unknown, dissect_rpc_unknown },
42 { 0, NULL, NULL, NULL }
44 static const value_string rstat1_proc_vals[] = {
45 { RSTATPROC_NULL, "NULL" },
46 { RSTATPROC_STATS, "STATS" },
47 { RSTATPROC_HAVEDISK, "HAVEDISK" },
48 { 0, NULL }
51 static const vsff rstat2_proc[] = {
52 { RSTATPROC_NULL, "NULL",
53 dissect_rpc_void, dissect_rpc_void },
54 { RSTATPROC_STATS, "STATS",
55 dissect_rpc_unknown, dissect_rpc_unknown },
56 { RSTATPROC_HAVEDISK, "HAVEDISK",
57 dissect_rpc_unknown, dissect_rpc_unknown },
58 { 0, NULL, NULL, NULL }
60 static const value_string rstat2_proc_vals[] = {
61 { RSTATPROC_NULL, "NULL" },
62 { RSTATPROC_STATS, "STATS" },
63 { RSTATPROC_HAVEDISK, "HAVEDISK" },
64 { 0, NULL }
67 static const vsff rstat3_proc[] = {
68 { RSTATPROC_NULL, "NULL",
69 dissect_rpc_void, dissect_rpc_void },
70 { RSTATPROC_STATS, "STATS",
71 dissect_rpc_unknown, dissect_rpc_unknown },
72 { RSTATPROC_HAVEDISK, "HAVEDISK",
73 dissect_rpc_unknown, dissect_rpc_unknown },
74 { 0, NULL, NULL, NULL }
76 static const value_string rstat3_proc_vals[] = {
77 { RSTATPROC_NULL, "NULL" },
78 { RSTATPROC_STATS, "STATS" },
79 { RSTATPROC_HAVEDISK, "HAVEDISK" },
80 { 0, NULL }
83 static const vsff rstat4_proc[] = {
84 { RSTATPROC_NULL, "NULL",
85 dissect_rpc_void, dissect_rpc_void },
86 { RSTATPROC_STATS, "STATS",
87 dissect_rpc_unknown, dissect_rpc_unknown },
88 { RSTATPROC_HAVEDISK, "HAVEDISK",
89 dissect_rpc_unknown, dissect_rpc_unknown },
90 { 0, NULL, NULL, NULL }
92 static const value_string rstat4_proc_vals[] = {
93 { RSTATPROC_NULL, "NULL" },
94 { RSTATPROC_STATS, "STATS" },
95 { RSTATPROC_HAVEDISK, "HAVEDISK" },
96 { 0, NULL }
99 static const rpc_prog_vers_info rstat_vers_info[] = {
100 { 1, rstat1_proc, &hf_rstat_procedure_v1 },
101 { 2, rstat2_proc, &hf_rstat_procedure_v2 },
102 { 3, rstat3_proc, &hf_rstat_procedure_v3 },
103 { 4, rstat4_proc, &hf_rstat_procedure_v4 },
106 void
107 proto_register_rstat(void)
109 static hf_register_info hf[] = {
110 { &hf_rstat_procedure_v1, {
111 "V1 Procedure", "rstat.procedure_v1", FT_UINT32, BASE_DEC,
112 VALS(rstat1_proc_vals), 0, NULL, HFILL }},
113 { &hf_rstat_procedure_v2, {
114 "V2 Procedure", "rstat.procedure_v2", FT_UINT32, BASE_DEC,
115 VALS(rstat2_proc_vals), 0, NULL, HFILL }},
116 { &hf_rstat_procedure_v3, {
117 "V3 Procedure", "rstat.procedure_v3", FT_UINT32, BASE_DEC,
118 VALS(rstat3_proc_vals), 0, NULL, HFILL }},
119 { &hf_rstat_procedure_v4, {
120 "V4 Procedure", "rstat.procedure_v4", FT_UINT32, BASE_DEC,
121 VALS(rstat4_proc_vals), 0, NULL, HFILL }}
124 static int *ett[] = {
125 &ett_rstat,
128 proto_rstat = proto_register_protocol("RSTAT", "RSTAT", "rstat");
129 proto_register_field_array(proto_rstat, hf, array_length(hf));
130 proto_register_subtree_array(ett, array_length(ett));
133 void
134 proto_reg_handoff_rstat(void)
136 /* Register the protocol as RPC */
137 rpc_init_prog(proto_rstat, RSTAT_PROGRAM, ett_rstat,
138 G_N_ELEMENTS(rstat_vers_info), rstat_vers_info);
142 * Editor modelines - https://www.wireshark.org/tools/modelines.html
144 * Local variables:
145 * c-basic-offset: 8
146 * tab-width: 8
147 * indent-tabs-mode: t
148 * End:
150 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
151 * :indentSize=8:tabSize=8:noTabs=false: