diff options
author | Tom Haynes <loghyr@primarydata.com> | 2018-01-03 22:19:30 -0800 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2018-01-04 23:50:26 +0000 |
commit | 0b997f3a3aa63224f4a4578c34cee4f074d66876 (patch) | |
tree | 3e654bd7431905de8cd6e84507bfea1ed69f2553 | |
parent | 8bf24f51cbb285c31a6b7101f63257d2010f7082 (diff) |
nfs: Add the second version of the Primary Data NFSv4 file handle dissector
Change-Id: I05da9a546f5de81783e4c9d004aff7dbb3ead44b
Signed-off-by: Tom Haynes <loghyr@primarydata.com>
Reviewed-on: https://code.wireshark.org/review/25146
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r-- | epan/dissectors/packet-nfs.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/epan/dissectors/packet-nfs.c b/epan/dissectors/packet-nfs.c index f0bd580c3e..339e81b9ff 100644 --- a/epan/dissectors/packet-nfs.c +++ b/epan/dissectors/packet-nfs.c @@ -164,6 +164,7 @@ static int hf_nfs4_fh_pd_share = -1; static int hf_nfs4_fh_pd_flags = -1; static int hf_nfs4_fh_pd_flags_reserved = -1; static int hf_nfs4_fh_pd_flags_version = -1; +static int hf_nfs4_fh_pd_container = -1; static int hf_nfs4_fh_pd_inum = -1; static int hf_nfs_full_name = -1; static int hf_nfs_name = -1; @@ -2067,13 +2068,14 @@ dissect_fhandle_data_DCACHE(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree *t return tvb_captured_length(tvb); } -#define PD_VERSION_MASK 0xFF000000 -#define PD_RESERVED_MASK 0x00FFFFFF +#define PD_VERSION_MASK 0xF0000000 +#define PD_RESERVED_MASK 0x0FFFFFFF static int dissect_fhandle_data_PRIMARY_DATA(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_) { int offset = 0; + guint32 version; static const int *fh_flags[] = { &hf_nfs4_fh_pd_flags_version, @@ -2084,9 +2086,21 @@ dissect_fhandle_data_PRIMARY_DATA(tvbuff_t* tvb, packet_info *pinfo _U_, proto_t if (!tree) return tvb_captured_length(tvb); + + version = (tvb_get_letohl(tvb, offset + 4) & PD_VERSION_MASK) >> 28; + if (version > 1) { + return 0; + } + proto_tree_add_item(tree, hf_nfs4_fh_pd_share, tvb, offset, 4, ENC_LITTLE_ENDIAN); - proto_tree_add_bitmask(tree, tvb, offset + 4, hf_nfs4_fh_pd_flags, ett_nfs4_fh_pd_flags, fh_flags, ENC_NA); - proto_tree_add_item(tree, hf_nfs4_fh_pd_inum, tvb, offset + 8, 8, ENC_LITTLE_ENDIAN); + proto_tree_add_bitmask(tree, tvb, offset + 4, hf_nfs4_fh_pd_flags, ett_nfs4_fh_pd_flags, fh_flags, ENC_LITTLE_ENDIAN); + + if (version == 0) { + proto_tree_add_item(tree, hf_nfs4_fh_pd_inum, tvb, offset + 8, 8, ENC_LITTLE_ENDIAN); + } else if (version == 1) { + proto_tree_add_item(tree, hf_nfs4_fh_pd_container, tvb, offset + 8, 8, ENC_LITTLE_ENDIAN); + proto_tree_add_item(tree, hf_nfs4_fh_pd_inum, tvb, offset + 16, 8, ENC_LITTLE_ENDIAN); + } return tvb_captured_length(tvb); } @@ -11765,6 +11779,9 @@ proto_register_nfs(void) { &hf_nfs4_fh_pd_flags_version, { "version", "nfs.fh.pd.flags.version", FT_UINT32, BASE_DEC, NULL, PD_VERSION_MASK, NULL, HFILL }}, + { &hf_nfs4_fh_pd_container, { + "container", "nfs.fh.pd.container", FT_UINT64, BASE_DEC, + NULL, 0, NULL, HFILL }}, { &hf_nfs4_fh_pd_inum, { "inum", "nfs.fh.pd.inum", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }}, |