From 2d41b15495e245d9292ba42dd3954bdebc9f3290 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 31 Dec 2018 19:36:12 -0800 Subject: Add a "failed" return for tap packet routines. This allows taps that can fail to report an error and fail; a failed tap's packet routine won't be called again, so they don't have to keep track of whether they've failed themselves. We make the return value from the packet routine an enum. Don't have a separate type for the per-packet routine for "follow" taps; they're expected to act like tap packet routines, so just use the type for tap packet routines. One tap packet routine returned -1; that's not a valid return value, and wasn't one before this change (the return value was a boolean), so presume the intent was "don't redraw". Another tap routine's early return, without doing any work, returned TRUE; this is presumably an error (no work done, no need to redraw), so presumably it should be "don't redraw". Clean up some white space while we're at it. Change-Id: Ia7d2b717b2cace4b13c2b886e699aa4d79cc82c8 Reviewed-on: https://code.wireshark.org/review/31283 Reviewed-by: Guy Harris --- ui/qt/rtp_analysis_dialog.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ui/qt/rtp_analysis_dialog.cpp') diff --git a/ui/qt/rtp_analysis_dialog.cpp b/ui/qt/rtp_analysis_dialog.cpp index 46046cf787..51b6547bfe 100644 --- a/ui/qt/rtp_analysis_dialog.cpp +++ b/ui/qt/rtp_analysis_dialog.cpp @@ -656,20 +656,20 @@ void RtpAnalysisDialog::tapReset(void *tapinfo_ptr) rtp_analysis_dialog->resetStatistics(); } -gboolean RtpAnalysisDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *rtpinfo_ptr) +tap_packet_status RtpAnalysisDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *rtpinfo_ptr) { RtpAnalysisDialog *rtp_analysis_dialog = dynamic_cast((RtpAnalysisDialog*)tapinfo_ptr); - if (!rtp_analysis_dialog) return FALSE; + if (!rtp_analysis_dialog) return TAP_PACKET_DONT_REDRAW; const struct _rtp_info *rtpinfo = (const struct _rtp_info *)rtpinfo_ptr; - if (!rtpinfo) return FALSE; + if (!rtpinfo) return TAP_PACKET_DONT_REDRAW; /* we ignore packets that are not displayed */ if (pinfo->fd->passed_dfilter == 0) - return FALSE; + return TAP_PACKET_DONT_REDRAW; /* also ignore RTP Version != 2 */ else if (rtpinfo->info_version != 2) - return FALSE; + return TAP_PACKET_DONT_REDRAW; /* is it the forward direction? */ else if (rtpstream_id_equal_pinfo_rtp_info(&(rtp_analysis_dialog->fwd_statinfo_.id),pinfo,rtpinfo)) { @@ -680,7 +680,7 @@ gboolean RtpAnalysisDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epa rtp_analysis_dialog->addPacket(false, pinfo, rtpinfo); } - return FALSE; + return TAP_PACKET_DONT_REDRAW; } void RtpAnalysisDialog::tapDraw(void *tapinfo_ptr) -- cgit v1.2.3