1 /* scsi_service_response_time_dialog.cpp
3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 1998 Gerald Combs
7 * SPDX-License-Identifier: GPL-2.0-or-later
10 #include "scsi_service_response_time_dialog.h"
15 #include <epan/srt_table.h>
16 #include <epan/conversation.h>
17 #include <epan/dissectors/packet-scsi.h>
19 #include <ui/qt/utils/qt_ui_utils.h>
22 #include <QHBoxLayout>
25 ScsiServiceResponseTimeDialog::ScsiServiceResponseTimeDialog(QWidget
&parent
, CaptureFile
&cf
, struct register_srt
*srt
, const QString filter
) :
26 ServiceResponseTimeDialog(parent
, cf
, srt
, filter
)
28 setRetapOnShow(false);
29 setHint(tr("<small><i>Select a command and enter a filter if desired, then press Apply.</i></small>"));
31 QHBoxLayout
*filter_layout
= filterLayout();
32 command_combo_
= new QComboBox(this);
34 filter_layout
->insertStretch(0, 1);
35 filter_layout
->insertWidget(0, command_combo_
);
36 filter_layout
->insertWidget(0, new QLabel(tr("Command:")));
38 setWindowSubtitle(tr("SCSI Service Response Times"));
41 commands
<< "SBC (disk)" << "SSC (tape)" << "MMC (cd/dvd)" << "SMC (tape robot)" << "OSD (object based)";
42 command_combo_
->addItems(commands
);
45 TapParameterDialog
*ScsiServiceResponseTimeDialog::createScsiSrtDialog(QWidget
&parent
, const QString
, const QString opt_arg
, CaptureFile
&cf
)
48 bool have_args
= false;
51 // rpc,srt,scsi,command[,<filter>
52 QStringList args_l
= QString(opt_arg
).split(',');
53 if (args_l
.length() > 0) {
55 if (args_l
.length() > 1) {
56 filter
= QStringList(args_l
.mid(1)).join(",");
61 ScsiServiceResponseTimeDialog
*scsi_dlg
= new ScsiServiceResponseTimeDialog(parent
, cf
, get_srt_table_by_name("scsi"), filter
);
64 if (!command
.isEmpty()) {
65 scsi_dlg
->setScsiCommand(command
.toInt());
72 void ScsiServiceResponseTimeDialog::setScsiCommand(int command
)
74 command_combo_
->setCurrentIndex(command
);
78 void ScsiServiceResponseTimeDialog::provideParameterData()
83 command
= QStringLiteral(",%1").arg(command_combo_
->currentIndex());
85 scsistat_param(srt_
, command
.toStdString().c_str(), &err
);