#include <config.h>
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
+// Qt 5.5.0 + Visual C++ 2013
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4996)
#endif
#include "main_window.h"
#ifdef _WIN32
#include <windows.h>
-#include <io.h>
#endif
#ifdef HAVE_LIBPCAP
#include "wsutil/file_util.h"
#include "wsutil/filesystem.h"
-#include <wsutil/str_util.h>
+#include "wsutil/str_util.h"
#include "epan/addr_resolv.h"
-#include "epan/color_dissector_filters.h"
+#include "epan/dissector_filters.h"
#include "epan/column.h"
#include "epan/dfilter/dfilter-macro.h"
#include "epan/epan_dissect.h"
#include "color_utils.h"
#include "coloring_rules_dialog.h"
#include "conversation_dialog.h"
+#include "conversation_hash_tables_dialog.h"
#include "enabled_protocols_dialog.h"
#include "decode_as_dialog.h"
#include "display_filter_edit.h"
#include "display_filter_expression_dialog.h"
+#include "dissector_tables_dialog.h"
#include "endpoint_dialog.h"
#include "expert_info_dialog.h"
#include "export_object_dialog.h"
#include "lbm_lbtrm_transport_dialog.h"
#include "lbm_lbtru_transport_dialog.h"
#include "lte_mac_statistics_dialog.h"
+#include "lte_rlc_statistics_dialog.h"
+#include "lte_rlc_graph_dialog.h"
#include "mtp3_summary_dialog.h"
#include "multicast_statistics_dialog.h"
#include "packet_comment_dialog.h"
#include "sequence_dialog.h"
#include "stats_tree_dialog.h"
#include "stock_icon.h"
+#include "supported_protocols_dialog.h"
#include "tap_parameter_dialog.h"
#include "tcp_stream_dialog.h"
#include "time_shift_dialog.h"
} else {
emit displayFilterSuccess(false);
}
+ if (packet_list_) {
+ packet_list_->resetColumns();
+ }
}
// A new layout should be applied when it differs from the old layout AND
QVector<unsigned> new_layout = QVector<unsigned>() << prefs.gui_layout_type
<< prefs.gui_layout_content_1
<< prefs.gui_layout_content_2
- << prefs.gui_layout_content_3;
+ << prefs.gui_layout_content_3
+ << recent.packet_list_show
+ << recent.tree_view_show
+ << recent.byte_view_show;
+
if (cur_layout_ == new_layout) return;
QSplitter *parents[3];
}
main_ui_->mainToolBar->setToolButtonStyle(tbstyle);
+
+ main_ui_->mainToolBar->setVisible(recent.main_toolbar_show);
+ main_ui_->displayFilterToolBar->setVisible(recent.filter_toolbar_show);
+ main_ui_->wirelessToolBar->setVisible(recent.wireless_toolbar_show);
+ main_ui_->statusBar->setVisible(recent.statusbar_show);
}
void MainWindow::updatePreferenceActions()
main_ui_->actionGoAutoScroll->setChecked(prefs.capture_auto_scroll);
}
+void MainWindow::updateRecentActions()
+{
+ main_ui_->actionViewMainToolbar->setChecked(recent.main_toolbar_show);
+ main_ui_->actionViewFilterToolbar->setChecked(recent.filter_toolbar_show);
+ main_ui_->actionViewWirelessToolbar->setChecked(recent.wireless_toolbar_show);
+ main_ui_->actionViewStatusBar->setChecked(recent.statusbar_show);
+ main_ui_->actionViewPacketList->setChecked(recent.packet_list_show);
+ main_ui_->actionViewPacketDetails->setChecked(recent.tree_view_show);
+ main_ui_->actionViewPacketBytes->setChecked(recent.byte_view_show);
+
+ foreach (QAction* tda, td_actions.keys()) {
+ if (recent.gui_time_format == td_actions[tda]) {
+ tda->setChecked(true);
+ }
+ }
+ foreach (QAction* tpa, tp_actions.keys()) {
+ if (recent.gui_time_precision == tp_actions[tpa]) {
+ tpa->setChecked(true);
+ }
+ }
+ main_ui_->actionViewTimeDisplaySecondsWithHoursAndMinutes->setChecked(recent.gui_seconds_format == TS_SECONDS_HOUR_MIN_SEC);
+
+ main_ui_->actionViewColorizePacketList->setChecked(recent.packet_list_colorize);
+}
+
void MainWindow::filterAction(QString &action_filter, FilterAction::Action action, FilterAction::ActionType type)
{
QString cur_filter, new_filter;
QString msgtip = QString();
main_ui_->statusBar->pushFileStatus(msg, msgtip);
main_ui_->mainStack->setCurrentWidget(&master_split_);
+ main_ui_->actionAnalyzeReloadLuaPlugins->setEnabled(false);
+
WiresharkApplication::processEvents();
}
setForCapturedPackets(true);
main_ui_->statusBar->setFileName(capture_file_);
+ main_ui_->actionAnalyzeReloadLuaPlugins->setEnabled(true);
packet_list_->captureFileReadFinished();
emit setDissectedCaptureFile(capture_file_.capFile());
}
-// Our event loop becomes nested whenever we call update_progress_dlg, which
-// includes several places in file.c. The GTK+ UI stays out of trouble by
-// showing a modal progress dialog. We attempt to do the equivalent below by
-// disabling parts of the main window. At a minumum the ProgressFrame in the
-// main status bar must remain accessible.
-//
-// We might want to do this any time the main status bar progress frame is
-// shown and hidden.
void MainWindow::captureFileRetapStarted()
{
// XXX Push a status message?
- main_ui_->actionFileClose->setEnabled(false);
- main_ui_->actionViewReload->setEnabled(false);
- main_ui_->centralWidget->setEnabled(false);
+ freeze();
}
void MainWindow::captureFileRetapFinished()
{
- main_ui_->actionFileClose->setEnabled(true);
- main_ui_->actionViewReload->setEnabled(true);
- main_ui_->centralWidget->setEnabled(true);
+ thaw();
+}
+
+void MainWindow::captureFileFlushTapsData()
+{
+ draw_tap_listeners(FALSE);
}
void MainWindow::captureFileClosing() {
setMenusForCaptureFile(true);
setForCapturedPackets(false);
- setMenusForSelectedPacket();
setForCaptureInProgress(false);
// Reset expert information indicator
file_set_dialog_.fileClosed();
setMenusForFileSet(false);
+ setWindowModified(false);
// Reset expert information indicator
main_ui_->statusBar->captureFileClosing();
main_ui_->statusBar->popFileStatus();
- setTitlebarForSelectedTreeRow();
+ setDefaultWindowTitle();
+ setWindowIcon(wsApp->normalIcon());
+ setMenusForSelectedPacket();
setMenusForSelectedTreeRow();
if (!global_capture_opts.multi_files_on)
// Recreate filter buttons
foreach (QAction *act, main_ui_->displayFilterToolBar->actions()) {
// Permanent actions shouldn't have data
- if (act->property(dfe_property_).isValid() || act->isSeparator()) {
+ if (act->property(dfe_property_).isValid()) {
main_ui_->displayFilterToolBar->removeAction(act);
delete act;
}
}
- bool first = true;
+ // XXX Add a context menu for removing and changing buttons.
for (struct filter_expression *fe = *pfilter_expression_head; fe != NULL; fe = fe->next) {
if (!fe->enabled) continue;
QAction *dfb_action = new QAction(fe->label, main_ui_->displayFilterToolBar);
dfb_action->setProperty(dfe_property_, true);
main_ui_->displayFilterToolBar->addAction(dfb_action);
connect(dfb_action, SIGNAL(triggered()), this, SLOT(displayFilterButtonClicked()));
- if (first) {
- first = false;
- main_ui_->displayFilterToolBar->insertSeparator(dfb_action);
- }
}
}
return;
}
- main_ui_->mainStack->setCurrentWidget(&master_split_);
-
// Ideally we should have disabled the start capture
// toolbar buttons and menu items. This may not be the
// case, e.g. with QtMacExtras.
return;
}
+ main_ui_->mainStack->setCurrentWidget(&master_split_);
+
/* XXX - we might need to init other pref data as well... */
/* XXX - can this ever happen? */
collect_ifaces(&global_capture_opts);
CaptureFile::globalCapFile()->window = this;
- if (capture_start(&global_capture_opts, &cap_session_, main_window_update)) {
+ if (capture_start(&global_capture_opts, &cap_session_, &info_data_, main_window_update)) {
capture_options *capture_opts = cap_session_.capture_opts;
GString *interface_names;
/* enable autoscroll timer as needed. */
- packet_list_->setAutoScroll(main_ui_->actionGoAutoScroll->isChecked());
+ packet_list_->setVerticalAutoScroll(main_ui_->actionGoAutoScroll->isChecked());
/* Add "interface name<live capture in progress>" on main status bar */
interface_names = get_iface_list_string(capture_opts, 0);
main_ui_->statusBar->setFileName(capture_file_);
/* disable autoscroll timer if any. */
- packet_list_->setAutoScroll(false);
+ packet_list_->setVerticalAutoScroll(false);
}
// Keep focus rects from showing through the welcome screen. Primarily for
void MainWindow::setMenusForSelectedPacket()
{
- gboolean is_ip = FALSE, is_tcp = FALSE, is_udp = FALSE, is_sctp = FALSE, is_ssl = FALSE, is_rtp = FALSE;
+ gboolean is_ip = FALSE, is_tcp = FALSE, is_udp = FALSE, is_sctp = FALSE, is_ssl = FALSE, is_rtp = FALSE, is_lte_rlc = FALSE;
/* Making the menu context-sensitive allows for easier selection of the
desired item and has the added benefit, with large captures, of
if (capture_file_.capFile()->edt)
{
- proto_get_frame_protocols(capture_file_.capFile()->edt->pi.layers, &is_ip, &is_tcp, &is_udp, &is_sctp, &is_ssl, &is_rtp);
+ proto_get_frame_protocols(capture_file_.capFile()->edt->pi.layers,
+ &is_ip, &is_tcp, &is_udp, &is_sctp,
+ &is_ssl, &is_rtp, &is_lte_rlc);
}
}
packet_list_->conversationMenu()->clear();
packet_list_->colorizeMenu()->clear();
- for (GList *color_list_entry = color_conv_filter_list; color_list_entry; color_list_entry = g_list_next(color_list_entry)) {
+ for (GList *conv_filter_list_entry = conv_filter_list; conv_filter_list_entry; conv_filter_list_entry = g_list_next(conv_filter_list_entry)) {
// Main menu items
- color_conversation_filter_t* color_filter = (color_conversation_filter_t *)color_list_entry->data;
- QAction *conv_action = main_ui_->menuConversationFilter->addAction(color_filter->display_name);
+ conversation_filter_t* conv_filter = (conversation_filter_t *)conv_filter_list_entry->data;
+ QAction *conv_action = main_ui_->menuConversationFilter->addAction(conv_filter->display_name);
bool enable = false;
QString filter;
- if (capture_file_.capFile()->edt) {
- enable = color_filter->is_filter_valid(&capture_file_.capFile()->edt->pi);
- filter = gchar_free_to_qstring(color_filter->build_filter_string(&capture_file_.capFile()->edt->pi));
+ if (capture_file_.capFile() && capture_file_.capFile()->edt) {
+ enable = conv_filter->is_filter_valid(&capture_file_.capFile()->edt->pi);
+ filter = gchar_free_to_qstring(conv_filter->build_filter_string(&capture_file_.capFile()->edt->pi));
}
conv_action->setEnabled(enable);
conv_action->setData(filter);
main_ui_->actionSCTPShowAllAssociations->setEnabled(is_sctp);
main_ui_->actionSCTPFilterThisAssociation->setEnabled(is_sctp);
main_ui_->actionTelephonyRTPStreamAnalysis->setEnabled(is_rtp);
+ main_ui_->actionTelephonyLteRlcGraph->setEnabled(is_lte_rlc);
}
void MainWindow::setMenusForSelectedTreeRow(field_info *fi) {
field_id = proto_registrar_get_parent(fi->hfinfo->id);
}
- if (field_id >= 0 && !proto_is_private(field_id)) {
+ if (field_id >= 0) {
can_open_url = true;
main_ui_->actionContextWikiProtocolPage->setData(field_id);
main_ui_->actionContextFilterFieldReference->setData(field_id);
if (!proto_tree_ || !proto_tree_->hasFocus()) return;
main_ui_->menuConversationFilter->clear();
- for (GList *color_list_entry = color_conv_filter_list; color_list_entry; color_list_entry = g_list_next(color_list_entry)) {
- color_conversation_filter_t* color_filter = (color_conversation_filter_t *)color_list_entry->data;
- QAction *conv_action = main_ui_->menuConversationFilter->addAction(color_filter->display_name);
+ for (GList *conv_filter_list_entry = conv_filter_list; conv_filter_list_entry; conv_filter_list_entry = g_list_next(conv_filter_list_entry)) {
+ conversation_filter_t* conv_filter = (conversation_filter_t *)conv_filter_list_entry->data;
+ QAction *conv_action = main_ui_->menuConversationFilter->addAction(conv_filter->display_name);
- bool conv_enable = false;
- QString conv_filter;
- if (capture_file_.capFile() && capture_file_.capFile()->edt) {
- conv_enable = color_filter->is_filter_valid(&capture_file_.capFile()->edt->pi);
- conv_filter = color_filter->build_filter_string(&capture_file_.capFile()->edt->pi);
+ bool enable = false;
+ QString filter;
+ if (fi && capture_file_.capFile() && capture_file_.capFile()->edt) {
+ enable = conv_filter->is_filter_valid(&capture_file_.capFile()->edt->pi);
+ filter = conv_filter->build_filter_string(&capture_file_.capFile()->edt->pi);
}
- conv_action->setEnabled(conv_enable);
- conv_action->setData(conv_filter);
+ conv_action->setEnabled(enable);
+ conv_action->setData(filter);
connect(conv_action, SIGNAL(triggered()), this, SLOT(applyConversationFilter()));
}
void MainWindow::redissectPackets()
{
- if (capture_file_.capFile())
+ if (capture_file_.capFile()) {
cf_redissect_packets(capture_file_.capFile());
- main_ui_->statusBar->expertUpdate();
+ main_ui_->statusBar->expertUpdate();
+ }
proto_free_deregistered_fields();
}
-void MainWindow::fieldsChanged()
+void MainWindow::checkDisplayFilter()
{
- color_filters_reload();
- tap_listeners_dfilter_recompile();
-
if (!df_combo_box_->checkDisplayFilter()) {
g_free(CaptureFile::globalCapFile()->dfilter);
CaptureFile::globalCapFile()->dfilter = NULL;
}
+}
+
+void MainWindow::fieldsChanged()
+{
+ color_filters_reload();
+ tap_listeners_dfilter_recompile();
+
+ emit checkDisplayFilter();
if (have_custom_cols(&CaptureFile::globalCapFile()->cinfo)) {
// Recreate packet list columns according to new/changed/deleted fields
dfe_dialog->show();
}
+void MainWindow::on_actionNewDisplayFilterExpression_triggered()
+{
+ main_ui_->filterExpressionFrame->addExpression(df_combo_box_->lineEdit()->text());
+ showAccordionFrame(main_ui_->filterExpressionFrame);
+}
+
// On Qt4 + OS X with unifiedTitleAndToolBarOnMac set it's possible to make
// the main window obnoxiously wide.
void MainWindow::on_actionFileSetListFiles_triggered()
{
- file_set_dialog_.exec();
+ file_set_dialog_.show();
}
void MainWindow::on_actionFileSetNextFile_triggered()
open_failure_alert_box(file_name.toUtf8().constData(), errno, TRUE);
return;
}
- if (write(fd, data_p, capture_file_.capFile()->finfo_selected->length) < 0) {
+ if (ws_write(fd, data_p, capture_file_.capFile()->finfo_selected->length) < 0) {
write_failure_alert_box(file_name.toUtf8().constData(), errno);
- ::close(fd);
+ ws_close(fd);
return;
}
- if (::close(fd) < 0) {
+ if (ws_close(fd) < 0) {
write_failure_alert_box(file_name.toUtf8().constData(), errno);
return;
}
*/
if (ws_write(fd, keylist, (unsigned int)strlen(keylist)) < 0) {
write_failure_alert_box(file_name.toUtf8().constData(), errno);
- ::close(fd);
+ ws_close(fd);
g_free(keylist);
return;
}
- if (::close(fd) < 0) {
+ if (ws_close(fd) < 0) {
write_failure_alert_box(file_name.toUtf8().constData(), errno);
g_free(keylist);
return;
previous_focus_ = wsApp->focusWidget();
connect(previous_focus_, SIGNAL(destroyed()), this, SLOT(resetPreviousFocus()));
showAccordionFrame(main_ui_->searchFrame, true);
+ if (main_ui_->searchFrame->isVisible()) {
+ main_ui_->searchFrame->setFocus();
+ }
}
void MainWindow::on_actionEditFindNext_triggered()
void MainWindow::on_actionEditMarkPacket_triggered()
{
+ freeze();
packet_list_->markFrame();
+ thaw();
}
void MainWindow::on_actionEditMarkAllDisplayed_triggered()
{
+ freeze();
packet_list_->markAllDisplayedFrames(true);
+ thaw();
}
void MainWindow::on_actionEditUnmarkAllDisplayed_triggered()
{
+ freeze();
packet_list_->markAllDisplayedFrames(false);
+ thaw();
}
void MainWindow::on_actionEditNextMark_triggered()
void MainWindow::on_actionEditIgnorePacket_triggered()
{
+ freeze();
packet_list_->ignoreFrame();
+ thaw();
}
void MainWindow::on_actionEditIgnoreAllDisplayed_triggered()
{
+ freeze();
packet_list_->ignoreAllDisplayedFrames(true);
+ thaw();
}
void MainWindow::on_actionEditUnignoreAllDisplayed_triggered()
{
+ freeze();
packet_list_->ignoreAllDisplayedFrames(false);
+ thaw();
}
void MainWindow::on_actionEditSetTimeReference_triggered()
TimeShiftDialog ts_dialog(this, capture_file_.capFile());
connect(this, SIGNAL(setCaptureFile(capture_file*)),
&ts_dialog, SLOT(setCaptureFile(capture_file*)));
+ connect(&ts_dialog, SIGNAL(timeShifted()), packet_list_, SLOT(applyTimeShift()));
ts_dialog.exec();
}
cf_timestamp_auto_precision(capture_file_.capFile());
}
if (packet_list_) {
- packet_list_->columnsChanged();
+ packet_list_->resetColumns();
}
}
}
cf_timestamp_auto_precision(capture_file_.capFile());
}
if (packet_list_) {
- packet_list_->columnsChanged();
+ packet_list_->resetColumns();
}
}
}
cf_timestamp_auto_precision(capture_file_.capFile());
}
if (packet_list_) {
- packet_list_->columnsChanged();
+ packet_list_->resetColumns();
}
}
gbl_resolv_flags.transport_name = main_ui_->actionViewNameResolutionTransport->isChecked() ? TRUE : FALSE;
if (packet_list_) {
- packet_list_->columnsChanged();
+ packet_list_->resetColumns();
}
}
recent.packet_list_colorize = checked;
color_filters_enable(checked);
packet_list_->packetListModel()->resetColorized();
- packet_list_->update();
}
void MainWindow::on_actionViewColoringRules_triggered()
{
ColoringRulesDialog coloring_rules_dialog(this);
-
+ connect(&coloring_rules_dialog, SIGNAL(accepted()),
+ packet_list_, SLOT(recolorPackets()));
coloring_rules_dialog.exec();
}
guint8 cc_num = cc_action->data().toUInt();
gchar *filter = NULL;
- const color_conversation_filter_t *color_filter = find_color_conversation_filter("tcp");
+ const conversation_filter_t *color_filter = find_conversation_filter("tcp");
if ((color_filter != NULL) && (color_filter->is_filter_valid(pi)))
filter = color_filter->build_filter_string(pi);
if (filter == NULL) {
- color_filter = find_color_conversation_filter("udp");
+ color_filter = find_conversation_filter("udp");
if ((color_filter != NULL) && (color_filter->is_filter_valid(pi)))
filter = color_filter->build_filter_string(pi);
}
if (filter == NULL) {
- color_filter = find_color_conversation_filter("ip");
+ color_filter = find_conversation_filter("ip");
if ((color_filter != NULL) && (color_filter->is_filter_valid(pi)))
filter = color_filter->build_filter_string(pi);
}
if (filter == NULL) {
- color_filter = find_color_conversation_filter("ipv6");
+ color_filter = find_conversation_filter("ipv6");
if ((color_filter != NULL) && (color_filter->is_filter_valid(pi)))
filter = color_filter->build_filter_string(pi);
}
if (filter == NULL) {
- color_filter = find_color_conversation_filter("eth");
+ color_filter = find_conversation_filter("eth");
if ((color_filter != NULL) && (color_filter->is_filter_valid(pi)))
filter = color_filter->build_filter_string(pi);
}
if (create_rule) {
ColoringRulesDialog coloring_rules_dialog(this, filter);
+ connect(&coloring_rules_dialog, SIGNAL(accepted()),
+ packet_list_, SLOT(recolorPackets()));
coloring_rules_dialog.exec();
} else {
color_filters_set_tmp(cc_num, filter, FALSE);
} else {
// New coloring rule
ColoringRulesDialog coloring_rules_dialog(window(), filter);
+ connect(&coloring_rules_dialog, SIGNAL(accepted()),
+ packet_list_, SLOT(recolorPackets()));
coloring_rules_dialog.exec();
}
main_ui_->actionViewColorizeResetColorization->setEnabled(tmp_color_filters_used());
}
}
+void MainWindow::on_actionViewInternalsConversationHashTables_triggered()
+{
+ ConversationHashTablesDialog *conversation_hash_tables_dlg = new ConversationHashTablesDialog(this);
+ conversation_hash_tables_dlg->show();
+}
+
+void MainWindow::on_actionViewInternalsDissectorTables_triggered()
+{
+ DissectorTablesDialog *dissector_tables_dlg = new DissectorTablesDialog(this);
+ dissector_tables_dlg->show();
+}
+
+void MainWindow::on_actionViewInternalsSupportedProtocols_triggered()
+{
+ SupportedProtocolsDialog *supported_protocols_dlg = new SupportedProtocolsDialog(this);
+ supported_protocols_dlg->show();
+}
+
void MainWindow::on_actionViewShowPacketInNewWindow_triggered()
{
openPacketDialog();
cf_reload(CaptureFile::globalCapFile());
}
+void MainWindow::on_actionViewReload_as_File_Format_or_Capture_triggered()
+{
+ capture_file *cf = CaptureFile::globalCapFile();
+
+ if (cf->open_type == WTAP_TYPE_AUTO)
+ cf->open_type = open_info_name_to_type("MIME Files Format");
+ else /* TODO: This should be latest format chosen by user */
+ cf->open_type = WTAP_TYPE_AUTO;
+
+ cf_reload(cf);
+}
+
+
// Expand / collapse slots in proto_tree
// Go Menu
wsApp->flushAppSignals();
}
-#ifdef HAVE_LUA
void MainWindow::on_actionAnalyzeReloadLuaPlugins_triggered()
{
+#ifdef HAVE_LUA
if (wsApp->isReloadingLua())
return;
main_ui_->preferenceEditorFrame->animatedHide();
char *gdp_path, *dp_path;
- (void) wsApp->readConfigurationFiles(&gdp_path, &dp_path);
+ wsApp->readConfigurationFiles(&gdp_path, &dp_path, true);
fieldsChanged();
redissectPackets();
wsApp->setReloadingLua(false);
SimpleDialog::displayQueuedMessages();
-}
#endif
+}
void MainWindow::openFollowStreamDialog(follow_type_t type) {
FollowStreamDialog *fsd = new FollowStreamDialog(*this, capture_file_, type);
statCommandLteMacStatistics(NULL, NULL);
}
+void MainWindow::statCommandLteRlcStatistics(const char *arg, void *)
+{
+ LteRlcStatisticsDialog *lte_rlc_stats_dlg = new LteRlcStatisticsDialog(*this, capture_file_, arg);
+ connect(lte_rlc_stats_dlg, SIGNAL(filterAction(QString&,FilterAction::Action,FilterAction::ActionType)),
+ this, SLOT(filterAction(QString&,FilterAction::Action,FilterAction::ActionType)));
+ // N.B. It is necessary for the RLC Statistics window to launch the RLC graph in this way, to ensure
+ // that the goToPacket() signal/slot connection gets set up...
+ connect(lte_rlc_stats_dlg, SIGNAL(launchRLCGraph(bool, guint16, guint8, guint16, guint16, guint8)),
+ this, SLOT(launchRLCGraph(bool, guint16, guint8, guint16, guint16, guint8)));
+
+ lte_rlc_stats_dlg->show();
+}
+
+void MainWindow::on_actionTelephonyLteRlcStatistics_triggered()
+{
+ statCommandLteRlcStatistics(NULL, NULL);
+}
+
+void MainWindow::launchRLCGraph(bool channelKnown,
+ guint16 ueid, guint8 rlcMode,
+ guint16 channelType, guint16 channelId, guint8 direction)
+{
+ LteRlcGraphDialog *lrg_dialog = new LteRlcGraphDialog(*this, capture_file_, channelKnown);
+ connect(lrg_dialog, SIGNAL(goToPacket(int)), packet_list_, SLOT(goToPacket(int)));
+ // This is a bit messy, but wanted to hide these parameters from users of
+ // on_actionTelephonyLteRlcGraph_triggered().
+ if (channelKnown) {
+ lrg_dialog->setChannelInfo(ueid, rlcMode, channelType, channelId, direction);
+ }
+ lrg_dialog->show();
+}
+
+void MainWindow::on_actionTelephonyLteRlcGraph_triggered()
+{
+ // We don't yet know the channel.
+ launchRLCGraph(false, 0, 0, 0, 0, 0);
+}
+
void MainWindow::on_actionTelephonyMtp3Summary_triggered()
{
Mtp3SummaryDialog *mtp3s_dialog = new Mtp3SummaryDialog(*this, capture_file_);
// Bluetooth Menu
-void MainWindow::on_actionATT_Server_Attributes_triggered()
+void MainWindow::on_actionBluetoothATT_Server_Attributes_triggered()
{
BluetoothAttServerAttributesDialog *bluetooth_att_sever_attributes_dialog = new BluetoothAttServerAttributesDialog(*this, capture_file_);
connect(bluetooth_att_sever_attributes_dialog, SIGNAL(goToPacket(int)),
bluetooth_att_sever_attributes_dialog->show();
}
-void MainWindow::on_actionDevices_triggered()
+void MainWindow::on_actionBluetoothDevices_triggered()
{
BluetoothDevicesDialog *bluetooth_devices_dialog = new BluetoothDevicesDialog(*this, capture_file_);
connect(bluetooth_devices_dialog, SIGNAL(goToPacket(int)),
bluetooth_devices_dialog->show();
}
-void MainWindow::on_actionHCI_Summary_triggered()
+void MainWindow::on_actionBluetoothHCI_Summary_triggered()
{
BluetoothHciSummaryDialog *bluetooth_hci_summary_dialog = new BluetoothHciSummaryDialog(*this, capture_file_);
connect(bluetooth_hci_summary_dialog, SIGNAL(goToPacket(int)),
packet_list_->goToPacket(packet_num);
}
+// gtk/main_menubar.c:goto_conversation_frame
+void MainWindow::goToConversationFrame(bool go_next) {
+ gchar *filter = NULL;
+ dfilter_t *dfcode = NULL;
+ gboolean found_packet = FALSE;
+ packet_info *pi = &(capture_file_.capFile()->edt->pi);
+ conversation_filter_t* conv_filter;
+
+ /* Try to build a conversation
+ * filter in the order TCP, UDP, IP, Ethernet and apply the
+ * coloring */
+ conv_filter = find_conversation_filter("tcp");
+ if ((conv_filter != NULL) && (conv_filter->is_filter_valid(pi)))
+ filter = conv_filter->build_filter_string(pi);
+ conv_filter = find_conversation_filter("udp");
+ if ((conv_filter != NULL) && (conv_filter->is_filter_valid(pi)))
+ filter = conv_filter->build_filter_string(pi);
+ conv_filter = find_conversation_filter("ip");
+ if ((conv_filter != NULL) && (conv_filter->is_filter_valid(pi)))
+ filter = conv_filter->build_filter_string(pi);
+ conv_filter = find_conversation_filter("ipv6");
+ if ((conv_filter != NULL) && (conv_filter->is_filter_valid(pi)))
+ filter = conv_filter->build_filter_string(pi);
+
+ if( filter == NULL ) {
+ main_ui_->statusBar->pushTemporaryStatus(tr("Unable to build conversation filter."));
+ g_free(filter);
+ return;
+ }
+
+ if (!dfilter_compile(filter, &dfcode, NULL)) {
+ /* The attempt failed; report an error. */
+ main_ui_->statusBar->pushTemporaryStatus(tr("Error compiling filter for this conversation."));
+ g_free(filter);
+ return;
+ }
+
+ found_packet = cf_find_packet_dfilter(capture_file_.capFile(), dfcode, go_next ? SD_FORWARD : SD_BACKWARD);
+
+ if (!found_packet) {
+ /* We didn't find a packet */
+ main_ui_->statusBar->pushTemporaryStatus(tr("No previous/next packet in conversation."));
+ }
+
+ dfilter_free(dfcode);
+ g_free(filter);
+}
+
+void MainWindow::on_actionGoNextConversationPacket_triggered()
+{
+ goToConversationFrame(true);
+}
+
+void MainWindow::on_actionGoPreviousConversationPacket_triggered()
+{
+ goToConversationFrame(false);
+}
+
void MainWindow::on_actionGoAutoScroll_toggled(bool checked)
{
- packet_list_->setAutoScroll(checked);
+ packet_list_->setVerticalAutoScroll(checked);
}
void MainWindow::resetPreviousFocus() {
void MainWindow::on_actionCaptureRefreshInterfaces_triggered()
{
+ main_ui_->actionCaptureRefreshInterfaces->setEnabled(false);
wsApp->refreshLocalInterfaces();
+ main_ui_->actionCaptureRefreshInterfaces->setEnabled(true);
}
#endif
QDesktopServices::openUrl(dfref_url);
}
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
/*
* Editor modelines
*