2 * Routines for nlm dissection
4 * $Id: packet-nlm.c,v 1.20 2001/09/14 06:48:30 guy Exp $
6 * Ethereal - Network traffic analyzer
7 * By Gerald Combs <gerald@ethereal.com>
8 * Copyright 1998 Gerald Combs
10 * Copied from packet-mount.c
12 * 2001-JAN Ronnie Sahlberg <rsahlber@bigpond.net.au>
13 * Updates to version 1 of the protocol.
14 * Added version 3 of the protocol.
15 * Added version 4 of the protocol.
18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License
20 * as published by the Free Software Foundation; either version 2
21 * of the License, or (at your option) any later version.
23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
39 #ifdef HAVE_SYS_TYPES_H
40 #include <sys/types.h>
44 #include "packet-rpc.h"
45 #include "packet-nfs.h"
46 #include "packet-nlm.h"
49 * NFS Lock Manager protocol specs can only be found in actual
50 * implementations or in the nice book:
51 * Brent Callaghan: "NFS Illustrated", Addison-Wesley, ISBN 0-201-32570-5
52 * which I use here as reference (BC).
54 * They can also be found if you go to
56 * http://www.opengroup.org/publications/catalog/c702.htm
58 * and follow the links to the HTML version of the document.
61 static int proto_nlm = -1;
63 static int hf_nlm_cookie = -1;
64 static int hf_nlm_block = -1;
65 static int hf_nlm_exclusive = -1;
66 static int hf_nlm_lock = -1;
67 static int hf_nlm_lock_caller_name = -1;
68 static int hf_nlm_lock_owner = -1;
69 static int hf_nlm_lock_svid = -1;
70 static int hf_nlm_lock_l_offset = -1;
71 static int hf_nlm_lock_l_len = -1;
72 static int hf_nlm_reclaim = -1;
73 static int hf_nlm_stat = -1;
74 static int hf_nlm_state = -1;
75 static int hf_nlm_test_stat = -1;
76 static int hf_nlm_test_stat_stat = -1;
77 static int hf_nlm_holder = -1;
78 static int hf_nlm_share = -1;
79 static int hf_nlm_share_mode = -1;
80 static int hf_nlm_share_access = -1;
81 static int hf_nlm_share_name = -1;
82 static int hf_nlm_sequence = -1;
84 static gint ett_nlm = -1;
85 static gint ett_nlm_lock = -1;
88 const value_string names_nlm_stats[] =
90 /* NLM_GRANTED is the function number 5 and the state code 0.
91 * So we use for the state the postfix _S.
93 #define NLM_GRANTED_S 0
94 { NLM_GRANTED_S, "NLM_GRANTED" },
96 { NLM_DENIED, "NLM_DENIED" },
97 #define NLM_DENIED_NOLOCKS 2
98 { NLM_DENIED_NOLOCKS, "NLM_DENIED_NOLOCKS" },
100 { NLM_BLOCKED, "NLM_BLOCKED" },
101 #define NLM_DENIED_GRACE_PERIOD 4
102 { NLM_DENIED_GRACE_PERIOD, "NLM_DENIED_GRACE_PERIOD" },
103 #define NLM_DEADLCK 5
104 { NLM_DEADLCK, "NLM_DEADLCK" },
106 { NLM_ROFS, "NLM_ROFS" },
107 #define NLM_STALE_FH 7
108 { NLM_STALE_FH, "NLM_STALE_FH" },
110 { NLM_BIG, "NLM_BIG" },
112 { NLM_FAILED, "NLM_FAILED" },
117 const value_string names_fsh_mode[] =
120 { FSM_DN, "deny none" },
122 { FSM_DR, "deny read" },
124 { FSM_DW, "deny write" },
126 { FSM_DRW, "deny read/write" },
132 const value_string names_fsh_access[] =
135 { FSA_NONE, "no access" },
137 { FSA_R, "read-only" },
139 { FSA_W, "write-only" },
141 { FSA_RW, "read/write" },
150 /* **************************** */
151 /* generic dissecting functions */
152 /* **************************** */
154 dissect_lock(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int version, int offset)
156 proto_item* lock_item = NULL;
157 proto_tree* lock_tree = NULL;
160 lock_item = proto_tree_add_item(tree, hf_nlm_lock, tvb,
161 offset, tvb_length_remaining(tvb, offset), FALSE);
163 lock_tree = proto_item_add_subtree(lock_item, ett_nlm_lock);
166 offset = dissect_rpc_string(tvb,pinfo,lock_tree,
167 hf_nlm_lock_caller_name, offset, NULL);
168 offset = dissect_nfs_fh3(tvb, offset, pinfo, lock_tree,"fh");
170 offset = dissect_rpc_data(tvb, pinfo, lock_tree, hf_nlm_lock_owner, offset);
172 offset = dissect_rpc_uint32(tvb, pinfo, lock_tree, hf_nlm_lock_svid, offset);
175 offset = dissect_rpc_uint64(tvb, pinfo, lock_tree, hf_nlm_lock_l_offset, offset);
176 offset = dissect_rpc_uint64(tvb, pinfo, lock_tree, hf_nlm_lock_l_len, offset);
179 offset = dissect_rpc_uint32(tvb, pinfo, lock_tree, hf_nlm_lock_l_offset, offset);
180 offset = dissect_rpc_uint32(tvb, pinfo, lock_tree, hf_nlm_lock_l_len, offset);
188 dissect_nlm_test(tvbuff_t *tvb, int offset, packet_info *pinfo,
189 proto_tree *tree, int version)
191 offset = dissect_rpc_data(tvb, pinfo, tree, hf_nlm_cookie, offset);
192 dissect_rpc_bool(tvb, pinfo, tree, hf_nlm_exclusive, offset);
194 offset = dissect_lock(tvb, pinfo, tree, version, offset);
199 dissect_nlm_lock(tvbuff_t *tvb, int offset, packet_info *pinfo,
200 proto_tree *tree,int version)
202 offset = dissect_rpc_data(tvb, pinfo, tree, hf_nlm_cookie, offset);
203 offset = dissect_rpc_bool(tvb, pinfo, tree, hf_nlm_block, offset);
204 offset = dissect_rpc_bool(tvb, pinfo, tree, hf_nlm_exclusive, offset);
205 offset = dissect_lock(tvb, pinfo, tree, version, offset);
206 offset = dissect_rpc_bool(tvb, pinfo, tree, hf_nlm_reclaim, offset);
207 offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nlm_state, offset);
212 dissect_nlm_cancel(tvbuff_t *tvb, int offset, packet_info *pinfo,
213 proto_tree *tree,int version)
215 offset = dissect_rpc_data(tvb, pinfo, tree, hf_nlm_cookie, offset);
216 offset = dissect_rpc_bool(tvb, pinfo, tree, hf_nlm_block, offset);
217 offset = dissect_rpc_bool(tvb, pinfo, tree, hf_nlm_exclusive, offset);
218 offset = dissect_lock(tvb, pinfo, tree, version, offset);
223 dissect_nlm_unlock(tvbuff_t *tvb, int offset, packet_info *pinfo,
224 proto_tree *tree,int version)
226 offset = dissect_rpc_data(tvb, pinfo, tree, hf_nlm_cookie, offset);
227 offset = dissect_lock(tvb, pinfo, tree, version, offset);
232 dissect_nlm_granted(tvbuff_t *tvb, int offset, packet_info *pinfo,
233 proto_tree *tree,int version)
235 offset = dissect_rpc_data(tvb, pinfo, tree, hf_nlm_cookie, offset);
236 offset = dissect_rpc_bool(tvb, pinfo, tree, hf_nlm_exclusive, offset);
237 offset = dissect_lock(tvb, pinfo, tree, version, offset);
243 dissect_nlm_test_res(tvbuff_t *tvb, int offset, packet_info *pinfo,
244 proto_tree *tree,int version)
246 proto_item* lock_item = NULL;
247 proto_tree* lock_tree = NULL;
249 offset = dissect_rpc_data(tvb, pinfo, tree, hf_nlm_cookie, offset);
252 lock_item = proto_tree_add_item(tree, hf_nlm_test_stat, tvb,
254 tvb_length_remaining(tvb, offset),
257 lock_tree = proto_item_add_subtree(lock_item,
261 offset = dissect_rpc_uint32(tvb, pinfo, lock_tree, hf_nlm_test_stat_stat,
264 /* last structure is optional, only supplied for stat==1 (LOCKED) */
265 if(!tvb_length_remaining(tvb, offset)){
270 lock_item = proto_tree_add_item(lock_tree, hf_nlm_holder, tvb,
272 tvb_length_remaining(tvb, offset),
275 lock_tree = proto_item_add_subtree(lock_item,
279 offset = dissect_rpc_bool(tvb, pinfo, lock_tree, hf_nlm_exclusive,
281 offset = dissect_rpc_uint32(tvb, pinfo, lock_tree, hf_nlm_lock_svid,
283 offset = dissect_rpc_data(tvb, pinfo, lock_tree, hf_nlm_lock_owner,
287 offset = dissect_rpc_uint64(tvb, pinfo, lock_tree,
288 hf_nlm_lock_l_offset, offset);
289 offset = dissect_rpc_uint64(tvb, pinfo, lock_tree,
290 hf_nlm_lock_l_len, offset);
293 offset = dissect_rpc_uint32(tvb, pinfo, lock_tree,
294 hf_nlm_lock_l_offset, offset);
295 offset = dissect_rpc_uint32(tvb, pinfo, lock_tree,
296 hf_nlm_lock_l_len, offset);
304 dissect_nlm_share(tvbuff_t *tvb, int offset, packet_info *pinfo,
305 proto_tree *tree,int version)
307 proto_item* lock_item = NULL;
308 proto_tree* lock_tree = NULL;
310 offset = dissect_rpc_data(tvb, pinfo, tree, hf_nlm_cookie, offset);
313 lock_item = proto_tree_add_item(tree, hf_nlm_share, tvb,
315 tvb_length_remaining(tvb, offset),
318 lock_tree = proto_item_add_subtree(lock_item,
322 offset = dissect_rpc_string(tvb,pinfo,lock_tree,
323 hf_nlm_lock_caller_name, offset, NULL);
325 offset = dissect_nfs_fh3(tvb, offset, pinfo, lock_tree, "fh");
327 offset = dissect_rpc_data(tvb, pinfo, lock_tree, hf_nlm_lock_owner, offset);
329 offset = dissect_rpc_uint32(tvb, pinfo, lock_tree, hf_nlm_share_mode, offset);
330 offset = dissect_rpc_uint32(tvb, pinfo, lock_tree, hf_nlm_share_access, offset);
333 offset = dissect_rpc_bool(tvb, pinfo, tree, hf_nlm_reclaim, offset);
338 dissect_nlm_shareres(tvbuff_t *tvb, int offset, packet_info *pinfo,
339 proto_tree *tree, int version)
341 offset = dissect_rpc_data(tvb, pinfo, tree, hf_nlm_cookie, offset);
342 offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nlm_stat, offset);
343 offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nlm_sequence, offset);
348 dissect_nlm_freeall(tvbuff_t *tvb, int offset, packet_info *pinfo,
349 proto_tree *tree,int version)
351 offset = dissect_rpc_string(tvb,pinfo,tree,
352 hf_nlm_share_name, offset, NULL);
354 offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nlm_stat, offset);
363 /* This function is identical for all NLM protocol versions (1-4)*/
365 dissect_nlm_gen_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
368 offset = dissect_rpc_data(tvb, pinfo, tree, hf_nlm_cookie, offset);
369 offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nlm_stat, offset);
374 dissect_nlm1_test(tvbuff_t *tvb, int offset, packet_info *pinfo,
377 return dissect_nlm_test(tvb,offset,pinfo,tree,1);
381 dissect_nlm4_test(tvbuff_t *tvb, int offset, packet_info *pinfo,
384 return dissect_nlm_test(tvb,offset,pinfo,tree,4);
389 dissect_nlm1_lock(tvbuff_t *tvb, int offset, packet_info *pinfo,
392 return dissect_nlm_lock(tvb,offset,pinfo,tree,1);
396 dissect_nlm4_lock(tvbuff_t *tvb, int offset, packet_info *pinfo,
399 return dissect_nlm_lock(tvb,offset,pinfo,tree,4);
404 dissect_nlm1_cancel(tvbuff_t *tvb, int offset, packet_info *pinfo,
407 return dissect_nlm_cancel(tvb,offset,pinfo,tree,1);
411 dissect_nlm4_cancel(tvbuff_t *tvb, int offset, packet_info *pinfo,
414 return dissect_nlm_cancel(tvb,offset,pinfo,tree,4);
419 dissect_nlm1_unlock(tvbuff_t *tvb, int offset, packet_info *pinfo,
422 return dissect_nlm_unlock(tvb,offset,pinfo,tree,1);
426 dissect_nlm4_unlock(tvbuff_t *tvb, int offset, packet_info *pinfo,
429 return dissect_nlm_unlock(tvb,offset,pinfo,tree,4);
434 dissect_nlm1_granted(tvbuff_t *tvb, int offset, packet_info *pinfo,
437 return dissect_nlm_granted(tvb,offset,pinfo,tree,1);
441 dissect_nlm4_granted(tvbuff_t *tvb, int offset, packet_info *pinfo,
444 return dissect_nlm_granted(tvb,offset,pinfo,tree,4);
449 dissect_nlm1_test_res(tvbuff_t *tvb, int offset, packet_info *pinfo,
452 return dissect_nlm_test_res(tvb,offset,pinfo,tree,1);
456 dissect_nlm4_test_res(tvbuff_t *tvb, int offset, packet_info *pinfo,
459 return dissect_nlm_test_res(tvb,offset,pinfo,tree,4);
463 dissect_nlm3_share(tvbuff_t *tvb, int offset, packet_info *pinfo,
466 return dissect_nlm_share(tvb,offset,pinfo,tree,3);
470 dissect_nlm4_share(tvbuff_t *tvb, int offset, packet_info *pinfo,
473 return dissect_nlm_share(tvb,offset,pinfo,tree,4);
477 dissect_nlm3_shareres(tvbuff_t *tvb, int offset, packet_info *pinfo,
480 return dissect_nlm_shareres(tvb,offset,pinfo,tree,3);
484 dissect_nlm4_shareres(tvbuff_t *tvb, int offset, packet_info *pinfo,
487 return dissect_nlm_shareres(tvb,offset,pinfo,tree,4);
491 dissect_nlm3_freeall(tvbuff_t *tvb, int offset, packet_info *pinfo,
494 return dissect_nlm_freeall(tvb,offset,pinfo,tree,3);
498 dissect_nlm4_freeall(tvbuff_t *tvb, int offset, packet_info *pinfo,
501 return dissect_nlm_freeall(tvb,offset,pinfo,tree,4);
507 /* proc number, "proc name", dissect_request, dissect_reply */
508 /* NULL as function pointer means: type of arguments is "void". */
509 /* NLM protocol version 1 */
510 static const vsff nlm1_proc[] = {
514 dissect_nlm1_test, dissect_nlm1_test_res },
516 dissect_nlm1_lock, dissect_nlm_gen_reply },
517 { NLM_CANCEL, "CANCEL",
518 dissect_nlm1_cancel, dissect_nlm_gen_reply },
519 { NLM_UNLOCK, "UNLOCK",
520 dissect_nlm1_unlock, dissect_nlm_gen_reply },
521 { NLM_GRANTED, "GRANTED",
522 dissect_nlm1_granted, dissect_nlm_gen_reply },
523 { NLM_TEST_MSG, "TEST_MSG",
524 dissect_nlm1_test, NULL },
525 { NLM_LOCK_MSG, "LOCK_MSG",
526 dissect_nlm1_lock, NULL },
527 { NLM_CANCEL_MSG, "CANCEL_MSG",
528 dissect_nlm1_cancel, NULL },
529 { NLM_UNLOCK_MSG, "UNLOCK_MSG",
530 dissect_nlm1_unlock, NULL },
531 { NLM_GRANTED_MSG, "GRANTED_MSG",
532 dissect_nlm1_granted, NULL },
533 { NLM_TEST_RES, "TEST_RES",
534 dissect_nlm1_test_res, NULL },
535 { NLM_LOCK_RES, "LOCK_RES",
536 dissect_nlm_gen_reply, NULL },
537 { NLM_CANCEL_RES, "CANCEL_RES",
538 dissect_nlm_gen_reply, NULL },
539 { NLM_UNLOCK_RES, "UNLOCK_RES",
540 dissect_nlm_gen_reply, NULL },
541 { NLM_GRANTED_RES, "GRANTED_RES",
542 dissect_nlm_gen_reply, NULL },
546 /* end of NLM protocol version 1 */
548 /* NLM protocol version 2 */
549 static const vsff nlm2_proc[] = {
553 dissect_nlm1_test, dissect_nlm1_test_res },
555 dissect_nlm1_lock, dissect_nlm_gen_reply },
556 { NLM_CANCEL, "CANCEL",
557 dissect_nlm1_cancel, dissect_nlm_gen_reply },
558 { NLM_UNLOCK, "UNLOCK",
559 dissect_nlm1_unlock, dissect_nlm_gen_reply },
560 { NLM_GRANTED, "GRANTED",
561 dissect_nlm1_granted, dissect_nlm_gen_reply },
562 { NLM_TEST_MSG, "TEST_MSG",
563 dissect_nlm1_test, NULL },
564 { NLM_LOCK_MSG, "LOCK_MSG",
565 dissect_nlm1_lock, NULL },
566 { NLM_CANCEL_MSG, "CANCEL_MSG",
567 dissect_nlm1_cancel, NULL },
568 { NLM_UNLOCK_MSG, "UNLOCK_MSG",
569 dissect_nlm1_unlock, NULL },
570 { NLM_GRANTED_MSG, "GRANTED_MSG",
571 dissect_nlm1_granted, NULL },
572 { NLM_TEST_RES, "TEST_RES",
573 dissect_nlm1_test_res, NULL },
574 { NLM_LOCK_RES, "LOCK_RES",
575 dissect_nlm_gen_reply, NULL },
576 { NLM_CANCEL_RES, "CANCEL_RES",
577 dissect_nlm_gen_reply, NULL },
578 { NLM_UNLOCK_RES, "UNLOCK_RES",
579 dissect_nlm_gen_reply, NULL },
580 { NLM_GRANTED_RES, "GRANTED_RES",
581 dissect_nlm_gen_reply, NULL },
585 /* end of NLM protocol version 2 */
587 /* NLM protocol version 3 */
588 static const vsff nlm3_proc[] = {
592 dissect_nlm1_test, dissect_nlm1_test_res },
594 dissect_nlm1_lock, dissect_nlm_gen_reply },
595 { NLM_CANCEL, "CANCEL",
596 dissect_nlm1_cancel, dissect_nlm_gen_reply },
597 { NLM_UNLOCK, "UNLOCK",
598 dissect_nlm1_unlock, dissect_nlm_gen_reply },
599 { NLM_GRANTED, "GRANTED",
600 dissect_nlm1_granted, dissect_nlm_gen_reply },
601 { NLM_TEST_MSG, "TEST_MSG",
602 dissect_nlm1_test, NULL },
603 { NLM_LOCK_MSG, "LOCK_MSG",
604 dissect_nlm1_lock, NULL },
605 { NLM_CANCEL_MSG, "CANCEL_MSG",
606 dissect_nlm1_cancel, NULL },
607 { NLM_UNLOCK_MSG, "UNLOCK_MSG",
608 dissect_nlm1_unlock, NULL },
609 { NLM_GRANTED_MSG, "GRANTED_MSG",
610 dissect_nlm1_granted, NULL },
611 { NLM_TEST_RES, "TEST_RES",
612 dissect_nlm1_test_res, NULL },
613 { NLM_LOCK_RES, "LOCK_RES",
614 dissect_nlm_gen_reply, NULL },
615 { NLM_CANCEL_RES, "CANCEL_RES",
616 dissect_nlm_gen_reply, NULL },
617 { NLM_UNLOCK_RES, "UNLOCK_RES",
618 dissect_nlm_gen_reply, NULL },
619 { NLM_GRANTED_RES, "GRANTED_RES",
620 dissect_nlm_gen_reply, NULL },
621 { NLM_SHARE, "SHARE",
622 dissect_nlm3_share, dissect_nlm3_shareres },
623 { NLM_UNSHARE, "UNSHARE",
624 dissect_nlm3_share, dissect_nlm3_shareres },
625 { NLM_NM_LOCK, "NM_LOCK",
626 dissect_nlm1_lock, dissect_nlm_gen_reply },
627 { NLM_FREE_ALL, "FREE_ALL",
628 dissect_nlm3_freeall, NULL },
632 /* end of NLM protocol version 3 */
635 /* NLM protocol version 4 */
636 static const vsff nlm4_proc[] = {
640 dissect_nlm4_test, dissect_nlm4_test_res },
642 dissect_nlm4_lock, dissect_nlm_gen_reply },
643 { NLM_CANCEL, "CANCEL",
644 dissect_nlm4_cancel, dissect_nlm_gen_reply },
645 { NLM_UNLOCK, "UNLOCK",
646 dissect_nlm4_unlock, dissect_nlm_gen_reply },
647 { NLM_GRANTED, "GRANTED",
648 dissect_nlm4_granted, dissect_nlm_gen_reply },
649 { NLM_TEST_MSG, "TEST_MSG",
650 dissect_nlm4_test, NULL },
651 { NLM_LOCK_MSG, "LOCK_MSG",
652 dissect_nlm4_lock, NULL },
653 { NLM_CANCEL_MSG, "CANCEL_MSG",
654 dissect_nlm4_cancel, NULL },
655 { NLM_UNLOCK_MSG, "UNLOCK_MSG",
656 dissect_nlm4_unlock, NULL },
657 { NLM_GRANTED_MSG, "GRANTED_MSG",
658 dissect_nlm4_granted, NULL },
659 { NLM_TEST_RES, "TEST_RES",
660 dissect_nlm4_test_res, NULL },
661 { NLM_LOCK_RES, "LOCK_RES",
662 dissect_nlm_gen_reply, NULL },
663 { NLM_CANCEL_RES, "CANCEL_RES",
664 dissect_nlm_gen_reply, NULL },
665 { NLM_UNLOCK_RES, "UNLOCK_RES",
666 dissect_nlm_gen_reply, NULL },
667 { NLM_GRANTED_RES, "GRANTED_RES",
668 dissect_nlm_gen_reply, NULL },
669 { NLM_SHARE, "SHARE",
670 dissect_nlm4_share, dissect_nlm4_shareres },
671 { NLM_UNSHARE, "UNSHARE",
672 dissect_nlm4_share, dissect_nlm4_shareres },
673 { NLM_NM_LOCK, "NM_LOCK",
674 dissect_nlm4_lock, dissect_nlm_gen_reply },
675 { NLM_FREE_ALL, "FREE_ALL",
676 dissect_nlm4_freeall, NULL },
680 /* end of NLM protocol version 4 */
683 static struct true_false_string yesno = { "Yes", "No" };
687 proto_register_nlm(void)
689 static hf_register_info hf[] = {
691 "cookie", "nlm.cookie", FT_BYTES, BASE_DEC,
692 NULL, 0, "cookie", HFILL }},
694 "block", "nlm.block", FT_BOOLEAN, BASE_NONE,
695 &yesno, 0, "block", HFILL }},
696 { &hf_nlm_exclusive, {
697 "exclusive", "nlm.exclusive", FT_BOOLEAN, BASE_NONE,
698 &yesno, 0, "exclusive", HFILL }},
700 "lock", "nlm.lock", FT_NONE, 0,
701 NULL, 0, "lock", HFILL }},
702 { &hf_nlm_lock_caller_name, {
703 "caller_name", "nlm.lock.caller_name", FT_STRING, BASE_NONE,
704 NULL, 0, "caller_name", HFILL }},
705 { &hf_nlm_lock_owner, {
706 "owner", "nlm.lock.owner", FT_BYTES, BASE_DEC,
707 NULL, 0, "owner", HFILL }},
708 { &hf_nlm_lock_svid, {
709 "svid", "nlm.lock.svid", FT_UINT32, BASE_DEC,
710 NULL, 0, "svid", HFILL }},
711 { &hf_nlm_lock_l_offset, {
712 "l_offset", "nlm.lock.l_offset", FT_UINT32, BASE_DEC,
713 NULL, 0, "l_offset", HFILL }},
714 { &hf_nlm_lock_l_len, {
715 "l_len", "nlm.lock.l_len", FT_UINT32, BASE_DEC,
716 NULL, 0, "l_len", HFILL }},
718 "reclaim", "nlm.reclaim", FT_BOOLEAN, BASE_NONE,
719 &yesno, 0, "reclaim", HFILL }},
721 "state", "nlm.state", FT_UINT32, BASE_DEC,
722 NULL, 0, "STATD state", HFILL }},
724 "stat", "nlm.stat", FT_UINT32, BASE_DEC,
725 VALS(names_nlm_stats), 0, "stat", HFILL }},
726 { &hf_nlm_test_stat, {
727 "test_stat", "nlm.test_stat", FT_NONE, 0,
728 NULL, 0, "test_stat", HFILL }},
729 { &hf_nlm_test_stat_stat, {
730 "stat", "nlm.test_stat.stat", FT_UINT32, BASE_DEC,
731 VALS(names_nlm_stats), 0, "stat", HFILL }},
733 "holder", "nlm.holder", FT_NONE, 0,
734 NULL, 0, "holder", HFILL }},
736 "share", "nlm.share", FT_NONE, 0,
737 NULL, 0, "share", HFILL }},
738 { &hf_nlm_share_mode, {
739 "mode", "nlm.share.mode", FT_UINT32, BASE_DEC,
740 VALS(names_fsh_mode), 0, "mode", HFILL }},
741 { &hf_nlm_share_access, {
742 "access", "nlm.share.access", FT_UINT32, BASE_DEC,
743 VALS(names_fsh_access), 0, "access", HFILL }},
744 { &hf_nlm_share_name, {
745 "name", "nlm.share.name", FT_STRING, BASE_NONE,
746 NULL, 0, "name", HFILL }},
747 { &hf_nlm_sequence, {
748 "sequence", "nlm.sequence", FT_INT32, BASE_DEC,
749 NULL, 0, "sequence", HFILL }},
752 static gint *ett[] = {
757 proto_nlm = proto_register_protocol("Network Lock Manager Protocol",
759 proto_register_field_array(proto_nlm, hf, array_length(hf));
760 proto_register_subtree_array(ett, array_length(ett));
764 proto_reg_handoff_nlm(void)
766 /* Register the protocol as RPC */
767 rpc_init_prog(proto_nlm, NLM_PROGRAM, ett_nlm);
768 /* Register the procedure tables */
769 rpc_init_proc_table(NLM_PROGRAM, 1, nlm1_proc);
770 rpc_init_proc_table(NLM_PROGRAM, 2, nlm2_proc);
771 rpc_init_proc_table(NLM_PROGRAM, 3, nlm3_proc);
772 rpc_init_proc_table(NLM_PROGRAM, 4, nlm4_proc);