1 /* strip_headers_dialog.cpp
2 * Dialog for stripping lower level protocols and outputting protocols
3 * with a native encapsulation to file
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
14 #include "strip_headers_dialog.h"
15 #include <ui_strip_headers_dialog.h>
18 #include <epan/exported_pdu.h>
20 #include "ui/export_pdu_ui_utils.h"
21 #include "ui/capture_globals.h"
23 #include "main_application.h"
25 StripHeadersDialog::StripHeadersDialog(QWidget
*parent
) :
27 ui(new Ui::StripHeadersDialog
)
29 GSList
*tap_name_list
;
33 setWindowTitle(mainApp
->windowTitleString(tr("Strip Headers")));
35 for (tap_name_list
= get_export_pdu_tap_list(); tap_name_list
; tap_name_list
= g_slist_next(tap_name_list
)) {
36 if (export_pdu_tap_get_encap((const char*)tap_name_list
->data
) != WTAP_ENCAP_WIRESHARK_UPPER_PDU
) {
37 ui
->comboBox
->addItem((const char*)(tap_name_list
->data
));
42 void StripHeadersDialog::on_buttonBox_accepted()
44 const QByteArray
& filter
= ui
->displayFilterLineEdit
->text().toUtf8();
45 const QByteArray
& tap_name
= ui
->comboBox
->currentText().toUtf8();
47 do_export_pdu(filter
.constData(), global_capture_opts
.temp_dir
, tap_name
.constData());
50 void StripHeadersDialog::on_buttonBox_helpRequested()
52 mainApp
->helpTopicAction(HELP_STRIP_HEADERS_DIALOG
);
55 StripHeadersDialog::~StripHeadersDialog()