Compare commits

...

5 Commits

Author SHA1 Message Date
Pau Espin 5438628f48 WIP RFC: disable handling SDP RTP if Osmux is announced in MGCP body
"X-Osmux: (*|<cid>)" is an Osmocom extension to MGCP which allows
to signal request and acceptance of use of Osmux framing instead of RTP.
It usually comes together with a regular SDP section which defines the
AMR data to be transported (in Osmux frames rather than RTP packets).
Hence, if Osmux is signalled, we want to avoid telling the RTP subsystem
to decode the recorded packets as RTP, which would then override the
default Osmux dissector.

TODO: find way to mark a packet_info as being "osmux" in packet-mgcp.c,
and use that information in packet-sdp.c to avoid adding the stream to
the RTP dissector.
2022-11-02 10:47:00 +01:00
Pascal Quantin a1c55f2356 GOOSE: add back goose.floating_point filter
Let's add it as a hidden filter for IEEE 754 single precision floating point

Closes #18491
2022-11-01 19:25:02 +00:00
Roland Knall fd7716542c Qt: Move generic methods to utils
Move the utils for checking for the last used directory and storing
it out of ProfileDialog, as they are not Profiles specific
2022-11-01 18:12:07 +00:00
Chuck Craft 91c0669fb7 Qt: KeyboardInputInterval - allow more relaxed typing for keyboardSearch
Gtk popped up a search box when typing in the tree view.
Most places in Qt, a Search: field was added to the dialog.
Looks possible to buffer keystrokes and do a string search in Qt.

Default value is 400ms (even on Windows). Average typing speed of
200 cpm = 300ms per character = too close to 400ms when searching
the protocol name in Preferences -> Protocols.
2022-11-01 17:39:16 +00:00
Chuck Craft 0bfa32ee6c wsdg: order Lua sections as a user may require them
Roughly follows order in previous chapter of examples.
2022-11-01 17:33:12 +00:00
11 changed files with 110 additions and 63 deletions

View File

@ -233,18 +233,18 @@ Trying to access a non-existing property, function or method currently gives an
error, but do not rely on it as the behavior may change in the future.
include::{build_dir}/wsluarm_src/wslua_dumper.adoc[]
include::{build_dir}/wsluarm_src/wslua_field.adoc[]
include::{build_dir}/wsluarm_src/wslua_utility.adoc[]
include::{build_dir}/wsluarm_src/wslua_gui.adoc[]
include::{build_dir}/wsluarm_src/wslua_listener.adoc[]
include::{build_dir}/wsluarm_src/wslua_pinfo.adoc[]
include::{build_dir}/wsluarm_src/wslua_proto.adoc[]
include::{build_dir}/wsluarm_src/wslua_tree.adoc[]
include::{build_dir}/wsluarm_src/wslua_field.adoc[]
include::{build_dir}/wsluarm_src/wslua_pinfo.adoc[]
include::{build_dir}/wsluarm_src/wslua_tvb.adoc[]
include::{build_dir}/wsluarm_src/wslua_tree.adoc[]
include::{build_dir}/wsluarm_src/wslua_listener.adoc[]
include::{build_dir}/wsluarm_src/wslua_dumper.adoc[]
include::{build_dir}/wsluarm_src/wslua_wtap.adoc[]
include::{build_dir}/wsluarm_src/wslua_file.adoc[]
include::{build_dir}/wsluarm_src/wslua_dir.adoc[]
include::{build_dir}/wsluarm_src/wslua_wtap.adoc[]
include::{build_dir}/wsluarm_src/wslua_utility.adoc[]
include::{build_dir}/wsluarm_src/wslua_int64.adoc[]
include::{build_dir}/wsluarm_src/wslua_struct.adoc[]

View File

@ -631,7 +631,7 @@ side is a tree where you can select the page to be shown.
image::wsug_graphics/ws-gui-preferences.png[{screenshot-attrs}]
Wireshark supports quite a few protocols, which is reflected in the long list of entries in the “Protocols” pane.
You can jump to the preferences for a specific protocol by expanding “Protocols” and quickly typing the first few letters of the protocol name.
You can jump to the preferences for a specific protocol by expanding “Protocols” and typing the first few letters of the protocol name.
The “Advanced” pane will let you view and edit all of Wiresharks preferences, similar to link:about:config[] and link:chrome:flags[] in the Firefox and Chrome web browsers.

View File

@ -68,12 +68,11 @@ GOOSEpdu
int len = tvb_reported_length_remaining(tvb, offset);
%(DEFAULT_BODY)s
if ((len == FLOAT_ENC_LENGTH) && (tvb_get_guint8(tvb,0) == SINGLE_FLOAT_EXP_BITS) ){
/* IEEE 754 single precision floating point */
proto_item_set_hidden(actx->created_item);
proto_tree_add_item(tree, hf_goose_float_value, tvb, 1, (FLOAT_ENC_LENGTH-1), ENC_BIG_ENDIAN);
offset = len;
}else{
%(DEFAULT_BODY)s
}
#.END

View File

