2 * Routines for nlm dissection
4 * $Id: packet-nlm.c,v 1.23 2002/01/24 09:20:50 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 <See AUTHORS for email>
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_offset64 = -1;
72 static int hf_nlm_lock_l_len = -1;
73 static int hf_nlm_lock_l_len64 = -1;
74 static int hf_nlm_reclaim = -1;
75 static int hf_nlm_stat = -1;
76 static int hf_nlm_state = -1;
77 static int hf_nlm_test_stat = -1;
78 static int hf_nlm_test_stat_stat = -1;
79 static int hf_nlm_holder = -1;
80 static int hf_nlm_share = -1;
81 static int hf_nlm_share_mode = -1;
82 static int hf_nlm_share_access = -1;
83 static int hf_nlm_share_name = -1;
84 static int hf_nlm_sequence = -1;
86 static gint ett_nlm = -1;
87 static gint ett_nlm_lock = -1;
90 const value_string names_nlm_stats[] =
92 /* NLM_GRANTED is the function number 5 and the state code 0.
93 * So we use for the state the postfix _S.
95 #define NLM_GRANTED_S 0
96 { NLM_GRANTED_S, "NLM_GRANTED" },
98 { NLM_DENIED, "NLM_DENIED" },
99 #define NLM_DENIED_NOLOCKS 2
100 { NLM_DENIED_NOLOCKS, "NLM_DENIED_NOLOCKS" },
101 #define NLM_BLOCKED 3
102 { NLM_BLOCKED, "NLM_BLOCKED" },
103 #define NLM_DENIED_GRACE_PERIOD 4
104 { NLM_DENIED_GRACE_PERIOD, "NLM_DENIED_GRACE_PERIOD" },
105 #define NLM_DEADLCK 5
106 { NLM_DEADLCK, "NLM_DEADLCK" },
108 { NLM_ROFS, "NLM_ROFS" },
109 #define NLM_STALE_FH 7
110 { NLM_STALE_FH, "NLM_STALE_FH" },
112 { NLM_BIG, "NLM_BIG" },
114 { NLM_FAILED, "NLM_FAILED" },
119 const value_string names_fsh_mode[] =
122 { FSM_DN, "deny none" },
124 { FSM_DR, "deny read" },
126 { FSM_DW, "deny write" },
128 { FSM_DRW, "deny read/write" },
134 const value_string names_fsh_access[] =
137 { FSA_NONE, "no access" },
139 { FSA_R, "read-only" },
141 { FSA_W, "write-only" },
143 { FSA_RW, "read/write" },
152 /* **************************** */
153 /* generic dissecting functions */
154 /* **************************** */
156 dissect_lock(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int version, int offset)
158 proto_item* lock_item = NULL;
159 proto_tree* lock_tree = NULL;
162 lock_item = proto_tree_add_item(tree, hf_nlm_lock, tvb,
165 lock_tree = proto_item_add_subtree(lock_item, ett_nlm_lock);
168 offset = dissect_rpc_string(tvb,pinfo,lock_tree,
169 hf_nlm_lock_caller_name, offset, NULL);
170 offset = dissect_nfs_fh3(tvb, offset, pinfo, lock_tree,"fh");
172 offset = dissect_rpc_data(tvb, pinfo, lock_tree, hf_nlm_lock_owner, offset);
174 offset = dissect_rpc_uint32(tvb, pinfo, lock_tree, hf_nlm_lock_svid, offset);
177 offset = dissect_rpc_uint64(tvb, pinfo, lock_tree, hf_nlm_lock_l_offset64, offset);
178 offset = dissect_rpc_uint64(tvb, pinfo, lock_tree, hf_nlm_lock_l_len64, offset);
181 offset = dissect_rpc_uint32(tvb, pinfo, lock_tree, hf_nlm_lock_l_offset, offset);
182 offset = dissect_rpc_uint32(tvb, pinfo, lock_tree, hf_nlm_lock_l_len, offset);
190 dissect_nlm_test(tvbuff_t *tvb, int offset, packet_info *pinfo,
191 proto_tree *tree, int version)
193 offset = dissect_rpc_data(tvb, pinfo, tree, hf_nlm_cookie, offset);
194 dissect_rpc_bool(tvb, pinfo, tree, hf_nlm_exclusive, offset);
196 offset = dissect_lock(tvb, pinfo, tree, version, offset);
201 dissect_nlm_lock(tvbuff_t *tvb, int offset, packet_info *pinfo,
202 proto_tree *tree,int version)
204 offset = dissect_rpc_data(tvb, pinfo, tree, hf_nlm_cookie, offset);
205 offset = dissect_rpc_bool(tvb, pinfo, tree, hf_nlm_block, offset);
206 offset = dissect_rpc_bool(tvb, pinfo, tree, hf_nlm_exclusive, offset);
207 offset = dissect_lock(tvb, pinfo, tree, version, offset);
208 offset = dissect_rpc_bool(tvb, pinfo, tree, hf_nlm_reclaim, offset);
209 offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nlm_state, offset);
214 dissect_nlm_cancel(tvbuff_t *tvb, int offset, packet_info *pinfo,
215 proto_tree *tree,int version)
217 offset = dissect_rpc_data(tvb, pinfo, tree, hf_nlm_cookie, offset);
218 offset = dissect_rpc_bool(tvb, pinfo, tree, hf_nlm_block, offset);
219 offset = dissect_rpc_bool(tvb, pinfo, tree, hf_nlm_exclusive, offset);
220 offset = dissect_lock(tvb, pinfo, tree, version, offset);
225 dissect_nlm_unlock(tvbuff_t *tvb, int offset, packet_info *pinfo,
226 proto_tree *tree,int version)
228 offset = dissect_rpc_data(tvb, pinfo, tree, hf_nlm_cookie, offset);
229 offset = dissect_lock(tvb, pinfo, tree, version, offset);
234 dissect_nlm_granted(tvbuff_t *tvb, int offset, packet_info *pinfo,
235 proto_tree *tree,int version)
237 offset = dissect_rpc_data(tvb, pinfo, tree, hf_nlm_cookie, offset);
238 offset = dissect_rpc_bool(tvb, pinfo, tree, hf_nlm_exclusive, offset);
239 offset = dissect_lock(tvb, pinfo, tree, version, offset);
245 dissect_nlm_test_res(tvbuff_t *tvb, int offset, packet_info *pinfo,
246 proto_tree *tree,int version)
248 proto_item* lock_item = NULL;
249 proto_tree* lock_tree = NULL;
251 offset = dissect_rpc_data(tvb, pinfo, tree, hf_nlm_cookie, offset);
254 lock_item = proto_tree_add_item(tree, hf_nlm_test_stat, tvb,
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_reported_length_remaining(tvb, offset) == 0){
270 lock_item = proto_tree_add_item(lock_tree, hf_nlm_holder, tvb,
273 lock_tree = proto_item_add_subtree(lock_item,
277 offset = dissect_rpc_bool(tvb, pinfo, lock_tree, hf_nlm_exclusive,
279 offset = dissect_rpc_uint32(tvb, pinfo, lock_tree, hf_nlm_lock_svid,
281 offset = dissect_rpc_data(tvb, pinfo, lock_tree, hf_nlm_lock_owner,
285 offset = dissect_rpc_uint64(tvb, pinfo, lock_tree,
286 hf_nlm_lock_l_offset64, offset);
287 offset = dissect_rpc_uint64(tvb, pinfo, lock_tree,
288 hf_nlm_lock_l_len64, offset);
291 offset = dissect_rpc_uint32(tvb, pinfo, lock_tree,
292 hf_nlm_lock_l_offset, offset);
293 offset = dissect_rpc_uint32(tvb, pinfo, lock_tree,
294 hf_nlm_lock_l_len, offset);
302 dissect_nlm_share(tvbuff_t *tvb, int offset, packet_info *pinfo,
303 proto_tree *tree,int version)
305 proto_item* lock_item = NULL;
306 proto_tree* lock_tree = NULL;
308 offset = dissect_rpc_data(tvb, pinfo, tree, hf_nlm_cookie, offset);
311 lock_item = proto_tree_add_item(tree, hf_nlm_share, tvb,
314 lock_tree = proto_item_add_subtree(lock_item,
318 offset = dissect_rpc_string(tvb,pinfo,lock_tree,
319 hf_nlm_lock_caller_name, offset, NULL);
321 offset = dissect_nfs_fh3(tvb, offset, pinfo, lock_tree, "fh");
323 offset = dissect_rpc_data(tvb, pinfo, lock_tree, hf_nlm_lock_owner, offset);
325 offset = dissect_rpc_uint32(tvb, pinfo, lock_tree, hf_nlm_share_mode, offset);
326 offset = dissect_rpc_uint32(tvb, pinfo, lock_tree, hf_nlm_share_access, offset);
329 offset = dissect_rpc_bool(tvb, pinfo, tree, hf_nlm_reclaim, offset);
334 dissect_nlm_shareres(tvbuff_t *tvb, int offset, packet_info *pinfo,
335 proto_tree *tree, int version)
337 offset = dissect_rpc_data(tvb, pinfo, tree, hf_nlm_cookie, offset);
338 offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nlm_stat, offset);
339 offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nlm_sequence, offset);
344 dissect_nlm_freeall(tvbuff_t *tvb, int offset, packet_info *pinfo,
345 proto_tree *tree,int version)
347 offset = dissect_rpc_string(tvb,pinfo,tree,
348 hf_nlm_share_name, offset, NULL);
350 offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nlm_stat, offset);
359 /* This function is identical for all NLM protocol versions (1-4)*/
361 dissect_nlm_gen_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
364 offset = dissect_rpc_data(tvb, pinfo, tree, hf_nlm_cookie, offset);
365 offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nlm_stat, offset);
370 dissect_nlm1_test(tvbuff_t *tvb, int offset, packet_info *pinfo,
373 return dissect_nlm_test(tvb,offset,pinfo,tree,1);
377 dissect_nlm4_test(tvbuff_t *tvb, int offset, packet_info *pinfo,
380 return dissect_nlm_test(tvb,offset,pinfo,tree,4);
385 dissect_nlm1_lock(tvbuff_t *tvb, int offset, packet_info *pinfo,
388 return dissect_nlm_lock(tvb,offset,pinfo,tree,1);
392 dissect_nlm4_lock(tvbuff_t *tvb, int offset, packet_info *pinfo,
395 return dissect_nlm_lock(tvb,offset,pinfo,tree,4);
400 dissect_nlm1_cancel(tvbuff_t *tvb, int offset, packet_info *pinfo,
403 return dissect_nlm_cancel(tvb,offset,pinfo,tree,1);
407 dissect_nlm4_cancel(tvbuff_t *tvb, int offset, packet_info *pinfo,
410 return dissect_nlm_cancel(tvb,offset,pinfo,tree,4);
415 dissect_nlm1_unlock(tvbuff_t *tvb, int offset, packet_info *pinfo,
418 return dissect_nlm_unlock(tvb,offset,pinfo,tree,1);
422 dissect_nlm4_unlock(tvbuff_t *tvb, int offset, packet_info *pinfo,
425 return dissect_nlm_unlock(tvb,offset,pinfo,tree,4);
430 dissect_nlm1_granted(tvbuff_t *tvb, int offset, packet_info *pinfo,
433 return dissect_nlm_granted(tvb,offset,pinfo,tree,1);
437 dissect_nlm4_granted(tvbuff_t *tvb, int offset, packet_info *pinfo,
440 return dissect_nlm_granted(tvb,offset,pinfo,tree,4);
445 dissect_nlm1_test_res(tvbuff_t *tvb, int offset, packet_info *pinfo,
448 return dissect_nlm_test_res(tvb,offset,pinfo,tree,1);
452 dissect_nlm4_test_res(tvbuff_t *tvb, int offset, packet_info *pinfo,
455 return dissect_nlm_test_res(tvb,offset,pinfo,tree,4);
459 dissect_nlm3_share(tvbuff_t *tvb, int offset, packet_info *pinfo,
462 return dissect_nlm_share(tvb,offset,pinfo,tree,3);
466 dissect_nlm4_share(tvbuff_t *tvb, int offset, packet_info *pinfo,
469 return dissect_nlm_share(tvb,offset,pinfo,tree,4);
473 dissect_nlm3_shareres(tvbuff_t *tvb, int offset, packet_info *pinfo,
476 return dissect_nlm_shareres(tvb,offset,pinfo,tree,3);
480 dissect_nlm4_shareres(tvbuff_t *tvb, int offset, packet_info *pinfo,
483 return dissect_nlm_shareres(tvb,offset,pinfo,tree,4);
487 dissect_nlm3_freeall(tvbuff_t *tvb, int offset, packet_info *pinfo,
490 return dissect_nlm_freeall(tvb,offset,pinfo,tree,3);
494 dissect_nlm4_freeall(tvbuff_t *tvb, int offset, packet_info *pinfo,
497 return dissect_nlm_freeall(tvb,offset,pinfo,tree,4);
503 /* proc number, "proc name", dissect_request, dissect_reply */
504 /* NULL as function pointer means: type of arguments is "void". */
505 /* NLM protocol version 1 */
506 static const vsff nlm1_proc[] = {
510 dissect_nlm1_test, dissect_nlm1_test_res },
512 dissect_nlm1_lock, dissect_nlm_gen_reply },
513 { NLM_CANCEL, "CANCEL",
514 dissect_nlm1_cancel, dissect_nlm_gen_reply },
515 { NLM_UNLOCK, "UNLOCK",
516 dissect_nlm1_unlock, dissect_nlm_gen_reply },
517 { NLM_GRANTED, "GRANTED",
518 dissect_nlm1_granted, dissect_nlm_gen_reply },
519 { NLM_TEST_MSG, "TEST_MSG",
520 dissect_nlm1_test, NULL },
521 { NLM_LOCK_MSG, "LOCK_MSG",
522 dissect_nlm1_lock, NULL },
523 { NLM_CANCEL_MSG, "CANCEL_MSG",
524 dissect_nlm1_cancel, NULL },
525 { NLM_UNLOCK_MSG, "UNLOCK_MSG",
526 dissect_nlm1_unlock, NULL },
527 { NLM_GRANTED_MSG, "GRANTED_MSG",
528 dissect_nlm1_granted, NULL },
529 { NLM_TEST_RES, "TEST_RES",
530 dissect_nlm1_test_res, NULL },
531 { NLM_LOCK_RES, "LOCK_RES",
532 dissect_nlm_gen_reply, NULL },
533 { NLM_CANCEL_RES, "CANCEL_RES",
534 dissect_nlm_gen_reply, NULL },
535 { NLM_UNLOCK_RES, "UNLOCK_RES",
536 dissect_nlm_gen_reply, NULL },
537 { NLM_GRANTED_RES, "GRANTED_RES",
538 dissect_nlm_gen_reply, NULL },
542 /* end of NLM protocol version 1 */
544 /* NLM protocol version 2 */
545 static const vsff nlm2_proc[] = {
549 dissect_nlm1_test, dissect_nlm1_test_res },
551 dissect_nlm1_lock, dissect_nlm_gen_reply },
552 { NLM_CANCEL, "CANCEL",
553 dissect_nlm1_cancel, dissect_nlm_gen_reply },
554 { NLM_UNLOCK, "UNLOCK",
555 dissect_nlm1_unlock, dissect_nlm_gen_reply },
556 { NLM_GRANTED, "GRANTED",
557 dissect_nlm1_granted, dissect_nlm_gen_reply },
558 { NLM_TEST_MSG, "TEST_MSG",
559 dissect_nlm1_test, NULL },
560 { NLM_LOCK_MSG, "LOCK_MSG",
561 dissect_nlm1_lock, NULL },
562 { NLM_CANCEL_MSG, "CANCEL_MSG",
563 dissect_nlm1_cancel, NULL },
564 { NLM_UNLOCK_MSG, "UNLOCK_MSG",
565 dissect_nlm1_unlock, NULL },
566 { NLM_GRANTED_MSG, "GRANTED_MSG",
567 dissect_nlm1_granted, NULL },
568 { NLM_TEST_RES, "TEST_RES",
569 dissect_nlm1_test_res, NULL },
570 { NLM_LOCK_RES, "LOCK_RES",
571 dissect_nlm_gen_reply, NULL },
572 { NLM_CANCEL_RES, "CANCEL_RES",
573 dissect_nlm_gen_reply, NULL },
574 { NLM_UNLOCK_RES, "UNLOCK_RES",
575 dissect_nlm_gen_reply, NULL },
576 { NLM_GRANTED_RES, "GRANTED_RES",
577 dissect_nlm_gen_reply, NULL },
581 /* end of NLM protocol version 2 */
583 /* NLM protocol version 3 */
584 static const vsff nlm3_proc[] = {
588 dissect_nlm1_test, dissect_nlm1_test_res },
590 dissect_nlm1_lock, dissect_nlm_gen_reply },
591 { NLM_CANCEL, "CANCEL",
592 dissect_nlm1_cancel, dissect_nlm_gen_reply },
593 { NLM_UNLOCK, "UNLOCK",
594 dissect_nlm1_unlock, dissect_nlm_gen_reply },
595 { NLM_GRANTED, "GRANTED",
596 dissect_nlm1_granted, dissect_nlm_gen_reply },
597 { NLM_TEST_MSG, "TEST_MSG",
598 dissect_nlm1_test, NULL },
599 { NLM_LOCK_MSG, "LOCK_MSG",
600 dissect_nlm1_lock, NULL },
601 { NLM_CANCEL_MSG, "CANCEL_MSG",
602 dissect_nlm1_cancel, NULL },
603 { NLM_UNLOCK_MSG, "UNLOCK_MSG",
604 dissect_nlm1_unlock, NULL },
605 { NLM_GRANTED_MSG, "GRANTED_MSG",
606 dissect_nlm1_granted, NULL },
607 { NLM_TEST_RES, "TEST_RES",
608 dissect_nlm1_test_res, NULL },
609 { NLM_LOCK_RES, "LOCK_RES",
610 dissect_nlm_gen_reply, NULL },
611 { NLM_CANCEL_RES, "CANCEL_RES",
612 dissect_nlm_gen_reply, NULL },
613 { NLM_UNLOCK_RES, "UNLOCK_RES",
614 dissect_nlm_gen_reply, NULL },
615 { NLM_GRANTED_RES, "GRANTED_RES",
616 dissect_nlm_gen_reply, NULL },
617 { NLM_SHARE, "SHARE",
618 dissect_nlm3_share, dissect_nlm3_shareres },
619 { NLM_UNSHARE, "UNSHARE",
620 dissect_nlm3_share, dissect_nlm3_shareres },
621 { NLM_NM_LOCK, "NM_LOCK",
622 dissect_nlm1_lock, dissect_nlm_gen_reply },
623 { NLM_FREE_ALL, "FREE_ALL",
624 dissect_nlm3_freeall, NULL },
628 /* end of NLM protocol version 3 */
631 /* NLM protocol version 4 */
632 static const vsff nlm4_proc[] = {
636 dissect_nlm4_test, dissect_nlm4_test_res },
638 dissect_nlm4_lock, dissect_nlm_gen_reply },
639 { NLM_CANCEL, "CANCEL",
640 dissect_nlm4_cancel, dissect_nlm_gen_reply },
641 { NLM_UNLOCK, "UNLOCK",
642 dissect_nlm4_unlock, dissect_nlm_gen_reply },
643 { NLM_GRANTED, "GRANTED",
644 dissect_nlm4_granted, dissect_nlm_gen_reply },
645 { NLM_TEST_MSG, "TEST_MSG",
646 dissect_nlm4_test, NULL },
647 { NLM_LOCK_MSG, "LOCK_MSG",
648 dissect_nlm4_lock, NULL },
649 { NLM_CANCEL_MSG, "CANCEL_MSG",
650 dissect_nlm4_cancel, NULL },
651 { NLM_UNLOCK_MSG, "UNLOCK_MSG",
652 dissect_nlm4_unlock, NULL },
653 { NLM_GRANTED_MSG, "GRANTED_MSG",
654 dissect_nlm4_granted, NULL },
655 { NLM_TEST_RES, "TEST_RES",
656 dissect_nlm4_test_res, NULL },
657 { NLM_LOCK_RES, "LOCK_RES",
658 dissect_nlm_gen_reply, NULL },
659 { NLM_CANCEL_RES, "CANCEL_RES",
660 dissect_nlm_gen_reply, NULL },
661 { NLM_UNLOCK_RES, "UNLOCK_RES",
662 dissect_nlm_gen_reply, NULL },
663 { NLM_GRANTED_RES, "GRANTED_RES",
664 dissect_nlm_gen_reply, NULL },
665 { NLM_SHARE, "SHARE",
666 dissect_nlm4_share, dissect_nlm4_shareres },
667 { NLM_UNSHARE, "UNSHARE",
668 dissect_nlm4_share, dissect_nlm4_shareres },
669 { NLM_NM_LOCK, "NM_LOCK",
670 dissect_nlm4_lock, dissect_nlm_gen_reply },
671 { NLM_FREE_ALL, "FREE_ALL",
672 dissect_nlm4_freeall, NULL },
676 /* end of NLM protocol version 4 */
679 static struct true_false_string yesno = { "Yes", "No" };
683 proto_register_nlm(void)
685 static hf_register_info hf[] = {
687 "cookie", "nlm.cookie", FT_BYTES, BASE_DEC,
688 NULL, 0, "cookie", HFILL }},
690 "block", "nlm.block", FT_BOOLEAN, BASE_NONE,
691 &yesno, 0, "block", HFILL }},
692 { &hf_nlm_exclusive, {
693 "exclusive", "nlm.exclusive", FT_BOOLEAN, BASE_NONE,
694 &yesno, 0, "exclusive", HFILL }},
696 "lock", "nlm.lock", FT_NONE, 0,
697 NULL, 0, "lock", HFILL }},
698 { &hf_nlm_lock_caller_name, {
699 "caller_name", "nlm.lock.caller_name", FT_STRING, BASE_NONE,
700 NULL, 0, "caller_name", HFILL }},
701 { &hf_nlm_lock_owner, {
702 "owner", "nlm.lock.owner", FT_BYTES, BASE_DEC,
703 NULL, 0, "owner", HFILL }},
704 { &hf_nlm_lock_svid, {
705 "svid", "nlm.lock.svid", FT_UINT32, BASE_DEC,
706 NULL, 0, "svid", HFILL }},
707 { &hf_nlm_lock_l_offset64, {
708 "l_offset", "nlm.lock.l_offset", FT_UINT64, BASE_DEC,
709 NULL, 0, "l_offset", HFILL }},
710 { &hf_nlm_lock_l_offset, {
711 "l_offset", "nlm.lock.l_offset", FT_UINT32, BASE_DEC,
712 NULL, 0, "l_offset", HFILL }},
713 { &hf_nlm_lock_l_len64, {
714 "l_len", "nlm.lock.l_len", FT_UINT64, BASE_DEC,
715 NULL, 0, "l_len", HFILL }},
716 { &hf_nlm_lock_l_len, {
717 "l_len", "nlm.lock.l_len", FT_UINT32, BASE_DEC,
718 NULL, 0, "l_len", HFILL }},
720 "reclaim", "nlm.reclaim", FT_BOOLEAN, BASE_NONE,
721 &yesno, 0, "reclaim", HFILL }},
723 "state", "nlm.state", FT_UINT32, BASE_DEC,
724 NULL, 0, "STATD state", HFILL }},
726 "stat", "nlm.stat", FT_UINT32, BASE_DEC,
727 VALS(names_nlm_stats), 0, "stat", HFILL }},
728 { &hf_nlm_test_stat, {
729 "test_stat", "nlm.test_stat", FT_NONE, 0,
730 NULL, 0, "test_stat", HFILL }},
731 { &hf_nlm_test_stat_stat, {
732 "stat", "nlm.test_stat.stat", FT_UINT32, BASE_DEC,
733 VALS(names_nlm_stats), 0, "stat", HFILL }},
735 "holder", "nlm.holder", FT_NONE, 0,
736 NULL, 0, "holder", HFILL }},
738 "share", "nlm.share", FT_NONE, 0,
739 NULL, 0, "share", HFILL }},
740 { &hf_nlm_share_mode, {
741 "mode", "nlm.share.mode", FT_UINT32, BASE_DEC,
742 VALS(names_fsh_mode), 0, "mode", HFILL }},
743 { &hf_nlm_share_access, {
744 "access", "nlm.share.access", FT_UINT32, BASE_DEC,
745 VALS(names_fsh_access), 0, "access", HFILL }},
746 { &hf_nlm_share_name, {
747 "name", "nlm.share.name", FT_STRING, BASE_NONE,
748 NULL, 0, "name", HFILL }},
749 { &hf_nlm_sequence, {
750 "sequence", "nlm.sequence", FT_INT32, BASE_DEC,
751 NULL, 0, "sequence", HFILL }},
754 static gint *ett[] = {
759 proto_nlm = proto_register_protocol("Network Lock Manager Protocol",
761 proto_register_field_array(proto_nlm, hf, array_length(hf));
762 proto_register_subtree_array(ett, array_length(ett));
766 proto_reg_handoff_nlm(void)
768 /* Register the protocol as RPC */
769 rpc_init_prog(proto_nlm, NLM_PROGRAM, ett_nlm);
770 /* Register the procedure tables */
771 rpc_init_proc_table(NLM_PROGRAM, 1, nlm1_proc);
772 rpc_init_proc_table(NLM_PROGRAM, 2, nlm2_proc);
773 rpc_init_proc_table(NLM_PROGRAM, 3, nlm3_proc);
774 rpc_init_proc_table(NLM_PROGRAM, 4, nlm4_proc);