aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-laplink.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-laplink.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-laplink.c')
-rw-r--r--epan/dissectors/packet-laplink.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/epan/dissectors/packet-laplink.c b/epan/dissectors/packet-laplink.c
index 50beae0c75..a44d589484 100644
--- a/epan/dissectors/packet-laplink.c
+++ b/epan/dissectors/packet-laplink.c
@@ -108,8 +108,8 @@ dissect_laplink_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d
}
/* Code to actually dissect the packets - TCP aspects*/
-static void
-dissect_laplink_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_laplink_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
int offset = 0;
int length = 0;
@@ -143,6 +143,7 @@ dissect_laplink_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
+ return tvb_length(tvb);
/* If this protocol has a sub-dissector call it here, see section 1.8 */
}
@@ -157,12 +158,13 @@ get_laplink_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
return plen;
}
-static void
-dissect_laplink_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_laplink_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, laplink_desegment,
6, get_laplink_pdu_len,
- dissect_laplink_tcp_pdu);
+ dissect_laplink_tcp_pdu, data);
+ return tvb_length(tvb);
}
@@ -235,7 +237,7 @@ proto_reg_handoff_laplink(void)
dissector_handle_t laplink_udp_handle;
dissector_handle_t laplink_tcp_handle;
- laplink_tcp_handle = create_dissector_handle(dissect_laplink_tcp,
+ laplink_tcp_handle = new_create_dissector_handle(dissect_laplink_tcp,
proto_laplink);
dissector_add_uint("tcp.port", TCP_PORT_LAPLINK, laplink_tcp_handle);