summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2016-02-06 00:19:50 +0100
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2016-02-06 07:23:11 +0000
commit8678e5a9b33013b5d9c72bd269999af91fa9c3d7 (patch)
tree8955e74d7c65bc08472355fe6a296f18fec6c6b6
parente81cbe6e199acd83b18e96b1344478891e5c49a0 (diff)
downloadwireshark-8678e5a9b33013b5d9c72bd269999af91fa9c3d7.tar.gz
GlusterFS: Add support for the SEEK procedure
Gluster added support for a SEEK operation, supporting SEEK_DATA and SEEK_HOLE. The actual protocol modifications can be found in commit 9b71092f3 (http://review.gluster.org/11482). Bug:12088 Change-Id: I298b4a5023fa748e9c443ae5a24a1b58d76a5453 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: https://code.wireshark.org/review/13780 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
-rw-r--r--epan/dissectors/packet-gluster.h7
-rw-r--r--epan/dissectors/packet-glusterfs.c45
2 files changed, 52 insertions, 0 deletions
diff --git a/epan/dissectors/packet-gluster.h b/epan/dissectors/packet-gluster.h
index 5f1cb5a701..9809032d05 100644
--- a/epan/dissectors/packet-gluster.h
+++ b/epan/dissectors/packet-gluster.h
@@ -367,6 +367,8 @@ enum gf_fop_procnum {
GFS3_OP_FALLOCATE,
GFS3_OP_DISCARD,
GFS3_OP_ZEROFILL,
+ GFS3_OP_IPC,
+ GFS3_OP_SEEK,
GFS3_OP_MAXVALUE
};
@@ -411,6 +413,11 @@ enum gluster_lk_whence {
GF_LK_SEEK_END
};
+enum gluster_seek_whence {
+ GF_SEEK_DATA = 0,
+ GF_SEEK_HOLE
+};
+
/* based on enum glusterd_op_ from xlators/mgmt/glusterd/src/glusterd.h */
enum glusterd_ops {
GD_OP_NONE = 0,
diff --git a/epan/dissectors/packet-glusterfs.c b/epan/dissectors/packet-glusterfs.c
index 6e02c6831d..603293666b 100644
--- a/epan/dissectors/packet-glusterfs.c
+++ b/epan/dissectors/packet-glusterfs.c
@@ -74,6 +74,7 @@ static gint hf_glusterfs_umask = -1;
static gint hf_glusterfs_mask = -1;
static gint hf_glusterfs_name = -1;
static gint hf_glusterfs_namelen = -1;
+static gint hf_glusterfs_whence = -1;
/* flags passed on to OPEN, CREATE etc.*/
static gint hf_glusterfs_flags = -1;
@@ -1863,6 +1864,34 @@ glusterfs_gfs3_3_op_zerofill_call(tvbuff_t *tvb,
return offset;
}
+static int
+glusterfs_gfs3_3_op_seek_reply(tvbuff_t *tvb, packet_info *pinfo _U_,
+ proto_tree *tree, void* data _U_)
+{
+ int offset = 0;
+
+ offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
+ offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
+ offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
+
+ return offset;
+}
+
+static int
+glusterfs_gfs3_3_op_seek_call(tvbuff_t *tvb, packet_info *pinfo _U_,
+ proto_tree *tree, void* data _U_)
+{
+ int offset = 0;
+
+ offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
+ offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
+ offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
+ offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_whence, offset);
+ offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
+
+ return offset;
+}
+
/* This function is for common replay. RELEASE , RELEASEDIR and some other function use this method */
int
@@ -2160,6 +2189,10 @@ static const vsff glusterfs3_3_fop_proc[] = {
GFS3_OP_ZEROFILL, "ZEROFILL",
glusterfs_gfs3_3_op_zerofill_call, glusterfs_gfs3_3_op_setattr_reply
},
+ {
+ GFS3_OP_SEEK, "SEEK",
+ glusterfs_gfs3_3_op_seek_call, glusterfs_gfs3_3_op_seek_reply
+ },
{ 0, NULL, NULL, NULL }
};
@@ -2218,6 +2251,8 @@ static const value_string glusterfs3_1_fop_proc_vals[] = {
{ GFS3_OP_FALLOCATE, "FALLOCATE" },
{ GFS3_OP_DISCARD, "DISCARD" },
{ GFS3_OP_ZEROFILL, "ZEROFILL" },
+ { GFS3_OP_IPC, "IPC" },
+ { GFS3_OP_SEEK, "SEEK" },
{ 0, NULL }
};
static value_string_ext glusterfs3_1_fop_proc_vals_ext = VALUE_STRING_EXT_INIT(glusterfs3_1_fop_proc_vals);
@@ -2266,6 +2301,12 @@ static const value_string glusterfs_lk_whence[] = {
{ 0, NULL }
};
+static const value_string glusterfs_seek_whence[] = {
+ { GF_SEEK_DATA, "SEEK_DATA" },
+ { GF_SEEK_HOLE, "SEEK_HOLE" },
+ { 0, NULL }
+};
+
void
proto_register_glusterfs(void)
{
@@ -2365,6 +2406,10 @@ proto_register_glusterfs(void)
{ "Entries returned", "glusterfs.entries", FT_INT32, BASE_DEC,
NULL, 0, NULL, HFILL }
},
+ { &hf_glusterfs_whence,
+ { "Whence", "glusterfs.whence", FT_UINT32, BASE_DEC,
+ VALS(glusterfs_seek_whence), 0, NULL, HFILL }
+ },
/* Flags passed on to OPEN, CREATE etc, based on */
{ &hf_glusterfs_flags,
{ "Flags", "glusterfs.flags", FT_UINT32, BASE_OCT,