@ -626,14 +626,13 @@ dissect_goose_FloatingPoint(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of
int len = tvb_reported_length_remaining(tvb, offset);
if ((len == FLOAT_ENC_LENGTH) && (tvb_get_guint8(tvb,0) == SINGLE_FLOAT_EXP_BITS) ){
/* IEEE 754 single precision floating point */
proto_tree_add_item(tree, hf_goose_float_value, tvb, 1, (FLOAT_ENC_LENGTH-1), ENC_BIG_ENDIAN);
offset = len;
}else{
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
NULL);
if ((len == FLOAT_ENC_LENGTH) && (tvb_get_guint8(tvb,0) == SINGLE_FLOAT_EXP_BITS) ){
/* IEEE 754 single precision floating point */
proto_item_set_hidden(actx->created_item);
proto_tree_add_item(tree, hf_goose_float_value, tvb, 1, (FLOAT_ENC_LENGTH-1), ENC_BIG_ENDIAN);
}

View File

@ -157,6 +157,7 @@ static int hf_mgcp_req_dup = -1;
static int hf_mgcp_req_dup_frame = -1;
static int hf_mgcp_rsp_dup = -1;
static int hf_mgcp_rsp_dup_frame = -1;
static int hf_mgcp_param_x_osmux = -1;
static int hf_mgcp_unknown_parameter = -1;
static int hf_mgcp_malformed_parameter = -1;
@ -882,25 +883,34 @@ static gint tvb_parse_param(tvbuff_t* tvb, gint offset, gint len, int** hf, mgcp
tvb_current_offset++;
/* Keep going, through possible vendor param name */
char ext_buf[256];
ext_buf[0] = '\0';
for (counter = 1;
((len > (counter + tvb_current_offset-offset)) &&
(g_ascii_isalpha(tempchar = tvb_get_guint8(tvb, tvb_current_offset+counter)) ||
g_ascii_isdigit(tempchar))) ;
counter++);
counter++) ext_buf[counter - 1] = g_ascii_toupper(tempchar);
if (tempchar == ':')
{
/* Looks like a valid vendor param name */
tvb_current_offset += counter;
ext_buf[counter - 1] = '\0';
fprintf(stderr, "MGCP Extension: %s\n", ext_buf);
switch (plus_minus)
{
case '+':
*hf = &hf_mgcp_param_extension_critical;
break;
case '-':
*hf = &hf_mgcp_param_extension;
if (strcmp(ext_buf, "OSMUX") == 0) {
fprintf(stderr, "MGCP Extension: is Osmux!!\n");
*hf = &hf_mgcp_param_x_osmux;
} else {
*hf = &hf_mgcp_param_extension;
}
break;
}
tvb_current_offset += counter;
}
}
break;
@ -1554,6 +1564,18 @@ static void dissect_mgcp_params(tvbuff_t *tvb, proto_tree *tree, mgcp_info_t* mi
dissect_mgcp_remotevoicemetrics(mgcp_param_tree, tvb, tvb_linebegin,
tvb_tokenbegin - tvb_linebegin, tokenlen);
}
/*
else
if (*my_param == hf_mgcp_param_x_osmux)
{
tokenlen = tvb_find_line_end(tvb, tvb_tokenbegin, -1, &tvb_lineend, FALSE);
proto_tree_add_string(mgcp_param_tree, *my_param, tvb,
tvb_linebegin, linelen,
tvb_format_text(wmem_packet_scope(), tvb, tvb_tokenbegin, tokenlen));
TODO: mark somewhere that Osmux is used, so that packet-sdp.c doesn't call srtp_add_address().
}
*/
else
{
tokenlen = tvb_find_line_end(tvb, tvb_tokenbegin, -1, &tvb_lineend, FALSE);
@ -2664,6 +2686,9 @@ void proto_register_mgcp(void)
{ &hf_mgcp_rsp_dup_frame,
{ "Original Response Frame", "mgcp.rsp.dup.frame", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
"Frame containing original response", HFILL }},
{ &hf_mgcp_param_x_osmux,
{ "Osmux", "mgcp.param.x_osmux", FT_STRING, BASE_NONE, NULL, 0x0,
"Osmux CID", HFILL }},
{ &hf_mgcp_unknown_parameter,
{ "Unknown parameter", "mgcp.unknown_parameter", FT_STRING, BASE_NONE, NULL, 0x0,
NULL, HFILL }},

View File

@ -2348,9 +2348,11 @@ apply_sdp_transport(packet_info *pinfo, transport_info_t *transport_info, int re
DPRINT(("calling rtp_add_address, channel=%d, media_port=%d",
i, media_desc->media_port));
DINDENT();
/* TODO: Here only call this if !osmux:
srtp_add_address(pinfo, PT_UDP, &media_desc->conn_addr, media_desc->media_port, 0, "SDP", establish_frame,
media_desc->media_types,
media_desc->media.rtp_dyn_payload, NULL, setup_info);
*/
DENDENT();
}
/* SPRT might use the same port... */
@ -2367,7 +2369,9 @@ apply_sdp_transport(packet_info *pinfo, transport_info_t *transport_info, int re
DPRINT(("calling rtcp_add_address, channel=%d, control_port=%d",
i, media_desc->control_port));
DINDENT();
/* TODO: Here only call this if !osmux:
rtcp_add_address(pinfo, &media_desc->conn_addr, media_desc->control_port, 0, "SDP", establish_frame);
*/
DENDENT();
}
}

