Removed trailing whitespaces from .h and .c files using the
[obnox/wireshark/wip.git] / packet-rstat.c
1 /* packet-rstat.c
2  * Stubs for Sun's remote statistics RPC service
3  *
4  * Guy Harris <guy@alum.mit.edu>
5  *
6  * $Id: packet-rstat.c,v 1.2 2002/08/02 23:35:58 jmayer Exp $
7  *
8  * Ethereal - Network traffic analyzer
9  * By Gerald Combs <gerald@ethereal.com>
10  * Copyright 1998 Gerald Combs
11  *
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.
16  *
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.
21  *
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.
25  */
26
27 #ifdef HAVE_CONFIG_H
28 #include "config.h"
29 #endif
30
31
32
33 #include "packet-rpc.h"
34
35 static int proto_rstat = -1;
36
37 static gint ett_rstat = -1;
38
39 #define RSTAT_PROGRAM   100001
40
41 #define RSTATPROC_NULL          0
42 #define RSTATPROC_STATS         1
43 #define RSTATPROC_HAVEDISK      2
44
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",
49                 NULL,   NULL },
50         { RSTATPROC_STATS,      "STATS",
51                 NULL,   NULL },
52         { RSTATPROC_HAVEDISK,   "HAVEDISK",
53                 NULL,   NULL },
54         { 0,    NULL,   NULL,   NULL }
55 };
56
57 static const vsff rstat2_proc[] = {
58         { RSTATPROC_NULL,       "NULL",
59                 NULL,   NULL },
60         { RSTATPROC_STATS,      "STATS",
61                 NULL,   NULL },
62         { RSTATPROC_HAVEDISK,   "HAVEDISK",
63                 NULL,   NULL },
64         { 0,    NULL,   NULL,   NULL }
65 };
66
67 static const vsff rstat3_proc[] = {
68         { RSTATPROC_NULL,       "NULL",
69                 NULL,   NULL },
70         { RSTATPROC_STATS,      "STATS",
71                 NULL,   NULL },
72         { RSTATPROC_HAVEDISK,   "HAVEDISK",
73                 NULL,   NULL },
74         { 0,    NULL,   NULL,   NULL }
75 };
76
77 static const vsff rstat4_proc[] = {
78         { RSTATPROC_NULL,       "NULL",
79                 NULL,   NULL },
80         { RSTATPROC_STATS,      "STATS",
81                 NULL,   NULL },
82         { RSTATPROC_HAVEDISK,   "HAVEDISK",
83                 NULL,   NULL },
84         { 0,    NULL,   NULL,   NULL }
85 };
86
87 void
88 proto_register_rstat(void)
89 {
90 #if 0
91         static hf_register_info hf[] = {
92         };
93 #endif
94
95         static gint *ett[] = {
96                 &ett_rstat,
97         };
98
99         proto_rstat = proto_register_protocol("RSTAT", "RSTAT", "rstat");
100 #if 0
101         proto_register_field_array(proto_rstat, hf, array_length(hf));
102 #endif
103         proto_register_subtree_array(ett, array_length(ett));
104 }
105
106 void
107 proto_reg_handoff_rstat(void)
108 {
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);
116 }