aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-glusterfs_hndsk.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2015-07-01 07:33:02 -0400
committerAnders Broman <a.broman58@gmail.com>2015-07-02 08:54:10 +0000
commitb68a0ed42e26aaa7f30b47657311c187c8e02114 (patch)
tree0731ab045fd6d7a43c2a9a8d280d0c4a9e2ac3e7 /epan/dissectors/packet-glusterfs_hndsk.c
parent9d8b81012700bda095418dd7f1f7d15b94809cab (diff)
Replace RPC "dissect_function_t" function signature with "new style" dissector function signature.
This paves the way for using dissector tables. Change-Id: I88ac165ef9aa5bf5c05e1115f7321e18e734d683 Reviewed-on: https://code.wireshark.org/review/9453 Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-glusterfs_hndsk.c')
-rw-r--r--epan/dissectors/packet-glusterfs_hndsk.c51
1 files changed, 32 insertions, 19 deletions
diff --git a/epan/dissectors/packet-glusterfs_hndsk.c b/epan/dissectors/packet-glusterfs_hndsk.c
index cf9635812c..bc6f407afa 100644
--- a/epan/dissectors/packet-glusterfs_hndsk.c
+++ b/epan/dissectors/packet-glusterfs_hndsk.c
@@ -64,9 +64,10 @@ static gint ett_gluster_hndsk = -1;
/* procedures for GLUSTER_HNDSK_PROGRAM */
static int
-gluster_hndsk_setvolume_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
+gluster_hndsk_setvolume_reply(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree, void* data _U_)
{
+ int offset = 0;
offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
offset = gluster_rpc_dissect_dict(tree, tvb, hf_gluster_hndsk_dict,
offset);
@@ -74,18 +75,17 @@ gluster_hndsk_setvolume_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
}
static int
-gluster_hndsk_setvolume_call(tvbuff_t *tvb, int offset,
+gluster_hndsk_setvolume_call(tvbuff_t *tvb,
packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
{
- offset = gluster_rpc_dissect_dict(tree, tvb, hf_gluster_hndsk_dict,
- offset);
- return offset;
+ return gluster_rpc_dissect_dict(tree, tvb, hf_gluster_hndsk_dict, 0);
}
static int
-gluster_hndsk_2_setvolume_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
+gluster_hndsk_2_setvolume_reply(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree, void* data _U_)
{
+ int offset = 0;
offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
offset = gluster_rpc_dissect_dict(tree, tvb, hf_gluster_hndsk_dict,
offset);
@@ -93,18 +93,17 @@ gluster_hndsk_2_setvolume_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
}
static int
-gluster_hndsk_2_setvolume_call(tvbuff_t *tvb, int offset,
+gluster_hndsk_2_setvolume_call(tvbuff_t *tvb,
packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
{
- offset = gluster_rpc_dissect_dict(tree, tvb, hf_gluster_hndsk_dict,
- offset);
- return offset;
+ return gluster_rpc_dissect_dict(tree, tvb, hf_gluster_hndsk_dict, 0);
}
static int
-gluster_hndsk_2_getspec_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
+gluster_hndsk_2_getspec_reply(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree, void* data _U_)
{
+ int offset = 0;
offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
offset = dissect_rpc_string(tvb, tree, hf_gluster_hndsk_spec, offset,
NULL);
@@ -114,11 +113,12 @@ gluster_hndsk_2_getspec_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
}
static int
-gluster_hndsk_2_getspec_call(tvbuff_t *tvb, int offset,
+gluster_hndsk_2_getspec_call(tvbuff_t *tvb,
packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
{
- if (tree)
- proto_tree_add_item(tree, hf_gluster_hndsk_flags, tvb, offset,
+ int offset = 0;
+
+ proto_tree_add_item(tree, hf_gluster_hndsk_flags, tvb, offset,
4, ENC_BIG_ENDIAN);
offset += 4;
offset = dissect_rpc_string(tvb, tree, hf_gluster_hndsk_key, offset,
@@ -129,18 +129,21 @@ gluster_hndsk_2_getspec_call(tvbuff_t *tvb, int offset,
}
static int
-gluster_hndsk_2_set_lk_ver_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
+gluster_hndsk_2_set_lk_ver_reply(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree, void* data _U_)
{
+ int offset = 0;
offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
offset = dissect_rpc_uint32(tvb, tree,hf_gluster_hndsk_lk_ver, offset);
return offset;
}
static int
-gluster_hndsk_2_set_lk_ver_call(tvbuff_t *tvb, int offset,
+gluster_hndsk_2_set_lk_ver_call(tvbuff_t *tvb,
packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
{
+ int offset = 0;
+
offset = dissect_rpc_string(tvb, tree, hf_gluster_hndsk_uid, offset,
NULL);
offset = dissect_rpc_uint32(tvb, tree,hf_gluster_hndsk_lk_ver, offset);
@@ -148,9 +151,11 @@ gluster_hndsk_2_set_lk_ver_call(tvbuff_t *tvb, int offset,
}
static int
-gluster_hndsk_2_event_notify_call(tvbuff_t *tvb, int offset,
+gluster_hndsk_2_event_notify_call(tvbuff_t *tvb,
packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
{
+ int offset = 0;
+
offset = dissect_rpc_uint32(tvb, tree, hf_gluster_hndsk_event_op,
offset);
offset = gluster_rpc_dissect_dict(tree, tvb, hf_gluster_hndsk_dict,
@@ -161,15 +166,23 @@ gluster_hndsk_2_event_notify_call(tvbuff_t *tvb, int offset,
/* In rpc/xdr/src/glusterfs3-xdr.c. xdr_gf_event_notify_rsp */
static int
-gluster_hndsk_2_event_notify_reply(tvbuff_t *tvb, int offset,
+gluster_hndsk_2_event_notify_reply(tvbuff_t *tvb,
packet_info *pinfo, proto_tree *tree, void* data _U_)
{
+ int offset = 0;
offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
offset = gluster_rpc_dissect_dict(tree, tvb, hf_gluster_hndsk_dict,
offset);
return offset;
}
+static int
+gluster_hndsk_dissect_common_reply(tvbuff_t *tvb,
+ packet_info *pinfo, proto_tree *tree, void* data _U_)
+{
+ return gluster_dissect_common_reply(tvb, 0, pinfo, tree, data);
+}
+
static const vsff gluster_hndsk_proc[] = {
{ GF_HNDSK_NULL, "NULL", NULL, NULL },
{
@@ -177,7 +190,7 @@ static const vsff gluster_hndsk_proc[] = {
gluster_hndsk_setvolume_call, gluster_hndsk_setvolume_reply
},
{ GF_HNDSK_GETSPEC, "GETSPEC", NULL, NULL },
- { GF_HNDSK_PING, "PING", NULL, gluster_dissect_common_reply },
+ { GF_HNDSK_PING, "PING", NULL, gluster_hndsk_dissect_common_reply },
{ 0, NULL, NULL, NULL }
};