Final updates for 0.9.14.
[metze/wireshark/wip.git] / packet-rwall.c
1 /* packet-rwall.c
2  *
3  * $Id: packet-rwall.c,v 1.9 2002/11/01 00:48:38 sahlberg Exp $
4  *
5  * Ethereal - Network traffic analyzer
6  * By Gerald Combs <gerald@ethereal.com>
7  * Copyright 1998 Gerald Combs
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22  */
23
24 #ifdef HAVE_CONFIG_H
25 #include "config.h"
26 #endif
27
28
29
30 #include "packet-rpc.h"
31 #include "packet-rwall.h"
32
33 static int proto_rwall = -1;
34 static int hf_rwall_procedure_v1 = -1;
35 static int hf_rwall_message = -1;
36
37 static gint ett_rwall = -1;
38
39 static int
40 dissect_rwall_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
41 {
42         offset = dissect_rpc_string(tvb, tree, hf_rwall_message, offset, NULL);
43
44         return offset;
45 }
46
47 static const vsff rwall1_proc[] = {
48         { RWALL_WALL,   "RWALL",
49                 dissect_rwall_call,     NULL },
50         { 0,    NULL,   NULL,   NULL }
51 };
52 static const value_string rwall1_proc_vals[] = {
53         { RWALL_WALL,   "RWALL" },
54         { 0,    NULL }
55 };
56
57
58 void
59 proto_register_rwall(void)
60 {
61         static hf_register_info hf[] = {
62                 { &hf_rwall_procedure_v1, {
63                         "V1 Procedure", "rwall.procedure_v1", FT_UINT32, BASE_DEC,
64                         VALS(rwall1_proc_vals), 0, "V1 Procedure", HFILL }},
65                 { &hf_rwall_message, {
66                         "Message", "rwall.message", FT_STRING, BASE_DEC,
67                         NULL, 0, "Message", HFILL }}
68         };
69
70         static gint *ett[] = {
71                 &ett_rwall,
72         };
73
74         proto_rwall = proto_register_protocol("Remote Wall protocol",
75             "RWALL", "rwall");
76         proto_register_field_array(proto_rwall, hf, array_length(hf));
77         proto_register_subtree_array(ett, array_length(ett));
78 }
79
80 void
81 proto_reg_handoff_rwall(void)
82 {
83         /* Register the protocol as RPC */
84         rpc_init_prog(proto_rwall, RWALL_PROGRAM, ett_rwall);
85         /* Register the procedure tables */
86         rpc_init_proc_table(RWALL_PROGRAM, 1, rwall1_proc, hf_rwall_procedure_v1);
87 }
88
89