diff options
author | Jirka Novak <j.novak@netsystem.cz> | 2021-01-01 16:51:47 +0100 |
---|---|---|
committer | AndersBroman <a.broman58@gmail.com> | 2021-01-01 19:06:58 +0000 |
commit | 2a5c96a79948d2f77cb48e048d6c6eba5c835f98 (patch) | |
tree | 5fee1a414289449482bec159e94f2f5b68bec6a3 /ui/qt/rtp_stream_dialog.cpp | |
parent | 1f3a81de8650aa505b9b2bae6df19a41b1531328 (diff) |
Voice dialogs: Added option to apply display filter in VoIP/RTP dialogs
VoIP Calls dialog and RTP Streams dialog has now option to apply display
filter dialog during processing packets.
Filter checkbox is activated during dialog open when display filter is active.
New field apply_display_filter had to be added to voip_calls_tapinfo_t and
_rtpstream_tapinfo/rtpstream_tapinfo_t structures.
Diffstat (limited to 'ui/qt/rtp_stream_dialog.cpp')
-rw-r--r-- | ui/qt/rtp_stream_dialog.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/ui/qt/rtp_stream_dialog.cpp b/ui/qt/rtp_stream_dialog.cpp index a78cb513dd..8952cb4f61 100644 --- a/ui/qt/rtp_stream_dialog.cpp +++ b/ui/qt/rtp_stream_dialog.cpp @@ -275,6 +275,8 @@ RtpStreamDialog::RtpStreamDialog(QWidget &parent, CaptureFile &cf) : ca->setToolTip(ui->actionCopyAsYaml->toolTip()); connect(ca, SIGNAL(triggered()), this, SLOT(on_actionCopyAsYaml_triggered())); copy_button_->setMenu(copy_menu); + connect(&cap_file_, SIGNAL(captureEvent(CaptureEvent)), + this, SLOT(captureEvent(CaptureEvent))); /* Register the tap listener */ memset(&tapinfo_, 0, sizeof(rtpstream_tapinfo_t)); @@ -285,6 +287,12 @@ RtpStreamDialog::RtpStreamDialog(QWidget &parent, CaptureFile &cf) : tapinfo_.mode = TAP_ANALYSE; register_tap_listener_rtpstream(&tapinfo_, NULL, show_tap_registration_error); + if (cap_file_.capFile()->dfilter) { + // Activate display filter checking + tapinfo_.apply_display_filter = true; + ui->displayFilterCheckBox->setChecked(true); + } + /* Scan for RTP streams (redissect all packets) */ rtpstream_scan(&tapinfo_, cf.capFile(), NULL); @@ -353,6 +361,25 @@ bool RtpStreamDialog::eventFilter(QObject *, QEvent *event) return false; } +void RtpStreamDialog::captureEvent(CaptureEvent e) +{ + if (e.captureContext() == CaptureEvent::Retap) + { + switch (e.eventType()) + { + case CaptureEvent::Started: + ui->displayFilterCheckBox->setEnabled(false); + break; + case CaptureEvent::Finished: + ui->displayFilterCheckBox->setEnabled(true); + break; + default: + break; + } + } + +} + void RtpStreamDialog::tapReset(rtpstream_tapinfo_t *tapinfo) { RtpStreamDialog *rtp_stream_dialog = dynamic_cast<RtpStreamDialog *>((RtpStreamDialog *)tapinfo->tap_data); @@ -716,6 +743,17 @@ void RtpStreamDialog::on_buttonBox_helpRequested() wsApp->helpTopicAction(HELP_RTP_ANALYSIS_DIALOG); } +void RtpStreamDialog::on_displayFilterCheckBox_toggled(bool checked _U_) +{ + if (!cap_file_.isValid()) { + return; + } + + tapinfo_.apply_display_filter = checked; + + cap_file_.retapPackets(); +} + void RtpStreamDialog::showPlayer() { rtpstream_info_t stream_info; @@ -750,6 +788,13 @@ void RtpStreamDialog::showPlayer() #endif // QT_MULTIMEDIA_LIB } +void RtpStreamDialog::displayFilterSuccess(bool success) +{ + if (success && ui->displayFilterCheckBox->isChecked()) { + cap_file_.retapPackets(); + } +} + /* * Editor modelines * |