2 * Routines for portmap dissection
4 * $Id: packet-portmap.c,v 1.1 1999/11/10 17:23:53 nneul Exp $
6 * Ethereal - Network traffic analyzer
7 * By Gerald Combs <gerald@unicom.net>
8 * Copyright 1998 Gerald Combs
10 * Copied from packet-smb.c
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.
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.
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.
32 #ifdef HAVE_SYS_TYPES_H
33 #include <sys/types.h>
37 #include "packet-rpc.h"
38 #include "packet-portmap.h"
40 static int proto_portmap = -1;
42 /* proc number, "proc name", dissect_request, dissect_reply */
43 /* NULL as function pointer means: take the generic one. */
44 const vsff portmap1_proc[] = {
45 { PORTMAPPROC_NULL, "NULL", NULL, NULL },
46 { PORTMAPPROC_SET, "SET", NULL, NULL },
47 { PORTMAPPROC_UNSET, "UNSET", NULL, NULL },
48 { PORTMAPPROC_GETPORT, "GETPORT", NULL, NULL },
49 { PORTMAPPROC_DUMP, "DUMP", NULL, NULL },
50 { PORTMAPPROC_CALLIT, "CALLIT", NULL, NULL },
51 { 0, NULL, NULL, NULL }
53 /* end of Portmap version 1 */
55 const vsff portmap2_proc[] = {
56 { PORTMAPPROC_NULL, "NULL", NULL, NULL },
57 { PORTMAPPROC_SET, "SET", NULL, NULL },
58 { PORTMAPPROC_UNSET, "UNSET", NULL, NULL },
59 { PORTMAPPROC_GETPORT, "GETPORT", NULL, NULL },
60 { PORTMAPPROC_DUMP, "DUMP", NULL, NULL },
61 { PORTMAPPROC_CALLIT, "CALLIT", NULL, NULL },
62 { 0, NULL, NULL, NULL }
64 /* end of Portmap version 2 */
68 proto_register_portmap(void)
70 proto_portmap = proto_register_protocol("Portmap", "PORTMAP");
72 /* Register the protocol as RPC */
73 rpc_init_prog(proto_portmap, PORTMAP_PROGRAM, ETT_PORTMAP);
74 /* Register the procedure tables */
75 rpc_init_proc_table(PORTMAP_PROGRAM, 1, portmap1_proc);
76 rpc_init_proc_table(PORTMAP_PROGRAM, 2, portmap2_proc);