aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2017-09-19 21:49:55 -0400
committerAnders Broman <a.broman58@gmail.com>2017-09-20 04:48:40 +0000
commitb5759cafae8f1cf852f39fe68accd126d40955cb (patch)
tree11423d30a43a5b10d31c61866817ae48567079f0 /ui
parent8db4ddd40c6858109369156f6ae7b14c40c3b8df (diff)
Integrate LBM UIM Flow dialog into "regular" Flow diagram.
Reduce all of the code duplication and just register the sequence analysis functionality in LBM dissector. Change-Id: I6cb5a7f0a92b04357334bbae301fa2d730a21994 Reviewed-on: https://code.wireshark.org/review/23630 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/gtk/CMakeLists.txt1
-rw-r--r--ui/gtk/Makefile.am2
-rw-r--r--ui/gtk/lbm_uimflow_dlg.c430
-rw-r--r--ui/gtk/lbm_uimflow_dlg.h45
-rw-r--r--ui/gtk/main_menubar.c2
-rw-r--r--ui/qt/CMakeLists.txt3
-rw-r--r--ui/qt/Makefile.am5
-rw-r--r--ui/qt/lbm_uimflow_dialog.cpp666
-rw-r--r--ui/qt/lbm_uimflow_dialog.h119
-rw-r--r--ui/qt/lbm_uimflow_dialog.ui329
-rw-r--r--ui/qt/main_window.h1
-rw-r--r--ui/qt/main_window.ui6
-rw-r--r--ui/qt/main_window_slots.cpp11
13 files changed, 0 insertions, 1620 deletions
diff --git a/ui/gtk/CMakeLists.txt b/ui/gtk/CMakeLists.txt
index b3ec0b3e3a..b64973da5a 100644
--- a/ui/gtk/CMakeLists.txt
+++ b/ui/gtk/CMakeLists.txt
@@ -202,7 +202,6 @@ set(WIRESHARK_TAP_SRC
iax2_analysis.c
io_stat.c
lbm_stream_dlg.c
- lbm_uimflow_dlg.c
mac_lte_stat_dlg.c
mcast_stream_dlg.c
mtp3_summary.c
diff --git a/ui/gtk/Makefile.am b/ui/gtk/Makefile.am
index 57635a8daa..5f46795d10 100644
--- a/ui/gtk/Makefile.am
+++ b/ui/gtk/Makefile.am
@@ -134,7 +134,6 @@ WIRESHARK_TAP_SRC = \
iax2_analysis.c \
io_stat.c \
lbm_stream_dlg.c \
- lbm_uimflow_dlg.c \
mac_lte_stat_dlg.c \
mcast_stream_dlg.c \
mtp3_summary.c \
@@ -199,7 +198,6 @@ WIRESHARK_COMMON_GTK_HDRS = \
hostlist_table.h \
keys.h \
lbm_stream_dlg.h \
- lbm_uimflow_dlg.h \
macros_dlg.h \
main.h \
main_filter_toolbar.h \
diff --git a/ui/gtk/lbm_uimflow_dlg.c b/ui/gtk/lbm_uimflow_dlg.c
deleted file mode 100644
index 3c2dfcb32c..0000000000
--- a/ui/gtk/lbm_uimflow_dlg.c
+++ /dev/null
@@ -1,430 +0,0 @@
-/* lbm_uimflow_dlg.c
- * Routines for LBMC UIM flow graph
- *
- * Copyright (c) 2005-2014 Informatica Corporation. All Rights Reserved.
- *
- * 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 <epan/to_str.h>
-#include <epan/packet.h>
-#include <epan/tap.h>
-#include <gtk/gtk.h>
-#include "ui/gtk/gui_utils.h"
-#include "ui/gtk/dlg_utils.h"
-#include <globals.h>
-#include "ui/gtk/graph_analysis.h"
-#include <epan/dissectors/packet-lbm.h>
-#include "lbm_uimflow_dlg.h"
-#include "ui/gtk/old-gtk-compat.h"
-
-typedef enum
-{
- select_all_packets,
- select_displayed_packets
-} lbmc_uim_flow_select_t;
-
-typedef struct
-{
- gboolean have_tap_listener;
- int tap_identifier;
- seq_analysis_info_t * graph_analysis;
- graph_analysis_data_t * graph_analysis_data;
- GtkWidget * flow_graph_dialog;
- lbmc_uim_flow_select_t packet_select_type;
- GtkWidget * select_all_radio_button;
- GtkWidget * select_displayed_radio_button;
-} lbm_uimflow_dialog_t;
-
-static lbm_uimflow_dialog_t dialog_data = { FALSE, -1, NULL, NULL, NULL, select_displayed_packets, NULL, NULL };
-
-static void lbmc_uim_flow_graph_data_init(void)
-{
- dialog_data.graph_analysis = sequence_analysis_info_new();
- dialog_data.graph_analysis->name = "any";
- dialog_data.graph_analysis->all_packets = TRUE;
- dialog_data.graph_analysis->any_addr = TRUE;
-}
-
-static void lbmc_uim_flow_toggle_select_all_cb(GtkWidget * widget _U_, gpointer user_data _U_)
-{
- /* is the button now active? */
- if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog_data.select_all_radio_button)))
- {
- dialog_data.packet_select_type = select_all_packets;
- }
-}
-
-static void lbmc_uim_flow_toggle_select_displayed_cb(GtkWidget * widget _U_, gpointer user_data _U_)
-{
- /* is the button now active? */
- if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog_data.select_displayed_radio_button)))
- {
- dialog_data.packet_select_type = select_displayed_packets;
- }
-}
-
-static void lbmc_uim_flow_tap_reset(void * tap_data _U_)
-{
- if (dialog_data.graph_analysis != NULL)
- {
- /* free the graph data items */
- sequence_analysis_list_free(dialog_data.graph_analysis);
- }
-}
-
-static int lbmc_uim_flow_graph_add_to_graph(packet_info * pinfo, const lbm_uim_stream_info_t * stream_info)
-{
- lbm_uim_stream_endpoint_t epa;
- lbm_uim_stream_endpoint_t epb;
- seq_analysis_item_t * item;
- gchar * ctxinst1;
- gchar * ctxinst2;
- gboolean swap_endpoints = FALSE;
- int rc;
-
- if (stream_info->endpoint_a.type != stream_info->endpoint_b.type)
- {
- return (1);
- }
- if (stream_info->endpoint_a.type == lbm_uim_instance_stream)
- {
- rc = memcmp((void *)stream_info->endpoint_a.stream_info.ctxinst.ctxinst,
- (void *)stream_info->endpoint_b.stream_info.ctxinst.ctxinst,
- LBM_CONTEXT_INSTANCE_BLOCK_SZ);
- if (rc <= 0)
- {
- swap_endpoints = FALSE;
- }
- else
- {
- swap_endpoints = TRUE;
- }
- }
- else
- {
- if (stream_info->endpoint_a.stream_info.dest.domain < stream_info->endpoint_b.stream_info.dest.domain)
- {
- swap_endpoints = FALSE;
- }
- else if (stream_info->endpoint_a.stream_info.dest.domain > stream_info->endpoint_b.stream_info.dest.domain)
- {
- swap_endpoints = TRUE;
- }
- else
- {
- int compare;
-
- compare = cmp_address(&(stream_info->endpoint_a.stream_info.dest.addr), &(stream_info->endpoint_b.stream_info.dest.addr));
- if (compare < 0)
- {
- swap_endpoints = FALSE;
- }
- else if (compare > 0)
- {
- swap_endpoints = TRUE;
- }
- else
- {
- if (stream_info->endpoint_a.stream_info.dest.port <= stream_info->endpoint_b.stream_info.dest.port)
- {
- swap_endpoints = FALSE;
- }
- else
- {
- swap_endpoints = TRUE;
- }
- }
- }
- }
- if (swap_endpoints == FALSE)
- {
- epa = stream_info->endpoint_a;
- epb = stream_info->endpoint_b;
- }
- else
- {
- epb = stream_info->endpoint_a;
- epa = stream_info->endpoint_b;
- }
- item = (seq_analysis_item_t *)g_malloc0(sizeof(seq_analysis_item_t));
- copy_address(&(item->src_addr), &(pinfo->src));
- copy_address(&(item->dst_addr), &(pinfo->dst));
- item->frame_number = pinfo->num;
- item->port_src = pinfo->srcport;
- item->port_dst = pinfo->destport;
- if (stream_info->description == NULL)
- {
- item->frame_label = g_strdup_printf("(%" G_GUINT32_FORMAT ")", stream_info->sqn);
- }
- else
- {
- item->frame_label = g_strdup_printf("%s (%" G_GUINT32_FORMAT ")", stream_info->description, stream_info->sqn);
- }
- if (epa.type == lbm_uim_instance_stream)
- {
- ctxinst1 = bytes_to_str(pinfo->pool, epa.stream_info.ctxinst.ctxinst, sizeof(epa.stream_info.ctxinst.ctxinst));
- ctxinst2 = bytes_to_str(pinfo->pool, epb.stream_info.ctxinst.ctxinst, sizeof(epb.stream_info.ctxinst.ctxinst));
- item->comment = g_strdup_printf("%s <-> %s [%" G_GUINT64_FORMAT "]",
- ctxinst1,
- ctxinst2,
- stream_info->channel);
- }
- else
- {
- item->comment = g_strdup_printf("%" G_GUINT32_FORMAT ":%s:%" G_GUINT16_FORMAT " <-> %" G_GUINT32_FORMAT ":%s:%" G_GUINT16_FORMAT " [%" G_GUINT64_FORMAT "]",
- epa.stream_info.dest.domain,
- address_to_str(pinfo->pool, &(epa.stream_info.dest.addr)),
- epa.stream_info.dest.port,
- epb.stream_info.dest.domain,
- address_to_str(pinfo->pool, &(epb.stream_info.dest.addr)),
- epb.stream_info.dest.port,
- stream_info->channel);
- }
- item->conv_num = (guint16)LBM_CHANNEL_ID(stream_info->channel);
- item->display = TRUE;
- item->line_style = 1;
- g_queue_push_tail(dialog_data.graph_analysis->items, item);
- return (1);
-}
-
-static gboolean lbmc_uim_flow_tap_packet(void * tap_data _U_, packet_info * pinfo, epan_dissect_t * edt _U_, const void * stream_info)
-{
- const lbm_uim_stream_info_t * info = (const lbm_uim_stream_info_t *)stream_info;
- if ((dialog_data.packet_select_type == select_all_packets) || (pinfo->fd->flags.passed_dfilter == 1))
- {
- lbmc_uim_flow_graph_add_to_graph(pinfo, info);
- return (TRUE);
- }
- return (FALSE);
-}
-
-static void lbmc_uim_flow_tap_draw(void * tap_data _U_)
-{
- return;
-}
-
-static void lbmc_uim_flow_remove_tap_listener(void)
-{
- remove_tap_listener(&(dialog_data.tap_identifier));
- dialog_data.have_tap_listener = FALSE;
-}
-
-static void lbmc_uim_flow_graph_on_ok_cb(GtkButton * button _U_, gpointer user_data)
-{
- GList * list = NULL;
- gchar time_str[COL_MAX_LEN];
-
- if (dialog_data.have_tap_listener == TRUE)
- {
- /* remove_tap_listeners */
- lbmc_uim_flow_remove_tap_listener();
- }
-
- /* Scan for displayed packets (retap all packets) */
- if (dialog_data.have_tap_listener == FALSE)
- {
- GString * err_msg;
-
- err_msg = register_tap_listener("lbm_uim",
- &(dialog_data.tap_identifier),
- NULL,
- TL_REQUIRES_COLUMNS,
- lbmc_uim_flow_tap_reset,
- lbmc_uim_flow_tap_packet,
- lbmc_uim_flow_tap_draw);
- if (err_msg != NULL)
- {
- fprintf(stderr, "register_tap_listener: %s\n", err_msg->str);
- g_string_free(err_msg, TRUE);
- }
- dialog_data.have_tap_listener = TRUE;
- }
- cf_retap_packets(&cfile);
- /* Fill in the timestamps. */
- list = g_queue_peek_nth_link(dialog_data.graph_analysis->items, 0);
- while (list != NULL)
- {
- seq_analysis_item_t * seq_item = (seq_analysis_item_t *)list->data;
- set_fd_time(cfile.epan, frame_data_sequence_find(cfile.frames, seq_item->frame_number), time_str);
- seq_item->time_str = g_strdup(time_str);
- list = g_list_next(list);
- }
- if (dialog_data.graph_analysis_data->dlg.window != NULL)
- {
- graph_analysis_update(dialog_data.graph_analysis_data);
- }
- else
- {
- dialog_data.graph_analysis_data->dlg.parent_w = (GtkWidget *)user_data;
- graph_analysis_create(dialog_data.graph_analysis_data);
- }
-}
-
-static void lbmc_uim_flow_graph_on_destroy_cb(GtkWidget * widget _U_, gpointer user_data _U_)
-{
- /* remove_tap_listeners */
- lbmc_uim_flow_remove_tap_listener();
-
- /* Clean up memory used by tap */
- lbmc_uim_flow_tap_reset(NULL);
-
- g_assert(dialog_data.graph_analysis != NULL);
- g_assert(dialog_data.graph_analysis_data != NULL);
-
- sequence_analysis_info_free(dialog_data.graph_analysis);
- dialog_data.graph_analysis = NULL;
-
- g_free(dialog_data.graph_analysis_data);
- dialog_data.graph_analysis_data = NULL;
-
- /* Note that we no longer have a "Flow Graph" dialog box. */
- dialog_data.flow_graph_dialog = NULL;
-}
-
-static void lbmc_uim_flow_graph_dlg_create(void)
-{
- GtkWidget * flow_graph_dlg_w = NULL;
- GtkWidget * main_vb = NULL;
- GtkWidget * hbuttonbox = NULL;
- GtkWidget * bt_cancel = NULL;
- GtkWidget * bt_ok = NULL;
- GtkWidget * range_fr = NULL;
- GtkWidget * range_grid = NULL;
-
- flow_graph_dlg_w = dlg_window_new("Wireshark: UIM Flow Graph");
- gtk_window_set_destroy_with_parent(GTK_WINDOW(flow_graph_dlg_w), TRUE);
-
- gtk_window_set_default_size(GTK_WINDOW(flow_graph_dlg_w), 250, 150);
-
- main_vb = ws_gtk_box_new(GTK_ORIENTATION_VERTICAL, 0, FALSE);
- gtk_container_add(GTK_CONTAINER(flow_graph_dlg_w), main_vb);
- gtk_container_set_border_width(GTK_CONTAINER(main_vb), 7);
-
- gtk_widget_show(flow_graph_dlg_w);
-
- /*** Packet range frame ***/
- range_fr = gtk_frame_new("Choose packets");
- gtk_box_pack_start(GTK_BOX(main_vb), range_fr, FALSE, FALSE, 5);
-
- range_grid = ws_gtk_grid_new();
- gtk_container_set_border_width(GTK_CONTAINER(range_grid), 5);
- gtk_container_add(GTK_CONTAINER(range_fr), range_grid);
-
- /* Process all packets */
- dialog_data.select_all_radio_button = gtk_radio_button_new_with_mnemonic_from_widget(NULL, "_All packets");
- gtk_widget_set_tooltip_text(dialog_data.select_all_radio_button, ("Process all packets"));
- g_signal_connect(dialog_data.select_all_radio_button, "toggled", G_CALLBACK(lbmc_uim_flow_toggle_select_all_cb), NULL);
- ws_gtk_grid_attach_extended(GTK_GRID(range_grid), dialog_data.select_all_radio_button, 0, 0, 1, 1,
- (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(0), 0, 0);
- if (dialog_data.packet_select_type == select_all_packets)
- {
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog_data.select_all_radio_button), TRUE);
- }
- gtk_widget_show(dialog_data.select_all_radio_button);
-
- /* Process displayed packets */
- dialog_data.select_displayed_radio_button =
- gtk_radio_button_new_with_mnemonic_from_widget(GTK_RADIO_BUTTON(dialog_data.select_all_radio_button), "_Displayed packets");
- gtk_widget_set_tooltip_text(dialog_data.select_displayed_radio_button, ("Process displayed packets"));
- g_signal_connect(dialog_data.select_displayed_radio_button, "toggled", G_CALLBACK(lbmc_uim_flow_toggle_select_displayed_cb), NULL);
- ws_gtk_grid_attach_extended(GTK_GRID(range_grid), dialog_data.select_displayed_radio_button, 0, 1, 1, 1,
- (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(0), 0, 0);
- if (dialog_data.packet_select_type == select_displayed_packets)
- {
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog_data.select_displayed_radio_button), TRUE);
- }
- gtk_widget_show(dialog_data.select_displayed_radio_button);
-
- gtk_widget_show(range_grid);
- gtk_widget_show(range_fr);
-
- /* button row */
- hbuttonbox = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
- gtk_box_pack_start(GTK_BOX(main_vb), hbuttonbox, FALSE, FALSE, 5);
- gtk_button_box_set_layout(GTK_BUTTON_BOX(hbuttonbox), GTK_BUTTONBOX_SPREAD);
- gtk_box_set_spacing(GTK_BOX(hbuttonbox), 30);
-
- bt_ok = gtk_button_new_from_stock(GTK_STOCK_OK);
- gtk_container_add(GTK_CONTAINER(hbuttonbox), bt_ok);
- gtk_widget_set_tooltip_text(bt_ok, "Show the flow graph");
- g_signal_connect(bt_ok, "clicked", G_CALLBACK(lbmc_uim_flow_graph_on_ok_cb), flow_graph_dlg_w);
- gtk_widget_show(bt_ok);
-
- bt_cancel = gtk_button_new_from_stock(GTK_STOCK_CANCEL);
- gtk_container_add(GTK_CONTAINER(hbuttonbox), bt_cancel);
- gtk_widget_set_can_default(bt_cancel, TRUE);
- gtk_widget_set_tooltip_text(bt_cancel, "Cancel this dialog");
- window_set_cancel_button(flow_graph_dlg_w, bt_cancel, window_cancel_button_cb);
-
- g_signal_connect(flow_graph_dlg_w, "delete_event", G_CALLBACK(window_delete_event_cb), NULL);
- g_signal_connect(flow_graph_dlg_w, "destroy", G_CALLBACK(lbmc_uim_flow_graph_on_destroy_cb), NULL);
-
- gtk_widget_show_all(flow_graph_dlg_w);
- window_present(flow_graph_dlg_w);
-
- dialog_data.flow_graph_dialog = flow_graph_dlg_w;
-}
-
-static void lbmc_uim_flow_graph_init_tap(const char * dummy _U_, void * user_data _U_)
-{
- /*
- The storage allocated by lbmc_uim_flow_graph_data_init() and lbmc_uim_graph_analysis_init()
- will be considered to be "associated with" the dialog_data.flow_graph_dialog dialog box. It will be freed
- when the dialog_data.flow_graph_dialog dialog box is destroyed.
- */
- if (dialog_data.flow_graph_dialog != NULL)
- {
- g_assert(dialog_data.graph_analysis != NULL);
- g_assert(dialog_data.graph_analysis_data != NULL);
- /* There's already a dialog box; reactivate it. */
- reactivate_window(dialog_data.flow_graph_dialog);
- }
- else
- {
- g_assert(dialog_data.graph_analysis == NULL);
- g_assert(dialog_data.graph_analysis_data == NULL);
- /* initialize graph items store */
- lbmc_uim_flow_graph_data_init();
-
- /* init the Graph Analysis */
- dialog_data.graph_analysis_data = graph_analysis_init(dialog_data.graph_analysis);
-
- lbmc_uim_flow_graph_dlg_create();
- }
-}
-
-void lbmc_uim_flow_menu_cb(gpointer arg _U_)
-{
- lbmc_uim_flow_graph_init_tap("", NULL);
-}
-
-/*
- * Editor modelines - http://www.wireshark.org/tools/modelines.html
- *
- * Local variables:
- * c-basic-offset: 4
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- *
- * vi: set shiftwidth=4 tabstop=8 expandtab:
- * :indentSize=4:tabSize=8:noTabs=true:
- */
diff --git a/ui/gtk/lbm_uimflow_dlg.h b/ui/gtk/lbm_uimflow_dlg.h
deleted file mode 100644
index c7260d0f56..0000000000
--- a/ui/gtk/lbm_uimflow_dlg.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* lbm_uimflow_dlg.h
- * Routines for LBMC UIM flow graph dialog
- *
- * Copyright (c) 2005-2014 Informatica Corporation. All Rights Reserved.
- *
- * 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 LBM_UIMFLOW_DLG_H_INCLUDED
-#define LBM_UIMFLOW_DLG_H_INCLUDED
-
-#include <glib.h>
-
-void lbmc_uim_flow_menu_cb(gpointer arg);
-
-#endif
-
-/*
- * Editor modelines - http://www.wireshark.org/tools/modelines.html
- *
- * Local variables:
- * c-basic-offset: 4
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- *
- * vi: set shiftwidth=4 tabstop=8 expandtab:
- * :indentSize=4:tabSize=8:noTabs=true:
- */
diff --git a/ui/gtk/main_menubar.c b/ui/gtk/main_menubar.c
index 1d7b73979b..336ed9bff5 100644
--- a/ui/gtk/main_menubar.c
+++ b/ui/gtk/main_menubar.c
@@ -103,7 +103,6 @@
#include "ui/gtk/packet_list.h"
#include "ui/gtk/lbm_stream_dlg.h"
-#include "ui/gtk/lbm_uimflow_dlg.h"
#ifdef HAVE_LIBPCAP
#include "capture_opts.h"
@@ -1431,7 +1430,6 @@ static const GtkActionEntry main_menu_bar_entries[] = {
{ "/Statistics/29West/Queues/lbmr_queue_queries_receiver", NULL, "Queries by Receiver", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
{ "/Statistics/29West/UIM", NULL, "UIM", NULL, NULL, NULL },
{ "/Statistics/29West/UIM/Streams", NULL, "Streams", NULL, NULL, G_CALLBACK(lbmc_stream_dlg_stream_menu_cb) },
- { "/Statistics/29West/UIM/StreamFlowGraph", WIRESHARK_STOCK_FLOW_GRAPH, "Stream Flow Graph", NULL, NULL, G_CALLBACK(lbmc_uim_flow_menu_cb) },
{ "/Statistics/ancp", NULL, "ANCP", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
{ "/Statistics/BACnet", NULL, "BACnet", NULL, NULL, NULL },
diff --git a/ui/qt/CMakeLists.txt b/ui/qt/CMakeLists.txt
index 01b4fb64cb..3822e050f0 100644
--- a/ui/qt/CMakeLists.txt
+++ b/ui/qt/CMakeLists.txt
@@ -133,7 +133,6 @@ set(WIRESHARK_QT_HEADERS
lbm_lbtrm_transport_dialog.h
lbm_lbtru_transport_dialog.h
lbm_stream_dialog.h
- lbm_uimflow_dialog.h
lte_rlc_graph_dialog.h
lte_mac_statistics_dialog.h
lte_rlc_statistics_dialog.h
@@ -325,7 +324,6 @@ set(WIRESHARK_QT_SRC
lbm_lbtrm_transport_dialog.cpp
lbm_lbtru_transport_dialog.cpp
lbm_stream_dialog.cpp
- lbm_uimflow_dialog.cpp
lte_mac_statistics_dialog.cpp
lte_rlc_graph_dialog.cpp
lte_rlc_statistics_dialog.cpp
@@ -467,7 +465,6 @@ set(WIRESHARK_QT_UI
lbm_lbtrm_transport_dialog.ui
lbm_lbtru_transport_dialog.ui
lbm_stream_dialog.ui
- lbm_uimflow_dialog.ui
lte_rlc_graph_dialog.ui
main_welcome.ui
main_window.ui
diff --git a/ui/qt/Makefile.am b/ui/qt/Makefile.am
index c7647628c3..6d441c7ca3 100644
--- a/ui/qt/Makefile.am
+++ b/ui/qt/Makefile.am
@@ -261,7 +261,6 @@ MOC_HDRS = \
lbm_lbtrm_transport_dialog.h \
lbm_lbtru_transport_dialog.h \
lbm_stream_dialog.h \
- lbm_uimflow_dialog.h \
lte_mac_statistics_dialog.h \
lte_rlc_graph_dialog.h \
lte_rlc_statistics_dialog.h \
@@ -372,7 +371,6 @@ UI_FILES = \
lbm_lbtrm_transport_dialog.ui \
lbm_lbtru_transport_dialog.ui \
lbm_stream_dialog.ui \
- lbm_uimflow_dialog.ui \
lte_rlc_graph_dialog.ui \
main_welcome.ui \
main_window.ui \
@@ -566,7 +564,6 @@ WIRESHARK_QT_SRC = \
lbm_lbtrm_transport_dialog.cpp \
lbm_lbtru_transport_dialog.cpp \
lbm_stream_dialog.cpp \
- lbm_uimflow_dialog.cpp \
lte_mac_statistics_dialog.cpp \
lte_rlc_graph_dialog.cpp \
lte_rlc_statistics_dialog.cpp \
@@ -878,8 +875,6 @@ lbm_lbtru_transport_dialog.$(OBJEXT): ui_lbm_lbtru_transport_dialog.h
lbm_stream_dialog.$(OBJEXT): ui_lbm_stream_dialog.h
-lbm_uimflow_dialog.$(OBJEXT): ui_lbm_uimflow_dialog.h
-
lte_rlc_graph_dialog.$(OBJEXT): ui_lte_rlc_graph_dialog.h
main_welcome.$(OBJEXT): ui_main_welcome.h
diff --git a/ui/qt/lbm_uimflow_dialog.cpp b/ui/qt/lbm_uimflow_dialog.cpp
deleted file mode 100644
index 29e5020270..0000000000
--- a/ui/qt/lbm_uimflow_dialog.cpp
+++ /dev/null
@@ -1,666 +0,0 @@
-/* lbm_uimflow_dialog.cpp
- *
- * Copyright (c) 2005-2014 Informatica Corporation. All Rights Reserved.
- *
- * 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.
- */
-
-// Adapted from sequence_dialog.cpp
-
-#include "lbm_uimflow_dialog.h"
-#include <ui_lbm_uimflow_dialog.h>
-
-#include "file.h"
-
-#include <epan/dissectors/packet-lbm.h>
-#include <epan/packet_info.h>
-#include <epan/tap.h>
-#include <epan/to_str.h>
-#include <epan/addr_resolv.h>
-#include <wsutil/nstime.h>
-
-#include <wsutil/utf8_entities.h>
-
-#include <ui/qt/utils/qt_ui_utils.h>
-#include "sequence_diagram.h"
-#include "wireshark_application.h"
-
-#include <QDir>
-#include <QFileDialog>
-#include <QFontMetrics>
-#include <QPoint>
-
-#include <QDebug>
-
-static gboolean lbm_uimflow_add_to_graph(seq_analysis_info_t * seq_info, packet_info * pinfo, const lbm_uim_stream_info_t * stream_info)
-{
- lbm_uim_stream_endpoint_t epa;
- lbm_uim_stream_endpoint_t epb;
- seq_analysis_item_t * item;
- gchar * ctxinst1 = NULL;
- gchar * ctxinst2 = NULL;
- gboolean swap_endpoints = FALSE;
- int rc;
-
- if (stream_info->endpoint_a.type != stream_info->endpoint_b.type)
- {
- return (FALSE);
- }
- if (stream_info->endpoint_a.type == lbm_uim_instance_stream)
- {
- rc = memcmp((const void *)stream_info->endpoint_a.stream_info.ctxinst.ctxinst,
- (const void *)stream_info->endpoint_b.stream_info.ctxinst.ctxinst,
- LBM_CONTEXT_INSTANCE_BLOCK_SZ);
- if (rc <= 0)
- {
- swap_endpoints = FALSE;
- }
- else
- {
- swap_endpoints = TRUE;
- }
- }
- else
- {
- if (stream_info->endpoint_a.stream_info.dest.domain < stream_info->endpoint_b.stream_info.dest.domain)
- {
- swap_endpoints = FALSE;
- }
- else if (stream_info->endpoint_a.stream_info.dest.domain > stream_info->endpoint_b.stream_info.dest.domain)
- {
- swap_endpoints = TRUE;
- }
- else
- {
- int compare;
-
- compare = cmp_address(&(stream_info->endpoint_a.stream_info.dest.addr), &(stream_info->endpoint_b.stream_info.dest.addr));
- if (compare < 0)
- {
- swap_endpoints = FALSE;
- }
- else if (compare > 0)
- {
- swap_endpoints = TRUE;
- }
- else
- {
- if (stream_info->endpoint_a.stream_info.dest.port <= stream_info->endpoint_b.stream_info.dest.port)
- {
- swap_endpoints = FALSE;
- }
- else
- {
- swap_endpoints = TRUE;
- }
- }
- }
- }
- if (swap_endpoints == FALSE)
- {
- epa = stream_info->endpoint_a;
- epb = stream_info->endpoint_b;
- }
- else
- {
- epb = stream_info->endpoint_a;
- epa = stream_info->endpoint_b;
- }
- item = (seq_analysis_item_t *)g_malloc0(sizeof(seq_analysis_item_t));
- copy_address(&(item->src_addr), &(pinfo->src));
- copy_address(&(item->dst_addr), &(pinfo->dst));
- item->frame_number = pinfo->num;
- item->port_src = pinfo->srcport;
- item->port_dst = pinfo->destport;
- if (stream_info->description == NULL)
- {
- item->frame_label = g_strdup_printf("(%" G_GUINT32_FORMAT ")", stream_info->sqn);
- }
- else
- {
- item->frame_label = g_strdup_printf("%s (%" G_GUINT32_FORMAT ")", stream_info->description, stream_info->sqn);
- }
- if (epa.type == lbm_uim_instance_stream)
- {
- ctxinst1 = bytes_to_str(pinfo->pool, epa.stream_info.ctxinst.ctxinst, sizeof(epa.stream_info.ctxinst.ctxinst));
- ctxinst2 = bytes_to_str(pinfo->pool, epb.stream_info.ctxinst.ctxinst, sizeof(epb.stream_info.ctxinst.ctxinst));
- item->comment = g_strdup_printf("%s <-> %s [%" G_GUINT64_FORMAT "]",
- ctxinst1,
- ctxinst2,
- stream_info->channel);
- }
- else
- {
- item->comment = g_strdup_printf("%" G_GUINT32_FORMAT ":%s:%" G_GUINT16_FORMAT " <-> %" G_GUINT32_FORMAT ":%s:%" G_GUINT16_FORMAT " [%" G_GUINT64_FORMAT "]",
- epa.stream_info.dest.domain,
- address_to_str(pinfo->pool, &(epa.stream_info.dest.addr)),
- epa.stream_info.dest.port,
- epb.stream_info.dest.domain,
- address_to_str(pinfo->pool, &(epb.stream_info.dest.addr)),
- epb.stream_info.dest.port,
- stream_info->channel);
- }
- item->conv_num = (guint16)LBM_CHANNEL_ID(stream_info->channel);
- item->display = TRUE;
- item->line_style = 1;
- g_queue_push_tail(seq_info->items, item);
- return (TRUE);
-}
-
-static gboolean lbm_uimflow_tap_packet(void * tap_data, packet_info * pinfo, epan_dissect_t *, const void * stream_info)
-{
- seq_analysis_info_t * sainfo = (seq_analysis_info_t *)tap_data;
- const lbm_uim_stream_info_t * info = (const lbm_uim_stream_info_t *)stream_info;
-
- if ((sainfo->all_packets) || (pinfo->fd->flags.passed_dfilter == 1))
- {
- gboolean rc = lbm_uimflow_add_to_graph(sainfo, pinfo, info);
- return (rc);
- }
- return (FALSE);
-}
-
-static void lbm_uimflow_get_analysis(capture_file * cfile, seq_analysis_info_t * seq_info)
-{
- GList * list = NULL;
- gchar time_str[COL_MAX_LEN];
-
- register_tap_listener("lbm_uim", (void *)seq_info, NULL, TL_REQUIRES_COLUMNS, NULL, lbm_uimflow_tap_packet, NULL);
- cf_retap_packets(cfile);
- remove_tap_listener((void *)seq_info);
-
- /* Fill in the timestamps. */
- list = g_queue_peek_nth_link(seq_info->items, 0);
- while (list != NULL)
- {
- seq_analysis_item_t * seq_item = (seq_analysis_item_t *)list->data;
- set_fd_time(cfile->epan, frame_data_sequence_find(cfile->frames, seq_item->frame_number), time_str);
- seq_item->time_str = g_strdup(time_str);
- list = g_list_next(list);
- }
-}
-
-// To do:
-// - Add UTF8 to text dump
-// - Save to XMI? http://www.umlgraph.org/
-// - Time: abs vs delta
-// - Hide nodes
-// - Clickable time + comments?
-// - Incorporate packet comments?
-// - Change line_style to seq_type (i.e. draw ACKs dashed)
-// - Create WSGraph subclasses with common behavior.
-// - Help button and text
-
-LBMUIMFlowDialog::LBMUIMFlowDialog(QWidget * parent, capture_file * cfile) :
- GeometryStateDialog(parent),
- m_ui(new Ui::LBMUIMFlowDialog),
- m_capture_file(cfile),
- m_num_items(0),
- m_packet_num(0),
- m_node_label_width(20)
-{
- m_ui->setupUi(this);
- if (parent) loadGeometry(parent->width(), parent->height() * 4 / 5);
-
- QCustomPlot * sp = m_ui->sequencePlot;
-
- m_sequence_diagram = new SequenceDiagram(sp->yAxis, sp->xAxis2, sp->yAxis2);
- sp->addPlottable(m_sequence_diagram);
- sp->axisRect()->setRangeDragAxes(sp->xAxis2, sp->yAxis);
-
- sp->xAxis->setVisible(false);
- sp->xAxis->setPadding(0);
- sp->xAxis->setLabelPadding(0);
- sp->xAxis->setTickLabelPadding(0);
- sp->xAxis2->setVisible(true);
- sp->yAxis2->setVisible(true);
-
- m_one_em = QFontMetrics(sp->yAxis->labelFont()).height();
- m_ui->horizontalScrollBar->setSingleStep(100 / m_one_em);
- m_ui->verticalScrollBar->setSingleStep(100 / m_one_em);
-
- sp->setInteractions(QCP::iRangeDrag);
-
- m_ui->gridLayout->setSpacing(0);
- connect(sp->yAxis, SIGNAL(rangeChanged(QCPRange)), sp->yAxis2, SLOT(setRange(QCPRange)));
-
- m_context_menu.addAction(m_ui->actionReset);
- m_context_menu.addSeparator();
- m_context_menu.addAction(m_ui->actionMoveRight10);
- m_context_menu.addAction(m_ui->actionMoveLeft10);
- m_context_menu.addAction(m_ui->actionMoveUp10);
- m_context_menu.addAction(m_ui->actionMoveDown10);
- m_context_menu.addAction(m_ui->actionMoveRight1);
- m_context_menu.addAction(m_ui->actionMoveLeft1);
- m_context_menu.addAction(m_ui->actionMoveUp1);
- m_context_menu.addAction(m_ui->actionMoveDown1);
- m_context_menu.addSeparator();
- m_context_menu.addAction(m_ui->actionGoToPacket);
-
- memset(&m_sequence_analysis, 0, sizeof(m_sequence_analysis));
-
- m_ui->showComboBox->blockSignals(true);
- m_ui->showComboBox->setCurrentIndex(0);
- m_ui->showComboBox->blockSignals(false);
- m_sequence_analysis.all_packets = TRUE;
- m_sequence_analysis.any_addr = TRUE;
-
- QPushButton * save_bt = m_ui->buttonBox->button(QDialogButtonBox::Save);
- save_bt->setText(tr("Save As" UTF8_HORIZONTAL_ELLIPSIS));
-
- connect(m_ui->horizontalScrollBar, SIGNAL(valueChanged(int)), this, SLOT(hScrollBarChanged(int)));
- connect(m_ui->verticalScrollBar, SIGNAL(valueChanged(int)), this, SLOT(vScrollBarChanged(int)));
- connect(sp->xAxis2, SIGNAL(rangeChanged(QCPRange)), this, SLOT(xAxisChanged(QCPRange)));
- connect(sp->yAxis, SIGNAL(rangeChanged(QCPRange)), this, SLOT(yAxisChanged(QCPRange)));
- connect(sp, SIGNAL(mousePress(QMouseEvent*)), this, SLOT(diagramClicked(QMouseEvent*)));
- connect(sp, SIGNAL(mouseMove(QMouseEvent*)), this, SLOT(mouseMoved(QMouseEvent*)));
- connect(sp, SIGNAL(mouseRelease(QMouseEvent*)), this, SLOT(mouseReleased(QMouseEvent*)));
- connect(this, SIGNAL(goToPacket(int)), m_sequence_diagram, SLOT(setSelectedPacket(int)));
-
- disconnect(m_ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
-
- fillDiagram();
-}
-
-LBMUIMFlowDialog::~LBMUIMFlowDialog(void)
-{
- delete m_ui;
-}
-
-void LBMUIMFlowDialog::setCaptureFile(capture_file * cfile)
-{
- if (cfile == NULL) // We only want to know when the file closes.
- {
- m_capture_file = NULL;
- }
-}
-
-void LBMUIMFlowDialog::showEvent(QShowEvent *)
-{
- resetAxes();
-}
-
-void LBMUIMFlowDialog::resizeEvent(QResizeEvent *)
-{
- resetAxes(true);
-}
-
-void LBMUIMFlowDialog::keyPressEvent(QKeyEvent * event)
-{
- int pan_pixels = (event->modifiers() & Qt::ShiftModifier) ? 1 : 10;
-
- // XXX - Copy some shortcuts from tcp_stream_dialog.cpp
- switch (event->key())
- {
- case Qt::Key_Right:
- case Qt::Key_L:
- panAxes(pan_pixels, 0);
- break;
- case Qt::Key_Left:
- case Qt::Key_H:
- panAxes(-1 * pan_pixels, 0);
- break;
- case Qt::Key_Up:
- case Qt::Key_K:
- panAxes(0, -1 * pan_pixels);
- break;
- case Qt::Key_Down:
- case Qt::Key_J:
- panAxes(0, pan_pixels);
- break;
- case Qt::Key_0:
- case Qt::Key_ParenRight: // Shifted 0 on U.S. keyboards
- case Qt::Key_R:
- case Qt::Key_Home:
- resetAxes();
- break;
- case Qt::Key_G:
- on_actionGoToPacket_triggered();
- break;
- }
-
- QDialog::keyPressEvent(event);
-}
-
-void LBMUIMFlowDialog::mouseReleaseEvent(QMouseEvent * event)
-{
- mouseReleased(event);
-}
-
-void LBMUIMFlowDialog::hScrollBarChanged(int value)
-{
- if (qAbs(m_ui->sequencePlot->xAxis2->range().center() - value / 100.0) > 0.01)
- {
- m_ui->sequencePlot->xAxis2->setRange(value / 100.0, m_ui->sequencePlot->xAxis2->range().size(), Qt::AlignCenter);
- m_ui->sequencePlot->replot();
- }
-}
-
-void LBMUIMFlowDialog::vScrollBarChanged(int value)
-{
- if (qAbs(m_ui->sequencePlot->yAxis->range().center() - value / 100.0) > 0.01)
- {
- m_ui->sequencePlot->yAxis->setRange(value / 100.0, m_ui->sequencePlot->yAxis->range().size(), Qt::AlignCenter);
- m_ui->sequencePlot->replot();
- }
-}
-
-void LBMUIMFlowDialog::xAxisChanged(QCPRange range)
-{
- m_ui->horizontalScrollBar->setValue(qRound(qreal(range.center() * 100.0)));
- m_ui->horizontalScrollBar->setPageStep(qRound(qreal(range.size() * 100.0)));
-}
-
-void LBMUIMFlowDialog::yAxisChanged(QCPRange range)
-{
- m_ui->verticalScrollBar->setValue(qRound(qreal(range.center() * 100.0)));
- m_ui->verticalScrollBar->setPageStep(qRound(qreal(range.size() * 100.0)));
-}
-
-void LBMUIMFlowDialog::diagramClicked(QMouseEvent * event)
-{
- QCustomPlot * sp = m_ui->sequencePlot;
-
- if (event->button() == Qt::RightButton)
- {
- // XXX We should find some way to get sequenceDiagram to handle a
- // contextMenuEvent instead.
- m_context_menu.exec(event->globalPos());
- }
- else if (sp->axisRect()->rect().contains(event->pos()))
- {
- sp->setCursor(QCursor(Qt::ClosedHandCursor));
- }
- on_actionGoToPacket_triggered();
-}
-
-void LBMUIMFlowDialog::mouseMoved(QMouseEvent * event)
-{
- QCustomPlot * sp = m_ui->sequencePlot;
- Qt::CursorShape shape = Qt::ArrowCursor;
- if (event)
- {
- if (event->buttons().testFlag(Qt::LeftButton))
- {
- shape = Qt::ClosedHandCursor;
- }
- else
- {
- if (sp->axisRect()->rect().contains(event->pos()))
- {
- shape = Qt::OpenHandCursor;
- }
- }
- }
- sp->setCursor(QCursor(shape));
-
- m_packet_num = 0;
- QString hint;
- if (event)
- {
- seq_analysis_item_t * sai = m_sequence_diagram->itemForPosY(event->pos().y());
- if (sai)
- {
- m_packet_num = sai->frame_number;
- hint = QString("Packet %1: %2").arg(m_packet_num).arg(sai->comment);
- }
- }
-
- if (hint.isEmpty())
- {
- hint += tr("%Ln node(s)", "", m_sequence_analysis.num_nodes) + QString(", ")
- + tr("%Ln item(s)", "", m_num_items);
- }
-
- hint.prepend("<small><i>");
- hint.append("</i></small>");
- m_ui->hintLabel->setText(hint);
-}
-
-void LBMUIMFlowDialog::mouseReleased(QMouseEvent *)
-{
- if (m_ui->sequencePlot->cursor().shape() == Qt::ClosedHandCursor)
- {
- m_ui->sequencePlot->setCursor(QCursor(Qt::OpenHandCursor));
- }
-}
-
-void LBMUIMFlowDialog::on_buttonBox_accepted(void)
-{
- QString file_name, extension;
- QDir path(wsApp->lastOpenDir());
- QString pdf_filter = tr("Portable Document Format (*.pdf)");
- QString png_filter = tr("Portable Network Graphics (*.png)");
- QString bmp_filter = tr("Windows Bitmap (*.bmp)");
- // Gaze upon my beautiful graph with lossy artifacts!
- QString jpeg_filter = tr("JPEG File Interchange Format (*.jpeg *.jpg)");
- QString ascii_filter = tr("ASCII (*.txt)");
-
- QString filter = QString("%1;;%2;;%3;;%4")
- .arg(pdf_filter)
- .arg(png_filter)
- .arg(bmp_filter)
- .arg(jpeg_filter);
- if (m_capture_file)
- {
- filter.append(QString(";;%5").arg(ascii_filter));
- }
-
- file_name = QFileDialog::getSaveFileName(this, wsApp->windowTitleString(tr("Save Graph As" UTF8_HORIZONTAL_ELLIPSIS)),
- path.canonicalPath(), filter, &extension);
-
- if (file_name.length() > 0)
- {
- bool save_ok = false;
- if (extension.compare(pdf_filter) == 0)
- {
- save_ok = m_ui->sequencePlot->savePdf(file_name);
- }
- else if (extension.compare(png_filter) == 0)
- {
- save_ok = m_ui->sequencePlot->savePng(file_name);
- }
- else if (extension.compare(bmp_filter) == 0)
- {
- save_ok = m_ui->sequencePlot->saveBmp(file_name);
- }
- else if (extension.compare(jpeg_filter) == 0)
- {
- save_ok = m_ui->sequencePlot->saveJpg(file_name);
- }
- else if (extension.compare(ascii_filter) == 0 && m_capture_file)
- {
- save_ok = sequence_analysis_dump_to_file(file_name.toUtf8().constData(), &m_sequence_analysis, m_capture_file, 0);
- }
- // else error dialog?
- if (save_ok)
- {
- path = QDir(file_name);
- wsApp->setLastOpenDir(path.canonicalPath().toUtf8().constData());
- }
- }
-}
-
-void LBMUIMFlowDialog::fillDiagram(void)
-{
- QCustomPlot * sp = m_ui->sequencePlot;
- seq_analysis_info_t new_sa;
-
- new_sa = m_sequence_analysis;
- new_sa.items = g_queue_new();
- new_sa.ht = NULL;
- new_sa.num_nodes = 0;
- lbm_uimflow_get_analysis(m_capture_file, &new_sa);
- m_num_items = sequence_analysis_get_nodes(&new_sa);
- m_sequence_diagram->setData(&new_sa);
- sequence_analysis_list_free(&m_sequence_analysis);
- m_sequence_analysis = new_sa;
-
- QFontMetrics vfm = QFontMetrics(sp->xAxis2->labelFont());
- m_node_label_width = 0;
- for (guint i = 0; i < m_sequence_analysis.num_nodes; i++)
- {
- QString addr_str = address_to_display_qstring(&(m_sequence_analysis.nodes[i]));
- int label_w = vfm.width(addr_str);
- if (m_node_label_width < label_w)
- {
- m_node_label_width = label_w;
- }
- }
- m_node_label_width = (m_node_label_width * 3 / 4) + m_one_em;
-
- mouseMoved(NULL);
- resetAxes();
-
- // XXX QCustomPlot doesn't seem to draw any sort of focus indicator.
- sp->setFocus();
-}
-
-void LBMUIMFlowDialog::panAxes(int x_pixels, int y_pixels)
-{
- QCustomPlot * sp = m_ui->sequencePlot;
- double h_pan = 0.0;
- double v_pan = 0.0;
-
- h_pan = sp->xAxis2->range().size() * x_pixels / sp->xAxis2->axisRect()->width();
- v_pan = sp->yAxis->range().size() * y_pixels / sp->yAxis->axisRect()->height();
- // The GTK+ version won't pan unless we're zoomed. Should we do the same here?
- if (h_pan)
- {
- sp->xAxis2->moveRange(h_pan);
- sp->replot();
- }
- if (v_pan)
- {
- sp->yAxis->moveRange(v_pan);
- sp->replot();
- }
-}
-
-void LBMUIMFlowDialog::resetAxes(bool keep_lower)
-{
- QCustomPlot * sp = m_ui->sequencePlot;
- // Allow space for labels on the top and port numbers on the left.
- double top_pos = -1.0, left_pos = -0.5;
- if (keep_lower)
- {
- top_pos = sp->yAxis->range().lower;
- left_pos = sp->xAxis2->range().lower;
- }
-
- double range_ratio = sp->xAxis2->axisRect()->width() / m_node_label_width * sp->axisRect()->rangeZoomFactor(Qt::Horizontal);
- sp->xAxis2->setRange(left_pos, range_ratio + left_pos);
-
- range_ratio = sp->yAxis->axisRect()->height() / (m_one_em * 1.5);
- sp->yAxis->setRange(top_pos, range_ratio + top_pos);
-
- double rmin = sp->xAxis2->range().size() / 2;
- m_ui->horizontalScrollBar->setRange((rmin - 0.5) * 100, (m_sequence_analysis.num_nodes - 0.5 - rmin) * 100);
- xAxisChanged(sp->xAxis2->range());
-
- rmin = (sp->yAxis->range().size() / 2);
- m_ui->verticalScrollBar->setRange((rmin - 1.0) * 100, (m_num_items - 0.5 - rmin) * 100);
- yAxisChanged(sp->yAxis->range());
-
- sp->replot();
-}
-
-void LBMUIMFlowDialog::on_resetButton_clicked(void)
-{
- resetAxes();
-}
-
-void LBMUIMFlowDialog::on_actionGoToPacket_triggered(void)
-{
- if (m_capture_file && m_packet_num > 0)
- {
- emit goToPacket(m_packet_num);
- }
-}
-
-void LBMUIMFlowDialog::on_showComboBox_currentIndexChanged(int index)
-{
- if (index == 0)
- {
- m_sequence_analysis.all_packets = TRUE;
- }
- else
- {
- m_sequence_analysis.all_packets = FALSE;
- }
- fillDiagram();
-}
-
-void LBMUIMFlowDialog::on_actionReset_triggered(void)
-{
- on_resetButton_clicked();
-}
-
-void LBMUIMFlowDialog::on_actionMoveRight10_triggered(void)
-{
- panAxes(10, 0);
-}
-
-void LBMUIMFlowDialog::on_actionMoveLeft10_triggered(void)
-{
- panAxes(-10, 0);
-}
-
-void LBMUIMFlowDialog::on_actionMoveUp10_triggered(void)
-{
- panAxes(0, -10);
-}
-
-void LBMUIMFlowDialog::on_actionMoveDown10_triggered(void)
-{
- panAxes(0, 10);
-}
-
-void LBMUIMFlowDialog::on_actionMoveRight1_triggered(void)
-{
- panAxes(1, 0);
-}
-
-void LBMUIMFlowDialog::on_actionMoveLeft1_triggered(void)
-{
- panAxes(-1, 0);
-}
-
-void LBMUIMFlowDialog::on_actionMoveUp1_triggered(void)
-{
- panAxes(0, -1);
-}
-
-void LBMUIMFlowDialog::on_actionMoveDown1_triggered(void)
-{
- panAxes(0, 1);
-}
-
-/*
- * Editor modelines - http://www.wireshark.org/tools/modelines.html
- *
- * Local variables:
- * c-basic-offset: 4
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- *
- * vi: set shiftwidth=4 tabstop=8 expandtab:
- * :indentSize=4:tabSize=8:noTabs=true:
- */
diff --git a/ui/qt/lbm_uimflow_dialog.h b/ui/qt/lbm_uimflow_dialog.h
deleted file mode 100644
index 75fb30ca29..0000000000
--- a/ui/qt/lbm_uimflow_dialog.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/* lbm_uimflow_dialog.h
- *
- * Copyright (c) 2005-2014 Informatica Corporation. All Rights Reserved.
- *
- * 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 LBM_UIMFLOW_DIALOG_H
-#define LBM_UIMFLOW_DIALOG_H
-
-#include <config.h>
-
-#include <glib.h>
-
-#include "cfile.h"
-
-#include "epan/packet.h"
-
-#include "ui/tap-sequence-analysis.h"
-
-#include "geometry_state_dialog.h"
-#include "sequence_diagram.h"
-
-#include <QMenu>
-
-namespace Ui
-{
- class LBMUIMFlowDialog;
-}
-
-class LBMUIMFlowDialog : public GeometryStateDialog
-{
- Q_OBJECT
-
- public:
- explicit LBMUIMFlowDialog(QWidget * parent = 0, capture_file * cfile = NULL);
- ~LBMUIMFlowDialog(void);
-
- signals:
- void goToPacket(int packet_number);
-
- public slots:
- void setCaptureFile(capture_file * CaptureFile);
-
- protected:
- void showEvent(QShowEvent * event);
- void resizeEvent(QResizeEvent * event);
- void keyPressEvent(QKeyEvent * event);
- void mouseReleaseEvent(QMouseEvent * event);
-
- private slots:
- void hScrollBarChanged(int value);
- void vScrollBarChanged(int value);
- void xAxisChanged(QCPRange range);
- void yAxisChanged(QCPRange range);
- void diagramClicked(QMouseEvent * event);
- void mouseMoved(QMouseEvent * event);
- void mouseReleased(QMouseEvent * event);
-
- void on_buttonBox_accepted(void);
- void on_resetButton_clicked(void);
- void on_actionGoToPacket_triggered(void);
- void on_showComboBox_currentIndexChanged(int index);
- void on_actionReset_triggered(void);
- void on_actionMoveRight10_triggered(void);
- void on_actionMoveLeft10_triggered(void);
- void on_actionMoveUp10_triggered(void);
- void on_actionMoveDown10_triggered(void);
- void on_actionMoveRight1_triggered(void);
- void on_actionMoveLeft1_triggered(void);
- void on_actionMoveUp1_triggered(void);
- void on_actionMoveDown1_triggered(void);
-
- private:
- Ui::LBMUIMFlowDialog * m_ui;
- SequenceDiagram * m_sequence_diagram;
- capture_file * m_capture_file;
- seq_analysis_info_t m_sequence_analysis;
- int m_num_items;
- guint32 m_packet_num;
- double m_one_em;
- int m_node_label_width;
- QMenu m_context_menu;
-
- void fillDiagram(void);
- void panAxes(int x_pixels, int y_pixels);
- void resetAxes(bool keep_lower = false);
-};
-
-#endif
-
-/*
- * Editor modelines - http://www.wireshark.org/tools/modelines.html
- *
- * Local variables:
- * c-basic-offset: 4
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- *
- * vi: set shiftwidth=4 tabstop=8 expandtab:
- * :indentSize=4:tabSize=8:noTabs=true:
- */
diff --git a/ui/qt/lbm_uimflow_dialog.ui b/ui/qt/lbm_uimflow_dialog.ui
deleted file mode 100644
index 7224b9eb9b..0000000000
--- a/ui/qt/lbm_uimflow_dialog.ui
+++ /dev/null
@@ -1,329 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>LBMUIMFlowDialog</class>
- <widget class="QDialog" name="LBMUIMFlowDialog">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>679</width>
- <height>568</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>LBM UIM Flows</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="1">
- <widget class="QScrollBar" name="verticalScrollBar">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QScrollBar" name="horizontalScrollBar">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QFrame" name="frame"/>
- </item>
- <item row="0" column="0">
- <widget class="QCustomPlot" name="sequencePlot" native="true">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>1</verstretch>
- </sizepolicy>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QLabel" name="hintLabel">
- <property name="toolTip">
- <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;
-
-&lt;h3&gt;Valuable and amazing time-saving keyboard shortcuts&lt;/h3&gt;
-&lt;table&gt;&lt;tbody&gt;
-
-&lt;tr&gt;&lt;th&gt;0&lt;/th&gt;&lt;td&gt;Reset graph to its initial state&lt;/td&gt;&lt;/th&gt;
-
-&lt;tr&gt;&lt;th&gt;→&lt;/th&gt;&lt;td&gt;Move right 10 pixels&lt;/td&gt;&lt;/th&gt;
-&lt;tr&gt;&lt;th&gt;←&lt;/th&gt;&lt;td&gt;Move left 10 pixels&lt;/td&gt;&lt;/th&gt;
-&lt;tr&gt;&lt;th&gt;↑&lt;/th&gt;&lt;td&gt;Move up 10 pixels&lt;/td&gt;&lt;/th&gt;
-&lt;tr&gt;&lt;th&gt;↓&lt;/th&gt;&lt;td&gt;Move down 10 pixels&lt;/td&gt;&lt;/th&gt;
-&lt;tr&gt;&lt;th&gt;&lt;i&gt;Shift+&lt;/i&gt;→&lt;/th&gt;&lt;td&gt;Move right 1 pixel&lt;/td&gt;&lt;/th&gt;
-&lt;tr&gt;&lt;th&gt;&lt;i&gt;Shift+&lt;/i&gt;←&lt;/th&gt;&lt;td&gt;Move left 1 pixel&lt;/td&gt;&lt;/th&gt;
-&lt;tr&gt;&lt;th&gt;&lt;i&gt;Shift+&lt;/i&gt;↑&lt;/th&gt;&lt;td&gt;Move up 1 pixel&lt;/td&gt;&lt;/th&gt;
-&lt;tr&gt;&lt;th&gt;&lt;i&gt;Shift+&lt;/i&gt;↓&lt;/th&gt;&lt;td&gt;Move down 1 pixel&lt;/td&gt;&lt;/th&gt;
-
-&lt;tr&gt;&lt;th&gt;g&lt;/th&gt;&lt;td&gt;Go to packet under cursor&lt;/td&gt;&lt;/th&gt;
-
-&lt;/tbody&gt;&lt;/table&gt;
-&lt;/body&gt;&lt;/html&gt;</string>
- </property>
- <property name="text">
- <string>&lt;small&gt;&lt;i&gt;A hint&lt;/i&gt;&lt;/small&gt;</string>
- </property>
- <property name="wordWrap">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" name="controlHorizontalLayout" stretch="0,0,1">
- <item>
- <widget class="QLabel" name="label">
- <property name="text">
- <string>Show:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QComboBox" name="showComboBox">
- <item>
- <property name="text">
- <string>All packets</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Displayed packets</string>
- </property>
- </item>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer_4">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <spacer name="horizontalSpacer_3">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QPushButton" name="resetButton">
- <property name="text">
- <string>Reset</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QDialogButtonBox" name="buttonBox">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="standardButtons">
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok|QDialogButtonBox::Save</set>
- </property>
- </widget>
- </item>
- </layout>
- <action name="actionReset">
- <property name="text">
- <string>Reset Diagram</string>
- </property>
- <property name="toolTip">
- <string>Reset the diagram to its initial state.</string>
- </property>
- <property name="shortcut">
- <string>0</string>
- </property>
- </action>
- <action name="actionMoveUp10">
- <property name="text">
- <string>Move Up 10 Pixels</string>
- </property>
- <property name="toolTip">
- <string>Move up 10 pixels</string>
- </property>
- <property name="shortcut">
- <string>Up</string>
- </property>
- </action>
- <action name="actionMoveLeft10">
- <property name="text">
- <string>Move Left 10 Pixels</string>
- </property>
- <property name="toolTip">
- <string>Move left 10 pixels</string>
- </property>
- <property name="shortcut">
- <string>Left</string>
- </property>
- </action>
- <action name="actionMoveRight10">
- <property name="text">
- <string>Move Right 10 Pixels</string>
- </property>
- <property name="toolTip">
- <string>Move right 10 pixels</string>
- </property>
- <property name="shortcut">
- <string>Right</string>
- </property>
- </action>
- <action name="actionMoveDown10">
- <property name="text">
- <string>Move Down 10 Pixels</string>
- </property>
- <property name="toolTip">
- <string>Move down 10 pixels</string>
- </property>
- <property name="shortcut">
- <string>Down</string>
- </property>
- </action>
- <action name="actionMoveUp1">
- <property name="text">
- <string>Move Up 1 Pixel</string>
- </property>
- <property name="toolTip">
- <string>Move up 1 pixel</string>
- </property>
- <property name="shortcut">
- <string>Shift+Up</string>
- </property>
- </action>
- <action name="actionMoveLeft1">
- <property name="text">
- <string>Move Left 1 Pixel</string>
- </property>
- <property name="toolTip">
- <string>Move left 1 pixel</string>
- </property>
- <property name="shortcut">
- <string>Shift+Left</string>
- </property>
- </action>
- <action name="actionMoveRight1">
- <property name="text">
- <string>Move Right 1 Pixel</string>
- </property>
- <property name="toolTip">
- <string>Move right 1 pixel</string>
- </property>
- <property name="shortcut">
- <string>Shift+Right</string>
- </property>
- </action>
- <action name="actionMoveDown1">
- <property name="text">
- <string>Move Down 1 Pixel</string>
- </property>
- <property name="toolTip">
- <string>Move down 1 pixel</string>
- </property>
- <property name="shortcut">
- <string>Shift+Down</string>
- </property>
- </action>
- <action name="actionGoToPacket">
- <property name="text">
- <string>Go To Packet Under Cursor</string>
- </property>
- <property name="toolTip">
- <string>Go to packet currently under the cursor</string>
- </property>
- <property name="shortcut">
- <string>G</string>
- </property>
- </action>
- <action name="actionFlowAny">
- <property name="text">
- <string>All Flows</string>
- </property>
- <property name="toolTip">
- <string>Show flows for all packets</string>
- </property>
- <property name="shortcut">
- <string>1</string>
- </property>
- </action>
- <action name="actionFlowTcp">
- <property name="text">
- <string>TCP Flows</string>
- </property>
- <property name="toolTip">
- <string>Show only TCP flow information</string>
- </property>
- <property name="shortcut">
- <string>1</string>
- </property>
- </action>
- </widget>
- <customwidgets>
- <customwidget>
- <class>QCustomPlot</class>
- <extends>QWidget</extends>
- <header>widgets/qcustomplot.h</header>
- <container>1</container>
- </customwidget>
- </customwidgets>
- <resources/>
- <connections>
- <connection>
- <sender>buttonBox</sender>
- <signal>accepted()</signal>
- <receiver>LBMUIMFlowDialog</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>LBMUIMFlowDialog</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.h b/ui/qt/main_window.h
index 1e3ff04847..9eeacd0f1a 100644
--- a/ui/qt/main_window.h
+++ b/ui/qt/main_window.h
@@ -597,7 +597,6 @@ private slots:
void on_actionStatistics29WestQueues_Queries_by_Queue_triggered();
void on_actionStatistics29WestQueues_Queries_by_Receiver_triggered();
void on_actionStatistics29WestUIM_Streams_triggered();
- void on_actionStatistics29WestUIM_Stream_Flow_Graph_triggered();
void on_actionStatistics29WestLBTRM_triggered();
void on_actionStatistics29WestLBTRU_triggered();
void on_actionStatisticsANCP_triggered();
diff --git a/ui/qt/main_window.ui b/ui/qt/main_window.ui
index 64287047af..32bc227961 100644
--- a/ui/qt/main_window.ui
+++ b/ui/qt/main_window.ui
@@ -513,7 +513,6 @@
<string>UIM</string>
</property>
<addaction name="actionStatistics29WestUIM_Streams"/>
- <addaction name="actionStatistics29WestUIM_Stream_Flow_Graph"/>
</widget>
<addaction name="menu29WestTopics"/>
<addaction name="menu29WestQueues"/>
@@ -2051,11 +2050,6 @@
<string>Streams</string>
</property>
</action>
- <action name="actionStatistics29WestUIM_Stream_Flow_Graph">
- <property name="text">
- <string>Stream Flow Graph</string>
- </property>
- </action>
<action name="actionStatistics29WestLBTRM">
<property name="text">
<string>LBT-RM</string>
diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp
index 8e15e832eb..59e6d2ebbf 100644
--- a/ui/qt/main_window_slots.cpp
+++ b/ui/qt/main_window_slots.cpp
@@ -132,7 +132,6 @@ DIAG_ON(frame-larger-than=)
#include "io_graph_dialog.h"
#include <ui/qt/widgets/additional_toolbar.h>
#include "lbm_stream_dialog.h"
-#include "lbm_uimflow_dialog.h"
#include "lbm_lbtrm_transport_dialog.h"
#include "lbm_lbtru_transport_dialog.h"
#include "lte_mac_statistics_dialog.h"
@@ -3144,16 +3143,6 @@ void MainWindow::on_actionStatistics29WestUIM_Streams_triggered()
stream_dialog->show();
}
-void MainWindow::on_actionStatistics29WestUIM_Stream_Flow_Graph_triggered()
-{
- LBMUIMFlowDialog * uimflow_dialog = new LBMUIMFlowDialog(this, capture_file_.capFile());
- connect(uimflow_dialog, SIGNAL(goToPacket(int)),
- packet_list_, SLOT(goToPacket(int)));
- connect(this, SIGNAL(setCaptureFile(capture_file*)),
- uimflow_dialog, SLOT(setCaptureFile(capture_file*)));
- uimflow_dialog->show();
-}
-
void MainWindow::on_actionStatistics29WestLBTRM_triggered()
{
LBMLBTRMTransportDialog * lbtrm_dialog = new LBMLBTRMTransportDialog(this, capture_file_.capFile());