aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>2011-05-15 14:18:22 +0000
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>2011-05-15 14:18:22 +0000
commitf0e31fa1adb933a3ede9dd8344621f2fc128baf4 (patch)
treefe780ffc83ba2c73fe9d2d66b881b23eb89db5c5
parent4091f6b6c96743ae7fa85158eeb880471bd45c28 (diff)
Add the TCPGraph for UIManager.
Note sensitivity remains to be fixed. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37154 f5534014-38df-0310-8fa8-9805f1628bb7
-rw-r--r--gtk/gui_stat_menu.h2
-rw-r--r--gtk/menus.c12
-rw-r--r--gtk/tcp_graph.c46
3 files changed, 57 insertions, 3 deletions
diff --git a/gtk/gui_stat_menu.h b/gtk/gui_stat_menu.h
index 4f466206cf..42ae64bfa0 100644
--- a/gtk/gui_stat_menu.h
+++ b/gtk/gui_stat_menu.h
@@ -155,6 +155,8 @@ void gsm_a_stat_gtk_sacch_rr_cb(GtkAction *action, gpointer user_data);
void gsm_map_stat_gtk_cb(GtkAction *action, gpointer user_data);
void gsm_map_stat_gtk_sum_cb(GtkAction *action, gpointer user_data);
+void tcp_graph_cb (GtkAction *action, gpointer user_data);
+
extern void register_stat_menu_item_stock(
register_stat_group_t group,
const char *gui_path,
diff --git a/gtk/menus.c b/gtk/menus.c
index 422cf87d96..d8aaf07f03 100644
--- a/gtk/menus.c
+++ b/gtk/menus.c
@@ -1258,7 +1258,11 @@ static const char *ui_desc_menubar =
" <placeholder name='HTTP-List-item'/>\n"
" </menu>\n"
" <menu name= 'TCPStreamGraphMenu' action='/Analyze/StatisticsMenu/TCPStreamGraphMenu'>\n"
-" <menuitem name='BSMAP' action='/Analyze/StatisticsMenu/TCPStreamGraphMenu/Time-Sequence-Graph-Stevens'/>\n"
+" <menuitem name='Sequence-Graph-Stevens' action='/Analyze/StatisticsMenu/TCPStreamGraphMenu/Time-Sequence-Graph-Stevens'/>\n"
+" <menuitem name='Sequence-Graph-tcptrace' action='/Analyze/StatisticsMenu/TCPStreamGraphMenu/Time-Sequence-Graph-tcptrace'/>\n"
+" <menuitem name='Throughput-Graph' action='/Analyze/StatisticsMenu/TCPStreamGraphMenu/Throughput-Graph'/>\n"
+" <menuitem name='RTT-Graph' action='/Analyze/StatisticsMenu/TCPStreamGraphMenu/RTT-Graph'/>\n"
+" <menuitem name='Window-Scaling-Graph' action='/Analyze/StatisticsMenu/TCPStreamGraphMenu/Window-Scaling-Graph'/>\n"
" </menu>\n"
" </menu>\n"
" <menu name= 'TelephonyMenu' action='/Telephony'>\n"
@@ -1652,7 +1656,11 @@ static const GtkActionEntry main_menu_bar_entries[] = {
{ "/Analyze/StatisticsMenu/FlowGraph", WIRESHARK_STOCK_FLOW_GRAPH, "Flo_w Graph...", NULL, NULL, G_CALLBACK(flow_graph_launch) },
{ "/Analyze/StatisticsMenu/HTTP", NULL, "HTTP", NULL, NULL, NULL },
{ "/Analyze/StatisticsMenu/TCPStreamGraphMenu", NULL, "TCP StreamGraph", NULL, NULL, NULL },
- { "/Analyze/StatisticsMenu/TCPStreamGraphMenuTime-Sequence-Graph-Stevens", NULL, "TCP StreamGraph", NULL, NULL, G_CALLBACK(tcp_graph_cb) },
+ { "/Analyze/StatisticsMenu/TCPStreamGraphMenu/Time-Sequence-Graph-Stevens", NULL, "Time-Sequence Graph (Stevens)", NULL, NULL, G_CALLBACK(tcp_graph_cb) },
+ { "/Analyze/StatisticsMenu/TCPStreamGraphMenu/Time-Sequence-Graph-tcptrace", NULL, "Time-Sequence Graph (tcptrace)", NULL, NULL, G_CALLBACK(tcp_graph_cb) },
+ { "/Analyze/StatisticsMenu/TCPStreamGraphMenu/Throughput-Graph", NULL, "Throughput Graph", NULL, NULL, G_CALLBACK(tcp_graph_cb) },
+ { "/Analyze/StatisticsMenu/TCPStreamGraphMenu/RTT-Graph", NULL, "Round Trip Time Graph", NULL, NULL, G_CALLBACK(tcp_graph_cb) },
+ { "/Analyze/StatisticsMenu/TCPStreamGraphMenu/Window-Scaling-Graph", NULL, "Window Scaling Graph", NULL, NULL, G_CALLBACK(tcp_graph_cb) },
{ "/Statistics/Summary", GTK_STOCK_PROPERTIES, "_Summary", NULL, NULL, G_CALLBACK(summary_open_cb) },
{ "/Statistics/ProtocolHierarchy", NULL, "_Protocol Hierarchy", NULL, NULL, G_CALLBACK(proto_hier_stats_cb) },
diff --git a/gtk/tcp_graph.c b/gtk/tcp_graph.c
index 18513d1dee..0fa588d7dd 100644
--- a/gtk/tcp_graph.c
+++ b/gtk/tcp_graph.c
@@ -589,7 +589,47 @@ static void unset_busy_cursor(GdkWindow *w)
gdk_window_set_cursor(w, NULL);
gdk_flush();
}
+#ifdef MAIN_MENU_USE_UIMANAGER
+void tcp_graph_cb (GtkAction *action, gpointer user_data)
+{
+ struct segment current;
+ struct graph *g;
+ const gchar *name;
+ guint graph_type;
+
+ name = gtk_action_get_name (action);
+ if(strcmp(name, "Analyze/StatisticsMenu/TCPStreamGraphMenu/Time-Sequence-Graph-Stevens") == 0){
+ graph_type = GRAPH_TSEQ_STEVENS;
+ }else if(strcmp(name, "/Analyze/StatisticsMenu/TCPStreamGraphMenu/Time-Sequence-Graph-tcptrace") == 0){
+ graph_type = GRAPH_TSEQ_TCPTRACE;
+ }else if(strcmp(name, "StatisticsMenu/TCPStreamGraphMenu/Throughput-Graph") == 0){
+ graph_type = GRAPH_THROUGHPUT;
+ }else if(strcmp(name, "/Analyze/StatisticsMenu/TCPStreamGraphMenu/RTT-Graph") == 0){
+ graph_type = GRAPH_RTT;
+ }else if(strcmp(name, "/Analyze/StatisticsMenu/TCPStreamGraphMenu/Window-Scaling-Graph") == 0){
+ graph_type = GRAPH_WSCALE;
+ }
+
+ debug(DBS_FENTRY) puts ("tcp_graph_cb()");
+
+ if (! (g = graph_new()))
+ return;
+ refnum++;
+ graph_initialize_values (g);
+
+ g->type = graph_type;
+ if (!select_tcpip_session (&cfile, &current)) {
+ return;
+ }
+
+ graph_segment_list_get(g);
+ create_gui(g);
+ /* display_text(g); */
+ graph_init_sequence(g);
+
+}
+#else
static void tcp_graph_cb (GtkWidget *w _U_, gpointer data, guint callback_action /*graph_type*/ _U_)
{
struct segment current;
@@ -615,7 +655,7 @@ static void tcp_graph_cb (GtkWidget *w _U_, gpointer data, guint callback_action
/* display_text(g); */
graph_init_sequence(g);
}
-
+#endif
static void create_gui (struct graph *g)
{
debug(DBS_FENTRY) puts ("create_gui()");
@@ -4327,6 +4367,8 @@ static gboolean tcp_graph_selected_packet_enabled(frame_data *current_frame, epa
void
register_tap_listener_tcp_graph(void)
{
+#ifdef MAIN_MENU_USE_UIMANAGER
+#else
register_stat_menu_item("TCP Stream Graph/Time-Sequence Graph (Stevens)", REGISTER_STAT_GROUP_UNSORTED,
tcp_graph_cb, tcp_graph_selected_packet_enabled, NULL, GINT_TO_POINTER(0));
register_stat_menu_item("TCP Stream Graph/Time-Sequence Graph (tcptrace)", REGISTER_STAT_GROUP_UNSORTED,
@@ -4337,4 +4379,6 @@ register_tap_listener_tcp_graph(void)
tcp_graph_cb, tcp_graph_selected_packet_enabled, NULL, GINT_TO_POINTER(3));
register_stat_menu_item("TCP Stream Graph/Window Scaling Graph", REGISTER_STAT_GROUP_UNSORTED,
tcp_graph_cb, tcp_graph_selected_packet_enabled, NULL, GINT_TO_POINTER(GRAPH_WSCALE));
+#endif
+
}