2 * Routines for mount dissection
4 * $Id: packet-mount.c,v 1.35 2002/11/01 00:48:38 sahlberg Exp $
6 * Ethereal - Network traffic analyzer
7 * By Gerald Combs <gerald@ethereal.com>
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.
34 #include "packet-rpc.h"
35 #include "packet-mount.h"
36 #include "packet-nfs.h"
39 static int proto_mount = -1;
40 static int hf_mount_procedure_v1 = -1;
41 static int hf_mount_procedure_v2 = -1;
42 static int hf_mount_procedure_v3 = -1;
43 static int hf_mount_path = -1;
44 static int hf_mount3_status = -1;
45 static int hf_mount_mountlist_hostname = -1;
46 static int hf_mount_mountlist_directory = -1;
47 static int hf_mount_mountlist = -1;
48 static int hf_mount_groups_group = -1;
49 static int hf_mount_groups = -1;
50 static int hf_mount_exportlist_directory = -1;
51 static int hf_mount_exportlist = -1;
52 static int hf_mount_pathconf_link_max = -1;
53 static int hf_mount_pathconf_max_canon = -1;
54 static int hf_mount_pathconf_max_input = -1;
55 static int hf_mount_pathconf_name_max = -1;
56 static int hf_mount_pathconf_path_max = -1;
57 static int hf_mount_pathconf_pipe_buf = -1;
58 static int hf_mount_pathconf_vdisable = -1;
59 static int hf_mount_pathconf_mask = -1;
60 static int hf_mount_pathconf_error_all = -1;
61 static int hf_mount_pathconf_error_link_max = -1;
62 static int hf_mount_pathconf_error_max_canon = -1;
63 static int hf_mount_pathconf_error_max_input = -1;
64 static int hf_mount_pathconf_error_name_max = -1;
65 static int hf_mount_pathconf_error_path_max = -1;
66 static int hf_mount_pathconf_error_pipe_buf = -1;
67 static int hf_mount_pathconf_chown_restricted = -1;
68 static int hf_mount_pathconf_no_trunc = -1;
69 static int hf_mount_pathconf_error_vdisable = -1;
70 static int hf_mount_flavors = -1;
71 static int hf_mount_flavor = -1;
73 static gint ett_mount = -1;
74 static gint ett_mount_mountlist = -1;
75 static gint ett_mount_groups = -1;
76 static gint ett_mount_exportlist = -1;
77 static gint ett_mount_pathconf_mask = -1;
79 #define MAX_GROUP_NAME_LIST 128
80 static char group_name_list[MAX_GROUP_NAME_LIST];
81 static int group_names_len;
83 /* RFC 1094, Page 24 */
84 /* This function dissects fhstatus for v1 and v2 of the mount protocol.
85 * Formally, hf_mount3_status only define the status codes returned by version
87 * Though not formally defined in the standard, we use the same
88 * value-to-string mappings as version 3 since we belive that this mapping
89 * is consistant with most v1 and v2 implementations.
92 dissect_fhstatus(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
96 status=tvb_get_ntohl(tvb,offset);
97 offset = dissect_rpc_uint32(tvb,tree,hf_mount3_status,offset);
101 offset = dissect_fhandle(tvb,offset,pinfo,tree,"fhandle");
113 dissect_mount_dirpath_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
116 if((!pinfo->fd->flags.visited) && nfs_file_name_snooping){
117 rpc_call_info_value *civ=pinfo->private_data;
119 if(civ->request && (civ->proc==1)){
120 unsigned char *host, *name;
121 unsigned const char *dir;
124 host=ip_to_str(pinfo->dst.data);
125 len=tvb_get_ntohl(tvb, offset);
127 dir=tvb_get_ptr(tvb, offset+4, len);
130 name=g_malloc(strlen(host)+1+len+1+200);
132 memcpy(ptr, host, strlen(host));
135 memcpy(ptr, dir, len);
139 nfs_name_snoop_add_name(civ->xid, tvb, -1, strlen(name), 0, 0, name);
146 offset = dissect_rpc_string(tvb,tree,hf_mount_path,offset,NULL);
153 /* RFC 1094, Page 25,26 */
155 dissect_mount1_mnt_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
157 offset = dissect_fhstatus(tvb,offset,pinfo,tree);
164 /* RFC 1094, Page 26 */
165 /* RFC 1813, Page 110 */
167 dissect_mountlist(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
169 proto_item* lock_item = NULL;
170 proto_tree* lock_tree = NULL;
171 int old_offset = offset;
176 lock_item = proto_tree_add_item(tree, hf_mount_mountlist, tvb,
179 lock_tree = proto_item_add_subtree(lock_item, ett_mount_mountlist);
182 offset = dissect_rpc_string(tvb, lock_tree,
183 hf_mount_mountlist_hostname, offset, &hostname);
184 offset = dissect_rpc_string(tvb, lock_tree,
185 hf_mount_mountlist_directory, offset, &directory);
188 /* now we have a nicer string */
189 proto_item_set_text(lock_item, "Mount List Entry: %s:%s", hostname, directory);
190 /* now we know, that mountlist is shorter */
191 proto_item_set_len(lock_item, offset - old_offset);
200 /* RFC 1094, Page 26 */
201 /* RFC 1813, Page 110 */
203 dissect_mount_dump_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
205 offset = dissect_rpc_list(tvb, pinfo, tree, offset, dissect_mountlist);
212 /* RFC 1094, Page 26 */
213 /* RFC 1813, Page 110 */
215 dissect_group(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
218 len=tvb_get_ntohl(tvb,offset);
219 str_len=tvb_get_nstringz(tvb,offset+4,
220 MAX_GROUP_NAME_LIST-5-group_names_len,
221 group_name_list+group_names_len);
222 if((group_names_len>=(MAX_GROUP_NAME_LIST-5))||(str_len<0)){
223 strcpy(group_name_list+(MAX_GROUP_NAME_LIST-5),"...");
224 group_names_len=MAX_GROUP_NAME_LIST-1;
226 group_names_len+=str_len;
227 group_name_list[group_names_len++]=' ';
229 group_name_list[group_names_len]=0;
231 offset = dissect_rpc_string(tvb, tree,
232 hf_mount_groups_group, offset, NULL);
238 /* RFC 1094, Page 26 */
239 /* RFC 1813, Page 113 */
241 dissect_exportlist(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
243 proto_item* exportlist_item = NULL;
244 proto_tree* exportlist_tree = NULL;
245 int old_offset = offset;
247 proto_item* groups_item = NULL;
248 proto_item* groups_tree = NULL;
251 group_name_list[0]=0;
254 exportlist_item = proto_tree_add_item(tree, hf_mount_exportlist, tvb,
257 exportlist_tree = proto_item_add_subtree(exportlist_item, ett_mount_exportlist);
260 offset = dissect_rpc_string(tvb, exportlist_tree,
261 hf_mount_exportlist_directory, offset, &directory);
262 groups_offset = offset;
265 groups_item = proto_tree_add_item(exportlist_tree, hf_mount_groups, tvb,
268 groups_tree = proto_item_add_subtree(groups_item, ett_mount_groups);
271 offset = dissect_rpc_list(tvb, pinfo, groups_tree, offset, dissect_group);
273 /* mark empty lists */
274 if (offset - groups_offset == 4) {
275 proto_item_set_text(groups_item, "Groups: empty");
278 /* now we know, that groups is shorter */
279 proto_item_set_len(groups_item, offset - groups_offset);
282 if (exportlist_item) {
283 /* now we have a nicer string */
284 proto_item_set_text(exportlist_item, "Export List Entry: %s -> %s", directory,group_name_list);
285 /* now we know, that exportlist is shorter */
286 proto_item_set_len(exportlist_item, offset - old_offset);
294 /* RFC 1094, Page 26 */
295 /* RFC 1813, Page 113 */
297 dissect_mount_export_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
299 offset = dissect_rpc_list(tvb, pinfo, tree, offset, dissect_exportlist);
305 #define OFFS_MASK 32 /* offset of the "pc_mask" field */
307 #define PC_ERROR_ALL 0x0001
308 #define PC_ERROR_LINK_MAX 0x0002
309 #define PC_ERROR_MAX_CANON 0x0004
310 #define PC_ERROR_MAX_INPUT 0x0008
311 #define PC_ERROR_NAME_MAX 0x0010
312 #define PC_ERROR_PATH_MAX 0x0020
313 #define PC_ERROR_PIPE_BUF 0x0040
314 #define PC_CHOWN_RESTRICTED 0x0080
315 #define PC_NO_TRUNC 0x0100
316 #define PC_ERROR_VDISABLE 0x0200
318 static const true_false_string tos_error_all = {
320 "Some or all info valid"
323 static const true_false_string tos_error_link_max = {
328 static const true_false_string tos_error_max_canon = {
333 static const true_false_string tos_error_max_input = {
338 static const true_false_string tos_error_name_max = {
343 static const true_false_string tos_error_path_max = {
348 static const true_false_string tos_error_pipe_buf = {
353 static const true_false_string tos_chown_restricted = {
354 "Only a privileged user can change the ownership of a file",
355 "Users may give away their own files"
358 static const true_false_string tos_no_trunc = {
359 "File names that are too long will get an error",
360 "File names that are too long will be truncated"
363 static const true_false_string tos_error_vdisable = {
370 dissect_mount_pathconf_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
374 proto_item *lock_item;
375 proto_tree *lock_tree;
379 * Extract the mask first, so we know which other fields the
380 * server was able to return to us.
382 pc_mask = tvb_get_ntohl(tvb, offset+OFFS_MASK) & 0xffff;
383 if (!(pc_mask & (PC_ERROR_LINK_MAX|PC_ERROR_ALL))) {
385 dissect_rpc_uint32(tvb,tree,hf_mount_pathconf_link_max,offset);
390 if (!(pc_mask & (PC_ERROR_MAX_CANON|PC_ERROR_ALL))) {
392 proto_tree_add_item(tree,
393 hf_mount_pathconf_max_canon,tvb,offset+2,2,
394 tvb_get_ntohs(tvb,offset)&0xffff);
399 if (!(pc_mask & (PC_ERROR_MAX_INPUT|PC_ERROR_ALL))) {
401 proto_tree_add_item(tree,
402 hf_mount_pathconf_max_input,tvb,offset+2,2,
403 tvb_get_ntohs(tvb,offset)&0xffff);
408 if (!(pc_mask & (PC_ERROR_NAME_MAX|PC_ERROR_ALL))) {
410 proto_tree_add_item(tree,
411 hf_mount_pathconf_name_max,tvb,offset+2,2,
412 tvb_get_ntohs(tvb,offset)&0xffff);
417 if (!(pc_mask & (PC_ERROR_PATH_MAX|PC_ERROR_ALL))) {
419 proto_tree_add_item(tree,
420 hf_mount_pathconf_path_max,tvb,offset+2,2,
421 tvb_get_ntohs(tvb,offset)&0xffff);
426 if (!(pc_mask & (PC_ERROR_PIPE_BUF|PC_ERROR_ALL))) {
428 proto_tree_add_item(tree,
429 hf_mount_pathconf_pipe_buf,tvb,offset+2,2,
430 tvb_get_ntohs(tvb,offset)&0xffff);
435 offset += 4; /* skip "pc_xxx" pad field */
437 if (!(pc_mask & (PC_ERROR_VDISABLE|PC_ERROR_ALL))) {
439 proto_tree_add_item(tree,
440 hf_mount_pathconf_vdisable,tvb,offset+3,1,
441 tvb_get_ntohs(tvb,offset)&0xffff);
448 lock_item = proto_tree_add_item(tree, hf_mount_pathconf_mask, tvb,
451 lock_tree = proto_item_add_subtree(lock_item, ett_mount_pathconf_mask);
452 proto_tree_add_boolean(lock_tree, hf_mount_pathconf_error_all, tvb,
453 offset + 2, 2, pc_mask);
455 proto_tree_add_boolean(lock_tree, hf_mount_pathconf_error_link_max, tvb,
456 offset + 2, 2, pc_mask);
457 proto_tree_add_boolean(lock_tree, hf_mount_pathconf_error_max_canon, tvb,
458 offset + 2, 2, pc_mask);
459 proto_tree_add_boolean(lock_tree, hf_mount_pathconf_error_max_input, tvb,
460 offset + 2, 2, pc_mask);
461 proto_tree_add_boolean(lock_tree, hf_mount_pathconf_error_name_max, tvb,
462 offset + 2, 2, pc_mask);
463 proto_tree_add_boolean(lock_tree, hf_mount_pathconf_error_path_max, tvb,
464 offset + 2, 2, pc_mask);
465 proto_tree_add_boolean(lock_tree, hf_mount_pathconf_error_pipe_buf, tvb,
466 offset + 2, 2, pc_mask);
467 proto_tree_add_boolean(lock_tree, hf_mount_pathconf_chown_restricted, tvb,
468 offset + 2, 2, pc_mask);
469 proto_tree_add_boolean(lock_tree, hf_mount_pathconf_no_trunc, tvb,
470 offset + 2, 2, pc_mask);
471 proto_tree_add_boolean(lock_tree, hf_mount_pathconf_error_vdisable, tvb,
472 offset + 2, 2, pc_mask);
479 /* RFC 1813, Page 107 */
480 static const value_string mount3_mountstat3[] =
486 { 13, "ERR_ACCESS" },
487 { 20, "ERR_NOTDIR" },
489 { 63, "ERR_NAMETOOLONG" },
490 { 10004, "ERR_NOTSUPP" },
491 { 10006, "ERR_SERVERFAULT" },
496 /* RFC 1813, Page 107 */
498 dissect_mountstat3(tvbuff_t *tvb, proto_tree *tree, int offset, int hfindex, guint32 *status)
502 mountstat3 = tvb_get_ntohl(tvb, offset);
504 offset = dissect_rpc_uint32(tvb,tree,hfindex,offset);
505 *status = mountstat3;
509 /* RFC 1831, Page 109 */
511 dissect_mount3_mnt_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
514 guint32 auth_flavors;
516 guint32 auth_flavor_i;
518 offset = dissect_mountstat3(tvb,tree,offset,hf_mount3_status,&status);
522 offset = dissect_nfs_fh3(tvb,offset,pinfo,tree,"fhandle");
524 auth_flavors = tvb_get_ntohl(tvb, offset);
525 proto_tree_add_uint(tree,hf_mount_flavors, tvb,
526 offset, 4, auth_flavors);
528 for (auth_flavor_i = 0 ; auth_flavor_i < auth_flavors ; auth_flavor_i++) {
529 auth_flavor = tvb_get_ntohl(tvb, offset);
530 proto_tree_add_uint(tree,hf_mount_flavor, tvb,
531 offset, 4, auth_flavor);
544 /* proc number, "proc name", dissect_request, dissect_reply */
545 /* NULL as function pointer means: type of arguments is "void". */
547 /* Mount protocol version 1, RFC 1094 */
548 static const vsff mount1_proc[] = {
549 { 0, "NULL", NULL, NULL },
550 { MOUNTPROC_MNT, "MNT",
551 dissect_mount_dirpath_call, dissect_mount1_mnt_reply },
552 { MOUNTPROC_DUMP, "DUMP",
553 NULL, dissect_mount_dump_reply },
554 { MOUNTPROC_UMNT, "UMNT",
555 dissect_mount_dirpath_call, NULL },
556 { MOUNTPROC_UMNTALL, "UMNTALL",
558 { MOUNTPROC_EXPORT, "EXPORT",
559 NULL, dissect_mount_export_reply },
560 { MOUNTPROC_EXPORTALL, "EXPORTALL",
561 NULL, dissect_mount_export_reply },
562 { 0, NULL, NULL, NULL }
564 static const value_string mount1_proc_vals[] = {
566 { MOUNTPROC_MNT, "MNT" },
567 { MOUNTPROC_DUMP, "DUMP" },
568 { MOUNTPROC_UMNT, "UMNT" },
569 { MOUNTPROC_UMNTALL, "UMNTALL" },
570 { MOUNTPROC_EXPORT, "EXPORT" },
571 { MOUNTPROC_EXPORTALL, "EXPORTALL" },
574 /* end of mount version 1 */
577 /* Mount protocol version 2, private communication from somebody at Sun;
578 mount V2 is V1 plus MOUNTPROC_PATHCONF to fetch information for the
579 POSIX "pathconf()" call. */
580 static const vsff mount2_proc[] = {
581 { 0, "NULL", NULL, NULL },
582 { MOUNTPROC_MNT, "MNT",
583 dissect_mount_dirpath_call, dissect_mount1_mnt_reply },
584 { MOUNTPROC_DUMP, "DUMP",
585 NULL, dissect_mount_dump_reply },
586 { MOUNTPROC_UMNT, "UMNT",
587 dissect_mount_dirpath_call, NULL },
588 { MOUNTPROC_UMNTALL, "UMNTALL",
590 { MOUNTPROC_EXPORT, "EXPORT",
591 NULL, dissect_mount_export_reply },
592 { MOUNTPROC_EXPORTALL, "EXPORTALL",
593 NULL, dissect_mount_export_reply },
594 { MOUNTPROC_PATHCONF, "PATHCONF",
595 dissect_mount_dirpath_call, dissect_mount_pathconf_reply },
596 { 0, NULL, NULL, NULL }
598 static const value_string mount2_proc_vals[] = {
600 { MOUNTPROC_MNT, "MNT" },
601 { MOUNTPROC_DUMP, "DUMP" },
602 { MOUNTPROC_UMNT, "UMNT" },
603 { MOUNTPROC_UMNTALL, "UMNTALL" },
604 { MOUNTPROC_EXPORT, "EXPORT" },
605 { MOUNTPROC_EXPORTALL, "EXPORTALL" },
606 { MOUNTPROC_PATHCONF, "PATHCONF" },
609 /* end of mount version 2 */
612 /* Mount protocol version 3, RFC 1813 */
613 static const vsff mount3_proc[] = {
614 { 0, "NULL", NULL, NULL },
615 { MOUNTPROC_MNT, "MNT",
616 dissect_mount_dirpath_call, dissect_mount3_mnt_reply },
617 { MOUNTPROC_DUMP, "DUMP",
618 NULL, dissect_mount_dump_reply },
619 { MOUNTPROC_UMNT, "UMNT",
620 dissect_mount_dirpath_call, NULL },
621 { MOUNTPROC_UMNTALL, "UMNTALL",
623 { MOUNTPROC_EXPORT, "EXPORT",
624 NULL, dissect_mount_export_reply },
625 { 0, NULL, NULL, NULL }
627 static const value_string mount3_proc_vals[] = {
629 { MOUNTPROC_MNT, "MNT" },
630 { MOUNTPROC_DUMP, "DUMP" },
631 { MOUNTPROC_UMNT, "UMNT" },
632 { MOUNTPROC_UMNTALL, "UMNTALL" },
633 { MOUNTPROC_EXPORT, "EXPORT" },
636 /* end of Mount protocol version 3 */
640 proto_register_mount(void)
642 static hf_register_info hf[] = {
643 { &hf_mount_procedure_v1, {
644 "V1 Procedure", "mount.procedure_v1", FT_UINT32, BASE_DEC,
645 VALS(mount1_proc_vals), 0, "V1 Procedure", HFILL }},
646 { &hf_mount_procedure_v2, {
647 "V2 Procedure", "mount.procedure_v2", FT_UINT32, BASE_DEC,
648 VALS(mount2_proc_vals), 0, "V2 Procedure", HFILL }},
649 { &hf_mount_procedure_v3, {
650 "V3 Procedure", "mount.procedure_v3", FT_UINT32, BASE_DEC,
651 VALS(mount3_proc_vals), 0, "V3 Procedure", HFILL }},
653 "Path", "mount.path", FT_STRING, BASE_DEC,
654 NULL, 0, "Path", HFILL }},
655 { &hf_mount3_status, {
656 "Status", "mount.status", FT_UINT32, BASE_DEC,
657 VALS(mount3_mountstat3), 0, "Status", HFILL }},
658 { &hf_mount_mountlist_hostname, {
659 "Hostname", "mount.dump.hostname", FT_STRING, BASE_DEC,
660 NULL, 0, "Hostname", HFILL }},
661 { &hf_mount_mountlist_directory, {
662 "Directory", "mount.dump.directory", FT_STRING, BASE_DEC,
663 NULL, 0, "Directory", HFILL }},
664 { &hf_mount_mountlist, {
665 "Mount List Entry", "mount.dump.entry", FT_NONE, 0,
666 NULL, 0, "Mount List Entry", HFILL }},
667 { &hf_mount_groups_group, {
668 "Group", "mount.export.group", FT_STRING, BASE_DEC,
669 NULL, 0, "Group", HFILL }},
670 { &hf_mount_groups, {
671 "Groups", "mount.export.groups", FT_NONE, 0,
672 NULL, 0, "Groups", HFILL }},
673 { &hf_mount_exportlist_directory, {
674 "Directory", "mount.export.directory", FT_STRING, BASE_DEC,
675 NULL, 0, "Directory", HFILL }},
676 { &hf_mount_exportlist, {
677 "Export List Entry", "mount.export.entry", FT_NONE, 0,
678 NULL, 0, "Export List Entry", HFILL }},
679 { &hf_mount_pathconf_link_max, {
680 "Maximum number of links to a file", "mount.pathconf.link_max",
682 NULL, 0, "Maximum number of links allowed to a file", HFILL }},
683 { &hf_mount_pathconf_max_canon, {
684 "Maximum terminal input line length", "mount.pathconf.max_canon",
686 NULL, 0, "Max tty input line length", HFILL }},
687 { &hf_mount_pathconf_max_input, {
688 "Terminal input buffer size", "mount.pathconf.max_input",
690 NULL, 0, "Terminal input buffer size", HFILL }},
691 { &hf_mount_pathconf_name_max, {
692 "Maximum file name length", "mount.pathconf.name_max",
694 NULL, 0, "Maximum file name length", HFILL }},
695 { &hf_mount_pathconf_path_max, {
696 "Maximum path name length", "mount.pathconf.path_max",
698 NULL, 0, "Maximum path name length", HFILL }},
699 { &hf_mount_pathconf_pipe_buf, {
700 "Pipe buffer size", "mount.pathconf.pipe_buf",
702 NULL, 0, "Maximum amount of data that can be written atomically to a pipe", HFILL }},
703 { &hf_mount_pathconf_vdisable, {
704 "VDISABLE character", "mount.pathconf.vdisable_char",
706 NULL, 0, "Character value to disable a terminal special character", HFILL }},
707 { &hf_mount_pathconf_mask, {
708 "Reply error/status bits", "mount.pathconf.mask",
710 NULL, 0, "Bit mask with error and status bits", HFILL }},
711 { &hf_mount_pathconf_error_all, {
712 "ERROR_ALL", "mount.pathconf.mask.error_all",
713 FT_BOOLEAN, 16, TFS(&tos_error_all),
714 PC_ERROR_ALL, "", HFILL }},
715 { &hf_mount_pathconf_error_link_max, {
716 "ERROR_LINK_MAX", "mount.pathconf.mask.error_link_max",
717 FT_BOOLEAN, 16, TFS(&tos_error_link_max),
718 PC_ERROR_LINK_MAX, "", HFILL }},
719 { &hf_mount_pathconf_error_max_canon, {
720 "ERROR_MAX_CANON", "mount.pathconf.mask.error_max_canon",
721 FT_BOOLEAN, 16, TFS(&tos_error_max_canon),
722 PC_ERROR_MAX_CANON, "", HFILL }},
723 { &hf_mount_pathconf_error_max_input, {
724 "ERROR_MAX_INPUT", "mount.pathconf.mask.error_max_input",
725 FT_BOOLEAN, 16, TFS(&tos_error_max_input),
726 PC_ERROR_MAX_INPUT, "", HFILL }},
727 { &hf_mount_pathconf_error_name_max, {
728 "ERROR_NAME_MAX", "mount.pathconf.mask.error_name_max",
729 FT_BOOLEAN, 16, TFS(&tos_error_name_max),
730 PC_ERROR_NAME_MAX, "", HFILL }},
731 { &hf_mount_pathconf_error_path_max, {
732 "ERROR_PATH_MAX", "mount.pathconf.mask.error_path_max",
733 FT_BOOLEAN, 16, TFS(&tos_error_path_max),
734 PC_ERROR_PATH_MAX, "", HFILL }},
735 { &hf_mount_pathconf_error_pipe_buf, {
736 "ERROR_PIPE_BUF", "mount.pathconf.mask.error_pipe_buf",
737 FT_BOOLEAN, 16, TFS(&tos_error_pipe_buf),
738 PC_ERROR_PIPE_BUF, "", HFILL }},
739 { &hf_mount_pathconf_chown_restricted, {
740 "CHOWN_RESTRICTED", "mount.pathconf.mask.chown_restricted",
741 FT_BOOLEAN, 16, TFS(&tos_chown_restricted),
742 PC_CHOWN_RESTRICTED, "", HFILL }},
743 { &hf_mount_pathconf_no_trunc, {
744 "NO_TRUNC", "mount.pathconf.mask.no_trunc",
745 FT_BOOLEAN, 16, TFS(&tos_no_trunc),
746 PC_NO_TRUNC, "", HFILL }},
747 { &hf_mount_pathconf_error_vdisable, {
748 "ERROR_VDISABLE", "mount.pathconf.mask.error_vdisable",
749 FT_BOOLEAN, 16, TFS(&tos_error_vdisable),
750 PC_ERROR_VDISABLE, "", HFILL }},
751 { &hf_mount_flavors, {
752 "Flavors", "mount.flavors", FT_UINT32, BASE_DEC,
753 NULL, 0, "Flavors", HFILL }},
754 { &hf_mount_flavor, {
755 "Flavor", "mount.flavor", FT_UINT32, BASE_DEC,
756 VALS(rpc_auth_flavor), 0, "Flavor", HFILL }},
758 static gint *ett[] = {
760 &ett_mount_mountlist,
762 &ett_mount_exportlist,
763 &ett_mount_pathconf_mask,
766 proto_mount = proto_register_protocol("Mount Service", "MOUNT", "mount");
767 proto_register_field_array(proto_mount, hf, array_length(hf));
768 proto_register_subtree_array(ett, array_length(ett));
772 proto_reg_handoff_mount(void)
774 /* Register the protocol as RPC */
775 rpc_init_prog(proto_mount, MOUNT_PROGRAM, ett_mount);
776 /* Register the procedure tables */
777 rpc_init_proc_table(MOUNT_PROGRAM, 1, mount1_proc, hf_mount_procedure_v1);
778 rpc_init_proc_table(MOUNT_PROGRAM, 2, mount2_proc, hf_mount_procedure_v2);
779 rpc_init_proc_table(MOUNT_PROGRAM, 3, mount3_proc, hf_mount_procedure_v3);