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>
This commit is contained in:
Michael Mann 2015-05-14 22:53:16 -04:00 committed by Anders Broman
parent 713ed3f817
commit feb47cf936
6 changed files with 16 additions and 14 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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();
}

View File

@ -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) {

View File

@ -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.