diff options
author | Michael Mann <mmann78@netscape.net> | 2015-11-22 22:59:08 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2015-11-23 13:09:55 +0000 |
commit | 2bbbb4879c3e0885fd971bd75ca88a183feb92f0 (patch) | |
tree | 9bbd51756fa6230f3555612e27863b316371ad38 /epan/dissectors/packet-dtls.c | |
parent | 073cfb33ec84f12d7904f0e6ed2b0a5d049f4ded (diff) |
register_dissector -> new_register_dissector
Change-Id: Ic368dd8e83cf39e0c934da0ae2744778e2d54ce6
Reviewed-on: https://code.wireshark.org/review/12050
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-dtls.c')
-rw-r--r-- | epan/dissectors/packet-dtls.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/epan/dissectors/packet-dtls.c b/epan/dissectors/packet-dtls.c index e352dd29f1..77fec90292 100644 --- a/epan/dissectors/packet-dtls.c +++ b/epan/dissectors/packet-dtls.c @@ -337,8 +337,8 @@ static gint looks_like_dtls(tvbuff_t *tvb, guint32 offset); /* * Code to actually dissect the packets */ -static void -dissect_dtls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_dtls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { conversation_t *conversation; @@ -376,8 +376,7 @@ dissect_dtls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) session->last_nontls_frame >= pinfo->fd->num) { /* This conversation started at a different protocol and STARTTLS was * used, but this packet comes too early. */ - /* TODO: convert to new-style dissector and return 0 to reject packet. */ - return; + return 0; } /* try decryption only the first time we see this packet @@ -450,6 +449,7 @@ dissect_dtls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } tap_queue_packet(dtls_tap, pinfo, NULL); + return tvb_captured_length(tvb); } static gboolean @@ -467,13 +467,13 @@ dissect_dtls_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat /* Advance offset to the end of the current DTLS record */ offset += tvb_get_ntohs(tvb, offset + 11) + 13; if (offset == length) { - dissect_dtls(tvb, pinfo, tree); + dissect_dtls(tvb, pinfo, tree, data); return TRUE; } } if (pinfo->fragmented && offset >= 13) { - dissect_dtls(tvb, pinfo, tree); + dissect_dtls(tvb, pinfo, tree, data); return TRUE; } return FALSE; @@ -490,12 +490,12 @@ dissect_dtls_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat offset += tvb_get_ntohs(tvb, offset + 8) + 10; } else { /* Dissect what we've got, which might be as little as 3 bytes. */ - dissect_dtls(tvb, pinfo, tree); + dissect_dtls(tvb, pinfo, tree, data); return TRUE; } if (offset == length) { /* Can this ever happen? Well, just in case ... */ - dissect_dtls(tvb, pinfo, tree); + dissect_dtls(tvb, pinfo, tree, data); return TRUE; } } @@ -504,7 +504,7 @@ dissect_dtls_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat * original number of bytes present before truncation or we're dealing with * a packet fragment that's also been truncated. */ if ((length >= 3) && (offset <= tvb_reported_length(tvb) || pinfo->fragmented)) { - dissect_dtls(tvb, pinfo, tree); + dissect_dtls(tvb, pinfo, tree, data); return TRUE; } return FALSE; @@ -1833,7 +1833,7 @@ proto_register_dtls(void) } #endif - register_dissector("dtls", dissect_dtls, proto_dtls); + new_register_dissector("dtls", dissect_dtls, proto_dtls); dtls_handle = find_dissector("dtls"); register_init_routine(dtls_init); |