diff --git a/sharkd_session.c b/sharkd_session.c index a5b90ba139..dfb7945e1e 100644 --- a/sharkd_session.c +++ b/sharkd_session.c @@ -2182,7 +2182,7 @@ sharkd_session_process_tap(char *buf, const jsmntok_t *tokens, int count) int i; rtpstream_tapinfo_t rtp_tapinfo = - { NULL, NULL, NULL, NULL, 0, NULL, 0, TAP_ANALYSE, NULL, NULL, NULL, FALSE }; + { NULL, NULL, NULL, NULL, 0, NULL, 0, TAP_ANALYSE, NULL, NULL, NULL, FALSE, FALSE}; for (i = 0; i < 16; i++) { diff --git a/ui/cli/tap-rtp.c b/ui/cli/tap-rtp.c index 0be5d75acd..1e6f5add4b 100644 --- a/ui/cli/tap-rtp.c +++ b/ui/cli/tap-rtp.c @@ -44,7 +44,7 @@ static void rtpstreams_stat_draw_cb(rtpstream_tapinfo_t *tapinfo); */ static rtpstream_tapinfo_t the_tapinfo_struct = { NULL, rtpstreams_stat_draw_cb, NULL, - NULL, 0, NULL, 0, TAP_ANALYSE, NULL, NULL, NULL, FALSE + NULL, 0, NULL, 0, TAP_ANALYSE, NULL, NULL, NULL, FALSE, FALSE }; static void diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp index 91f26251ca..3ae2b43185 100644 --- a/ui/qt/main_window_slots.cpp +++ b/ui/qt/main_window_slots.cpp @@ -3310,6 +3310,8 @@ void MainWindow::openVoipCallsDialog(bool all_flows) this, SLOT(filterPackets(QString, bool))); connect(voip_calls_dialog_, SIGNAL(openRtpStreamDialogPassOut()), this, SLOT(on_actionTelephonyRTPStreams_triggered())); + connect(this, SIGNAL(displayFilterSuccess(bool)), + voip_calls_dialog_, SLOT(displayFilterSuccess(bool))); interconnectRtpStreamDialogToVoipCallsDialog(rtp_stream_dialog_, voip_calls_dialog_); voip_calls_dialog_->show(); voip_calls_dialog_->raise(); @@ -3413,6 +3415,8 @@ void MainWindow::on_actionTelephonyRTPStreams_triggered() packet_list_, SLOT(goToPacket(int))); connect(rtp_stream_dialog_, SIGNAL(updateFilter(QString, bool)), this, SLOT(filterPackets(QString, bool))); + connect(this, SIGNAL(displayFilterSuccess(bool)), + rtp_stream_dialog_, SLOT(displayFilterSuccess(bool))); interconnectRtpStreamDialogToVoipCallsDialog(rtp_stream_dialog_, voip_calls_dialog_); rtp_stream_dialog_->show(); rtp_stream_dialog_->raise(); diff --git a/ui/qt/models/voip_calls_info_model.cpp b/ui/qt/models/voip_calls_info_model.cpp index b6b1f6989b..614540665a 100644 --- a/ui/qt/models/voip_calls_info_model.cpp +++ b/ui/qt/models/voip_calls_info_model.cpp @@ -214,6 +214,12 @@ void VoipCallsInfoModel::updateCalls(GQueue *callsinfos) } } +void VoipCallsInfoModel::removeAllCalls() +{ + beginRemoveRows(QModelIndex(), 0, rowCount() - 1); + callinfos_.clear(); + endRemoveRows(); +} // Proxy model that allows columns to be sorted. VoipCallsInfoSortedModel::VoipCallsInfoSortedModel(QObject *parent) : diff --git a/ui/qt/models/voip_calls_info_model.h b/ui/qt/models/voip_calls_info_model.h index 3f8931d380..dc833b2c1e 100644 --- a/ui/qt/models/voip_calls_info_model.h +++ b/ui/qt/models/voip_calls_info_model.h @@ -33,6 +33,7 @@ public: void setTimeOfDay(bool timeOfDay); bool timeOfDay() const; void updateCalls(GQueue *callsinfos); + void removeAllCalls(); static voip_calls_info_t *indexToCallInfo(const QModelIndex &index); 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 *)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 * diff --git a/ui/qt/rtp_stream_dialog.h b/ui/qt/rtp_stream_dialog.h index 762406eb64..8a3ce1c9bb 100644 --- a/ui/qt/rtp_stream_dialog.h +++ b/ui/qt/rtp_stream_dialog.h @@ -41,6 +41,7 @@ signals: public slots: void selectRtpStream(rtpstream_id_t *id); void deselectRtpStream(rtpstream_id_t *id); + void displayFilterSuccess(bool success); protected: bool eventFilter(QObject *obj, QEvent *event); @@ -85,6 +86,8 @@ private slots: void on_buttonBox_clicked(QAbstractButton *button); void on_actionExportAsRtpDump_triggered(); void on_actionAnalyze_triggered(); + void captureEvent(CaptureEvent e); + void on_displayFilterCheckBox_toggled(bool checked); }; #endif // RTP_STREAM_DIALOG_H diff --git a/ui/qt/rtp_stream_dialog.ui b/ui/qt/rtp_stream_dialog.ui index 9398b47875..c881e656c1 100644 --- a/ui/qt/rtp_stream_dialog.ui +++ b/ui/qt/rtp_stream_dialog.ui @@ -122,6 +122,33 @@ + + + + + + <html><head/><body><p>Only show conversations matching the current display filter</p></body></html> + + + Limit to display filter + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + diff --git a/ui/qt/voip_calls_dialog.cpp b/ui/qt/voip_calls_dialog.cpp index 2d31abd896..259b4bd9fb 100644 --- a/ui/qt/voip_calls_dialog.cpp +++ b/ui/qt/voip_calls_dialog.cpp @@ -79,6 +79,8 @@ VoipCallsDialog::VoipCallsDialog(QWidget &parent, CaptureFile &cf, bool all_flow ca = copy_menu->addAction(tr("as YAML")); connect(ca, SIGNAL(triggered()), this, SLOT(copyAsYAML())); copy_button_->setMenu(copy_menu); + connect(&cap_file_, SIGNAL(captureEvent(CaptureEvent)), + this, SLOT(captureEvent(CaptureEvent))); memset (&tapinfo_, 0, sizeof(tapinfo_)); tapinfo_.tap_packet = tapPacket; @@ -94,6 +96,11 @@ VoipCallsDialog::VoipCallsDialog(QWidget &parent, CaptureFile &cf, bool all_flow shown_callsinfos_ = g_queue_new(); voip_calls_init_all_taps(&tapinfo_); + if (cap_file_.capFile()->dfilter) { + // Activate display filter checking + tapinfo_.apply_display_filter = true; + ui->displayFilterCheckBox->setChecked(true); + } updateWidgets(); @@ -183,6 +190,25 @@ void VoipCallsDialog::changeEvent(QEvent *event) QDialog::changeEvent(event); } +void VoipCallsDialog::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 VoipCallsDialog::tapReset(void *tapinfo_ptr) { voip_calls_tapinfo_t *tapinfo = static_cast(tapinfo_ptr); @@ -572,6 +598,36 @@ void VoipCallsDialog::on_buttonBox_clicked(QAbstractButton *button) } } +void VoipCallsDialog::removeAllCalls() +{ + voip_calls_info_t *callsinfo; + GList *list = NULL; + + call_infos_model_->removeAllCalls(); + + /* Free shown callsinfos */ + list = g_queue_peek_nth_link(shown_callsinfos_, 0); + while (list) + { + callsinfo = (voip_calls_info_t *)list->data; + voip_calls_free_callsinfo(callsinfo); + list = g_list_next(list); + } + g_queue_clear(shown_callsinfos_); +} + +void VoipCallsDialog::on_displayFilterCheckBox_toggled(bool checked) +{ + if (!cap_file_.isValid()) { + return; + } + + tapinfo_.apply_display_filter = checked; + removeAllCalls(); + + cap_file_.retapPackets(); +} + void VoipCallsDialog::on_buttonBox_helpRequested() { wsApp->helpTopicAction(HELP_TELEPHONY_VOIP_CALLS_DIALOG); @@ -602,6 +658,13 @@ void VoipCallsDialog::openRtpStreamDialogPassIn() emit openRtpStreamDialogPassOut(); } +void VoipCallsDialog::displayFilterSuccess(bool success) +{ + if (success && ui->displayFilterCheckBox->isChecked()) { + removeAllCalls(); + cap_file_.retapPackets(); + } +} /* * Editor modelines diff --git a/ui/qt/voip_calls_dialog.h b/ui/qt/voip_calls_dialog.h index 706d970285..e52fd0253c 100644 --- a/ui/qt/voip_calls_dialog.h +++ b/ui/qt/voip_calls_dialog.h @@ -49,6 +49,9 @@ signals: void deselectRtpStreamPassOut(rtpstream_id_t *id); void openRtpStreamDialogPassOut(); +public slots: + void displayFilterSuccess(bool success); + protected: void contextMenuEvent(QContextMenuEvent *event); virtual void removeTapListeners(); @@ -82,6 +85,7 @@ private: void prepareFilter(); void showSequence(); void showPlayer(); + void removeAllCalls(); QList streamRowData(int row) const; @@ -98,6 +102,8 @@ private slots: void selectRtpStreamPassIn(rtpstream_id_t *id); void deselectRtpStreamPassIn(rtpstream_id_t *id); void openRtpStreamDialogPassIn(); + void captureEvent(CaptureEvent e); + void on_displayFilterCheckBox_toggled(bool checked); }; #endif // VOIP_CALLS_DIALOG_H diff --git a/ui/qt/voip_calls_dialog.ui b/ui/qt/voip_calls_dialog.ui index 376d05251f..01fd7fdcd0 100644 --- a/ui/qt/voip_calls_dialog.ui +++ b/ui/qt/voip_calls_dialog.ui @@ -42,6 +42,23 @@ + + + + <html><head/><body><p>Only show conversations matching the current display filter</p></body></html> + + + Limit to display filter + + + + + + + Time of Day + + + @@ -55,13 +72,6 @@ - - - - Time of Day - - - diff --git a/ui/rtp_stream.h b/ui/rtp_stream.h index 3542070e30..e368a792bf 100644 --- a/ui/rtp_stream.h +++ b/ui/rtp_stream.h @@ -96,6 +96,7 @@ struct _rtpstream_tapinfo { rtpstream_info_t *filter_stream_rev; /**< used as filter in some tap modes */ FILE *save_file; gboolean is_registered; /**< if the tap listener is currently registered or not */ + gboolean apply_display_filter; /**< if apply display filter during analyse */ }; #if 0 diff --git a/ui/tap-rtp-common.c b/ui/tap-rtp-common.c index 676c29a171..2efa2dcaa2 100644 --- a/ui/tap-rtp-common.c +++ b/ui/tap-rtp-common.c @@ -380,6 +380,11 @@ tap_packet_status rtpstream_packet_cb(void *arg, packet_info *pinfo, epan_dissec new_stream_info.first_payload_type_name = rtpinfo->info_payload_type_str; if (tapinfo->mode == TAP_ANALYSE) { + /* if display filtering activated and packet do not match, ignore it */ + if (tapinfo->apply_display_filter && (pinfo->fd->passed_dfilter == 0)) { + return TAP_PACKET_DONT_REDRAW; + } + /* check whether we already have a stream with these parameters in the list */ list = g_list_first(tapinfo->strinfo_list); while (list) diff --git a/ui/voip_calls.c b/ui/voip_calls.c index 1934a1303e..8eea6cd9a1 100644 --- a/ui/voip_calls.c +++ b/ui/voip_calls.c @@ -514,6 +514,10 @@ rtp_event_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt _ voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_rtp_event_); const struct _rtp_event_info *pi = (const struct _rtp_event_info *)rtp_event_info; + /* if display filtering activated and packet do not match, ignore it */ + if (tapinfo->apply_display_filter && (pinfo->fd->passed_dfilter == 0)) { + return TAP_PACKET_DONT_REDRAW; + } /* do not consider RTP events packets without a setup frame */ if (pi->info_setup_frame_num == 0) { return TAP_PACKET_DONT_REDRAW; @@ -604,6 +608,11 @@ rtp_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, void c const struct _rtp_info *rtp_info = (const struct _rtp_info *)rtp_info_ptr; + /* if display filtering activated and packet do not match, ignore it */ + if (tapinfo->apply_display_filter && (pinfo->fd->passed_dfilter == 0)) { + return TAP_PACKET_DONT_REDRAW; + } + /* do not consider RTP packets without a setup frame */ if (rtp_info->info_setup_frame_num == 0) { return TAP_PACKET_DONT_REDRAW; @@ -914,6 +923,11 @@ t38_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, const const t38_packet_info *t38_info = (const t38_packet_info *)t38_info_ptr; + /* if display filtering activated and packet do not match, ignore it */ + if (tapinfo->apply_display_filter && (pinfo->fd->passed_dfilter == 0)) { + return TAP_PACKET_DONT_REDRAW; + } + if (t38_info->setup_frame_number != 0) { /* using the setup frame number of the T38 packet, we get the call number that it belongs */ if(tapinfo->graph_analysis){ @@ -1120,6 +1134,11 @@ sip_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt , const sip_info_value_t *pi = (const sip_info_value_t *)SIPinfo; + /* if display filtering activated and packet do not match, ignore it */ + if (tapinfo->apply_display_filter && (pinfo->fd->passed_dfilter == 0)) { + return TAP_PACKET_DONT_REDRAW; + } + tapinfo->sip_frame_num = pinfo->num; /* do not consider packets without call_id */ @@ -1341,6 +1360,11 @@ isup_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, const isup_tap_rec_t *pi = (const isup_tap_rec_t *)isup_info; + /* if display filtering activated and packet do not match, ignore it */ + if (tapinfo->apply_display_filter && (pinfo->fd->passed_dfilter == 0)) { + return TAP_PACKET_DONT_REDRAW; + } + /* check if the lower layer is MTP matching the frame number */ if (tapinfo->mtp3_frame_num != pinfo->num) return TAP_PACKET_DONT_REDRAW; @@ -1536,6 +1560,11 @@ mtp3_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_mtp3_); const mtp3_tap_rec_t *pi = (const mtp3_tap_rec_t *)mtp3_info; + /* if display filtering activated and packet do not match, ignore it */ + if (tapinfo->apply_display_filter && (pinfo->fd->passed_dfilter == 0)) { + return TAP_PACKET_DONT_REDRAW; + } + /* keep the data in memory to use when the ISUP information arrives */ tapinfo->mtp3_opc = pi->addr_opc.pc; @@ -1552,6 +1581,11 @@ m3ua_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_m3ua_); const mtp3_tap_rec_t *pi = (const mtp3_tap_rec_t *)mtp3_info; + /* if display filtering activated and packet do not match, ignore it */ + if (tapinfo->apply_display_filter && (pinfo->fd->passed_dfilter == 0)) { + return TAP_PACKET_DONT_REDRAW; + } + /* keep the data in memory to use when the ISUP information arrives */ tapinfo->mtp3_opc = pi->addr_opc.pc; @@ -1633,6 +1667,11 @@ q931_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, const q931_packet_info *pi = (const q931_packet_info *)q931_info; + /* if display filtering activated and packet do not match, ignore it */ + if (tapinfo->apply_display_filter && (pinfo->fd->passed_dfilter == 0)) { + return TAP_PACKET_DONT_REDRAW; + } + /* free previously allocated q931_calling/ed_number */ g_free(tapinfo->q931_calling_number); g_free(tapinfo->q931_called_number); @@ -1972,6 +2011,11 @@ h225_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, const h225_packet_info *pi = (const h225_packet_info *)H225info; + /* if display filtering activated and packet do not match, ignore it */ + if (tapinfo->apply_display_filter && (pinfo->fd->passed_dfilter == 0)) { + return TAP_PACKET_DONT_REDRAW; + } + /* if not guid and RAS and not LRQ, LCF or LRJ return because did not belong to a call */ /* OR, if not guid and is H225 return because doesn't belong to a call */ if ((memcmp(&pi->guid, &guid_allzero, GUID_LEN) == 0)) @@ -2280,6 +2324,11 @@ h245dg_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *ed const h245_packet_info *pi = (const h245_packet_info *)H245info; + /* if display filtering activated and packet do not match, ignore it */ + if (tapinfo->apply_display_filter && (pinfo->fd->passed_dfilter == 0)) { + return TAP_PACKET_DONT_REDRAW; + } + /* check if Tunneling is OFF and we have a call with this H245 add */ list = g_queue_peek_nth_link(tapinfo->callsinfos, 0); while (list) @@ -2392,6 +2441,11 @@ sdp_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt _ voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_sdp_); const sdp_packet_info *pi = (const sdp_packet_info *)SDPinfo; + /* if display filtering activated and packet do not match, ignore it */ + if (tapinfo->apply_display_filter && (pinfo->fd->passed_dfilter == 0)) { + return TAP_PACKET_DONT_REDRAW; + } + /* There are protocols like MGCP/SIP where the SDP is called before the tap for the MGCP/SIP packet, in those cases we assign the SPD summary to global lastSDPsummary to use it later @@ -2584,6 +2638,10 @@ mgcp_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, const mgcp_info_t *pi = (const mgcp_info_t *)MGCPinfo; + /* if display filtering activated and packet do not match, ignore it */ + if (tapinfo->apply_display_filter && (pinfo->fd->passed_dfilter == 0)) { + return TAP_PACKET_DONT_REDRAW; + } if ((pi->mgcp_type == MGCP_REQUEST) && !pi->is_duplicate ) { /* check whether we already have a call with this Endpoint and it is active*/ @@ -2849,6 +2907,11 @@ actrace_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *e voip_calls_info_t *tmp_listinfo; voip_calls_info_t *callsinfo = NULL; + /* if display filtering activated and packet do not match, ignore it */ + if (tapinfo->apply_display_filter && (pinfo->fd->passed_dfilter == 0)) { + return TAP_PACKET_DONT_REDRAW; + } + tapinfo->actrace_frame_num = pinfo->num; tapinfo->actrace_trunk = pi->trunk; tapinfo->actrace_direction = pi->direction; @@ -3071,6 +3134,10 @@ static tap_packet_status h248_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, const void *prot_info) { voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_h248_); + /* if display filtering activated and packet do not match, ignore it */ + if (tapinfo->apply_display_filter && (pinfo->fd->passed_dfilter == 0)) { + return TAP_PACKET_DONT_REDRAW; + } return h248_calls_packet_common(tapinfo, pinfo, edt, prot_info, REDRAW_H248); } @@ -3089,6 +3156,10 @@ static tap_packet_status megaco_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, const void *prot_info) { voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_megaco_); + /* if display filtering activated and packet do not match, ignore it */ + if (tapinfo->apply_display_filter && (pinfo->fd->passed_dfilter == 0)) { + return TAP_PACKET_DONT_REDRAW; + } return h248_calls_packet_common(tapinfo, pinfo, edt, prot_info, REDRAW_MEGACO); } @@ -3264,6 +3335,10 @@ static tap_packet_status sccp_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, const void *prot_info) { voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_sccp_); + /* if display filtering activated and packet do not match, ignore it */ + if (tapinfo->apply_display_filter && (pinfo->fd->passed_dfilter == 0)) { + return TAP_PACKET_DONT_REDRAW; + } sccp_payload_values = sccp_message_type_acro_values; return sccp_calls(tapinfo, pinfo, edt, prot_info, REDRAW_SCCP); } @@ -3283,6 +3358,10 @@ static tap_packet_status sua_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, const void *prot_info) { voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_sua_); + /* if display filtering activated and packet do not match, ignore it */ + if (tapinfo->apply_display_filter && (pinfo->fd->passed_dfilter == 0)) { + return TAP_PACKET_DONT_REDRAW; + } sccp_payload_values = sua_co_class_type_acro_values; return sccp_calls(tapinfo, pinfo, edt, prot_info, REDRAW_SUA); } @@ -3358,6 +3437,11 @@ unistim_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *e /* Fetch specific packet infos */ const unistim_info_t *pi = (const unistim_info_t *)unistim_info; + /* if display filtering activated and packet do not match, ignore it */ + if (tapinfo->apply_display_filter && (pinfo->fd->passed_dfilter == 0)) { + return TAP_PACKET_DONT_REDRAW; + } + /* Init gstring */ g_tmp = g_string_new(NULL); @@ -3883,6 +3967,11 @@ skinny_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *ed skinny_calls_info_t *tmp_skinnyinfo; gchar *comment; + /* if display filtering activated and packet do not match, ignore it */ + if (tapinfo->apply_display_filter && (pinfo->fd->passed_dfilter == 0)) { + return TAP_PACKET_DONT_REDRAW; + } + if (si == NULL || (si->callId == 0 && si->passThroughPartyId == 0)) return TAP_PACKET_DONT_REDRAW; /* check whether we already have this context in the list */ @@ -4039,6 +4128,11 @@ iax2_calls_packet( void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt const iax2_info_t *ii = (const iax2_info_t *)iax2_info; iax2_info_t *tmp_iax2info; + /* if display filtering activated and packet do not match, ignore it */ + if (tapinfo->apply_display_filter && (pinfo->fd->passed_dfilter == 0)) { + return TAP_PACKET_DONT_REDRAW; + } + if (ii == NULL || ii->ptype != IAX2_FULL_PACKET || (ii->scallno == 0 && ii->dcallno == 0)) return TAP_PACKET_DONT_REDRAW; /* check whether we already have this context in the list */ @@ -4172,6 +4266,11 @@ voip_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, GList *list = NULL; const voip_packet_info_t *pi = (const voip_packet_info_t *)VoIPinfo; + /* if display filtering activated and packet do not match, ignore it */ + if (tapinfo->apply_display_filter && (pinfo->fd->passed_dfilter == 0)) { + return TAP_PACKET_DONT_REDRAW; + } + /* VOIP_CALLS_DEBUG("num %u", pinfo->num); */ if (pi->call_id) list = g_queue_peek_nth_link(tapinfo->callsinfos, 0); @@ -4283,6 +4382,12 @@ static tap_packet_status prot_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt _U_, const void *prot_info _U_) { voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_prot_); + + /* if display filtering activated and packet do not match, ignore it */ + if (tapinfo->apply_display_filter && (pinfo->fd->passed_dfilter == 0)) { + return TAP_PACKET_DONT_REDRAW; + } + if (callsinfo!=NULL) { callsinfo->stop_abs = pinfo->abs_ts; callsinfo->stop_rel = pinfo->rel_ts; diff --git a/ui/voip_calls.h b/ui/voip_calls.h index 7f8879512e..0fc71f180f 100644 --- a/ui/voip_calls.h +++ b/ui/voip_calls.h @@ -216,6 +216,7 @@ typedef struct _voip_calls_tapinfo { gint32 actrace_direction; flow_show_options fs_option; guint32 redraw; + gboolean apply_display_filter; } voip_calls_tapinfo_t; #if 0