From f8f41fe3c633ae4cd0b7e9cfd6ff6a4b3367f94d Mon Sep 17 00:00:00 2001 From: Gilbert Ramirez Date: Fri, 19 Nov 1999 13:09:56 +0000 Subject: Added Uwe's update to RPC. svn path=/trunk/; revision=1069 --- packet-mount.c | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 86 insertions(+), 2 deletions(-) (limited to 'packet-mount.c') diff --git a/packet-mount.c b/packet-mount.c index 25e2376249..d1051c8444 100644 --- a/packet-mount.c +++ b/packet-mount.c @@ -1,7 +1,7 @@ /* packet-mount.c * Routines for mount dissection * - * $Id: packet-mount.c,v 1.4 1999/11/16 11:42:38 guy Exp $ + * $Id: packet-mount.c,v 1.5 1999/11/19 13:09:55 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -36,10 +36,14 @@ #include "packet-rpc.h" #include "packet-mount.h" +#include "packet-nfs.h" static int proto_mount = -1; static int hf_mount_path = -1; +static int hf_mount_status = -1; +static int hf_mount_flavors = -1; +static int hf_mount_flavor = -1; static gint ett_mount = -1; @@ -75,11 +79,82 @@ const vsff mount1_proc[] = { /* end of mount version 1 */ +/* RFC 1813, Page 107 */ +const value_string mount3_mountstat3[] = +{ + { 0, "OK" }, + { 1, "ERR_PERM" }, + { 2, "ERR_NOENT" }, + { 5, "ERR_IO" }, + { 13, "ERR_ACCESS" }, + { 20, "ERR_NOTDIR" }, + { 22, "ERR_INVAL" }, + { 63, "ERR_NAMETOOLONG" }, + { 10004, "ERR_NOTSUPP" }, + { 10006, "ERR_SERVERFAULT" }, + { 0, NULL } +}; + + +/* RFC 1813, Page 107 */ +int +dissect_mountstat3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, + int hfindex, guint32* status) +{ + guint32 mountstat3; + + if (!BYTES_ARE_IN_FRAME(offset,4)) return offset; + mountstat3 = EXTRACT_UINT(pd, offset+0); + + if (tree) { + proto_tree_add_item(tree, hfindex, offset, 4, mountstat3); + } + + offset += 4; + *status = mountstat3; + return offset; +} + + +/* RFC 1831, Page 109 */ +int dissect_mount3_mnt_reply(const u_char *pd, int offset, frame_data *fd, + proto_tree *tree) +{ + guint32 status; + guint32 auth_flavors; + guint32 auth_flavor; + guint32 auth_flavor_i; + + offset = dissect_mountstat3(pd, offset, fd, tree, hf_mount_status, &status); + switch (status) { + case 0: + offset = dissect_nfs_fh3(pd,offset,fd,tree,"fhandle"); + if (!BYTES_ARE_IN_FRAME(offset,4)) return offset; + auth_flavors = EXTRACT_UINT(pd,offset+0); + proto_tree_add_item(tree,hf_mount_flavors, + offset, 4, auth_flavors); + offset += 4; + for (auth_flavor_i = 0 ; auth_flavor_i < hf_mount_flavors ; auth_flavor_i++) { + if (!BYTES_ARE_IN_FRAME(offset,4)) return offset; + auth_flavor = EXTRACT_UINT(pd,offset+0); + proto_tree_add_item(tree,hf_mount_flavor, + offset, 4, auth_flavor); + offset += 4; + } + break; + default: + /* void */ + break; + } + + return offset; +} + /* Mount protocol version 3, RFC 1813 */ const vsff mount3_proc[] = { { 0, "NULL", NULL, NULL }, { MOUNTPROC_MNT, "MNT", - dissect_mount_dirpath_call, NULL }, + dissect_mount_dirpath_call, dissect_mount3_mnt_reply }, { MOUNTPROC_DUMP, "DUMP", NULL, NULL }, { MOUNTPROC_UMNT, "UMNT", @@ -100,6 +175,15 @@ proto_register_mount(void) { &hf_mount_path, { "Path", "mount.path", FT_STRING, BASE_DEC, NULL, 0, "Path" }}, + { &hf_mount_status, { + "Status", "mount.status", FT_UINT32, BASE_DEC, + mount3_mountstat3, 0, "Status" }}, + { &hf_mount_flavors, { + "Flavors", "mount.flavors", FT_UINT32, BASE_DEC, + NULL, 0, "Flavors" }}, + { &hf_mount_flavor, { + "Flavor", "mount.flavor", FT_UINT32, BASE_DEC, + rpc_auth_flavor, 0, "Flavor" }}, }; static gint *ett[] = { &ett_mount, -- cgit v1.2.3