Include <time.h> to declare "gmtime()".
[obnox/wireshark/wip.git] / packet-stat.c
1 /* packet-stat.c
2  * Routines for stat dissection
3  *
4  * $Id: packet-stat.c,v 1.3 1999/11/18 19:59:11 guy Exp $
5  *
6  * Ethereal - Network traffic analyzer
7  * By Gerald Combs <gerald@unicom.net>
8  * Copyright 1998 Gerald Combs
9  *
10  * Copied from packet-smb.c
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 #include "packet-rpc.h"
37 #include "packet-stat.h"
38
39 static int proto_stat = -1;
40
41 static gint ett_stat = -1;
42
43 /* proc number, "proc name", dissect_request, dissect_reply */
44 /* NULL as function pointer means: take the generic one. */
45
46 const vsff stat_proc[] = {
47     { 0, "NULL", NULL, NULL },
48     { STATPROC_STAT,   "STAT",      
49                 NULL, NULL },
50     { STATPROC_MON,   "MON",      
51                 NULL, NULL },
52     { STATPROC_UNMON, "UNMON",        
53                 NULL, NULL },
54     { STATPROC_UNMON_ALL, "UNMON_ALL",        
55                 NULL, NULL },
56     { STATPROC_SIMU_CRASH, "SIMU_CRASH",        
57                 NULL, NULL },
58     { STATPROC_NOTIFY, "NOTIFY",        
59                 NULL, NULL },
60     { 0, NULL, NULL, NULL }
61 };
62 /* end of stat version 1 */
63
64
65 void
66 proto_register_stat(void)
67 {
68 #if 0
69         static hf_register_info hf[] = {
70                 { &hf_stat_path, {
71                         "Path", "stat.path", FT_STRING, BASE_DEC,
72                         NULL, 0, "Path" }},
73         };
74 #endif
75         static gint *ett[] = {
76                 &ett_stat,
77         };
78
79         proto_stat = proto_register_protocol("Status Service", "stat");
80 #if 0
81         proto_register_field_array(proto_stat, hf, array_length(hf));
82 #endif
83         proto_register_subtree_array(ett, array_length(ett));
84
85         /* Register the protocol as RPC */
86         rpc_init_prog(proto_stat, STAT_PROGRAM, ett_stat);
87         /* Register the procedure tables */
88         rpc_init_proc_table(STAT_PROGRAM, 1, stat_proc);
89 }