aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2015-05-14 22:53:16 -0400
committerAnders Broman <a.broman58@gmail.com>2015-05-20 11:03:58 +0000
commitfeb47cf93662723386dbce7d1f180efc39f131f1 (patch)
tree535e365114a2df552a963af9a9cead0c9864bff4
parent713ed3f81724f3ea39ade8fdd53f482715f296ca (diff)
Start exposing the filter field of a tap listener to the RTP GUI APIs.
A tap listener has the ability to apply a filter (typically the display filter). Add a parameter to RTP GUI API functions to allow them to pass in a filter. Bug: 996 Change-Id: Ib184dfb023be5d1d24a0d842b4039311426b5293 Reviewed-on: https://code.wireshark.org/review/8468 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--ui/gtk/iax2_analysis.c2
-rw-r--r--ui/gtk/rtp_analysis.c2
-rw-r--r--ui/gtk/rtp_stream_dlg.c6
-rw-r--r--ui/qt/rtp_stream_dialog.cpp4
-rw-r--r--ui/rtp_stream.c12
-rw-r--r--ui/rtp_stream.h4
6 files changed, 16 insertions, 14 deletions
diff --git a/ui/gtk/iax2_analysis.c b/ui/gtk/iax2_analysis.c
index e167e570ee..3297601d55 100644
--- a/ui/gtk/iax2_analysis.c
+++ b/ui/gtk/iax2_analysis.c
@@ -3771,7 +3771,7 @@ void iax2_analysis_cb(GtkAction *action _U_, gpointer user_data _U_)
port_dst_rev = edt.pi.srcport;
/* Scan for rtpstream */
- rtpstream_scan(rtpstream_dlg_get_tapinfo(), &cfile);
+ rtpstream_scan(rtpstream_dlg_get_tapinfo(), &cfile, NULL);
/* search for reversed direction in the global rtp streams list */
nfound = 0;
strinfo_list = g_list_first(rtpstream_dlg_get_tapinfo()->strinfo_list);
diff --git a/ui/gtk/rtp_analysis.c b/ui/gtk/rtp_analysis.c
index 2e319b440c..4f6fbb9e29 100644
--- a/ui/gtk/rtp_analysis.c
+++ b/ui/gtk/rtp_analysis.c
@@ -3999,7 +3999,7 @@ rtp_analysis_cb(GtkAction *action _U_, gpointer user_data _U_)
}
/* Scan for rtpstream */
- rtpstream_scan(rtpstream_dlg_get_tapinfo(), &cfile);
+ rtpstream_scan(rtpstream_dlg_get_tapinfo(), &cfile, NULL);
/* search for reversed direction in the global rtp streams list */
nfound = 0;
strinfo_list = g_list_first(rtpstream_dlg_get_tapinfo()->strinfo_list);
diff --git a/ui/gtk/rtp_stream_dlg.c b/ui/gtk/rtp_stream_dlg.c
index 75b64e4a15..1762f7e6d2 100644
--- a/ui/gtk/rtp_stream_dlg.c
+++ b/ui/gtk/rtp_stream_dlg.c
@@ -1149,11 +1149,13 @@ void rtpstream_dlg_show(GList *list_lcl)
/* entry point when called via the GTK menu */
void rtpstream_launch(GtkAction *action _U_, gpointer user_data _U_)
{
+ const char *filter = gtk_entry_get_text(GTK_ENTRY(main_display_filter_widget));
+
/* Register the tap listener */
- register_tap_listener_rtp_stream(&the_tapinfo_struct);
+ register_tap_listener_rtp_stream(&the_tapinfo_struct, filter);
/* Scan for RTP streams (redissect all packets) */
- rtpstream_scan(&the_tapinfo_struct, &cfile);
+ rtpstream_scan(&the_tapinfo_struct, &cfile, filter);
/* Show the dialog box with the list of streams */
rtpstream_dlg_show(the_tapinfo_struct.strinfo_list);
diff --git a/ui/qt/rtp_stream_dialog.cpp b/ui/qt/rtp_stream_dialog.cpp
index dd26c2a5fb..a1ce24e3c2 100644
--- a/ui/qt/rtp_stream_dialog.cpp
+++ b/ui/qt/rtp_stream_dialog.cpp
@@ -270,9 +270,9 @@ RtpStreamDialog::RtpStreamDialog(QWidget &parent, CaptureFile &cf) :
tapinfo_.tap_data = this;
tapinfo_.mode = TAP_ANALYSE;
- register_tap_listener_rtp_stream(&tapinfo_);
+ register_tap_listener_rtp_stream(&tapinfo_, NULL);
/* Scan for RTP streams (redissect all packets) */
- rtpstream_scan(&tapinfo_, cf.capFile());
+ rtpstream_scan(&tapinfo_, cf.capFile(), NULL);
updateWidgets();
}
diff --git a/ui/rtp_stream.c b/ui/rtp_stream.c
index 11f41c15a5..f54235519d 100644
--- a/ui/rtp_stream.c
+++ b/ui/rtp_stream.c
@@ -64,7 +64,7 @@ static void rtpstream_draw(void *ti_ptr)
/****************************************************************************/
/* scan for RTP streams */
-void rtpstream_scan(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file)
+void rtpstream_scan(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file, const char *fstring)
{
gboolean was_registered;
@@ -74,7 +74,7 @@ void rtpstream_scan(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file)
was_registered = tapinfo->is_registered;
if (!tapinfo->is_registered)
- register_tap_listener_rtp_stream(tapinfo);
+ register_tap_listener_rtp_stream(tapinfo, fstring);
tapinfo->mode = TAP_ANALYSE;
cf_retap_packets(cap_file);
@@ -111,7 +111,7 @@ gboolean rtpstream_save(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file, rt
}
if (!tapinfo->is_registered)
- register_tap_listener_rtp_stream(tapinfo);
+ register_tap_listener_rtp_stream(tapinfo, NULL);
tapinfo->mode = TAP_SAVE;
tapinfo->filter_stream_fwd = stream;
@@ -163,7 +163,7 @@ void rtpstream_mark(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file, rtp_st
was_registered = tapinfo->is_registered;
if (!tapinfo->is_registered)
- register_tap_listener_rtp_stream(tapinfo);
+ register_tap_listener_rtp_stream(tapinfo, NULL);
tapinfo->mode = TAP_MARK;
tapinfo->filter_stream_fwd = stream_fwd;
@@ -193,7 +193,7 @@ remove_tap_listener_rtp_stream(rtpstream_tapinfo_t *tapinfo)
/****************************************************************************/
void
-register_tap_listener_rtp_stream(rtpstream_tapinfo_t *tapinfo)
+register_tap_listener_rtp_stream(rtpstream_tapinfo_t *tapinfo, const char *fstring)
{
GString *error_string;
@@ -203,7 +203,7 @@ register_tap_listener_rtp_stream(rtpstream_tapinfo_t *tapinfo)
if (!tapinfo->is_registered) {
error_string = register_tap_listener("rtp", tapinfo,
- NULL, 0, rtpstream_reset_cb, rtpstream_packet,
+ fstring, 0, rtpstream_reset_cb, rtpstream_packet,
rtpstream_draw);
if (error_string != NULL) {
diff --git a/ui/rtp_stream.h b/ui/rtp_stream.h
index 9c9b57c070..d7cef57158 100644
--- a/ui/rtp_stream.h
+++ b/ui/rtp_stream.h
@@ -137,7 +137,7 @@ struct _rtpstream_tapinfo {
* So whenever rtp_stream.c is added to the list of WIRESHARK_TAP_SRCs, the tap will be registered on startup.
* If not, it will be registered on demand by the rtp_streams and rtp_analysis functions that need it.
*/
-void register_tap_listener_rtp_stream(rtpstream_tapinfo_t *tapinfo);
+void register_tap_listener_rtp_stream(rtpstream_tapinfo_t *tapinfo, const char *fstring);
/**
* Removes the rtp_streams tap listener (if not already done)
@@ -154,7 +154,7 @@ void rtpstream_reset(rtpstream_tapinfo_t *tapinfo);
* Scans all packets for RTP streams and updates the RTP streams list.
* (redissects all packets)
*/
-void rtpstream_scan(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file);
+void rtpstream_scan(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file, const char *fstring);
/**
* Saves an RTP stream as raw data stream with timestamp information for later RTP playback.