Don't let the user specify a maximum capture file size if they're not
[obnox/wireshark/wip.git] / packet-ypbind.c
1 /* packet-ypbind.c
2  * Routines for ypbind dissection
3  *
4  * $Id: packet-ypbind.c,v 1.7 2001/01/18 09:55:10 guy 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 #ifdef HAVE_SYS_TYPES_H
33 #include <sys/types.h>
34 #endif
35
36
37 #include "packet-rpc.h"
38 #include "packet-ypbind.h"
39
40 static int proto_ypbind = -1;
41
42 static gint ett_ypbind = -1;
43
44 /* proc number, "proc name", dissect_request, dissect_reply */
45 /* NULL as function pointer means: type of arguments is "void". */
46 static const vsff ypbind1_proc[] = {
47         { YPBINDPROC_NULL,      "NULL",         NULL,                           NULL },
48         { YPBINDPROC_DOMAIN,    "DOMAIN",               NULL,                           NULL },
49         { YPBINDPROC_SETDOM,    "SETDOMAIN",            NULL,                           NULL },
50         { 0,    NULL,           NULL,                           NULL }
51 };
52 /* end of YPBind version 1 */
53
54 static const vsff ypbind2_proc[] = {
55         { YPBINDPROC_NULL,      "NULL",         NULL,                           NULL },
56         { YPBINDPROC_DOMAIN,    "DOMAIN",               NULL,                           NULL },
57         { YPBINDPROC_SETDOM,    "SETDOMAIN",            NULL,                           NULL },
58         { 0,    NULL,       NULL,               NULL }
59 };
60 /* end of YPBind version 2 */
61
62
63 void
64 proto_register_ypbind(void)
65 {
66         static gint *ett[] = {
67                 &ett_ypbind,
68         };
69
70         proto_ypbind = proto_register_protocol("Yellow Pages Bind",
71             "YPBIND", "ypbind");
72         proto_register_subtree_array(ett, array_length(ett));
73 }
74
75 void
76 proto_reg_handoff_ypbind(void)
77 {
78         /* Register the protocol as RPC */
79         rpc_init_prog(proto_ypbind, YPBIND_PROGRAM, ett_ypbind);
80         /* Register the procedure tables */
81         rpc_init_proc_table(YPBIND_PROGRAM, 1, ypbind1_proc);
82         rpc_init_proc_table(YPBIND_PROGRAM, 2, ypbind2_proc);
83 }