diff options
-rw-r--r-- | ui/qt/CMakeLists.txt | 3 | ||||
-rw-r--r-- | ui/qt/Makefile.am | 2 | ||||
-rw-r--r-- | ui/qt/Makefile.common | 4 | ||||
-rw-r--r-- | ui/qt/QtShark.pro | 3 | ||||
-rw-r--r-- | ui/qt/export_pdu_dialog.cpp | 75 | ||||
-rw-r--r-- | ui/qt/export_pdu_dialog.h | 60 | ||||
-rw-r--r-- | ui/qt/export_pdu_dialog.ui | 107 | ||||
-rw-r--r-- | ui/qt/main_window.cpp | 3 | ||||
-rw-r--r-- | ui/qt/main_window.h | 1 | ||||
-rw-r--r-- | ui/qt/main_window.ui | 88 | ||||
-rw-r--r-- | ui/qt/main_window_slots.cpp | 17 |
11 files changed, 322 insertions, 41 deletions
diff --git a/ui/qt/CMakeLists.txt b/ui/qt/CMakeLists.txt index 774b9c06ed..581507d2bb 100644 --- a/ui/qt/CMakeLists.txt +++ b/ui/qt/CMakeLists.txt @@ -45,6 +45,7 @@ set(WIRESHARK_QT_HEADERS elided_label.h export_dissection_dialog.h export_object_dialog.h + export_pdu_dialog.h file_set_dialog.h filter_expressions_preferences_frame.h follow_stream_dialog.h @@ -119,6 +120,7 @@ set(WIRESHARK_QT_SRC elided_label.cpp export_dissection_dialog.cpp export_object_dialog.cpp + export_pdu_dialog.cpp file_set_dialog.cpp filter_expressions_preferences_frame.cpp follow_stream_dialog.cpp @@ -189,6 +191,7 @@ set(WIRESHARK_QT_UI column_preferences_frame.ui decode_as_dialog.ui export_object_dialog.ui + export_pdu_dialog.ui file_set_dialog.ui filter_expressions_preferences_frame.ui follow_stream_dialog.ui diff --git a/ui/qt/Makefile.am b/ui/qt/Makefile.am index 005ee4ebf0..f005f1a703 100644 --- a/ui/qt/Makefile.am +++ b/ui/qt/Makefile.am @@ -139,6 +139,8 @@ decode_as_dialog.cpp decode_as_dialog.h: ui_decode_as_dialog.h export_object_dialog.cpp export_object_dialog.h: ui_export_object_dialog.h +export_pdu_dialog.cpp export_pdu_dialog.h: ui_export_pdu_dialog.h + file_set_dialog.cpp file_set_dialog.h: ui_file_set_dialog.h filter_expressions_preferences_frame.cpp filter_expressions_preferences_frame.h: ui_filter_expressions_preferences_frame.h diff --git a/ui/qt/Makefile.common b/ui/qt/Makefile.common index 771756c5c8..8094f9cf34 100644 --- a/ui/qt/Makefile.common +++ b/ui/qt/Makefile.common @@ -37,6 +37,7 @@ NODIST_GENERATED_HEADER_FILES = \ ui_column_preferences_frame.h \ ui_decode_as_dialog.h \ ui_export_object_dialog.h \ + ui_export_pdu_dialog.h \ ui_file_set_dialog.h \ ui_filter_expressions_preferences_frame.h \ ui_follow_stream_dialog.h \ @@ -123,6 +124,7 @@ MOC_HDRS = \ elided_label.h \ export_dissection_dialog.h \ export_object_dialog.h \ + export_pdu_dialog.h \ file_set_dialog.h \ filter_expressions_preferences_frame.h \ follow_stream_dialog.h \ @@ -181,6 +183,7 @@ UI_FILES = \ column_preferences_frame.ui \ decode_as_dialog.ui \ export_object_dialog.ui \ + export_pdu_dialog.ui \ file_set_dialog.ui \ filter_expressions_preferences_frame.ui \ follow_stream_dialog.ui \ @@ -283,6 +286,7 @@ WIRESHARK_QT_SRC = \ elided_label.cpp \ export_dissection_dialog.cpp \ export_object_dialog.cpp \ + export_pdu_dialog.cpp \ file_set_dialog.cpp \ filter_expressions_preferences_frame.cpp \ follow_stream_dialog.cpp \ diff --git a/ui/qt/QtShark.pro b/ui/qt/QtShark.pro index 1e37f5652b..7e6c601620 100644 --- a/ui/qt/QtShark.pro +++ b/ui/qt/QtShark.pro @@ -227,6 +227,7 @@ FORMS += \ column_preferences_frame.ui \ decode_as_dialog.ui \ export_object_dialog.ui \ + export_pdu_dialog.ui \ file_set_dialog.ui \ filter_expressions_preferences_frame.ui \ follow_stream_dialog.ui \ @@ -268,6 +269,7 @@ HEADERS += $$HEADERS_WS_C \ elided_label.h \ export_dissection_dialog.h \ export_object_dialog.h \ + export_pdu_dialog.h \ filter_expressions_preferences_frame.h \ follow_stream_dialog.h \ follow_stream_text.h \ @@ -575,6 +577,7 @@ SOURCES += \ elided_label.cpp \ export_dissection_dialog.cpp \ export_object_dialog.cpp \ + export_pdu_dialog.cpp \ file_set_dialog.cpp \ filter_expressions_preferences_frame.cpp \ follow_stream_dialog.cpp \ diff --git a/ui/qt/export_pdu_dialog.cpp b/ui/qt/export_pdu_dialog.cpp new file mode 100644 index 0000000000..9acb9dd4d4 --- /dev/null +++ b/ui/qt/export_pdu_dialog.cpp @@ -0,0 +1,75 @@ +/* export_pdu_dialog.cpp + * + * Wireshark - Network traffic analyzer + * By Gerald Combs <gerald@wireshark.org> + * Copyright 1998 Gerald Combs + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include "config.h" + +#include "export_pdu_dialog.h" +#include "ui_export_pdu_dialog.h" + +#include "globals.h" +#include "pcap-encap.h" + +#include <epan/tap.h> +#include <epan/exported_pdu.h> + +#include "ui/tap_export_pdu.h" + +ExportPDUDialog::ExportPDUDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::ExportPDUDialog) +{ + ui->setupUi(this); + + ui->comboBox->addItem(EXPORT_PDU_TAP_NAME_LAYER_7); + ui->comboBox->addItem(EXPORT_PDU_TAP_NAME_LAYER_3); + ui->comboBox->addItem(EXPORT_PDU_TAP_NAME_DVB_CI); + ui->comboBox->addItem(EXPORT_PDU_TAP_NAME_LOGCAT); +} +void ExportPDUDialog::on_buttonBox_accepted() +{ + const char *filter; + QString tap_name; + exp_pdu_t exp_pdu_data; + + exp_pdu_data.pkt_encap = wtap_wtap_encap_to_pcap_encap(WTAP_ENCAP_WIRESHARK_UPPER_PDU); + + filter = ui->displayFilterLineEdit->text().toUtf8().constData(); + tap_name = ui->comboBox->currentText(); + + do_export_pdu(filter, (gchar *)tap_name.toUtf8().constData(), &exp_pdu_data); +} +ExportPDUDialog::~ExportPDUDialog() +{ + delete ui; +} + +/* + * Editor modelines + * + * Local Variables: + * c-basic-offset: 4 + * tab-width: 8 + * indent-tabs-mode: nil + * End: + * + * ex: set shiftwidth=4 tabstop=8 expandtab: + * :indentSize=4:tabSize=8:noTabs=true: + */ diff --git a/ui/qt/export_pdu_dialog.h b/ui/qt/export_pdu_dialog.h new file mode 100644 index 0000000000..efd6a411f9 --- /dev/null +++ b/ui/qt/export_pdu_dialog.h @@ -0,0 +1,60 @@ +/* export_pdu_dialog.h + * + * Wireshark - Network traffic analyzer + * By Gerald Combs <gerald@wireshark.org> + * Copyright 1998 Gerald Combs + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef EXPORT_PDU_DIALOG_H +#define EXPORT_PDU_DIALOG_H + +#include <QDialog> +#include <QDebug> + +namespace Ui { +class ExportPDUDialog; +} + +class ExportPDUDialog : public QDialog +{ + Q_OBJECT + +public: + explicit ExportPDUDialog(QWidget *parent = 0); + ~ExportPDUDialog(); + +private: + Ui::ExportPDUDialog *ui; + +private slots: + void on_buttonBox_accepted(); +}; + +#endif // EXPORT_PDU_DIALOG_H + +/* + * Editor modelines + * + * Local Variables: + * c-basic-offset: 4 + * tab-width: 8 + * indent-tabs-mode: nil + * End: + * + * ex: set shiftwidth=4 tabstop=8 expandtab: + * :indentSize=4:tabSize=8:noTabs=true: + */ diff --git a/ui/qt/export_pdu_dialog.ui b/ui/qt/export_pdu_dialog.ui new file mode 100644 index 0000000000..57040ffd93 --- /dev/null +++ b/ui/qt/export_pdu_dialog.ui @@ -0,0 +1,107 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>ExportPDUDialog</class> + <widget class="QDialog" name="ExportPDUDialog"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>393</width> + <height>158</height> + </rect> + </property> + <property name="windowTitle"> + <string>Dialog</string> + </property> + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="geometry"> + <rect> + <x>30</x> + <y>100</y> + <width>341</width> + <height>32</height> + </rect> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons"> + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> + </property> + </widget> + <widget class="QWidget" name="layoutWidget"> + <property name="geometry"> + <rect> + <x>16</x> + <y>20</y> + <width>361</width> + <height>29</height> + </rect> + </property> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QLabel" name="label"> + <property name="text"> + <string>Display filter:</string> + </property> + </widget> + </item> + <item> + <widget class="DisplayFilterEdit" name="displayFilterLineEdit"/> + </item> + </layout> + </widget> + <widget class="QComboBox" name="comboBox"> + <property name="geometry"> + <rect> + <x>10</x> + <y>60</y> + <width>120</width> + <height>30</height> + </rect> + </property> + </widget> + </widget> + <customwidgets> + <customwidget> + <class>DisplayFilterEdit</class> + <extends>QLineEdit</extends> + <header location="global">display_filter_edit.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections> + <connection> + <sender>buttonBox</sender> + <signal>accepted()</signal> + <receiver>ExportPDUDialog</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel"> + <x>248</x> + <y>254</y> + </hint> + <hint type="destinationlabel"> + <x>157</x> + <y>274</y> + </hint> + </hints> + </connection> + <connection> + <sender>buttonBox</sender> + <signal>rejected()</signal> + <receiver>ExportPDUDialog</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel"> + <x>316</x> + <y>260</y> + </hint> + <hint type="destinationlabel"> + <x>286</x> + <y>274</y> + </hint> + </hints> + </connection> + </connections> +</ui> diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp index 92ccf4cbdd..b35aed006d 100644 --- a/ui/qt/main_window.cpp +++ b/ui/qt/main_window.cpp @@ -1421,6 +1421,7 @@ void MainWindow::setMenusForCaptureFile(bool force_disable) main_ui_->actionFileExportPackets->setEnabled(false); main_ui_->menuFileExportPacketDissections->setEnabled(false); main_ui_->actionFileExportPacketBytes->setEnabled(false); + main_ui_->actionFileExportPDU->setEnabled(false); main_ui_->actionFileExportSSLSessionKeys->setEnabled(false); main_ui_->menuFileExportObjects->setEnabled(false); main_ui_->actionViewReload->setEnabled(false); @@ -1438,6 +1439,7 @@ void MainWindow::setMenusForCaptureFile(bool force_disable) main_ui_->actionFileExportPackets->setEnabled(cf_can_write_with_wiretap(cap_file_)); main_ui_->menuFileExportPacketDissections->setEnabled(true); main_ui_->actionFileExportPacketBytes->setEnabled(true); + main_ui_->actionFileExportPDU->setEnabled(true); main_ui_->actionFileExportSSLSessionKeys->setEnabled(true); main_ui_->menuFileExportObjects->setEnabled(true); main_ui_->actionViewReload->setEnabled(true); @@ -1452,6 +1454,7 @@ void MainWindow::setMenusForCaptureInProgress(bool capture_in_progress) { main_ui_->menuOpenRecentCaptureFile->setEnabled(!capture_in_progress); main_ui_->menuFileExportPacketDissections->setEnabled(capture_in_progress); main_ui_->actionFileExportPacketBytes->setEnabled(capture_in_progress); + main_ui_->actionFileExportPDU->setEnabled(capture_in_progress); main_ui_->actionFileExportSSLSessionKeys->setEnabled(capture_in_progress); main_ui_->menuFileExportObjects->setEnabled(capture_in_progress); main_ui_->menuFileSet->setEnabled(!capture_in_progress); diff --git a/ui/qt/main_window.h b/ui/qt/main_window.h index a74423a906..13682dd58e 100644 --- a/ui/qt/main_window.h +++ b/ui/qt/main_window.h @@ -234,6 +234,7 @@ private slots: void on_actionFileExportObjectsSMB_triggered(); void on_actionFilePrint_triggered(); + void on_actionFileExportPDU_triggered(); void on_actionFileExportSSLSessionKeys_triggered(); void actionEditCopyTriggered(MainWindow::CopySelected selection_type); diff --git a/ui/qt/main_window.ui b/ui/qt/main_window.ui index da2be1eecd..0b35c7944e 100644 --- a/ui/qt/main_window.ui +++ b/ui/qt/main_window.ui @@ -151,6 +151,7 @@ <addaction name="actionFileExportPackets"/> <addaction name="menuFileExportPacketDissections"/> <addaction name="actionFileExportPacketBytes"/> + <addaction name="actionFileExportPDU"/> <addaction name="actionFileExportSSLSessionKeys"/> <addaction name="menuFileExportObjects"/> <addaction name="separator"/> @@ -158,47 +159,6 @@ <addaction name="separator"/> <addaction name="actionFileQuit"/> </widget> - <widget class="QMenu" name="menuEdit"> - <property name="title"> - <string>&Edit</string> - </property> - <widget class="QMenu" name="menuEditCopy"> - <property name="title"> - <string>Copy</string> - </property> - <addaction name="actionEditCopyDescription"/> - <addaction name="actionEditCopyFieldName"/> - <addaction name="actionEditCopyValue"/> - <addaction name="separator"/> - <addaction name="actionEditCopyAsFilter"/> - </widget> - <addaction name="menuEditCopy"/> - <addaction name="actionEditFindPacket"/> - <addaction name="actionEditFindNext"/> - <addaction name="actionEditFindPrevious"/> - <addaction name="separator"/> - <addaction name="actionEditMarkPacket"/> - <addaction name="actionEditMarkAllDisplayed"/> - <addaction name="actionEditUnmarkAllDisplayed"/> - <addaction name="actionEditNextMark"/> - <addaction name="actionEditPreviousMark"/> - <addaction name="separator"/> - <addaction name="actionEditIgnorePacket"/> - <addaction name="actionEditIgnoreAllDisplayed"/> - <addaction name="actionEditUnignoreAllDisplayed"/> - <addaction name="separator"/> - <addaction name="actionEditSetTimeReference"/> - <addaction name="actionEditUnsetAllTimeReferences"/> - <addaction name="actionEditNextTimeReference"/> - <addaction name="actionEditPreviousTimeReference"/> - <addaction name="separator"/> - <addaction name="actionEditTimeShift"/> - <addaction name="separator"/> - <addaction name="actionEditPacketComment"/> - <addaction name="separator"/> - <addaction name="actionEditConfigurationProfiles"/> - <addaction name="actionEditPreferences"/> - </widget> <widget class="QMenu" name="menuCapture"> <property name="title"> <string>&Capture</string> @@ -377,6 +337,47 @@ <addaction name="actionTelephonySMPPOperations"/> <addaction name="actionTelephonyUCPMessages"/> </widget> + <widget class="QMenu" name="menuEdit"> + <property name="title"> + <string>&Edit</string> + </property> + <widget class="QMenu" name="menuEditCopy"> + <property name="title"> + <string>Copy</string> + </property> + <addaction name="actionEditCopyDescription"/> + <addaction name="actionEditCopyFieldName"/> + <addaction name="actionEditCopyValue"/> + <addaction name="separator"/> + <addaction name="actionEditCopyAsFilter"/> + </widget> + <addaction name="menuEditCopy"/> + <addaction name="actionEditFindPacket"/> + <addaction name="actionEditFindNext"/> + <addaction name="actionEditFindPrevious"/> + <addaction name="separator"/> + <addaction name="actionEditMarkPacket"/> + <addaction name="actionEditMarkAllDisplayed"/> + <addaction name="actionEditUnmarkAllDisplayed"/> + <addaction name="actionEditNextMark"/> + <addaction name="actionEditPreviousMark"/> + <addaction name="separator"/> + <addaction name="actionEditIgnorePacket"/> + <addaction name="actionEditIgnoreAllDisplayed"/> + <addaction name="actionEditUnignoreAllDisplayed"/> + <addaction name="separator"/> + <addaction name="actionEditSetTimeReference"/> + <addaction name="actionEditUnsetAllTimeReferences"/> + <addaction name="actionEditNextTimeReference"/> + <addaction name="actionEditPreviousTimeReference"/> + <addaction name="separator"/> + <addaction name="actionEditTimeShift"/> + <addaction name="separator"/> + <addaction name="actionEditPacketComment"/> + <addaction name="separator"/> + <addaction name="actionEditConfigurationProfiles"/> + <addaction name="actionEditPreferences"/> + </widget> <addaction name="menuFile"/> <addaction name="menuEdit"/> <addaction name="menuView"/> @@ -1521,6 +1522,11 @@ <string>Filter this Association</string> </property> </action> + <action name="actionFileExportPDU"> + <property name="text"> + <string>Export PDUs to File</string> + </property> + </action> </widget> <layoutdefault spacing="6" margin="11"/> <customwidgets> diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp index 3734670f52..5623eca8bf 100644 --- a/ui/qt/main_window_slots.cpp +++ b/ui/qt/main_window_slots.cpp @@ -70,6 +70,7 @@ #include "capture_file_dialog.h" #include "decode_as_dialog.h" #include "export_object_dialog.h" +#include "export_pdu_dialog.h" #include "packet_comment_dialog.h" #include "preferences_dialog.h" #include "print_dialog.h" @@ -1296,6 +1297,22 @@ void MainWindow::on_actionFileExportPacketBytes_triggered() wsApp->setLastOpenDir(&file_name); } } +void MainWindow::on_actionFileExportPDU_triggered() +{ + ExportPDUDialog *exportpdu_dialog = new ExportPDUDialog(this); + + if (exportpdu_dialog->isMinimized() == true) + { + exportpdu_dialog->showNormal(); + } + else + { + exportpdu_dialog->show(); + } + + exportpdu_dialog->raise(); + exportpdu_dialog->activateWindow(); +} void MainWindow::on_actionFileExportSSLSessionKeys_triggered() { |