aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/follow_stream_dialog.cpp
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2019-10-02 01:20:43 +0100
committerAnders Broman <a.broman58@gmail.com>2019-10-04 04:36:09 +0000
commitd2a660d805df50a2cbf92dc9e75114d5c05b616d (patch)
tree34f01db10cebeb8d25fe77537524633a68b440de /ui/qt/follow_stream_dialog.cpp
parent750ffac7b608838d61082826b99a3885919cfc24 (diff)
QUIC: Add Follow QUIC Stream support to Qt and tshark
The QUIC transport protocol provides a stream, similar to HTTP/2. Make it possible to look at the stream contents. This can be helpful while HTTP/3 support is not yet complete. Known issues that will be addressed in the future: - If a single packet contains multiple streams, then Follow QUIC Stream will wrongly include data from streams other than the selected one. This is tracked by bug 16093 and affects HTTP/2 as well. - The Substream index menu does not properly filter for available stream numbers. If a non-existing stream is selected, then changing to another (potentially valid) index results in the "Capture file invalid." error. As workaround, clear the display filter first. - Follow Stream always selects Stream ID 0 instead of the first or currently selected stream field in a packet. Users should manually update the stream index as needed. Change-Id: I5866be380d58c96f0a71a29abdbd1be20ae3534a Ping-Bug: 13881 Reviewed-on: https://code.wireshark.org/review/34694 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui/qt/follow_stream_dialog.cpp')
-rw-r--r--ui/qt/follow_stream_dialog.cpp45
1 files changed, 41 insertions, 4 deletions
diff --git a/ui/qt/follow_stream_dialog.cpp b/ui/qt/follow_stream_dialog.cpp
index c845830420..cf6e08e559 100644
--- a/ui/qt/follow_stream_dialog.cpp
+++ b/ui/qt/follow_stream_dialog.cpp
@@ -17,6 +17,7 @@
#include "epan/dissectors/packet-tcp.h"
#include "epan/dissectors/packet-udp.h"
#include "epan/dissectors/packet-http2.h"
+#include "epan/dissectors/packet-quic.h"
#include "epan/prefs.h"
#include "epan/addr_resolv.h"
#include "epan/charsets.h"
@@ -99,6 +100,9 @@ FollowStreamDialog::FollowStreamDialog(QWidget &parent, CaptureFile &cf, follow_
case FOLLOW_HTTP2:
follower_ = get_follow_by_name("HTTP2");
break;
+ case FOLLOW_QUIC:
+ follower_ = get_follow_by_name("QUIC");
+ break;
default :
g_assert_not_reached();
}
@@ -405,10 +409,18 @@ void FollowStreamDialog::on_subStreamNumberSpinBox_valueChanged(int sub_stream_n
// Stream ID 0 should always exist as it is used for control messages.
sub_stream_num_new = 0;
ok = TRUE;
- } else if (previous_sub_stream_num_ < sub_stream_num){
- ok = http2_get_stream_id_ge(static_cast<guint>(stream_num), sub_stream_num_new, &sub_stream_num_new);
+ } else if (follow_type_ == FOLLOW_HTTP2) {
+ if (previous_sub_stream_num_ < sub_stream_num){
+ ok = http2_get_stream_id_ge(static_cast<guint>(stream_num), sub_stream_num_new, &sub_stream_num_new);
+ } else {
+ ok = http2_get_stream_id_le(static_cast<guint>(stream_num), sub_stream_num_new, &sub_stream_num_new);
+ }
+ } else if (follow_type_ == FOLLOW_QUIC) {
+ // TODO clamp the stream IDs correctly for QUIC
+ ok = TRUE;
} else {
- ok = http2_get_stream_id_le(static_cast<guint>(stream_num), sub_stream_num_new, &sub_stream_num_new);
+ // Should not happen, this field is only visible for suitable protocols.
+ return;
}
sub_stream_num = static_cast<gint>(sub_stream_num_new);
@@ -502,6 +514,7 @@ FollowStreamDialog::readStream()
case FOLLOW_UDP :
case FOLLOW_HTTP :
case FOLLOW_HTTP2:
+ case FOLLOW_QUIC:
case FOLLOW_TLS :
ret = readFollowStream();
break;
@@ -891,7 +904,7 @@ bool FollowStreamDialog::follow(QString previous_filter, bool use_stream_index,
return false;
}
- /* disable substream spin box for all protocols except HTTP2 */
+ /* disable substream spin box for all protocols except HTTP2 and QUIC */
ui->subStreamNumberSpinBox->blockSignals(true);
ui->subStreamNumberSpinBox->setEnabled(false);
ui->subStreamNumberSpinBox->setValue(0);
@@ -951,6 +964,30 @@ bool FollowStreamDialog::follow(QString previous_filter, bool use_stream_index,
break;
}
+ case FOLLOW_QUIC:
+ {
+ int stream_count = get_quic_connections_count();
+ ui->streamNumberSpinBox->blockSignals(true);
+ ui->streamNumberSpinBox->setMaximum(stream_count-1);
+ ui->streamNumberSpinBox->setValue(stream_num);
+ ui->streamNumberSpinBox->blockSignals(false);
+ ui->streamNumberSpinBox->setToolTip(tr("%Ln total stream(s).", "", stream_count));
+ ui->streamNumberLabel->setToolTip(ui->streamNumberSpinBox->toolTip());
+
+ // TODO extract number of QUIC streams?
+ stream_count = G_MAXINT32;
+ ui->subStreamNumberSpinBox->blockSignals(true);
+ ui->subStreamNumberSpinBox->setEnabled(true);
+ ui->subStreamNumberSpinBox->setMaximum(stream_count);
+ ui->subStreamNumberSpinBox->setValue(sub_stream_num);
+ ui->subStreamNumberSpinBox->blockSignals(false);
+ ui->subStreamNumberSpinBox->setToolTip(tr("%Ln total sub stream(s).", "", stream_count));
+ ui->subStreamNumberSpinBox->setToolTip(ui->subStreamNumberSpinBox->toolTip());
+ ui->subStreamNumberSpinBox->setVisible(true);
+ ui->subStreamNumberLabel->setVisible(true);
+
+ break;
+ }
case FOLLOW_TLS:
case FOLLOW_HTTP:
/* No extra handling */