Kerberos: add kerberos_inject_longterm_key() helper function
[wireshark-sm.git] / ui / qt / scsi_service_response_time_dialog.cpp
blob117c1a17a49b0b9655ad301874a58ed05a46febe
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
8 */
10 #include "scsi_service_response_time_dialog.h"
12 #include <algorithm>
13 #include <stdio.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>
21 #include <QComboBox>
22 #include <QHBoxLayout>
23 #include <QLabel>
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"));
40 QStringList commands;
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)
47 QString filter;
48 bool have_args = false;
49 QString command;
51 // rpc,srt,scsi,command[,<filter>
52 QStringList args_l = QString(opt_arg).split(',');
53 if (args_l.length() > 0) {
54 command = args_l[0];
55 if (args_l.length() > 1) {
56 filter = QStringList(args_l.mid(1)).join(",");
58 have_args = true;
61 ScsiServiceResponseTimeDialog *scsi_dlg = new ScsiServiceResponseTimeDialog(parent, cf, get_srt_table_by_name("scsi"), filter);
63 if (have_args) {
64 if (!command.isEmpty()) {
65 scsi_dlg->setScsiCommand(command.toInt());
69 return scsi_dlg;
72 void ScsiServiceResponseTimeDialog::setScsiCommand(int command)
74 command_combo_->setCurrentIndex(command);
75 fillTree();
78 void ScsiServiceResponseTimeDialog::provideParameterData()
80 char* err;
81 QString command;
83 command = QStringLiteral(",%1").arg(command_combo_->currentIndex());
85 scsistat_param(srt_, command.toStdString().c_str(), &err);