From 0aaf0f04cff9385984ce8966f95af0726355dbde Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Thu, 9 Jul 2015 16:00:14 -0700 Subject: Add the "Resolved Addresses" dialog. The GTK+ equivalent is named "Address Resolution" but "Resolved Addresses" seemed (to me at least) to be more clear. Change-Id: I1806354d91bb5ce8af11d20568b92a04c78d4d73 Reviewed-on: https://code.wireshark.org/review/9580 Petri-Dish: Gerald Combs Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs --- ui/qt/CMakeLists.txt | 3 + ui/qt/Makefile.am | 2 + ui/qt/Makefile.common | 4 + ui/qt/Wireshark.pro | 3 + ui/qt/accordion_frame.h | 13 ++ ui/qt/main_window.h | 1 + ui/qt/main_window.ui | 9 + ui/qt/main_window_slots.cpp | 7 + ui/qt/resolved_addresses_dialog.cpp | 455 ++++++++++++++++++++++++++++++++++++ ui/qt/resolved_addresses_dialog.h | 85 +++++++ ui/qt/resolved_addresses_dialog.ui | 175 ++++++++++++++ 11 files changed, 757 insertions(+) create mode 100644 ui/qt/resolved_addresses_dialog.cpp create mode 100644 ui/qt/resolved_addresses_dialog.h create mode 100644 ui/qt/resolved_addresses_dialog.ui (limited to 'ui') diff --git a/ui/qt/CMakeLists.txt b/ui/qt/CMakeLists.txt index e850c64eae..9ef86b7ba1 100644 --- a/ui/qt/CMakeLists.txt +++ b/ui/qt/CMakeLists.txt @@ -97,6 +97,7 @@ set(WIRESHARK_QT_HEADERS qcustomplot.h recent_file_status.h related_packet_delegate.h + resolved_addresses_dialog.h response_time_delay_dialog.h rtp_stream_dialog.h sctp_all_assocs_dialog.h @@ -222,6 +223,7 @@ set(WIRESHARK_QT_SRC qt_ui_utils.cpp recent_file_status.cpp related_packet_delegate.cpp + resolved_addresses_dialog.cpp response_time_delay_dialog.cpp rtp_stream_dialog.cpp sctp_all_assocs_dialog.cpp @@ -326,6 +328,7 @@ set(WIRESHARK_QT_UI print_dialog.ui profile_dialog.ui protocol_hierarchy_dialog.ui + resolved_addresses_dialog.ui rtp_stream_dialog.ui sctp_all_assocs_dialog.ui sctp_assoc_analyse_dialog.ui diff --git a/ui/qt/Makefile.am b/ui/qt/Makefile.am index cc9ff5aa1c..4a50e4e9a3 100644 --- a/ui/qt/Makefile.am +++ b/ui/qt/Makefile.am @@ -214,6 +214,8 @@ remote_capture_dialog.cpp remote_capture_dialog.h: ui_remote_capture_dialog.h remote_settings_dialog.cpp remote_settings_dialog.h: ui_remote_settings_dialog.h +resolved_addresses_dialog.cpp resolved_addresses_dialog.h: ui_resolved_addresses_dialog.h + rtp_stream_dialog.cpp rtp_stream_dialog.h: ui_rtp_stream_dialog.h search_frame.cpp search_frame.h: ui_search_frame.h diff --git a/ui/qt/Makefile.common b/ui/qt/Makefile.common index 24b14989e2..6116ad444e 100644 --- a/ui/qt/Makefile.common +++ b/ui/qt/Makefile.common @@ -76,6 +76,7 @@ NODIST_GENERATED_HEADER_FILES = \ ui_protocol_hierarchy_dialog.h \ ui_remote_capture_dialog.h \ ui_remote_settings_dialog.h \ + ui_resolved_addresses_dialog.h \ ui_rtp_stream_dialog.h \ ui_sctp_all_assocs_dialog.h \ ui_sctp_assoc_analyse_dialog.h \ @@ -206,6 +207,7 @@ MOC_HDRS = \ related_packet_delegate.h \ remote_capture_dialog.h \ remote_settings_dialog.h \ + resolved_addresses_dialog.h \ response_time_delay_dialog.h \ search_frame.h \ rtp_stream_dialog.h \ @@ -286,6 +288,7 @@ UI_FILES = \ protocol_hierarchy_dialog.ui \ remote_capture_dialog.ui \ remote_settings_dialog.ui \ + resolved_addresses_dialog.ui \ rtp_stream_dialog.ui \ sctp_all_assocs_dialog.ui \ sctp_assoc_analyse_dialog.ui \ @@ -435,6 +438,7 @@ WIRESHARK_QT_SRC = \ related_packet_delegate.cpp \ remote_capture_dialog.cpp \ remote_settings_dialog.cpp \ + resolved_addresses_dialog.cpp \ response_time_delay_dialog.cpp \ rtp_stream_dialog.cpp \ sctp_all_assocs_dialog.cpp \ diff --git a/ui/qt/Wireshark.pro b/ui/qt/Wireshark.pro index 83690ce172..3d6c373eaa 100644 --- a/ui/qt/Wireshark.pro +++ b/ui/qt/Wireshark.pro @@ -252,6 +252,7 @@ FORMS += \ protocol_hierarchy_dialog.ui \ remote_capture_dialog.ui \ remote_settings_dialog.ui \ + resolved_addresses_dialog.ui \ rtp_stream_dialog.ui \ sctp_all_assocs_dialog.ui \ sctp_assoc_analyse_dialog.ui \ @@ -323,6 +324,7 @@ HEADERS += $$HEADERS_WS_C \ protocol_preferences_menu.h \ remote_capture_dialog.h \ remote_settings_dialog.h \ + resolved_addresses_dialog.h \ rtp_stream_dialog.h \ sctp_all_assocs_dialog.h \ sctp_assoc_analyse_dialog.h \ @@ -709,6 +711,7 @@ SOURCES += \ remote_capture_dialog.cpp \ remote_settings_dialog.cpp \ response_time_delay_dialog.cpp \ + resolved_addresses_dialog.cpp \ rtp_stream_dialog.cpp \ sctp_all_assocs_dialog.cpp \ sctp_assoc_analyse_dialog.cpp \ diff --git a/ui/qt/accordion_frame.h b/ui/qt/accordion_frame.h index 37d3e00016..778b86d1d6 100644 --- a/ui/qt/accordion_frame.h +++ b/ui/qt/accordion_frame.h @@ -51,3 +51,16 @@ private slots: }; #endif // ACCORDION_FRAME_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/main_window.h b/ui/qt/main_window.h index 9cc42f3671..6e280778ea 100644 --- a/ui/qt/main_window.h +++ b/ui/qt/main_window.h @@ -449,6 +449,7 @@ private slots: void on_actionCaptureRestart_triggered(); void on_actionStatisticsCaptureFileProperties_triggered(); + void on_actionStatisticsResolvedAddresses_triggered(); void on_actionStatisticsProtocolHierarchy_triggered(); void on_actionStatisticsFlowGraph_triggered(); void openTcpStreamDialog(int graph_type); diff --git a/ui/qt/main_window.ui b/ui/qt/main_window.ui index f2bc6687e6..3938547f2d 100644 --- a/ui/qt/main_window.ui +++ b/ui/qt/main_window.ui @@ -444,6 +444,7 @@ + @@ -2408,6 +2409,14 @@ No ANSI statistics registered + + + Resolved Addresses + + + Show each table of resolved addresses as copyable text. + + diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp index 59f290ed48..2307537bf9 100644 --- a/ui/qt/main_window_slots.cpp +++ b/ui/qt/main_window_slots.cpp @@ -104,6 +104,7 @@ #include "profile_dialog.h" #include "protocol_hierarchy_dialog.h" #include "qt_ui_utils.h" +#include "resolved_addresses_dialog.h" #include "rtp_stream_dialog.h" #include "sctp_all_assocs_dialog.h" #include "sctp_assoc_analyse_dialog.h" @@ -3077,6 +3078,12 @@ void MainWindow::on_actionStatisticsCaptureFileProperties_triggered() capture_file_properties_dialog->show(); } +void MainWindow::on_actionStatisticsResolvedAddresses_triggered() +{ + ResolvedAddressesDialog *resolved_addresses_dialog = new ResolvedAddressesDialog(this, &capture_file_); + resolved_addresses_dialog->show(); +} + void MainWindow::on_actionStatisticsProtocolHierarchy_triggered() { ProtocolHierarchyDialog *phd = new ProtocolHierarchyDialog(*this, capture_file_); diff --git a/ui/qt/resolved_addresses_dialog.cpp b/ui/qt/resolved_addresses_dialog.cpp new file mode 100644 index 0000000000..4ea9c1df67 --- /dev/null +++ b/ui/qt/resolved_addresses_dialog.cpp @@ -0,0 +1,455 @@ +/* resolved_addresses_dialog.cpp + * + * Wireshark - Network traffic analyzer + * By Gerald Combs + * 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 "resolved_addresses_dialog.h" +#include "ui_resolved_addresses_dialog.h" + +#include "config.h" + +#include + +#include "file.h" + +#include "epan/addr_resolv.h" + +#include +#include +#include + +#include "capture_file.h" +#include "wireshark_application.h" + +// To do: +// - We do a *lot* of string copying. +// - We end up with a lot of numeric entries here. + +extern "C" { + +static void +ipv4_hash_table_resolved_to_qstringlist(gpointer key _U_, gpointer value, gpointer sl_ptr) +{ + QStringList *string_list = (QStringList *) sl_ptr; + hashipv4_t *ipv4_hash_table_entry = (hashipv4_t *) value; + + if((ipv4_hash_table_entry->flags & DUMMY_ADDRESS_ENTRY) == 0) { + QString entry = QString("%1\t%2") + .arg(ipv4_hash_table_entry->ip) + .arg(ipv4_hash_table_entry->name); + *string_list << entry; + } +} + +static void +ipv6_hash_table_resolved_to_qstringlist(gpointer key _U_, gpointer value, gpointer sl_ptr) +{ + QStringList *string_list = (QStringList *) sl_ptr; + hashipv6_t *ipv6_hash_table_entry = (hashipv6_t *) value; + + if((ipv6_hash_table_entry->flags & DUMMY_ADDRESS_ENTRY) == 0) { + QString entry = QString("%1\t%2") + .arg(ipv6_hash_table_entry->ip6) + .arg(ipv6_hash_table_entry->name); + *string_list << entry; + } +} + +static void +ipv4_hash_table_to_qstringlist(gpointer key, gpointer value, gpointer sl_ptr) +{ + QStringList *string_list = (QStringList *) sl_ptr; + hashipv4_t *ipv4_hash_table_entry = (hashipv4_t *)value; + int addr = GPOINTER_TO_UINT(key); + + QString entry = QString("Key: 0x%1 IPv4: %2, Name: %3") + .arg(QString::number(addr, 16)) + .arg(ipv4_hash_table_entry->ip) + .arg(ipv4_hash_table_entry->name); + + *string_list << entry; +} + +static void +ipv6_hash_table_to_qstringlist(gpointer key, gpointer value, gpointer sl_ptr) +{ + QStringList *string_list = (QStringList *) sl_ptr; + hashipv6_t *ipv6_hash_table_entry = (hashipv6_t *)value; + int addr = GPOINTER_TO_UINT(key); + + QString entry = QString("Key: 0x%1 IPv4: %2, Name: %3") + .arg(QString::number(addr, 16)) + .arg(ipv6_hash_table_entry->ip6) + .arg(ipv6_hash_table_entry->name); + + *string_list << entry; +} + +static void +serv_port_hash_to_qstringlist(gpointer key, gpointer value, gpointer sl_ptr) +{ + QStringList *string_list = (QStringList *) sl_ptr; + serv_port_t *serv_port = (serv_port_t *)value; + int port = *(int*)key; + + QStringList entries; + + if (serv_port->tcp_name) entries << QString("%1\t%2/tcp").arg(serv_port->tcp_name).arg(port); + if (serv_port->udp_name) entries << QString("%1\t%2/udp").arg(serv_port->udp_name).arg(port); + if (serv_port->sctp_name) entries << QString("%1\t%2/sctp").arg(serv_port->sctp_name).arg(port); + if (serv_port->dccp_name) entries << QString("%1\t%2/dccp").arg(serv_port->dccp_name).arg(port); + + if (!entries.isEmpty()) *string_list << entries.join("\n"); +} + +static void +eth_hash_to_qstringlist(gpointer key _U_, gpointer value, gpointer sl_ptr) +{ + QStringList *string_list = (QStringList *) sl_ptr; + hashether_t* tp = (hashether_t*)value; + + QString entry = QString("%1 %2") + .arg(get_hash_ether_hexaddr(tp)) + .arg(get_hash_ether_resolved_name(tp)); + + *string_list << entry; +} + +static void +manuf_hash_to_qstringlist(gpointer key _U_, gpointer value, gpointer sl_ptr) +{ + QStringList *string_list = (QStringList *) sl_ptr; + hashmanuf_t *manuf = (hashmanuf_t*)value; + int eth_as_gint = *(int*)key; + + QString entry = QString("%1:%2:%3 %4") + .arg((eth_as_gint >> 16 & 0xff), 2, 16, QChar('0')) + .arg((eth_as_gint >> 8 & 0xff), 2, 16, QChar('0')) + .arg((eth_as_gint & 0xff), 2, 16, QChar('0')) + .arg(get_hash_manuf_resolved_name(manuf)); + + *string_list << entry; +} + +static void +wka_hash_to_qstringlist(gpointer key, gpointer value, gpointer sl_ptr) +{ + QStringList *string_list = (QStringList *) sl_ptr; + gchar *name = (gchar *)value; + gint64 eth_as_gint64 = *(gint64*)key; + + QString entry = QString("%1:%2:%3:%4:%5:%6 %7") + .arg((eth_as_gint64 >> 40 & 0xff), 2, 16, QChar('0')) + .arg((eth_as_gint64 >> 32 & 0xff), 2, 16, QChar('0')) + .arg((eth_as_gint64 >> 24 & 0xff), 2, 16, QChar('0')) + .arg((eth_as_gint64 >> 16 & 0xff), 2, 16, QChar('0')) + .arg((eth_as_gint64 >> 8 & 0xff), 2, 16, QChar('0')) + .arg((eth_as_gint64 & 0xff), 2, 16, QChar('0')) + .arg(name); + + *string_list << entry; +} + +} +const QString no_entries_ = QObject::tr("No entries."); +const QString entry_count_ = QObject::tr("%1 entries."); + +ResolvedAddressesDialog::ResolvedAddressesDialog(QWidget *parent, CaptureFile *capture_file) : + QDialog(NULL), + ui(new Ui::ResolvedAddressesDialog), + file_name_(tr("[no file]")) +{ + ui->setupUi(this); + + QStringList title_parts = QStringList() << tr("Resolved Addresses"); + + if (capture_file->isValid()) { + file_name_ = capture_file->capFile()->filename; + title_parts << file_name_; + } + setWindowTitle(wsApp->windowTitleString(title_parts)); + + // XXX Use recent settings instead + resize(parent->width() * 2 / 3, parent->height()); + + ui->plainTextEdit->setFont(wsApp->monospaceFont()); + ui->plainTextEdit->setReadOnly(true); + ui->plainTextEdit->setWordWrapMode(QTextOption::NoWrap); + ui->plainTextEdit->setTabStopWidth(ui->plainTextEdit->fontMetrics().averageCharWidth() * 8); + + GHashTable *ipv4_hash_table = get_ipv4_hash_table(); + if (ipv4_hash_table) { + g_hash_table_foreach(ipv4_hash_table, ipv4_hash_table_resolved_to_qstringlist, &host_addresses_); + g_hash_table_foreach(ipv4_hash_table, ipv4_hash_table_to_qstringlist, &v4_hash_addrs_); + } + + GHashTable *ipv6_hash_table = get_ipv6_hash_table(); + if (ipv6_hash_table) { + g_hash_table_foreach(ipv6_hash_table, ipv6_hash_table_resolved_to_qstringlist, &host_addresses_); + g_hash_table_foreach(ipv6_hash_table, ipv6_hash_table_to_qstringlist, &v6_hash_addrs_); + } + + GHashTable *serv_port_hashtable = get_serv_port_hashtable(); + if(serv_port_hashtable){ + g_hash_table_foreach(serv_port_hashtable, serv_port_hash_to_qstringlist, &service_ports_); + } + + GHashTable *eth_hashtable = get_eth_hashtable(); + if (eth_hashtable){ + g_hash_table_foreach(eth_hashtable, eth_hash_to_qstringlist, ðernet_addresses_); + } + + GHashTable *manuf_hashtable = get_manuf_hashtable(); + if (manuf_hashtable){ + g_hash_table_foreach(manuf_hashtable, manuf_hash_to_qstringlist, ðernet_manufacturers_); + } + + GHashTable *wka_hashtable = get_wka_hashtable(); + if(wka_hashtable){ + g_hash_table_foreach(wka_hashtable, wka_hash_to_qstringlist, ðernet_well_known_); + } + + fillShowMenu(); + fillBlocks(); +} + +ResolvedAddressesDialog::~ResolvedAddressesDialog() +{ + delete ui; +} + +void ResolvedAddressesDialog::changeEvent(QEvent *event) +{ + if (0 != event) + { + switch (event->type()) + { + case QEvent::LanguageChange: + ui->retranslateUi(this); + fillShowMenu(); + fillBlocks(); + break; + default: + break; + } + } + QDialog::changeEvent(event); +} + +void ResolvedAddressesDialog::fillShowMenu() +{ + QPushButton *show_bt = ui->buttonBox->button(QDialogButtonBox::Apply); + show_bt->setText(tr("Show")); + + if (!show_bt->menu()) { + show_bt->setMenu(new QMenu()); + } + + QMenu *show_menu = show_bt->menu(); + show_menu->clear(); + + show_menu->addAction(ui->actionAddressesHosts); + show_menu->addAction(ui->actionIPv4HashTable); + show_menu->addAction(ui->actionIPv6HashTable); + show_menu->addAction(ui->actionPortNames); + show_menu->addAction(ui->actionEthernetAddresses); + show_menu->addAction(ui->actionEthernetManufacturers); + show_menu->addAction(ui->actionEthernetWKA); + + show_menu->addSeparator(); + show_menu->addAction(ui->actionShowAll); + show_menu->addAction(ui->actionHideAll); +} + +void ResolvedAddressesDialog::fillBlocks() +{ + setUpdatesEnabled(false); + ui->plainTextEdit->clear(); + + QString lines; + ui->plainTextEdit->appendPlainText(tr("# Resolved addresses found in %1").arg(file_name_)); + + if (ui->actionAddressesHosts->isChecked()) { + lines = "\n"; + lines.append(tr("# Hosts\n#\n# ")); + if (!host_addresses_.isEmpty()) { + lines.append(entry_count_.arg(host_addresses_.length())); + lines.append("\n\n"); + lines.append(host_addresses_.join("\n")); + } else { + lines.append(no_entries_); + } + ui->plainTextEdit->appendPlainText(lines); + } + + if (ui->actionIPv4HashTable->isChecked()) { + lines = "\n"; + lines.append(tr("# IPv4 Hash Table\n#\n# ")); + if (!v4_hash_addrs_.isEmpty()) { + lines.append(entry_count_.arg(v4_hash_addrs_.length())); + lines.append(tr("\n\n")); + lines.append(v4_hash_addrs_.join("\n")); + } else { + lines.append(no_entries_); + } + ui->plainTextEdit->appendPlainText(lines); + } + + if (ui->actionIPv6HashTable->isChecked()) { + lines = "\n"; + lines.append(tr("# IPv6 Hash Table\n#\n# ")); + if (!v6_hash_addrs_.isEmpty()) { + lines.append(entry_count_.arg(v6_hash_addrs_.length())); + lines.append(tr("\n\n")); + lines.append(v6_hash_addrs_.join("\n")); + } else { + lines.append(no_entries_); + } + ui->plainTextEdit->appendPlainText(lines); + } + + if (ui->actionPortNames->isChecked()) { + lines = "\n"; + lines.append(tr("# Services\n#\n# ")); + if (!service_ports_.isEmpty()) { + lines.append(entry_count_.arg(service_ports_.length())); + lines.append(tr("\n\n")); + lines.append(service_ports_.join("\n")); + } else { + lines.append(no_entries_); + } + ui->plainTextEdit->appendPlainText(lines); + } + + if (ui->actionEthernetAddresses->isChecked()) { + lines = "\n"; + lines.append(tr("# Ethernet addresses\n#\n# ")); + if (!ethernet_addresses_.isEmpty()) { + lines.append(entry_count_.arg(ethernet_addresses_.length())); + lines.append(tr("\n\n")); + lines.append(ethernet_addresses_.join("\n")); + } else { + lines.append(no_entries_); + } + ui->plainTextEdit->appendPlainText(lines); + } + + if (ui->actionEthernetManufacturers->isChecked()) { + lines = "\n"; + lines.append(tr("# Ethernet manufacturers\n#\n# ")); + if (!ethernet_manufacturers_.isEmpty()) { + lines.append(entry_count_.arg(ethernet_manufacturers_.length())); + lines.append(tr("\n\n")); + lines.append(ethernet_manufacturers_.join("\n")); + } else { + lines.append(no_entries_); + } + ui->plainTextEdit->appendPlainText(lines); + } + + if (ui->actionEthernetWKA->isChecked()) { + lines = "\n"; + lines.append(tr("# Well known Ethernet addresses\n#\n# ")); + if (!ethernet_well_known_.isEmpty()) { + lines.append(entry_count_.arg(ethernet_well_known_.length())); + lines.append(tr("\n\n")); + lines.append(ethernet_well_known_.join("\n")); + } else { + lines.append(no_entries_); + } + ui->plainTextEdit->appendPlainText(lines); + } + + ui->plainTextEdit->moveCursor(QTextCursor::Start); + setUpdatesEnabled(true); +} + +void ResolvedAddressesDialog::on_actionAddressesHosts_triggered() +{ + fillBlocks(); +} + +void ResolvedAddressesDialog::on_actionIPv4HashTable_triggered() +{ + fillBlocks(); +} + +void ResolvedAddressesDialog::on_actionIPv6HashTable_triggered() +{ + fillBlocks(); +} + +void ResolvedAddressesDialog::on_actionPortNames_triggered() +{ + fillBlocks(); +} + +void ResolvedAddressesDialog::on_actionEthernetAddresses_triggered() +{ + fillBlocks(); +} + +void ResolvedAddressesDialog::on_actionEthernetManufacturers_triggered() +{ + fillBlocks(); +} + +void ResolvedAddressesDialog::on_actionEthernetWKA_triggered() +{ + fillBlocks(); +} + +void ResolvedAddressesDialog::on_actionShowAll_triggered() +{ + ui->actionAddressesHosts->setChecked(true); + ui->actionIPv4HashTable->setChecked(true); + ui->actionIPv6HashTable->setChecked(true); + ui->actionPortNames->setChecked(true); + ui->actionEthernetAddresses->setChecked(true); + ui->actionEthernetManufacturers->setChecked(true); + ui->actionEthernetWKA->setChecked(true); + + fillBlocks(); +} + +void ResolvedAddressesDialog::on_actionHideAll_triggered() +{ + ui->actionAddressesHosts->setChecked(false); + ui->actionIPv4HashTable->setChecked(false); + ui->actionIPv6HashTable->setChecked(false); + ui->actionPortNames->setChecked(false); + ui->actionEthernetAddresses->setChecked(false); + ui->actionEthernetManufacturers->setChecked(false); + ui->actionEthernetWKA->setChecked(false); + + fillBlocks(); +} + +/* + * 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/resolved_addresses_dialog.h b/ui/qt/resolved_addresses_dialog.h new file mode 100644 index 0000000000..01aef1e4a0 --- /dev/null +++ b/ui/qt/resolved_addresses_dialog.h @@ -0,0 +1,85 @@ +/* resolved_addresses_dialog.h + * + * Wireshark - Network traffic analyzer + * By Gerald Combs + * 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 RESOLVED_ADDRESSES_DIALOG_H +#define RESOLVED_ADDRESSES_DIALOG_H + +#include + +class CaptureFile; +class QTextBlock; + +namespace Ui { +class ResolvedAddressesDialog; +} + +class ResolvedAddressesDialog : public QDialog +{ + Q_OBJECT + +public: + explicit ResolvedAddressesDialog(QWidget *parent, CaptureFile *capture_file); + ~ResolvedAddressesDialog(); + +protected slots: + void changeEvent(QEvent* event); + +private slots: + void on_actionAddressesHosts_triggered(); + void on_actionIPv4HashTable_triggered(); + void on_actionIPv6HashTable_triggered(); + void on_actionPortNames_triggered(); + void on_actionEthernetAddresses_triggered(); + void on_actionEthernetManufacturers_triggered(); + void on_actionEthernetWKA_triggered(); + + void on_actionShowAll_triggered(); + void on_actionHideAll_triggered(); + +private: + Ui::ResolvedAddressesDialog *ui; + QString file_name_; + QStringList host_addresses_; + QStringList v4_hash_addrs_; + QStringList v6_hash_addrs_; + QStringList service_ports_; + QStringList ethernet_addresses_; + QStringList ethernet_manufacturers_; + QStringList ethernet_well_known_; + + void fillShowMenu(); + void fillBlocks(); +}; + +#endif // RESOLVED_ADDRESSES_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/resolved_addresses_dialog.ui b/ui/qt/resolved_addresses_dialog.ui new file mode 100644 index 0000000000..a67150930a --- /dev/null +++ b/ui/qt/resolved_addresses_dialog.ui @@ -0,0 +1,175 @@ + + + ResolvedAddressesDialog + + + + 0 + 0 + 620 + 450 + + + + Dialog + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + true + + + IPv4 Hash Table + + + Show the IPv4 hash table entries. + + + + + true + + + IPv6 Hash Table + + + Show the IPv6 hash table entries. + + + + + Show All + + + Show all address types. + + + + + Hide All + + + Hide all address types. + + + + + true + + + true + + + IPv4 and IPv6 Addresses (hosts) + + + Show resolved IPv4 and IPv6 host names in "hosts" format. + + + + + true + + + true + + + Port names (services) + + + Show resolved port names names in "servies" format. + + + + + true + + + true + + + Ethernet Addresses + + + Show resolved Ethernet addresses in "ethers" format. + + + + + true + + + true + + + Ethernet Well-Known Addresses + + + Show well-known Ethernet addresses in "ethers" format. + + + + + true + + + true + + + Ethernet Manufacturers + + + Show Ethernet manufacturers in "ethers" format. + + + + + + + buttonBox + accepted() + ResolvedAddressesDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + ResolvedAddressesDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + -- cgit v1.2.3