diff options
author | Michael Mann <mmann78@netscape.net> | 2013-11-09 17:46:28 +0000 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2013-11-09 17:46:28 +0000 |
commit | 8081cf1d90397cbbb4404f9720595e1537ed5e14 (patch) | |
tree | 353220f46e08be1f0020603538f501b65bea8f3b /epan/dissectors/packet-dnp.c | |
parent | c9b2ee3768abb730b49fc4fc779e77578a1c4971 (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-dnp.c')
-rw-r--r-- | epan/dissectors/packet-dnp.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/epan/dissectors/packet-dnp.c b/epan/dissectors/packet-dnp.c index cf63879ff6..97d72dfbf2 100644 --- a/epan/dissectors/packet-dnp.c +++ b/epan/dissectors/packet-dnp.c @@ -3064,8 +3064,8 @@ dissect_dnp3_al(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /*****************************************************************/ /* Data Link and Transport layer dissector */ /*****************************************************************/ -static void -dissect_dnp3_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_dnp3_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_item *ti, *tdl, *tc; proto_tree *dnp3_tree, *dl_tree, *field_tree; @@ -3381,6 +3381,8 @@ dissect_dnp3_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) col_set_fence(pinfo->cinfo, COL_INFO); } } + + return tvb_length(tvb); } static guint @@ -3403,7 +3405,7 @@ get_dnp3_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset) } static gboolean -dissect_dnp3_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) +dissect_dnp3_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { gint length = tvb_length(tvb); @@ -3414,13 +3416,13 @@ dissect_dnp3_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data } tcp_dissect_pdus(tvb, pinfo, tree, TRUE, DNP_HDR_LEN, - get_dnp3_message_len, dissect_dnp3_message); + get_dnp3_message_len, dissect_dnp3_message, data); return TRUE; } static gboolean -dissect_dnp3_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) +dissect_dnp3_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { gint length = tvb_length(tvb); @@ -3430,7 +3432,7 @@ dissect_dnp3_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data return FALSE; } - dissect_dnp3_message(tvb, pinfo, tree); + dissect_dnp3_message(tvb, pinfo, tree, data); return TRUE; } |