Add a routine to "epan/filesystem.c" to test whether a file is a FIFO.
[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.1 2002/05/15 07:21:41 guy 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 #ifdef HAVE_SYS_TYPES_H
33 #include <sys/types.h>
34 #endif
35
36
37 #include "packet-rpc.h"
38
39 static int proto_rstat = -1;
40
41 static gint ett_rstat = -1;
42
43 #define RSTAT_PROGRAM   100001
44
45 #define RSTATPROC_NULL          0
46 #define RSTATPROC_STATS         1
47 #define RSTATPROC_HAVEDISK      2
48
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",
53                 NULL,   NULL },
54         { RSTATPROC_STATS,      "STATS",
55                 NULL,   NULL },
56         { RSTATPROC_HAVEDISK,   "HAVEDISK",
57                 NULL,   NULL },
58         { 0,    NULL,   NULL,   NULL }
59 };
60
61 static const vsff rstat2_proc[] = {
62         { RSTATPROC_NULL,       "NULL",
63                 NULL,   NULL },
64         { RSTATPROC_STATS,      "STATS",
65                 NULL,   NULL },
66         { RSTATPROC_HAVEDISK,   "HAVEDISK",
67                 NULL,   NULL },
68         { 0,    NULL,   NULL,   NULL }
69 };
70
71 static const vsff rstat3_proc[] = {
72         { RSTATPROC_NULL,       "NULL",
73                 NULL,   NULL },
74         { RSTATPROC_STATS,      "STATS",
75                 NULL,   NULL },
76         { RSTATPROC_HAVEDISK,   "HAVEDISK",
77                 NULL,   NULL },
78         { 0,    NULL,   NULL,   NULL }
79 };
80
81 static const vsff rstat4_proc[] = {
82         { RSTATPROC_NULL,       "NULL",
83                 NULL,   NULL },
84         { RSTATPROC_STATS,      "STATS",
85                 NULL,   NULL },
86         { RSTATPROC_HAVEDISK,   "HAVEDISK",
87                 NULL,   NULL },
88         { 0,    NULL,   NULL,   NULL }
89 };
90
91 void
92 proto_register_rstat(void)
93 {
94 #if 0
95         static hf_register_info hf[] = {
96         };
97 #endif
98
99         static gint *ett[] = {
100                 &ett_rstat,
101         };
102
103         proto_rstat = proto_register_protocol("RSTAT", "RSTAT", "rstat");
104 #if 0
105         proto_register_field_array(proto_rstat, hf, array_length(hf));
106 #endif
107         proto_register_subtree_array(ett, array_length(ett));
108 }
109
110 void
111 proto_reg_handoff_rstat(void)
112 {
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);
120 }