14a2bc32a0cb046a9380752c2bcf35ba752a2a17
[metze/wireshark/wip.git] / packet-nlm.c
1 /* packet-nlm.c
2  * Routines for nlm dissection
3  *
4  * $Id: packet-nlm.c,v 1.2 1999/11/15 14:32:16 nneul Exp $
5  *
6  * Ethereal - Network traffic analyzer
7  * By Gerald Combs <gerald@unicom.net>
8  * Copyright 1998 Gerald Combs
9  *
10  * Copied from packet-mount.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
28 #ifdef HAVE_CONFIG_H
29 #include "config.h"
30 #endif
31
32
33 #ifdef HAVE_SYS_TYPES_H
34 #include <sys/types.h>
35 #endif
36
37
38 #include "packet-rpc.h"
39 #include "packet-nlm.h"
40
41
42 static int proto_nlm = -1;
43
44
45 /* proc number, "proc name", dissect_request, dissect_reply */
46 /* NULL as function pointer means: take the generic one. */
47 /* NLM protocol version 3 */
48 const vsff nlm3_proc[] = {
49         { 0,    "NULL",         NULL,   NULL },
50         { 1,    "TEST",         NULL,   NULL },
51         { 2,    "LOCK",         NULL,   NULL },
52         { 3,    "CANCEL",       NULL,   NULL },
53         { 4,    "UNLOCK",       NULL,   NULL },
54         { 5,    "GRANTED",      NULL,   NULL },
55         { 6,    "TEST_MSG",     NULL,   NULL },
56         { 7,    "LOCK_MSG",     NULL,   NULL },
57         { 8,    "CANCEL_MSG",   NULL,   NULL },
58         { 9,    "UNLOCK_MSG",   NULL,   NULL },
59         { 10,   "GRANTED_MSG",  NULL,   NULL },
60         { 11,   "TEST_RES",     NULL,   NULL },
61         { 12,   "LOCK_RES",     NULL,   NULL },
62         { 13,   "CANCEL_RES",   NULL,   NULL },
63         { 14,   "UNLOCK_RES",   NULL,   NULL },
64         { 15,   "GRANTED_RES",  NULL,   NULL },
65         { 20,   "SHARE",        NULL,   NULL },
66         { 21,   "UNSHARE",      NULL,   NULL },
67         { 22,   "NM_LOCK",      NULL,   NULL },
68         { 23,   "FREE_ALL",     NULL,   NULL },
69         { 0,    NULL,           NULL,   NULL }
70 };
71 /* end of NLM protocol version 3 */
72
73
74 void
75 proto_register_nlm(void)
76 {
77         proto_nlm = proto_register_protocol("Network Lock Manager Protocol", "nlm");
78
79         /* Register the protocol as RPC */
80         rpc_init_prog(proto_nlm, NLM_PROGRAM, ETT_NLM);
81         /* Register the procedure table */
82         rpc_init_proc_table(NLM_PROGRAM, 3, nlm3_proc);
83 }
84
85