2 * Stubs for Sun's remote statistics RPC service
4 * Guy Harris <guy@alum.mit.edu>
6 * $Id: packet-rstat.c,v 1.1 2002/05/15 07:21:41 guy 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.
32 #ifdef HAVE_SYS_TYPES_H
33 #include <sys/types.h>
37 #include "packet-rpc.h"
39 static int proto_rstat = -1;
41 static gint ett_rstat = -1;
43 #define RSTAT_PROGRAM 100001
45 #define RSTATPROC_NULL 0
46 #define RSTATPROC_STATS 1
47 #define RSTATPROC_HAVEDISK 2
49 /* proc number, "proc name", dissect_request, dissect_reply */
50 /* NULL as function pointer means: type of arguments is "void". */
51 static const vsff rstat1_proc[] = {
52 { RSTATPROC_NULL, "NULL",
54 { RSTATPROC_STATS, "STATS",
56 { RSTATPROC_HAVEDISK, "HAVEDISK",
58 { 0, NULL, NULL, NULL }
61 static const vsff rstat2_proc[] = {
62 { RSTATPROC_NULL, "NULL",
64 { RSTATPROC_STATS, "STATS",
66 { RSTATPROC_HAVEDISK, "HAVEDISK",
68 { 0, NULL, NULL, NULL }
71 static const vsff rstat3_proc[] = {
72 { RSTATPROC_NULL, "NULL",
74 { RSTATPROC_STATS, "STATS",
76 { RSTATPROC_HAVEDISK, "HAVEDISK",
78 { 0, NULL, NULL, NULL }
81 static const vsff rstat4_proc[] = {
82 { RSTATPROC_NULL, "NULL",
84 { RSTATPROC_STATS, "STATS",
86 { RSTATPROC_HAVEDISK, "HAVEDISK",
88 { 0, NULL, NULL, NULL }
92 proto_register_rstat(void)
95 static hf_register_info hf[] = {
99 static gint *ett[] = {
103 proto_rstat = proto_register_protocol("RSTAT", "RSTAT", "rstat");
105 proto_register_field_array(proto_rstat, hf, array_length(hf));
107 proto_register_subtree_array(ett, array_length(ett));
111 proto_reg_handoff_rstat(void)
113 /* Register the protocol as RPC */
114 rpc_init_prog(proto_rstat, RSTAT_PROGRAM, ett_rstat);
115 /* Register the procedure tables */
116 rpc_init_proc_table(RSTAT_PROGRAM, 1, rstat1_proc);
117 rpc_init_proc_table(RSTAT_PROGRAM, 2, rstat2_proc);
118 rpc_init_proc_table(RSTAT_PROGRAM, 3, rstat3_proc);
119 rpc_init_proc_table(RSTAT_PROGRAM, 4, rstat3_proc);