aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-nfs.c
diff options
context:
space:
mode:
authorTom Haynes <loghyr@primarydata.com>2015-09-08 13:34:29 -0700
committerPascal Quantin <pascal.quantin@gmail.com>2015-09-09 11:35:47 +0000
commitc7828244f5be7c88216c13840c704410e4f29f10 (patch)
tree57c25e6d33b2bee31821d2b197eb258e97b70a83 /epan/dissectors/packet-nfs.c
parent2160e9cd9774622805916d1b12720d598d9cbac2 (diff)
nfs: Add NFSv4.2 op CLONE
Change-Id: I38eab48dcc27c813fc134881b359d8033bc00771 Signed-off-by: Tom Haynes <loghyr@primarydata.com> Reviewed-on: https://code.wireshark.org/review/10430 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-nfs.c')
-rw-r--r--epan/dissectors/packet-nfs.c36
1 files changed, 34 insertions, 2 deletions
diff --git a/epan/dissectors/packet-nfs.c b/epan/dissectors/packet-nfs.c
index 8880b6b36d..9ad94cffcf 100644
--- a/epan/dissectors/packet-nfs.c
+++ b/epan/dissectors/packet-nfs.c
@@ -802,6 +802,7 @@ static gint ett_nfs4_callback_stateids_sub = -1;
static gint ett_nfs4_source_servers_sub = -1;
static gint ett_nfs4_copy = -1;
static gint ett_nfs4_copy_notify = -1;
+static gint ett_nfs4_clone = -1;
static expert_field ei_nfs_too_many_ops = EI_INIT;
static expert_field ei_nfs_not_vnx_file = EI_INIT;
@@ -7469,7 +7470,8 @@ static const value_string names_nfs4_operation[] = {
{ NFS4_OP_COPY, "COPY" },
{ NFS4_OP_COPY_NOTIFY, "COPY_NOTIFY" },
{ NFS4_OP_DEALLOCATE, "DEALLOCATE" },
- { NFS4_OP_SEEK, "SEEK" },
+ { NFS4_OP_SEEK, "SEEK" },
+ { NFS4_OP_CLONE, "CLONE" },
{ NFS4_OP_ILLEGAL, "ILLEGAL" },
{ 0, NULL }
};
@@ -7547,6 +7549,8 @@ static gint *nfs4_operation_ett[] =
NULL,
NULL,
&ett_nfs4_seek,
+ NULL,
+ &ett_nfs4_clone,
};
@@ -8765,6 +8769,7 @@ static int nfs4_operation_tiers[] = {
1 /* 61, NFS4_OP_COPY_NOTIFY */,
1 /* 62, NFS4_OP_DEALLOCATE */,
1 /* 69, NFS4_OP_SEEK */,
+ 1 /* 71, NFS4_OP_CLONE */,
};
#define NFS4_OPERATION_TIER(op) \
@@ -9380,6 +9385,29 @@ dissect_nfs4_request_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre
sid_hash, file_offset);
break;
+ case NFS4_OP_CLONE:
+ offset = dissect_nfs4_stateid(tvb, offset, newftree, &sid_hash);
+ offset = dissect_nfs4_stateid(tvb, offset, newftree, &dst_sid_hash);
+ file_offset = tvb_get_ntoh64(tvb, offset);
+ offset = dissect_rpc_uint64(tvb, newftree, hf_nfs4_offset, offset);
+ dst_file_offset = tvb_get_ntoh64(tvb, offset);
+ offset = dissect_rpc_uint64(tvb, newftree, hf_nfs4_offset, offset);
+ length64 = tvb_get_ntoh64(tvb, offset);
+ offset = dissect_rpc_uint64(tvb, newftree, hf_nfs4_length, offset);
+ if (sid_hash != 0)
+ wmem_strbuf_append_printf (op_summary[ops_counter].optext,
+ " Src StateID: 0x%04x"
+ " Offset: %" G_GINT64_MODIFIER "u"
+ " Len: %" G_GINT64_MODIFIER "u",
+ sid_hash, file_offset, length64);
+
+ if (dst_sid_hash != 0)
+ wmem_strbuf_append_printf (op_summary[ops_counter].optext,
+ " Dst StateID: 0x%04x"
+ " Offset: %" G_GINT64_MODIFIER "u",
+ dst_sid_hash, dst_file_offset);
+ break;
+
/* In theory, it's possible to get this opcode */
case NFS4_OP_ILLEGAL:
break;
@@ -9818,6 +9846,9 @@ dissect_nfs4_response_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tr
offset = dissect_rpc_uint64(tvb, newftree, hf_nfs4_offset, offset);
break;
+ case NFS4_OP_CLONE:
+ break;
+
default:
break;
}
@@ -12875,7 +12906,8 @@ proto_register_nfs(void)
&ett_nfs4_callback_stateids_sub,
&ett_nfs4_source_servers_sub,
&ett_nfs4_copy,
- &ett_nfs4_copy_notify
+ &ett_nfs4_copy_notify,
+ &ett_nfs4_clone
};
static ei_register_info ei[] = {