diff options
author | Michael Mann <mmann78@netscape.net> | 2015-07-01 07:33:02 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2015-07-02 08:54:10 +0000 |
commit | b68a0ed42e26aaa7f30b47657311c187c8e02114 (patch) | |
tree | 0731ab045fd6d7a43c2a9a8d280d0c4a9e2ac3e7 /epan/dissectors/packet-stat.c | |
parent | 9d8b81012700bda095418dd7f1f7d15b94809cab (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-stat.c')
-rw-r--r-- | epan/dissectors/packet-stat.c | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/epan/dissectors/packet-stat.c b/epan/dissectors/packet-stat.c index ff61c80f6a..e4a574cbf0 100644 --- a/epan/dissectors/packet-stat.c +++ b/epan/dissectors/packet-stat.c @@ -165,22 +165,18 @@ mon_id_len(tvbuff_t *tvb, int offset) } static int -dissect_stat_stat(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) +dissect_stat_stat(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { - if (tree) - { - offset = dissect_rpc_string(tvb,tree,hfi_stat_mon_name.id,offset,NULL); - } - - return offset; + return dissect_rpc_string(tvb,tree,hfi_stat_mon_name.id,0,NULL); } static int -dissect_stat_stat_res(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) +dissect_stat_stat_res(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { proto_item *sub_item; proto_tree *sub_tree; gint32 res; + int offset = 0; sub_item = proto_tree_add_item(tree, &hfi_stat_stat_res, tvb, offset, -1, ENC_NA); @@ -217,10 +213,11 @@ dissect_stat_my_id(tvbuff_t *tvb, int offset, proto_tree *tree) } static int -dissect_stat_mon_id(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) +dissect_stat_mon_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { proto_item *sub_item; proto_tree *sub_tree; + int offset = 0; sub_item = proto_tree_add_item(tree, &hfi_stat_mon, tvb, offset, mon_id_len(tvb,offset), ENC_NA); @@ -243,28 +240,26 @@ dissect_stat_priv(tvbuff_t *tvb, int offset, proto_tree *tree) } static int -dissect_stat_mon(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void *data _U_) +dissect_stat_mon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { - - offset = dissect_stat_mon_id(tvb,offset,pinfo,tree,data); + int offset = dissect_stat_mon_id(tvb,pinfo,tree,data); offset = dissect_stat_priv(tvb,offset,tree); return offset; } static int -dissect_stat_state(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) +dissect_stat_state(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { - offset = dissect_rpc_uint32(tvb,tree,hfi_stat_state.id,offset); - - return offset; + return dissect_rpc_uint32(tvb,tree,hfi_stat_state.id,0); } static int -dissect_stat_notify(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) +dissect_stat_notify(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { proto_item *sub_item; proto_tree *sub_tree; + int offset = 0; int start_offset = offset; sub_item = proto_tree_add_item(tree, &hfi_stat_stat_chge, tvb, @@ -282,11 +277,9 @@ dissect_stat_notify(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tre } static int -dissect_stat_umon_all(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) +dissect_stat_umon_all(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { - offset = dissect_stat_my_id(tvb,offset,tree); - - return offset; + return dissect_stat_my_id(tvb,0,tree); } /* proc number, "proc name", dissect_request, dissect_reply */ |