Add the RTP Stream Analysis dialog.

Combine the GTK+ RTP Stream Analysis and RTP Graph Analysis dialogs into
one. Yell at the user less. Disable the Analyze RTP Stream menu item if
we don't have an RTP stream selected.

There are a *lot* of moving parts in this dialog. I've tested with the
few RTP captures I have but it's by no means complete.

"To do" items are listed at the top of rtp_analysis.cpp.

Change-Id: Id503977f069bebc46cc68bc749f0c9cbf4d37bf6
Reviewed-on: https://code.wireshark.org/review/9650
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
This commit is contained in:
Gerald Combs 2015-02-02 09:01:29 -08:00
parent 2e215db532
commit d2acb04b4c
28 changed files with 2183 additions and 60 deletions

View File

@ -5417,7 +5417,8 @@ proto_get_protocol_filter_name(const int proto_id)
void
proto_get_frame_protocols(const wmem_list_t *layers, gboolean *is_ip,
gboolean *is_tcp, gboolean *is_udp,
gboolean *is_sctp, gboolean *is_ssl)
gboolean *is_sctp, gboolean *is_ssl,
gboolean *is_rtp)
{
wmem_list_frame_t *protos = wmem_list_head(layers);
int proto_id;
@ -5442,6 +5443,8 @@ proto_get_frame_protocols(const wmem_list_t *layers, gboolean *is_ip,
*is_sctp = TRUE;
} else if (is_ssl && !strcmp(proto_name, "ssl")) {
*is_ssl = TRUE;
} else if (is_rtp && !strcmp(proto_name, "rtp")) {
*is_rtp = TRUE;
}
protos = wmem_list_frame_next(protos);

View File

@ -2170,7 +2170,8 @@ WS_DLL_PUBLIC const char *proto_get_protocol_filter_name(const int proto_id);
* unchanged. May be NULL.
*/
WS_DLL_PUBLIC void proto_get_frame_protocols(const wmem_list_t *layers,
gboolean *is_ip, gboolean *is_tcp, gboolean *is_udp, gboolean *is_sctp, gboolean *is_ssl);
gboolean *is_ip, gboolean *is_tcp, gboolean *is_udp, gboolean *is_sctp,
gboolean *is_ssl, gboolean *is_rtp);
/** Find a protocol by name in a layer list.
* @param layers Protocol layer list

View File

@ -4573,7 +4573,7 @@ set_menus_for_selected_packet(capture_file *cf)
than one time reference frame or the current frame isn't a
time reference frame). (XXX - why check frame_selected?) */
if (cf->edt)
proto_get_frame_protocols(cf->edt->pi.layers, &is_ip, &is_tcp, &is_udp, &is_sctp, &is_ssl);
proto_get_frame_protocols(cf->edt->pi.layers, &is_ip, &is_tcp, &is_udp, &is_sctp, &is_ssl, NULL);
if (cf->edt && cf->edt->tree) {
GPtrArray *ga;

View File

@ -484,7 +484,7 @@ static int rtp_packet_save_payload(tap_rtp_save_info_t *saveinfo,
/****************************************************************************/
/* whenever a RTP packet is seen by the tap listener */
static int
static gboolean
rtp_packet(void *user_data_arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void *rtpinfo_arg)
{
user_data_t *user_data = (user_data_t *)user_data_arg;
@ -493,10 +493,10 @@ rtp_packet(void *user_data_arg, packet_info *pinfo, epan_dissect_t *edt _U_, con
/* we ignore packets that are not displayed */
if (pinfo->fd->flags.passed_dfilter == 0)
return 0;
return FALSE;
/* also ignore RTP Version != 2 */
else if (rtpinfo->info_version != 2)
return 0;
return FALSE;
/* is it the forward direction? */
else if (user_data->ssrc_fwd == rtpinfo->info_sync_src
&& (CMP_ADDRESS(&(user_data->src_fwd), &(pinfo->src)) == 0)
@ -548,7 +548,7 @@ rtp_packet(void *user_data_arg, packet_info *pinfo, epan_dissect_t *edt _U_, con
#endif
}
return 0;
return FALSE;
}
/*
@ -606,7 +606,7 @@ rtp_packet_add_info(GtkWidget *list, user_data_t * user_data,
g_snprintf(color_str, sizeof(color_str), "#ffffbfffbfff");
}
else if (statinfo->flags & STAT_FLAG_DUP_PKT) {
g_snprintf(status, sizeof(status), "Suspected duplicate(MAC address) only delta time calculated");
g_snprintf(status, sizeof(status), "Suspected duplicate (MAC address) only delta time calculated");
/* color = Yellow; */
g_snprintf(color_str, sizeof(color_str), "#ffffffff0000");
}
@ -3212,7 +3212,7 @@ draw_stat(user_data_t *user_data)
user_data->forward.statinfo.max_delta, user_data->forward.statinfo.max_nr,
user_data->forward.statinfo.max_jitter, user_data->forward.statinfo.mean_jitter,
user_data->forward.statinfo.max_skew,
f_expected, f_expected, f_lost, f_perc,
f_total_nr, f_expected, f_lost, f_perc,
user_data->forward.statinfo.sequence,
f_duration / 1000,
f_duration * (f_clock_drift - 1.0),
@ -3231,7 +3231,7 @@ draw_stat(user_data_t *user_data)
user_data->reversed.statinfo.max_delta, user_data->reversed.statinfo.max_nr,
user_data->reversed.statinfo.max_jitter, user_data->reversed.statinfo.mean_jitter,
user_data->reversed.statinfo.max_skew,
r_expected, r_expected, r_lost, r_perc,
r_total_nr, r_expected, r_lost, r_perc,
user_data->reversed.statinfo.sequence,
r_duration / 1000,
r_duration * (r_clock_drift - 1.0),
@ -3543,9 +3543,9 @@ create_rtp_dialog(user_data_t* user_data)
GtkWidget *player_bt;
#endif /* HAVE_LIBPORTAUDIO */
GtkWidget *graph_bt;
gchar label_forward[150];
gchar label_forward_tree[150];
gchar label_reverse[150];
gchar label_forward[200];
gchar label_forward_tree[200];
gchar label_reverse[200];
char *src_addr, *dst_addr;
window = dlg_window_new("Wireshark: RTP Stream Analysis"); /* transient_for top_level */
@ -3566,7 +3566,7 @@ create_rtp_dialog(user_data_t* user_data)
g_snprintf(label_forward_tree, sizeof(label_forward_tree),
"Analysing stream from %s port %u to %s port %u SSRC = 0x%X \n"
"Note many things affects the accurasy of the analysis, use with caution",
"Note many things affects the accuracy of the analysis, use with caution",
src_addr, user_data->port_src_fwd, dst_addr, user_data->port_dst_fwd, user_data->ssrc_fwd);
wmem_free(NULL, src_addr);
wmem_free(NULL, dst_addr);
@ -3575,7 +3575,7 @@ create_rtp_dialog(user_data_t* user_data)
dst_addr = (char*)address_to_display(NULL, &(user_data->dst_rev));
g_snprintf(label_reverse, sizeof(label_reverse),
"Analysing stream from %s port %u to %s port %u SSRC = 0x%X \n"
"Note many things affects the accurasy of the analysis, use with caution",
"Note many things affects the accuracy of the analysis, use with caution",
src_addr, user_data->port_src_rev, dst_addr, user_data->port_dst_rev, user_data->ssrc_rev);
wmem_free(NULL, src_addr);
wmem_free(NULL, dst_addr);
@ -3931,7 +3931,7 @@ rtp_analysis_cb(GtkAction *action _U_, gpointer user_data _U_)
guint32 ssrc_rev = 0;
unsigned int version_fwd;
gchar filter_text[256];
const gchar *filter_text = "rtp && rtp.version && rtp.ssrc && (ip || ipv6)";
dfilter_t *sfcode;
gchar *err_msg;
capture_file *cf;
@ -3943,7 +3943,6 @@ rtp_analysis_cb(GtkAction *action _U_, gpointer user_data _U_)
rtp_stream_info_t *strinfo;
/* Try to compile the filter. */
g_strlcpy(filter_text, "rtp && rtp.version && rtp.ssrc && (ip || ipv6)", sizeof(filter_text));
if (!dfilter_compile(filter_text, &sfcode, &err_msg)) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_msg);
g_free(err_msg);

View File

@ -99,6 +99,7 @@ set(WIRESHARK_QT_HEADERS
related_packet_delegate.h
resolved_addresses_dialog.h
response_time_delay_dialog.h
rtp_analysis_dialog.h
rtp_stream_dialog.h
sctp_all_assocs_dialog.h
sctp_assoc_analyse_dialog.h
@ -225,6 +226,7 @@ set(WIRESHARK_QT_SRC
related_packet_delegate.cpp
resolved_addresses_dialog.cpp
response_time_delay_dialog.cpp
rtp_analysis_dialog.cpp
rtp_stream_dialog.cpp
sctp_all_assocs_dialog.cpp
sctp_assoc_analyse_dialog.cpp
@ -329,6 +331,7 @@ set(WIRESHARK_QT_UI
profile_dialog.ui
protocol_hierarchy_dialog.ui
resolved_addresses_dialog.ui
rtp_analysis_dialog.ui
rtp_stream_dialog.ui
sctp_all_assocs_dialog.ui
sctp_assoc_analyse_dialog.ui

View File

@ -216,6 +216,10 @@ preferences_dialog.$(OBJEXT): ui_preferences_dialog.h
print_dialog.$(OBJEXT): ui_print_dialog.h
rtp_analysis_dialog.$(OBJEXT): ui_rtp_analysis_dialog.h
rtp_stream_dialog.$(OBJEXT): ui_rtp_stream_dialog.h
profile_dialog.$(OBJEXT): ui_profile_dialog.h
protocol_hierarchy_dialog.$(OBJEXT): ui_protocol_hierarchy_dialog.h

View File

@ -77,6 +77,7 @@ NODIST_GENERATED_HEADER_FILES = \
ui_remote_capture_dialog.h \
ui_remote_settings_dialog.h \
ui_resolved_addresses_dialog.h \
ui_rtp_analysis_dialog.h \
ui_rtp_stream_dialog.h \
ui_sctp_all_assocs_dialog.h \
ui_sctp_assoc_analyse_dialog.h \
@ -210,6 +211,7 @@ MOC_HDRS = \
resolved_addresses_dialog.h \
response_time_delay_dialog.h \
search_frame.h \
rtp_analysis_dialog.h \
rtp_stream_dialog.h \
sctp_all_assocs_dialog.h \
sctp_assoc_analyse_dialog.h \
@ -289,6 +291,7 @@ UI_FILES = \
remote_capture_dialog.ui \
remote_settings_dialog.ui \
resolved_addresses_dialog.ui \
rtp_analysis_dialog.ui \
rtp_stream_dialog.ui \
sctp_all_assocs_dialog.ui \
sctp_assoc_analyse_dialog.ui \
@ -440,6 +443,7 @@ WIRESHARK_QT_SRC = \
remote_settings_dialog.cpp \
resolved_addresses_dialog.cpp \
response_time_delay_dialog.cpp \
rtp_analysis_dialog.cpp \
rtp_stream_dialog.cpp \
sctp_all_assocs_dialog.cpp \
sctp_assoc_analyse_dialog.cpp \

View File

@ -253,6 +253,7 @@ FORMS += \
remote_capture_dialog.ui \
remote_settings_dialog.ui \
resolved_addresses_dialog.ui \
rtp_analysis_dialog.ui \
rtp_stream_dialog.ui \
sctp_all_assocs_dialog.ui \
sctp_assoc_analyse_dialog.ui \
@ -325,6 +326,7 @@ HEADERS += $$HEADERS_WS_C \
remote_capture_dialog.h \
remote_settings_dialog.h \
resolved_addresses_dialog.h \
rtp_analysis_dialog.h \
rtp_stream_dialog.h \
sctp_all_assocs_dialog.h \
sctp_assoc_analyse_dialog.h \
@ -712,6 +714,7 @@ SOURCES += \
remote_settings_dialog.cpp \
response_time_delay_dialog.cpp \
resolved_addresses_dialog.cpp \
rtp_analysis_dialog.cpp \
rtp_stream_dialog.cpp \
sctp_all_assocs_dialog.cpp \
sctp_assoc_analyse_dialog.cpp \

View File

@ -19,9 +19,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "color_utils.h"
#include "tango_colors.h"
/*
* Initialize a color with R, G, and B values, including any toolkit-dependent
@ -53,6 +53,24 @@ const QColor ColorUtils::expert_color_error = QColor ( 0xff, 0x5c, 0x5c );
const QColor ColorUtils::expert_color_foreground = QColor ( 0x00, 0x00, 0x00 ); /* Black */
const QColor ColorUtils::hidden_proto_item = QColor ( 0x44, 0x44, 0x44 ); /* Gray */
// Available colors
// XXX - Add custom
const QList<QRgb> ColorUtils::graph_colors_ = QList<QRgb>()
<< tango_aluminium_6 // Bar outline (use black instead)?
<< tango_sky_blue_5
<< tango_butter_6
<< tango_chameleon_5
<< tango_scarlet_red_5
<< tango_plum_5
<< tango_orange_6
<< tango_aluminium_3
<< tango_sky_blue_3
<< tango_butter_3
<< tango_chameleon_3
<< tango_scarlet_red_3
<< tango_plum_3
<< tango_orange_3;
ColorUtils::ColorUtils(QObject *parent) :
QObject(parent)
{

View File

@ -53,6 +53,7 @@ public:
static const QColor expert_color_foreground; /* black */
static const QColor hidden_proto_item; /* gray */
static const QList<QRgb> graph_colors_;
signals:
public slots:

View File

@ -855,7 +855,7 @@ bool FollowStreamDialog::follow(QString previous_filter, bool use_stream_index)
return false;
}
proto_get_frame_protocols(cap_file_.capFile()->edt->pi.layers, NULL, &is_tcp, &is_udp, NULL, NULL);
proto_get_frame_protocols(cap_file_.capFile()->edt->pi.layers, NULL, &is_tcp, &is_udp, NULL, NULL, NULL);
switch (follow_type_)
{

View File

@ -31,8 +31,8 @@
#include "ui/utf8_entities.h"
#include "qt_ui_utils.h"
#include "tango_colors.h"
#include "color_utils.h"
#include "qcustomplot.h"
#include "stock_icon.h"
#include "syntax_line_edit.h"
@ -78,21 +78,7 @@ const int num_cols_ = 7;
// Available colors
// XXX - Add custom
QList<QRgb> colors_ = QList<QRgb>()
<< tango_aluminium_6 // Bar outline (use black instead)?
<< tango_sky_blue_5
<< tango_butter_6
<< tango_chameleon_5
<< tango_scarlet_red_5
<< tango_plum_5
<< tango_orange_6
<< tango_aluminium_3
<< tango_sky_blue_3
<< tango_butter_3
<< tango_chameleon_3
<< tango_scarlet_red_3
<< tango_plum_3
<< tango_orange_3;
QList<QRgb> colors_ = ColorUtils::graph_colors_;
const qreal graph_line_width_ = 1.0;

View File

@ -1798,7 +1798,7 @@ void MainWindow::setMenusForFollowStream()
main_ui_->actionAnalyzeFollowUDPStream->setEnabled(false);
main_ui_->actionAnalyzeFollowSSLStream->setEnabled(false);
proto_get_frame_protocols(capture_file_.capFile()->edt->pi.layers, NULL, &is_tcp, &is_udp, NULL, NULL);
proto_get_frame_protocols(capture_file_.capFile()->edt->pi.layers, NULL, &is_tcp, &is_udp, NULL, NULL, NULL);
if (is_tcp)
{

View File

@ -511,6 +511,7 @@ private slots:
void on_actionTelephonyVoipCalls_triggered();
void on_actionTelephonyISUPMessages_triggered();
void on_actionTelephonyRTPStreams_triggered();
void on_actionTelephonyRTPStreamAnalysis_triggered();
void on_actionTelephonyRTSPPacketCounter_triggered();
void on_actionTelephonySMPPOperations_triggered();
void on_actionTelephonyUCPMessages_triggered();

View File

@ -500,6 +500,7 @@
<string>RTP</string>
</property>
<addaction name="actionTelephonyRTPStreams"/>
<addaction name="actionTelephonyRTPStreamAnalysis"/>
</widget>
<widget class="QMenu" name="menuANSI">
<property name="title">
@ -2535,6 +2536,14 @@
<string>Ctrl+Space</string>
</property>
</action>
<action name="actionTelephonyRTPStreamAnalysis">
<property name="text">
<string>Analyze RTP Stream</string>
</property>
<property name="toolTip">
<string>RTP Stream Analysis</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>

View File

@ -107,6 +107,7 @@
#include "qt_ui_utils.h"
#include "resolved_addresses_dialog.h"
#include "rtp_stream_dialog.h"
#include "rtp_analysis_dialog.h"
#include "sctp_all_assocs_dialog.h"
#include "sctp_assoc_analyse_dialog.h"
#include "sctp_graph_dialog.h"
@ -956,7 +957,7 @@ void MainWindow::recentActionTriggered() {
void MainWindow::setMenusForSelectedPacket()
{
// gboolean is_ip = FALSE, is_tcp = FALSE, is_udp = FALSE, is_sctp = FALSE, is_ssl = FALSE;
gboolean is_tcp = FALSE, is_sctp = FALSE;
gboolean is_tcp = FALSE, is_sctp = FALSE, is_rtp = FALSE;
// /* Making the menu context-sensitive allows for easier selection of the
// desired item and has the added benefit, with large captures, of
@ -999,7 +1000,7 @@ void MainWindow::setMenusForSelectedPacket()
if (capture_file_.capFile()->edt)
{
proto_get_frame_protocols(capture_file_.capFile()->edt->pi.layers, NULL, &is_tcp, NULL, &is_sctp, NULL);
proto_get_frame_protocols(capture_file_.capFile()->edt->pi.layers, NULL, &is_tcp, NULL, &is_sctp, NULL, &is_rtp);
}
}
// if (cfile.edt && cfile.edt->tree) {
@ -1160,6 +1161,7 @@ void MainWindow::setMenusForSelectedPacket()
main_ui_->actionSCTPAnalyseThisAssociation->setEnabled(is_sctp);
main_ui_->actionSCTPShowAllAssociations->setEnabled(is_sctp);
main_ui_->actionSCTPFilterThisAssociation->setEnabled(is_sctp);
main_ui_->actionTelephonyRTPStreamAnalysis->setEnabled(is_rtp);
// while (list_entry != NULL) {
// dissector_filter_t *filter_entry;
@ -2907,6 +2909,14 @@ void MainWindow::on_actionTelephonyRTPStreams_triggered()
rtp_stream_dialog->show();
}
void MainWindow::on_actionTelephonyRTPStreamAnalysis_triggered()
{
RtpAnalysisDialog *rtp_analysis_dialog = new RtpAnalysisDialog(*this, capture_file_);
connect(rtp_analysis_dialog, SIGNAL(goToPacket(int)),
packet_list_, SLOT(goToPacket(int)));
rtp_analysis_dialog->show();
}
void MainWindow::on_actionTelephonyRTSPPacketCounter_triggered()
{
openStatisticsTreeDialog("rtsp");

View File

@ -506,7 +506,7 @@ void PacketList::contextMenuEvent(QContextMenuEvent *event)
/* walk the list of a available protocols in the packet to see what we have */
if (cap_file_ != NULL && cap_file_->edt != NULL)
proto_get_frame_protocols(cap_file_->edt->pi.layers, NULL, &is_tcp, &is_udp, &is_sctp, NULL);
proto_get_frame_protocols(cap_file_->edt->pi.layers, NULL, &is_tcp, &is_udp, &is_sctp, NULL, NULL);
QMenu *main_conv_menu = window()->findChild<QMenu *>("menuConversationFilter");
conv_menu_.clear();

View File

@ -66,13 +66,15 @@ QByteArray gstring_free_to_qbytearray(GString *glib_gstring)
return qt_ba;
}
const QString address_to_qstring(const _address *address)
const QString address_to_qstring(const _address *address, bool enclose)
{
QString address_qstr = QString();
if (address) {
if (enclose && address->type == AT_IPv6) address_qstr += "[";
gchar *address_gchar_p = address_to_str(NULL, address);
address_qstr = address_gchar_p;
address_qstr += address_gchar_p;
wmem_free(NULL, address_gchar_p);
if (enclose && address->type == AT_IPv6) address_qstr += "]";
}
return address_qstr;
}

View File

@ -82,10 +82,11 @@ QByteArray gstring_free_to_qbytearray(GString *glib_gstring);
/** Convert an address to a QString using address_to_str().
*
* @param address A pointer to an address.
* @param enclose Enclose IPv6 addresses in square brackets.
*
* @return A QString representation of the address. May be the null string (QString())
*/
const QString address_to_qstring(const struct _address *address);
const QString address_to_qstring(const struct _address *address, bool enclose = false);
/** Convert an address to a QString using address_to_display().
*

File diff suppressed because it is too large Load Diff

156
ui/qt/rtp_analysis_dialog.h Normal file
View File

@ -0,0 +1,156 @@
/* rtp_analysis_dialog.h
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef RTP_ANALYSIS_DIALOG_H
#define RTP_ANALYSIS_DIALOG_H
#include <config.h>
#include <glib.h>
#include "epan/address.h"
#include "ui/rtp_analysis.h"
#include "ui/rtp_stream.h"
#include <QAbstractButton>
#include <QMenu>
#include "wireshark_dialog.h"
namespace Ui {
class RtpAnalysisDialog;
}
class QCPGraph;
class QTemporaryFile;
class RtpAnalysisDialog : public WiresharkDialog
{
Q_OBJECT
public:
explicit RtpAnalysisDialog(QWidget &parent, CaptureFile &cf);
~RtpAnalysisDialog();
signals:
void goToPacket(int packet_num);
protected:
virtual void reject();
protected slots:
virtual void updateWidgets();
private slots:
void on_actionGoToPacket_triggered();
void on_actionNextProblem_triggered();
void on_fJitterCheckBox_toggled(bool checked);
void on_fDiffCheckBox_toggled(bool checked);
void on_fDeltaCheckBox_toggled(bool checked);
void on_rJitterCheckBox_toggled(bool checked);
void on_rDiffCheckBox_toggled(bool checked);
void on_rDeltaCheckBox_toggled(bool checked);
void on_actionSaveAudio_triggered();
void on_actionSaveForwardAudio_triggered();
void on_actionSaveReverseAudio_triggered();
void on_actionSaveCsv_triggered();
void on_actionSaveForwardCsv_triggered();
void on_actionSaveReverseCsv_triggered();
void on_actionSaveGraph_triggered();
void on_buttonBox_helpRequested();
void showStreamMenu(QPoint pos);
void graphClicked(QMouseEvent *event);
private:
Ui::RtpAnalysisDialog *ui;
enum StreamDirection { dir_both_, dir_forward_, dir_reverse_ };
address src_fwd_;
guint32 port_src_fwd_;
address dst_fwd_;
guint32 port_dst_fwd_;
guint32 ssrc_fwd_;
address src_rev_;
guint32 port_src_rev_;
address dst_rev_;
guint32 port_dst_rev_;
guint32 ssrc_rev_;
int num_streams_;
tap_rtp_stat_t fwd_statinfo_;
tap_rtp_stat_t rev_statinfo_;
QTemporaryFile *fwd_tempfile_;
QTemporaryFile *rev_tempfile_;
// Graph data for QCustomPlot
QList<QCPGraph *>graphs_;
QVector<double> fwd_time_vals_;
QVector<double> fwd_jitter_vals_;
QVector<double> fwd_diff_vals_;
QVector<double> fwd_delta_vals_;
QVector<double> rev_time_vals_;
QVector<double> rev_jitter_vals_;
QVector<double> rev_diff_vals_;
QVector<double> rev_delta_vals_;
rtpstream_tapinfo_t tapinfo_;
QString err_str_;
QMenu stream_ctx_menu_;
QMenu graph_ctx_menu_;
// Tap callbacks
static void tapReset(void *tapinfo_ptr);
static gboolean tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *rtpinfo_ptr);
static void tapDraw(void *tapinfo_ptr);
void resetStatistics();
void addPacket(bool forward, packet_info *pinfo, const struct _rtp_info *rtpinfo);
void savePayload(QTemporaryFile *tmpfile, tap_rtp_stat_t *statinfo, packet_info *pinfo, const struct _rtp_info *rtpinfo);
void updateStatistics();
void updateGraph();
void saveAudio(StreamDirection direction);
void saveCsv(StreamDirection direction);
guint32 processNode(proto_node *ptree_node, header_field_info *hfinformation, const gchar* proto_field, bool *ok);
guint32 getIntFromProtoTree(proto_tree *protocol_tree, const gchar *proto_name, const gchar *proto_field, bool *ok);
bool eventFilter(QObject*, QEvent* event);
};
#endif // RTP_ANALYSIS_DIALOG_H
/*
* Editor modelines
*
* Local Variables:
* c-basic-offset: 4
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=4 tabstop=8 expandtab:
* :indentSize=4:tabSize=8:noTabs=true:
*/

View File

@ -0,0 +1,346 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>RtpAnalysisDialog</class>
<widget class="QDialog" name="RtpAnalysisDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>650</width>
<height>475</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="statisticsLabel">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;Forward&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;Reverse&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QTreeWidget" name="forwardTreeWidget">
<property name="rootIsDecorated">
<bool>false</bool>
</property>
<property name="itemsExpandable">
<bool>false</bool>
</property>
<property name="expandsOnDoubleClick">
<bool>false</bool>
</property>
<attribute name="title">
<string>Forward</string>
</attribute>
<column>
<property name="text">
<string>Packet</string>
</property>
</column>
<column>
<property name="text">
<string>Sequence</string>
</property>
</column>
<column>
<property name="text">
<string>Delta (ms)</string>
</property>
</column>
<column>
<property name="text">
<string>Jitter</string>
</property>
</column>
<column>
<property name="text">
<string>Skew</string>
</property>
</column>
<column>
<property name="text">
<string>Bandwidth</string>
</property>
</column>
<column>
<property name="text">
<string>Marker</string>
</property>
</column>
<column>
<property name="text">
<string>Status</string>
</property>
</column>
</widget>
<widget class="QTreeWidget" name="reverseTreeWidget">
<property name="rootIsDecorated">
<bool>false</bool>
</property>
<property name="itemsExpandable">
<bool>false</bool>
</property>
<attribute name="title">
<string>Reverse</string>
</attribute>
<column>
<property name="text">
<string notr="true">1</string>
</property>
</column>
</widget>
<widget class="QWidget" name="graphTab">
<attribute name="title">
<string>Graph</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="1,0,0">
<item>
<widget class="QCustomPlot" name="streamGraph" native="true"/>
</item>
<item>
<layout class="QHBoxLayout" name="forwardHorizontalLayout">
<item>
<widget class="QCheckBox" name="fJitterCheckBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Show or hide forward jitter values.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Forward Jitter</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="fDiffCheckBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Show or hide forward difference values.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Forward Difference</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="fDeltaCheckBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Show or hide forward delta values.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Forward Delta</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="reverseHorizontalLayout">
<item>
<widget class="QCheckBox" name="rJitterCheckBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Show or hide reverse jitter values.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Reverse Jitter</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="rDiffCheckBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Show or hide reverse difference values.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Reverse Difference</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="rDeltaCheckBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Show or hide reverse delta values.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Reverse Delta</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="hintLabel">
<property name="text">
<string>&lt;small&gt;&lt;i&gt;A hint.&lt;/i&gt;&lt;/small&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Close|QDialogButtonBox::Help|QDialogButtonBox::Save</set>
</property>
</widget>
</item>
</layout>
<action name="actionSaveAudio">
<property name="text">
<string>Audio</string>
</property>
<property name="toolTip">
<string>Save the audio data for both channels.</string>
</property>
</action>
<action name="actionSaveForwardAudio">
<property name="text">
<string>Forward Stream Audio</string>
</property>
<property name="toolTip">
<string>Save the forward stream audio data.</string>
</property>
</action>
<action name="actionSaveReverseAudio">
<property name="text">
<string>Reverse Stream Audio</string>
</property>
<property name="toolTip">
<string>Save the reverse stream audio data.</string>
</property>
</action>
<action name="actionSaveCsv">
<property name="text">
<string>CSV</string>
</property>
<property name="toolTip">
<string>Save both tables as CSV.</string>
</property>
</action>
<action name="actionSaveForwardCsv">
<property name="text">
<string>Forward Stream CSV</string>
</property>
<property name="toolTip">
<string>Save the forward table as CSV.</string>
</property>
</action>
<action name="actionSaveReverseCsv">
<property name="text">
<string>Reverse Stream CSV</string>
</property>
<property name="toolTip">
<string>Save the reverse table as CSV.</string>
</property>
</action>
<action name="actionSaveGraph">
<property name="text">
<string>Save Graph</string>
</property>
<property name="toolTip">
<string>Save the graph image.</string>
</property>
</action>
<action name="actionGoToPacket">
<property name="text">
<string>Go to Packet</string>
</property>
<property name="toolTip">
<string>Select the corresponding packet in the packet list.</string>
</property>
<property name="shortcut">
<string>G</string>
</property>
</action>
<action name="actionNextProblem">
<property name="text">
<string>Next Problem Packet</string>
</property>
<property name="toolTip">
<string>Go to the next problem packet</string>
</property>
<property name="shortcut">
<string>N</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
<class>QCustomPlot</class>
<extends>QWidget</extends>
<header>qcustomplot.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>RtpAnalysisDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>RtpAnalysisDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@ -316,7 +316,7 @@ bool RtpStreamDialog::eventFilter(QObject *, QEvent *event)
void RtpStreamDialog::tapDraw(rtpstream_tapinfo_t *tapinfo)
{
RtpStreamDialog *rtp_stream_dialog = static_cast<RtpStreamDialog *>(tapinfo->tap_data);
RtpStreamDialog *rtp_stream_dialog = dynamic_cast<RtpStreamDialog *>((RtpStreamDialog *)tapinfo->tap_data);
if (rtp_stream_dialog) {
rtp_stream_dialog->updateStreams();
}
@ -326,9 +326,8 @@ void RtpStreamDialog::tapMarkPacket(rtpstream_tapinfo_t *tapinfo, frame_data *fd
{
if (!tapinfo) return;
RtpStreamDialog *rtp_stream_dialog = static_cast<RtpStreamDialog *>(tapinfo->tap_data);
RtpStreamDialog *rtp_stream_dialog = dynamic_cast<RtpStreamDialog *>((RtpStreamDialog *)tapinfo->tap_data);
if (rtp_stream_dialog) {
rtp_stream_dialog->need_redraw_ = true;
cf_mark_frame(rtp_stream_dialog->cap_file_.capFile(), fd);
rtp_stream_dialog->need_redraw_ = true;
}

View File

@ -92,7 +92,7 @@ void SyntaxLineEdit::setSyntaxState(SyntaxState state) {
.arg("palette(text)") // Foreground
.arg(ColorUtils::fromColorT(&prefs.gui_text_valid).name()) // Valid
.arg(ColorUtils::fromColorT(&prefs.gui_text_invalid).name()) // Invalid
.arg(ColorUtils::fromColorT(&prefs.gui_text_deprecated).name()) // VDeprecated
.arg(ColorUtils::fromColorT(&prefs.gui_text_deprecated).name()) // Deprecated
;
setStyleSheet(style_sheet_);
}

View File

@ -39,6 +39,10 @@
* @todo what's this?
*/
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
void rtp_analysis(
address *ip_src_fwd,
guint32 port_src_fwd,
@ -88,7 +92,7 @@ typedef struct _tap_rtp_stat_t {
double sumt2;
double sumtTS;
double time; /**< Unit is ms */
double start_time;
double start_time; /**< Unit is ms */
double lastnominaltime;
double max_delta;
double max_jitter;
@ -127,6 +131,10 @@ extern int rtp_packet_analyse(tap_rtp_stat_t *statinfo,
packet_info *pinfo,
const struct _rtp_info *rtpinfo);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __RTP_ANALYSIS_H__ */
/*

View File

@ -4,7 +4,7 @@
* Copyright 2008, Ericsson AB
* By Balint Reczey <balint.reczey@ericsson.com>
*
* most functions are copied from ui/gtk/rtp_stream.c and ui/gtk/rtp_analisys.c
* most functions are copied from ui/gtk/rtp_stream.c and ui/gtk/rtp_analysis.c
* Copyright 2003, Alcatel Business Systems
* By Lars Ruoff <lars.ruoff@gmx.net>
*

View File

@ -27,14 +27,42 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef TAP_RTP_COMMON_H_INCLUDED
#define TAP_RTP_COMMON_H_INCLUDED
#ifndef __TAP_RTP_COMMON_H__
#define __TAP_RTP_COMMON_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* type of error when saving voice in a file didn't succeed */
typedef enum {
TAP_RTP_WRONG_CODEC,
TAP_RTP_WRONG_LENGTH,
TAP_RTP_PADDING_ERROR,
TAP_RTP_SHORT_FRAME,
TAP_RTP_FILE_OPEN_ERROR,
TAP_RTP_FILE_WRITE_ERROR,
TAP_RTP_NO_DATA
} error_type_t;
typedef struct _tap_rtp_save_info_t {
FILE *fp;
guint32 count;
error_type_t error_type;
gboolean saved;
} tap_rtp_save_info_t;
struct _rtp_stream_info;
void rtpstream_reset_cb(void*);
void rtp_write_header(rtp_stream_info_t*, FILE*);
void rtp_write_header(struct _rtp_stream_info*, FILE*);
int rtpstream_packet(void*, packet_info*, epan_dissect_t *, const void *);
#endif /*TAP_RTP_COMMON_H_INCLUDED*/
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __TAP_RTP_COMMON_H__ */
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html

View File

@ -31,16 +31,19 @@
* and other places
*/
#define UTF8_MIDDLE_DOT "\xc2\xb7" /* 183 / 0xb7 */
#define UTF8_MIDDLE_DOT "\xc2\xb7" /* 183 / 0xb7 */
#define UTF8_BULLET "\xe2\x80\xa2" /* 8226 / 0x2024 */
#define UTF8_EM_DASH "\xe2\x80\x94" /* 8212 / 0x2014 */
#define UTF8_HORIZONTAL_ELLIPSIS "\xe2\x80\xa6" /* 8230 / 0x2026 */
#define UTF8_LEFTWARDS_ARROW "\xe2\x86\x90" /* 8592 / 0x2190 */
#define UTF8_RIGHTWARDS_ARROW "\xe2\x86\x92" /* 8594 / 0x2192 */
#define UTF8_LEFT_RIGHT_ARROW "\xe2\x86\x94" /* 8596 / 0x2194 */
#define UTF8_BULLET "\xe2\x80\xa2" /* 8226 / 0x2024 */
#define UTF8_EM_DASH "\xe2\x80\x94" /* 8212 / 0x2014 */
#define UTF8_HORIZONTAL_ELLIPSIS "\xe2\x80\xa6" /* 8230 / 0x2026 */
#define UTF8_LEFTWARDS_ARROW "\xe2\x86\x90" /* 8592 / 0x2190 */
#define UTF8_RIGHTWARDS_ARROW "\xe2\x86\x92" /* 8594 / 0x2192 */
#define UTF8_LEFT_RIGHT_ARROW "\xe2\x86\x94" /* 8596 / 0x2194 */
#define UTF8_PLACE_OF_INTEREST_SIGN "\xe2\x8c\x98" /* 8984 / 0x2318 */
#define UTF8_PLACE_OF_INTEREST_SIGN "\xe2\x8c\x98" /* 8984 / 0x2318 */
#define UTF8_CHECK_MARK "\xe2\x9c\x93" /* 10003 / 0x2713 */
#define UTF8_BALLOT_X "\xe2\x9c\x97" /* 10007 / 0x2717 */
#endif /* __UTF8_ENTITIES_H__ */
/*