Ethereal-dev: [ethereal-dev] NFS goes on and on
Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.
From: Uwe Girlich <Uwe.Girlich@xxxxxxxxxxx>
Date: Mon, 29 Nov 1999 14:21:03 +0100
The next tiny step for NFS, just checked in: packet-nfs.c NFS v3 ACCESS call,reply
Index: packet-nfs.c =================================================================== RCS file: /usr/local/cvsroot/ethereal/packet-nfs.c,v retrieving revision 1.9 diff -u -r1.9 packet-nfs.c --- packet-nfs.c 1999/11/29 11:52:40 1.9 +++ packet-nfs.c 1999/11/29 13:06:50 @@ -68,6 +68,7 @@ static gint ett_nfs_post_op_attr = -1; static gint ett_nfs_wcc_attr = -1; static gint ett_nfs_wcc_data = -1; +static gint ett_nfs_access = -1; /***************************/ @@ -1490,6 +1491,44 @@ } +/* RFC 1813, Page 40 */ +int +dissect_access(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name) +{ + guint32 access; + proto_item* access_item = NULL; + proto_tree* access_tree = NULL; + + if (!BYTES_ARE_IN_FRAME(offset,4)) return offset; + access = EXTRACT_UINT(pd, offset+0); + + if (tree) { + access_item = proto_tree_add_text(tree, offset, 4, + "%s: 0x%02x", name, access); + if (access_item) + access_tree = proto_item_add_subtree(access_item, ett_nfs_access); + } + + if (access_tree) { + proto_tree_add_text(access_tree, offset, 4, "%s READ", + decode_boolean_bitfield(access, 0x001, 6, "allow", "not allow")); + proto_tree_add_text(access_tree, offset, 4, "%s LOOKUP", + decode_boolean_bitfield(access, 0x002, 6, "allow", "not allow")); + proto_tree_add_text(access_tree, offset, 4, "%s MODIFY", + decode_boolean_bitfield(access, 0x004, 6, "allowed", "not allow")); + proto_tree_add_text(access_tree, offset, 4, "%s EXTEND", + decode_boolean_bitfield(access, 0x008, 6, "allow", "not allow")); + proto_tree_add_text(access_tree, offset, 4, "%s DELETE", + decode_boolean_bitfield(access, 0x010, 6, "allow", "not allow")); + proto_tree_add_text(access_tree, offset, 4, "%s EXECUTE", + decode_boolean_bitfield(access, 0x020, 6, "allow", "not allow")); + } + + offset += 4; + return offset; +} + + /* generic NFS3 call dissector */ int dissect_nfs3_any_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree) @@ -1512,7 +1551,7 @@ } -/* RFC 1813, Page 32 */ +/* RFC 1813, Page 32,33 */ int dissect_nfs3_getattr_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree) { @@ -1521,7 +1560,7 @@ } -/* RFC 1813, Page 32 */ +/* RFC 1813, Page 32,33 */ int dissect_nfs3_getattr_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree) { @@ -1587,7 +1626,7 @@ } -/* RFC 1813, Page 33 */ +/* RFC 1813, Page 33..36 */ int dissect_nfs3_setattr_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree) { @@ -1598,7 +1637,7 @@ } -/* RFC 1813, Page 33 */ +/* RFC 1813, Page 33..36 */ int dissect_nfs3_setattr_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree) { @@ -1618,7 +1657,7 @@ } -/* RFC 1813, Page 37 */ +/* RFC 1813, Page 37..39 */ int dissect_nfs3_lookup_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree) { @@ -1627,7 +1666,7 @@ } -/* RFC 1813, Page 37 */ +/* RFC 1813, Page 37..39 */ int dissect_nfs3_lookup_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree) { @@ -1648,6 +1687,39 @@ return offset; } + +/* RFC 1813, Page 40..43 */ +int +dissect_nfs3_access_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree) +{ + offset = dissect_nfs_fh3(pd, offset, fd, tree, "object"); + offset = dissect_access (pd, offset, fd, tree, "access"); + + return offset; +} + + +/* RFC 1813, Page 40..43 */ +int +dissect_nfs3_access_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree) +{ + guint32 status; + + offset = dissect_nfsstat3(pd, offset, fd, tree, "status", &status); + switch (status) { + case 0: + offset = dissect_post_op_attr(pd, offset, fd, tree, "obj_attributes"); + offset = dissect_access (pd, offset, fd, tree, "access"); + break; + default: + offset = dissect_post_op_attr(pd, offset, fd, tree, "obj_attributes"); + break; + } + + return offset; +} + + /* proc number, "proc name", dissect_request, dissect_reply */ /* NULL as function pointer means: take the generic one. */ const vsff nfs3_proc[] = { @@ -1655,7 +1727,7 @@ { 1, "GETATTR", dissect_nfs3_getattr_call, dissect_nfs3_getattr_reply }, { 2, "SETATTR", dissect_nfs3_setattr_call, dissect_nfs3_setattr_reply }, { 3, "LOOKUP", dissect_nfs3_lookup_call, dissect_nfs3_lookup_reply }, - { 4, "ACCESS", dissect_nfs3_any_call, dissect_nfs3_any_reply }, + { 4, "ACCESS", dissect_nfs3_access_call, dissect_nfs3_access_reply }, { 5, "READLINK", dissect_nfs3_any_call, dissect_nfs3_any_reply }, { 6, "READ", dissect_nfs3_any_call, dissect_nfs3_any_reply }, { 7, "WRITE", dissect_nfs3_any_call, dissect_nfs3_any_reply }, @@ -1712,6 +1784,7 @@ &ett_nfs_post_op_attr, &ett_nfs_wcc_attr, &ett_nfs_wcc_data, + &ett_nfs_access }; proto_nfs = proto_register_protocol("Network File System", "nfs"); proto_register_field_array(proto_nfs, hf, array_length(hf));
- Prev by Date: [ethereal-dev] further NFS and mount dissectors
- Next by Date: Re: [ethereal-dev] C't article
- Previous by thread: Re: [ethereal-dev] further NFS and mount dissectors
- Next by thread: [ethereal-dev] extra info in TCP tree item in proto tree looks ugly
- Index(es):