View File

@ -651,6 +651,10 @@ int main(int argc, char *qt_argv[])
/* Create The Wireshark app */
WiresharkApplication ws_app(argc, qt_argv);
// Default value is 400ms = "quickly typing" when searching in Preferences->Protocols
// 1000ms allows a more "hunt/peck" typing speed. 2000ms tested - too long.
QApplication::setKeyboardInputInterval(1000);
/* initialize the funnel mini-api */
// xxx qtshark
//initialize_funnel_ops();

View File

@ -682,6 +682,8 @@ void ProfileDialog::finishImport(QFileInfo fi, int count, int skipped, QStringLi
if (skipped > 0)
msg.append(tr(", %Ln profile(s) skipped", "", skipped));
}
QMessageBox msgBox(icon, tr("Importing profiles"), msg, QMessageBox::Ok, this);
msgBox.exec();
storeLastDir(fi.absolutePath());
@ -695,50 +697,9 @@ void ProfileDialog::finishImport(QFileInfo fi, int count, int skipped, QStringLi
pd_ui_->profileTreeView->selectRow(idx.isValid() ? idx.row() : 0);
}
QMessageBox msgBox(icon, tr("Importing profiles"), msg, QMessageBox::Ok, this);
msgBox.exec();
updateWidgets();
}
QString ProfileDialog::lastOpenDir()
{
QString result;
switch (prefs.gui_fileopen_style) {
case FO_STYLE_LAST_OPENED:
/* The user has specified that we should start out in the last directory
we looked in. If we've already opened a file, use its containing
directory, if we could determine it, as the directory, otherwise
use the "last opened" directory saved in the preferences file if
there was one. */
/* This is now the default behaviour in file_selection_new() */
result = QString(get_last_open_dir());
break;
case FO_STYLE_SPECIFIED:
/* The user has specified that we should always start out in a
specified directory; if they've specified that directory,
start out by showing the files in that dir. */
if (prefs.gui_fileopen_dir[0] != '\0')
result = QString(prefs.gui_fileopen_dir);
break;
}
QDir ld(result);
if (ld.exists())
return result;
return QString();
}
void ProfileDialog::storeLastDir(QString dir)
{
if (mainApp && dir.length() > 0)
mainApp->setLastOpenDir(qUtf8Printable(dir));
}
void ProfileDialog::resetTreeView()
{
if (model_)

View File

@ -64,8 +64,6 @@ private:
void updateWidgets();
void resetTreeView();
QString lastOpenDir();
void storeLastDir(QString dir);
void finishImport(QFileInfo fi, int count, int skipped, QStringList import);
private slots:

View File

@ -17,12 +17,16 @@
#include <epan/range.h>
#include <epan/to_str.h>
#include <epan/value_string.h>
#include <epan/prefs.h>
#include <ui/recent.h>
#include <ui/last_open_dir.h>
#include "ui/ws_ui_util.h"
#include <wsutil/str_util.h>
#include <ui/qt/main_application.h>
#include <QAction>
#include <QApplication>
#include <QDateTime>
@ -295,3 +299,41 @@ QString make_filter_based_on_rtpstream_id(QVector<rtpstream_id_t *> stream_ids)
return filter;
}
QString lastOpenDir()
{
QString result;
switch (prefs.gui_fileopen_style) {
case FO_STYLE_LAST_OPENED:
/* The user has specified that we should start out in the last directory
we looked in. If we've already opened a file, use its containing
directory, if we could determine it, as the directory, otherwise
use the "last opened" directory saved in the preferences file if
there was one. */
/* This is now the default behaviour in file_selection_new() */
result = QString(get_last_open_dir());
break;
case FO_STYLE_SPECIFIED:
/* The user has specified that we should always start out in a
specified directory; if they've specified that directory,
start out by showing the files in that dir. */
if (prefs.gui_fileopen_dir[0] != '\0')
result = QString(prefs.gui_fileopen_dir);
break;
}
QDir ld(result);
if (ld.exists())
return result;
return QString();
}
void storeLastDir(QString dir)
{
if (mainApp && dir.length() > 0)
mainApp->setLastOpenDir(qUtf8Printable(dir));
}

View File

@ -253,6 +253,21 @@ void qvector_rtpstream_ids_free(QVector<rtpstream_id_t *> stream_ids);
*/
QString make_filter_based_on_rtpstream_id(QVector<rtpstream_id_t *> stream_ids);
/**
* @brief Return the last directory that had been opened.
*
* This can be influenced by prefs.gui_fileopen_style which will allow to either
* open the real last dir or have the user set one specifically.
*
* @return a reference to that directory.
*/
QString lastOpenDir();
/**
* @brief Store the directory as last directory being used
*/
void storeLastDir(QString dir);
#endif /* __QT_UI_UTILS__H__ */
// XXX Add a routine to fetch the HWND corresponding to a widget using QPlatformIntegration