2 * Stubs for Sun's remote statistics RPC service
4 * Guy Harris <guy@alum.mit.edu>
6 * $Id: packet-rstat.c,v 1.2 2002/08/02 23:35:58 jmayer Exp $
8 * Ethereal - Network traffic analyzer
9 * By Gerald Combs <gerald@ethereal.com>
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
33 #include "packet-rpc.h"
35 static int proto_rstat = -1;
37 static gint ett_rstat = -1;
39 #define RSTAT_PROGRAM 100001
41 #define RSTATPROC_NULL 0
42 #define RSTATPROC_STATS 1
43 #define RSTATPROC_HAVEDISK 2
45 /* proc number, "proc name", dissect_request, dissect_reply */
46 /* NULL as function pointer means: type of arguments is "void". */
47 static const vsff rstat1_proc[] = {
48 { RSTATPROC_NULL, "NULL",
50 { RSTATPROC_STATS, "STATS",
52 { RSTATPROC_HAVEDISK, "HAVEDISK",
54 { 0, NULL, NULL, NULL }
57 static const vsff rstat2_proc[] = {
58 { RSTATPROC_NULL, "NULL",
60 { RSTATPROC_STATS, "STATS",
62 { RSTATPROC_HAVEDISK, "HAVEDISK",
64 { 0, NULL, NULL, NULL }
67 static const vsff rstat3_proc[] = {
68 { RSTATPROC_NULL, "NULL",
70 { RSTATPROC_STATS, "STATS",
72 { RSTATPROC_HAVEDISK, "HAVEDISK",
74 { 0, NULL, NULL, NULL }
77 static const vsff rstat4_proc[] = {
78 { RSTATPROC_NULL, "NULL",
80 { RSTATPROC_STATS, "STATS",
82 { RSTATPROC_HAVEDISK, "HAVEDISK",
84 { 0, NULL, NULL, NULL }
88 proto_register_rstat(void)
91 static hf_register_info hf[] = {
95 static gint *ett[] = {
99 proto_rstat = proto_register_protocol("RSTAT", "RSTAT", "rstat");
101 proto_register_field_array(proto_rstat, hf, array_length(hf));
103 proto_register_subtree_array(ett, array_length(ett));
107 proto_reg_handoff_rstat(void)
109 /* Register the protocol as RPC */
110 rpc_init_prog(proto_rstat, RSTAT_PROGRAM, ett_rstat);
111 /* Register the procedure tables */
112 rpc_init_proc_table(RSTAT_PROGRAM, 1, rstat1_proc);
113 rpc_init_proc_table(RSTAT_PROGRAM, 2, rstat2_proc);
114 rpc_init_proc_table(RSTAT_PROGRAM, 3, rstat3_proc);
115 rpc_init_proc_table(RSTAT_PROGRAM, 4, rstat3_proc);