As per a suggestion by Olivier Biot, note that objects pointed to by
[obnox/wireshark/wip.git] / packet-ypxfr.c
1 /* packet-ypxfr.c
2  * Routines for ypxfr dissection
3  *
4  * $Id: packet-ypxfr.c,v 1.9 2002/11/01 00:48:39 sahlberg Exp $
5  *
6  * Ethereal - Network traffic analyzer
7  * By Gerald Combs <gerald@zing.org>
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
33 #include "packet-rpc.h"
34 #include "packet-ypxfr.h"
35
36 static int proto_ypxfr = -1;
37 static int hf_ypxfr_procedure_v1 = -1;
38
39 static gint ett_ypxfr = -1;
40
41 /* proc number, "proc name", dissect_request, dissect_reply */
42 /* NULL as function pointer means: type of arguments is "void". */
43 static const vsff ypxfr1_proc[] = {
44         { YPXFRPROC_NULL,       "NULL",         NULL,           NULL },
45         { YPXFRPROC_GETMAP,     "GETMAP",       NULL,           NULL },
46         { 0,                    NULL,           NULL,           NULL }
47 };
48 static const value_string ypxfr1_proc_vals[] = {
49         { YPXFRPROC_NULL,       "NULL" },
50         { YPXFRPROC_GETMAP,     "GETMAP" },
51         { 0,                    NULL }
52 };
53 /* end of YPXFR version 1 */
54
55 void
56 proto_register_ypxfr(void)
57 {
58         static hf_register_info hf[] = {
59                 { &hf_ypxfr_procedure_v1, {
60                         "V1 Procedure", "ypxfr.procedure_v1", FT_UINT32, BASE_DEC,
61                         VALS(ypxfr1_proc_vals), 0, "V1 Procedure", HFILL }}
62         };
63
64         static gint *ett[] = {
65                 &ett_ypxfr
66         };
67
68         proto_ypxfr = proto_register_protocol("Yellow Pages Transfer",
69             "YPXFR", "ypxfr");
70         proto_register_field_array(proto_ypxfr, hf, array_length(hf));
71         proto_register_subtree_array(ett, array_length(ett));
72 }
73
74 void
75 proto_reg_handoff_ypxfr(void)
76 {
77         /* Register the protocol as RPC */
78         rpc_init_prog(proto_ypxfr, YPXFR_PROGRAM, ett_ypxfr);
79         /* Register the procedure tables */
80         rpc_init_proc_table(YPXFR_PROGRAM, 1, ypxfr1_proc, hf_ypxfr_procedure_v1);
81 }