Coverage Report

Created: 2026-09-28 06:52

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/wireshark/epan/dissectors/packet-rstat.c
Line
Count
Source
1
/* packet-rstat.c
2
 * Stubs for Sun's remote statistics RPC service
3
 *
4
 * Guy Harris <guy@alum.mit.edu>
5
 *
6
 * Wireshark - Network traffic analyzer
7
 * By Gerald Combs <gerald@wireshark.org>
8
 * Copyright 1998 Gerald Combs
9
 *
10
 * SPDX-License-Identifier: GPL-2.0-or-later
11
 */
12
13
#include "config.h"
14
15
#include "packet-rpc.h"
16
17
void proto_register_rstat(void);
18
void proto_reg_handoff_rstat(void);
19
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;
25
26
static int ett_rstat;
27
28
16
#define RSTAT_PROGRAM 100001
29
30
#define RSTATPROC_NULL    0
31
#define RSTATPROC_STATS   1
32
#define RSTATPROC_HAVEDISK  2
33
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 }
43
};
44
static const value_string rstat_proc_vals[] = {
45
  { RSTATPROC_NULL, "NULL" },
46
  { RSTATPROC_STATS,  "STATS" },
47
  { RSTATPROC_HAVEDISK, "HAVEDISK" },
48
  { 0,  NULL }
49
};
50
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 }
59
};
60
61
static const vsff rstat3_proc[] = {
62
  { RSTATPROC_NULL, "NULL",
63
    dissect_rpc_void, dissect_rpc_void },
64
  { RSTATPROC_STATS,  "STATS",
65
    dissect_rpc_unknown,  dissect_rpc_unknown },
66
  { RSTATPROC_HAVEDISK, "HAVEDISK",
67
    dissect_rpc_unknown,  dissect_rpc_unknown },
68
  { 0,  NULL, NULL, NULL }
69
};
70
71
static const vsff rstat4_proc[] = {
72
  { RSTATPROC_NULL, "NULL",
73
    dissect_rpc_void, dissect_rpc_void },
74
  { RSTATPROC_STATS,  "STATS",
75
    dissect_rpc_unknown,  dissect_rpc_unknown },
76
  { RSTATPROC_HAVEDISK, "HAVEDISK",
77
    dissect_rpc_unknown,  dissect_rpc_unknown },
78
  { 0,  NULL, NULL, NULL }
79
};
80
81
static const rpc_prog_vers_info rstat_vers_info[] = {
82
  { 1, rstat1_proc, &hf_rstat_procedure_v1 },
83
  { 2, rstat2_proc, &hf_rstat_procedure_v2 },
84
  { 3, rstat3_proc, &hf_rstat_procedure_v3 },
85
  { 4, rstat4_proc, &hf_rstat_procedure_v4 },
86
};
87
88
void
89
proto_register_rstat(void)
90
16
{
91
16
  static hf_register_info hf[] = {
92
16
    { &hf_rstat_procedure_v1, {
93
16
      "V1 Procedure", "rstat.procedure_v1", FT_UINT32, BASE_DEC,
94
16
      VALS(rstat_proc_vals), 0, NULL, HFILL }},
95
16
    { &hf_rstat_procedure_v2, {
96
16
      "V2 Procedure", "rstat.procedure_v2", FT_UINT32, BASE_DEC,
97
16
      VALS(rstat_proc_vals), 0, NULL, HFILL }},
98
16
    { &hf_rstat_procedure_v3, {
99
16
      "V3 Procedure", "rstat.procedure_v3", FT_UINT32, BASE_DEC,
100
16
      VALS(rstat_proc_vals), 0, NULL, HFILL }},
101
16
    { &hf_rstat_procedure_v4, {
102
16
      "V4 Procedure", "rstat.procedure_v4", FT_UINT32, BASE_DEC,
103
16
      VALS(rstat_proc_vals), 0, NULL, HFILL }}
104
16
  };
105
106
16
  static int *ett[] = {
107
16
    &ett_rstat,
108
16
  };
109
110
16
  proto_rstat = proto_register_protocol("RSTAT", "RSTAT", "rstat");
111
16
  proto_register_field_array(proto_rstat, hf, array_length(hf));
112
16
  proto_register_subtree_array(ett, array_length(ett));
113
16
}
114
115
void
116
proto_reg_handoff_rstat(void)
117
16
{
118
  /* Register the protocol as RPC */
119
16
  rpc_init_prog(proto_rstat, RSTAT_PROGRAM, ett_rstat,
120
      G_N_ELEMENTS(rstat_vers_info), rstat_vers_info);
121
16
}
122
123
/*
124
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
125
 *
126
 * Local variables:
127
 * c-basic-offset: 8
128
 * tab-width: 8
129
 * indent-tabs-mode: t
130
 * End:
131
 *
132
 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
133
 * :indentSize=8:tabSize=8:noTabs=false:
134
 */