aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-yami.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2013-11-09 17:46:28 +0000
committerMichael Mann <mmann78@netscape.net>2013-11-09 17:46:28 +0000
commit8081cf1d90397cbbb4404f9720595e1537ed5e14 (patch)
tree353220f46e08be1f0020603538f501b65bea8f3b /epan/dissectors/packet-yami.c
parentc9b2ee3768abb730b49fc4fc779e77578a1c4971 (diff)
Add data parameter to tcp_dissect_pdus() as well as convert it to using "new" style dissectors.
Now that "bytes consumed" can be determined, should tcp_dissect_pdus() take advantage of that? Should tcp_dissect_pdus return length (bytes consumed)? There are many dissectors that just call tcp_dissect_pdus() then return tvb_length(tvb). Seems like that could all be rolled into one. svn path=/trunk/; revision=53198
Diffstat (limited to 'epan/dissectors/packet-yami.c')
-rw-r--r--epan/dissectors/packet-yami.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/epan/dissectors/packet-yami.c b/epan/dissectors/packet-yami.c
index 1e5576ac51..e0e9dd979d 100644
--- a/epan/dissectors/packet-yami.c
+++ b/epan/dissectors/packet-yami.c
@@ -468,10 +468,10 @@ dissect_yami_data(tvbuff_t *tvb, gboolean data, proto_tree *tree, int offset)
return offset;
}
-static void
-dissect_yami_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_yami_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
- proto_tree *yami_tree = NULL;
+ proto_tree *yami_tree;
proto_item *ti;
gint frame_number;
@@ -483,10 +483,8 @@ dissect_yami_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, "YAMI");
col_clear(pinfo->cinfo, COL_INFO);
- if (tree) {
- ti = proto_tree_add_item(tree, hfi_yami, tvb, 0, -1, ENC_NA);
- yami_tree = proto_item_add_subtree(ti, ett_yami);
- }
+ ti = proto_tree_add_item(tree, hfi_yami, tvb, 0, -1, ENC_NA);
+ yami_tree = proto_item_add_subtree(ti, ett_yami);
offset = 0;
@@ -525,6 +523,8 @@ dissect_yami_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect_yami_data(tvb, TRUE, yami_tree, offset);
}
}
+
+ return tvb_length(tvb);
}
#define FRAME_HEADER_LEN 16
@@ -538,9 +538,9 @@ get_yami_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
}
static int
-dissect_yami(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
+dissect_yami(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
- tcp_dissect_pdus(tvb, pinfo, tree, yami_desegment, FRAME_HEADER_LEN, get_yami_message_len, dissect_yami_pdu);
+ tcp_dissect_pdus(tvb, pinfo, tree, yami_desegment, FRAME_HEADER_LEN, get_yami_message_len, dissect_yami_pdu, data);
return tvb_length(tvb);
}