diff options
author | Prashanth Pai <ppai@redhat.com> | 2018-01-16 14:42:42 +0530 |
---|---|---|
committer | Dario Lombardo <lomato@gmail.com> | 2018-01-18 14:52:55 +0000 |
commit | dcacea5c1542611bbd8ca3a403f9099508aef67f (patch) | |
tree | 73198449533f918cf66084fa86f55166edccb17c /epan/dissectors/packet-glusterfs_hndsk.c | |
parent | a6e64bfc78f2e8502dc616c5d23dd28186656291 (diff) |
glusterfs: Add support for getvolumeinfo procedure
Bug: 14347
Change-Id: Ib8fcaa5f0af06d1f1141dbb51696d88fde7d71ba
Signed-off-by: Prashanth Pai <ppai@redhat.com>
Reviewed-on: https://code.wireshark.org/review/25335
Tested-by: Dario Lombardo <lomato@gmail.com>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-glusterfs_hndsk.c')
-rw-r--r-- | epan/dissectors/packet-glusterfs_hndsk.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/epan/dissectors/packet-glusterfs_hndsk.c b/epan/dissectors/packet-glusterfs_hndsk.c index f6422a4dd6..2dfa7eddd6 100644 --- a/epan/dissectors/packet-glusterfs_hndsk.c +++ b/epan/dissectors/packet-glusterfs_hndsk.c @@ -55,6 +55,7 @@ static gint hf_gluster_hndsk_spec = -1; /* GETSPEC Reply */ static gint hf_gluster_hndsk_key = -1; /* GETSPEC Call */ static gint hf_gluster_hndsk_event_op = -1; /* EVENT NOTIFY call */ static gint hf_gluster_hndsk_uid = -1; /* LOCK VERSION*/ +static gint hf_gluster_hndsk_op_errstr = -1; /* GETVOLUMEINFO */ static gint hf_gluster_hndsk_lk_ver= -1; static gint hf_gluster_hndsk_flags = -1; @@ -202,6 +203,26 @@ gluster_hndsk_2_event_notify_reply(tvbuff_t *tvb, } static int +gluster_hndsk_2_get_volume_info_call(tvbuff_t *tvb, packet_info *pinfo _U_, + proto_tree *tree, void* data _U_) +{ + return gluster_rpc_dissect_dict(tree, tvb, hf_gluster_hndsk_dict, 0); +} + +static int +gluster_hndsk_2_get_volume_info_reply(tvbuff_t *tvb, packet_info *pinfo, + proto_tree *tree, void* data) +{ + int offset = 0; + offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data); + offset = dissect_rpc_string(tvb, tree, hf_gluster_hndsk_op_errstr, offset, + NULL); + offset = gluster_rpc_dissect_dict(tree, tvb, hf_gluster_hndsk_dict, + offset); + return offset; +} + +static int glusterfs_rpc_dissect_upcall_flags(proto_tree *tree, tvbuff_t *tvb, int offset) { static const int *flag_bits[] = { @@ -300,6 +321,11 @@ static const vsff gluster_hndsk_2_proc[] = { gluster_hndsk_2_event_notify_call, gluster_hndsk_2_event_notify_reply }, + { + GF_HNDSK_GET_VOLUME_INFO, "GETVOLUMEINFO", + gluster_hndsk_2_get_volume_info_call, + gluster_hndsk_2_get_volume_info_reply + }, { 0, NULL, NULL, NULL } }; @@ -317,6 +343,7 @@ static const value_string gluster_hndsk_proc_vals[] = { { GF_HNDSK_PING, "PING" }, { GF_HNDSK_SET_LK_VER, "LOCK VERSION" }, { GF_HNDSK_EVENT_NOTIFY, "EVENTNOTIFY" }, + { GF_HNDSK_GET_VOLUME_INFO, "GETVOLUMEINFO" }, { 0, NULL } }; @@ -360,6 +387,11 @@ proto_register_gluster_hndsk(void) { &hf_gluster_hndsk_flags, { "Flags", "glusterfs.hndsk.flags", FT_UINT32, BASE_OCT, NULL, 0, NULL, HFILL } + }, + /* For handshake getvolumeinfo */ + { &hf_gluster_hndsk_op_errstr, + { "Op Errstr", "glusterfs.hndsk.getvolumeinfo.op_errstr", FT_STRING, + BASE_NONE, NULL, 0, NULL, HFILL } } }; |