diff options
author | Martin Mathieson <martin.r.mathieson@googlemail.com> | 2012-11-11 18:32:47 +0000 |
---|---|---|
committer | Martin Mathieson <martin.r.mathieson@googlemail.com> | 2012-11-11 18:32:47 +0000 |
commit | 0b3ffdd688cb7976066e742843fb83ef26ad22bc (patch) | |
tree | b53c4dd952608dda42925912411bff4f3b7c8ffd /ui/gtk | |
parent | acb53e7d4caf8a9747824606abad294ec5061091 (diff) | |
download | wireshark-0b3ffdd688cb7976066e742843fb83ef26ad22bc.tar.gz |
Allow TCP graphs to be launched from the conversation table window.
svn path=/trunk/; revision=46001
Diffstat (limited to 'ui/gtk')
-rw-r--r-- | ui/gtk/conversations_table.c | 97 | ||||
-rw-r--r-- | ui/gtk/dlg_utils.c | 8 | ||||
-rw-r--r-- | ui/gtk/gui_stat_menu.h | 3 | ||||
-rw-r--r-- | ui/gtk/stock_icons.c | 2 | ||||
-rw-r--r-- | ui/gtk/stock_icons.h | 2 | ||||
-rw-r--r-- | ui/gtk/tcp_graph.c | 124 |
6 files changed, 191 insertions, 45 deletions
diff --git a/ui/gtk/conversations_table.c b/ui/gtk/conversations_table.c index e0d313d1af..e30fedad66 100644 --- a/ui/gtk/conversations_table.c +++ b/ui/gtk/conversations_table.c @@ -47,6 +47,7 @@ #include "ui/gtk/filter_utils.h" #include "ui/gtk/gtkglobals.h" #include "ui/gtk/gui_utils.h" +#include "ui/gtk/gui_stat_menu.h" #include "ui/gtk/dlg_utils.h" #include "ui/gtk/help_dlg.h" #include "ui/gtk/main.h" @@ -61,6 +62,8 @@ #define CONV_PTR_KEY "conversations-pointer" #define NB_PAGES_KEY "notebook-pages" #define FOLLOW_STREAM_BT_KEY "follow-stream-button" +#define GRAPH_A_B_BT_KEY "graph-a-b-button" +#define GRAPH_B_A_BT_KEY "graph-b-a-button" #define NO_BPS_STR "N/A" #define CMP_NUM(n1, n2) \ @@ -2461,6 +2464,52 @@ init_ct_table_page(conversations_table *conversations, GtkWidget *vbox, gboolean static void +graph_cb(GtkWidget *follow_stream_bt, gboolean reverse_direction) +{ + conversations_table *ct = g_object_get_data (G_OBJECT(follow_stream_bt), CONV_PTR_KEY); + GtkTreeIter iter; + GtkTreeModel *model; + GtkTreeSelection *sel; + guint32 idx = 0; + conv_t *conv; + + if (!ct) + return; + + /* Check for a current selection and that index has associated data */ + sel = gtk_tree_view_get_selection (GTK_TREE_VIEW(ct->table)); + if (!gtk_tree_selection_get_selected(sel, &model, &iter)) { + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "No conversation selected"); + return; + } + + gtk_tree_model_get (model, &iter, INDEX_COLUMN, &idx, -1); + if (idx >= ct->num_conversations) { + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "No conversation selected"); + return; + } + + /* Look up the conversation for this index */ + conv = &g_array_index(ct->conversations, conv_t, idx); + + if (strcmp(ct->name, "TCP") == 0) { + /* Invoke the graph */ + if (!reverse_direction) { + tcp_graph_known_stream_launch(&conv->src_address, conv->src_port, + &conv->dst_address, conv->dst_port); + } + else { + tcp_graph_known_stream_launch(&conv->dst_address, conv->dst_port, + &conv->src_address, conv->src_port); + } + } + else { + simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Unknown stream: %s", ct->name); + } +} + + +static void follow_stream_cb(GtkWidget *follow_stream_bt, gpointer data _U_) { conversations_table *ct = g_object_get_data (G_OBJECT(follow_stream_bt), CONV_PTR_KEY); @@ -2538,6 +2587,7 @@ init_conversation_table(gboolean hide_ports, const char *table_name, const char gboolean ret; GtkWidget *copy_bt, *follow_stream_bt; gboolean add_follow_stream_button = FALSE; + gboolean add_graph_buttons = FALSE; conversations=g_malloc0(sizeof(conversations_table)); @@ -2562,8 +2612,11 @@ init_conversation_table(gboolean hide_ports, const char *table_name, const char return; } - if ((strcmp(table_name, "TCP") == 0) || (strcmp(table_name, "UDP") == 0)) - add_follow_stream_button = TRUE; + if (strcmp(table_name, "TCP") == 0) { + add_graph_buttons = TRUE; + if (strcmp(table_name, "UDP") == 0) + add_follow_stream_button = TRUE; + } /* Button row. */ /* XXX - maybe we want to have a "Copy as CSV" stock button here? */ @@ -2608,6 +2661,8 @@ static void ct_nb_switch_page_cb(GtkNotebook *nb, gpointer *pg _U_, guint page, gpointer data) { GtkWidget *copy_bt = (GtkWidget *) data; + GtkWidget *graph_a_b_bt = g_object_get_data(G_OBJECT(nb), GRAPH_A_B_BT_KEY); + GtkWidget *graph_b_a_bt = g_object_get_data(G_OBJECT(nb), GRAPH_B_A_BT_KEY); GtkWidget *follow_stream_bt = g_object_get_data(G_OBJECT(nb), FOLLOW_STREAM_BT_KEY); void **pages = g_object_get_data(G_OBJECT(nb), NB_PAGES_KEY); @@ -2617,16 +2672,25 @@ ct_nb_switch_page_cb(GtkNotebook *nb, gpointer *pg _U_, guint page, gpointer dat if (pages && (page > 0) && ((int) page <= GPOINTER_TO_INT(pages[0]))) { g_object_set_data(G_OBJECT(copy_bt), CONV_PTR_KEY, pages[page]); g_object_set_data(G_OBJECT(follow_stream_bt), CONV_PTR_KEY, pages[page]); + g_object_set_data(G_OBJECT(graph_a_b_bt), CONV_PTR_KEY, pages[page]); + g_object_set_data(G_OBJECT(graph_b_a_bt), CONV_PTR_KEY, pages[page]); /* Filter Stream only available for TCP and UDP */ if (strcmp(((conversations_table *)pages[page])->name, "TCP") == 0) { gtk_widget_set_tooltip_text(follow_stream_bt, "Follow TCP Stream."); gtk_widget_set_sensitive(follow_stream_bt, TRUE); + gtk_widget_set_tooltip_text(follow_stream_bt, "Graph A->B."); + gtk_widget_set_sensitive(graph_a_b_bt, TRUE); + gtk_widget_set_sensitive(graph_b_a_bt, TRUE); } else if (strcmp(((conversations_table *)pages[page])->name, "UDP") == 0) { gtk_widget_set_tooltip_text(follow_stream_bt, "Follow UDP Stream."); + gtk_widget_set_sensitive(graph_a_b_bt, FALSE); + gtk_widget_set_sensitive(graph_b_a_bt, FALSE); gtk_widget_set_sensitive(follow_stream_bt, TRUE); } else { gtk_widget_set_tooltip_text(follow_stream_bt, "Follow TCP or UDP Stream."); + gtk_widget_set_sensitive(graph_a_b_bt, FALSE); + gtk_widget_set_sensitive(graph_b_a_bt, FALSE); gtk_widget_set_sensitive(follow_stream_bt, FALSE); } } @@ -2765,6 +2829,8 @@ init_conversation_notebook_cb(GtkWidget *w _U_, gpointer d _U_) register_ct_t *registered; GtkWidget *copy_bt; GtkWidget *follow_stream_bt; + GtkWidget *graph_a_b_bt; + GtkWidget *graph_b_a_bt; pages = g_malloc(sizeof(void *) * (g_slist_length(registered_ct_tables) + 1)); @@ -2823,18 +2889,41 @@ init_conversation_notebook_cb(GtkWidget *w _U_, gpointer d _U_) /* Button row. */ /* XXX - maybe we want to have a "Copy as CSV" stock button here? */ /*copy_bt = gtk_button_new_with_label ("Copy content to clipboard as CSV");*/ - bbox = dlg_button_row_new(GTK_STOCK_CLOSE, GTK_STOCK_COPY, WIRESHARK_STOCK_FOLLOW_STREAM, GTK_STOCK_HELP, NULL); + bbox = dlg_button_row_new(GTK_STOCK_CLOSE, GTK_STOCK_COPY, + WIRESHARK_STOCK_FOLLOW_STREAM, + WIRESHARK_STOCK_GRAPH_A_B, + WIRESHARK_STOCK_GRAPH_B_A, + GTK_STOCK_HELP, NULL); gtk_box_pack_end(GTK_BOX(vbox), bbox, FALSE, FALSE, 0); + /* Close */ close_bt = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_CLOSE); window_set_cancel_button(win, close_bt, window_cancel_button_cb); + /* Copy */ copy_bt = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_COPY); gtk_widget_set_tooltip_text(copy_bt, "Copy all statistical values of this page to the clipboard in CSV (Comma Separated Values) format."); g_signal_connect(copy_bt, "clicked", G_CALLBACK(copy_as_csv_cb), NULL); g_object_set_data(G_OBJECT(copy_bt), CONV_PTR_KEY, pages[page]); + /* Graph A->B */ + graph_a_b_bt = g_object_get_data(G_OBJECT(bbox), WIRESHARK_STOCK_GRAPH_A_B); + gtk_widget_set_tooltip_text(graph_a_b_bt, "Graph A->B."); + g_object_set_data(G_OBJECT(graph_a_b_bt), E_DFILTER_TE_KEY, main_display_filter_widget); + g_object_set_data(G_OBJECT(graph_a_b_bt), CONV_PTR_KEY, pages[page]); + g_signal_connect(graph_a_b_bt, "clicked", G_CALLBACK(graph_cb), (gpointer)FALSE); + g_object_set_data(G_OBJECT(nb), GRAPH_A_B_BT_KEY, graph_a_b_bt); + + /* Graph B->A */ + graph_b_a_bt = g_object_get_data(G_OBJECT(bbox), WIRESHARK_STOCK_GRAPH_B_A); + gtk_widget_set_tooltip_text(graph_b_a_bt, "Graph B->A."); + g_object_set_data(G_OBJECT(graph_b_a_bt), E_DFILTER_TE_KEY, main_display_filter_widget); + g_object_set_data(G_OBJECT(graph_b_a_bt), CONV_PTR_KEY, pages[page]); + g_signal_connect(graph_b_a_bt, "clicked", G_CALLBACK(graph_cb), (gpointer)TRUE); + g_object_set_data(G_OBJECT(nb), GRAPH_B_A_BT_KEY, graph_b_a_bt); + + /* Follow stream */ follow_stream_bt = g_object_get_data(G_OBJECT(bbox), WIRESHARK_STOCK_FOLLOW_STREAM); gtk_widget_set_tooltip_text(follow_stream_bt, "Follow Stream."); g_object_set_data(G_OBJECT(follow_stream_bt), E_DFILTER_TE_KEY, main_display_filter_widget); @@ -2842,8 +2931,10 @@ init_conversation_notebook_cb(GtkWidget *w _U_, gpointer d _U_) g_signal_connect(follow_stream_bt, "clicked", G_CALLBACK(follow_stream_cb), NULL); g_object_set_data(G_OBJECT(nb), FOLLOW_STREAM_BT_KEY, follow_stream_bt); + g_signal_connect(nb, "switch-page", G_CALLBACK(ct_nb_switch_page_cb), copy_bt); + /* Help */ help_bt = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_HELP); g_signal_connect(help_bt, "clicked", G_CALLBACK(topic_cb), (gpointer)HELP_STATS_CONVERSATIONS_DIALOG); diff --git a/ui/gtk/dlg_utils.c b/ui/gtk/dlg_utils.c index 5e074b3aaf..c1c32f2bd3 100644 --- a/ui/gtk/dlg_utils.c +++ b/ui/gtk/dlg_utils.c @@ -138,6 +138,8 @@ dlg_button_row_new(const gchar *stock_id_first, ...) const gchar *map = NULL; #endif /* HAVE_GEOIP */ const gchar *follow_stream = NULL; + const gchar *graph_a_b = NULL; + const gchar *graph_b_a = NULL; va_start(stock_id_list, stock_id_first); @@ -208,6 +210,10 @@ dlg_button_row_new(const gchar *stock_id_first, ...) delete = stock_id; } else if (strcmp(stock_id, GTK_STOCK_COPY) == 0) { copy = stock_id; + } else if (strcmp(stock_id, WIRESHARK_STOCK_GRAPH_A_B) == 0) { + graph_a_b = stock_id; + } else if (strcmp(stock_id, WIRESHARK_STOCK_GRAPH_B_A) == 0) { + graph_b_a = stock_id; } else { /* we don't know that button! */ g_assert_not_reached(); @@ -431,6 +437,8 @@ dlg_button_row_new(const gchar *stock_id_first, ...) if (clear != NULL) dlg_button_new(hbox, button_hbox, clear); if (filter_stream!= NULL) dlg_button_new(hbox, button_hbox, filter_stream); if (follow_stream != NULL) dlg_button_new(hbox, button_hbox, follow_stream); + if (graph_a_b != NULL) dlg_button_new(hbox, button_hbox, graph_a_b); + if (graph_b_a != NULL) dlg_button_new(hbox, button_hbox, graph_b_a); if (close != NULL) dlg_button_new(hbox, button_hbox, close); if (cancel != NULL) dlg_button_new(hbox, button_hbox, cancel); diff --git a/ui/gtk/gui_stat_menu.h b/ui/gtk/gui_stat_menu.h index b1eb58e003..55abc728e7 100644 --- a/ui/gtk/gui_stat_menu.h +++ b/ui/gtk/gui_stat_menu.h @@ -176,6 +176,9 @@ void gtk_stats_tree_cb(GtkAction *action, gpointer user_data); void tcp_graph_cb(GtkAction *action, gpointer user_data); gboolean tcp_graph_selected_packet_enabled(frame_data *current_frame, epan_dissect_t *edt, gpointer callback_data _U_); +void tcp_graph_known_stream_launch(address *src_address, guint16 src_port, + address *dst_address, guint16 dst_port); + void gtk_rpcprogs_cb(GtkWidget *w, gpointer data); void mcaststream_launch(GtkAction *action, gpointer user_data); diff --git a/ui/gtk/stock_icons.c b/ui/gtk/stock_icons.c index 8ca65b20eb..858435319a 100644 --- a/ui/gtk/stock_icons.c +++ b/ui/gtk/stock_icons.c @@ -100,6 +100,8 @@ void stock_icons_init(void) { #ifdef HAVE_GEOIP { WIRESHARK_STOCK_MAP, "Map", 0, 0, NULL }, #endif + { WIRESHARK_STOCK_GRAPH_A_B, "Graph A->B", 0, 0, NULL }, + { WIRESHARK_STOCK_GRAPH_B_A, "Graph B->A", 0, 0, NULL }, { WIRESHARK_STOCK_FOLLOW_STREAM, "Follow Stream", 0, 0, NULL }, { WIRESHARK_STOCK_DISPLAY_FILTER, "Display _Filter", 0, 0, NULL }, { WIRESHARK_STOCK_DISPLAY_FILTER_ENTRY, "F_ilter:", 0, 0, NULL }, diff --git a/ui/gtk/stock_icons.h b/ui/gtk/stock_icons.h index 6f7875d273..d663a8afee 100644 --- a/ui/gtk/stock_icons.h +++ b/ui/gtk/stock_icons.h @@ -38,6 +38,8 @@ #ifdef HAVE_GEOIP #define WIRESHARK_STOCK_MAP "Wireshark_Stock_Map" #endif +#define WIRESHARK_STOCK_GRAPH_A_B "Wireshark_Stock_Graph_A_B" +#define WIRESHARK_STOCK_GRAPH_B_A "Wireshark_Stock_Graph_B_A" #define WIRESHARK_STOCK_FOLLOW_STREAM "Wireshark_Stock_FollowStream" #define WIRESHARK_STOCK_DISPLAY_FILTER "Wireshark_Stock_DisplayFilter" #define WIRESHARK_STOCK_DISPLAY_FILTER_ENTRY "Wireshark_Stock_DisplayFilter_Entry" diff --git a/ui/gtk/tcp_graph.c b/ui/gtk/tcp_graph.c index b080708284..4ec3285b28 100644 --- a/ui/gtk/tcp_graph.c +++ b/ui/gtk/tcp_graph.c @@ -333,7 +333,13 @@ struct graph { struct magnify magnify; struct axis *x_axis, *y_axis; struct segment *segments; - struct segment *current; + + /* The stream this graph will show */ + address src_address; + guint16 src_port; + address dst_address; + guint16 dst_port; + struct element_list *elists; /* element lists */ union { struct style_tseq_stevens tseq_stevens; @@ -429,7 +435,7 @@ static void graph_element_lists_initialize (struct graph * ); static void graph_title_pixmap_create (struct graph * ); static void graph_title_pixmap_draw (struct graph * ); static void graph_title_pixmap_display (struct graph * ); -static void graph_segment_list_get (struct graph * ); +static void graph_segment_list_get (struct graph *, gboolean stream_known ); static void graph_segment_list_free (struct graph * ); static void graph_select_segment (struct graph * , int , int ); static int line_detect_collision (struct element * , int , int ); @@ -612,6 +618,7 @@ static void unset_busy_cursor(GdkWindow *w, gboolean cross) gdk_flush(); } } + void tcp_graph_cb (GtkAction *action, gpointer user_data _U_) { struct segment current; @@ -648,12 +655,42 @@ void tcp_graph_cb (GtkAction *action, gpointer user_data _U_) g->type = graph_type; - graph_segment_list_get(g); + graph_segment_list_get(g, FALSE); create_gui(g); /* display_text(g); */ graph_init_sequence(g); } + +void tcp_graph_known_stream_launch(address *src_address, guint16 src_port, + address *dst_address, guint16 dst_port) +{ + struct graph *g; + + if (!(g = graph_new())) { + return; + } + + refnum++; + graph_initialize_values(g); + + /* Can set stream info for graph now */ + COPY_ADDRESS(&g->src_address, src_address); + g->src_port = src_port; + COPY_ADDRESS(&g->dst_address, dst_address); + g->dst_port = dst_port; + + /* This graph type is arguably the most useful, so start there */ + g->type = GRAPH_TSEQ_TCPTRACE; + + /* Get our list of segments from the packet list */ + graph_segment_list_get(g, TRUE); + + create_gui(g); + graph_init_sequence(g); +} + + static void create_gui (struct graph *g) { debug(DBS_FENTRY) puts ("create_gui()"); @@ -674,8 +711,6 @@ static void create_drawing_area (struct graph *g) #endif char *display_name; char window_title[WINDOW_TITLE_LENGTH]; - struct segment current; - struct tcpheader *thdr; GtkAllocation widget_alloc; #if 0 /* Prep. to include the controls in the graph window */ @@ -684,15 +719,14 @@ static void create_drawing_area (struct graph *g) GtkWidget *hbox; #endif debug(DBS_FENTRY) puts ("create_drawing_area()"); - thdr=select_tcpip_session (&cfile, ¤t); display_name = cf_get_display_name(&cfile); g_snprintf (window_title, WINDOW_TITLE_LENGTH, "TCP Graph %d: %s %s:%d -> %s:%d", refnum, display_name, - ep_address_to_str(&(thdr->ip_src)), - thdr->th_sport, - ep_address_to_str(&(thdr->ip_dst)), - thdr->th_dport + ep_address_to_str(&g->src_address), + g->src_port, + ep_address_to_str(&g->dst_address), + g->dst_port ); g_free(display_name); g->toplevel = dlg_window_new ("Tcp Graph"); @@ -1161,7 +1195,7 @@ static GtkWidget *control_panel_create_zoom_group (struct graph *g) g_signal_connect(zoom_in, "toggled", G_CALLBACK(callback_zoom_inout), g); g_signal_connect(zoom_h_step, "changed", G_CALLBACK(callback_zoom_step), g); - g_signal_connect(zoom_v_step, "changed", G_CALLBACK(callback_zoom_step), g); + g_signal_connect(zoom_v_step, "changed", G_CALLBACK(callback_zoom_step), g); g->zoom.widget.in_toggle = (GtkToggleButton * )zoom_in; g->zoom.widget.out_toggle = (GtkToggleButton * )zoom_out; @@ -1623,7 +1657,7 @@ static void callback_graph_type (GtkWidget *toggle, gpointer data) /* throughput graph uses differently constructed segment list so we * need to recreate it */ graph_segment_list_free (g); - graph_segment_list_get (g); + graph_segment_list_get (g, TRUE); } if (g->flags & GRAPH_INIT_ON_TYPE_CHANGE) { @@ -1781,10 +1815,11 @@ static int tapall_tcpip_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) { tcp_scan_t *ts=(tcp_scan_t *)pct; + struct graph *g = ts->g; struct tcpheader *tcphdr=(struct tcpheader *)vip; - if (compare_headers(&ts->current->ip_src, &ts->current->ip_dst, - ts->current->th_sport, ts->current->th_dport, + if (compare_headers(&g->src_address, &g->dst_address, + g->src_port, g->dst_port, &tcphdr->ip_src, &tcphdr->ip_dst, tcphdr->th_sport, tcphdr->th_dport, ts->direction)) { @@ -1811,9 +1846,6 @@ tapall_tcpip_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, cons ts->g->segments = segment; } ts->last = segment; - if(pinfo->fd->num==ts->current->num){ - ts->g->current = segment; - } } return 0; @@ -1822,19 +1854,27 @@ tapall_tcpip_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, cons /* here we collect all the external data we will ever need */ -static void graph_segment_list_get (struct graph *g) +static void graph_segment_list_get (struct graph *g, gboolean stream_known) { struct segment current; GString *error_string; tcp_scan_t ts; - debug(DBS_FENTRY) puts ("graph_segment_list_get()"); - select_tcpip_session (&cfile, ¤t); - if (g->type == GRAPH_THROUGHPUT) - ts.direction = COMPARE_CURR_DIR; - else - ts.direction = COMPARE_ANY_DIR; + + if (!stream_known) { + select_tcpip_session (&cfile, ¤t); + if (g->type == GRAPH_THROUGHPUT) + ts.direction = COMPARE_CURR_DIR; + else + ts.direction = COMPARE_ANY_DIR; + + /* Remember stream info in graph */ + COPY_ADDRESS(&g->src_address, ¤t.ip_src); + g->src_port = current.th_sport; + COPY_ADDRESS(&g->dst_address, ¤t.ip_dst); + g->dst_port = current.th_dport; + } /* rescan all the packets and pick up all interesting tcp headers. * we only filter for TCP here for speed and do the actual compare @@ -3699,8 +3739,8 @@ static int get_num_dsegs (struct graph *g) struct segment *tmp; for (tmp=g->segments, count=0; tmp; tmp=tmp->next) { - if(compare_headers(&g->current->ip_src, &g->current->ip_dst, - g->current->th_sport, g->current->th_dport, + if(compare_headers(&g->src_address, &g->dst_address, + g->src_port, g->dst_port, &tmp->ip_src, &tmp->ip_dst, tmp->th_sport, tmp->th_dport, COMPARE_CURR_DIR)) { @@ -3716,8 +3756,8 @@ static int get_num_acks (struct graph *g) struct segment *tmp; for (tmp=g->segments, count=0; tmp; tmp=tmp->next) { - if(!compare_headers(&g->current->ip_src, &g->current->ip_dst, - g->current->th_sport, g->current->th_dport, + if(!compare_headers(&g->src_address, &g->dst_address, + g->src_port, g->dst_port, &tmp->ip_src, &tmp->ip_dst, tmp->th_sport, tmp->th_dport, COMPARE_CURR_DIR)) { @@ -3802,8 +3842,8 @@ static void tseq_get_bounds (struct graph *g) /* go thru all segments to determine "bounds" */ for (tmp=g->segments; tmp; tmp=tmp->next) { - if(compare_headers(&g->current->ip_src, &g->current->ip_dst, - g->current->th_sport, g->current->th_dport, + if(compare_headers(&g->src_address, &g->dst_address, + g->src_port, g->dst_port, &tmp->ip_src, &tmp->ip_dst, tmp->th_sport, tmp->th_dport, COMPARE_CURR_DIR)) { @@ -3887,8 +3927,8 @@ static void tseq_stevens_make_elmtlist (struct graph *g) for (tmp=g->segments; tmp; tmp=tmp->next) { double secs, seqno; - if(!compare_headers(&g->current->ip_src, &g->current->ip_dst, - g->current->th_sport, g->current->th_dport, + if(!compare_headers(&g->src_address, &g->dst_address, + g->src_port, g->dst_port, &tmp->ip_src, &tmp->ip_dst, tmp->th_sport, tmp->th_dport, COMPARE_CURR_DIR)) { @@ -4013,8 +4053,8 @@ static void tseq_tcptrace_make_elmtlist (struct graph *g) secs = tmp->rel_secs + tmp->rel_usecs / 1000000.0; x = secs - xx0; x *= g->zoom.x; - if(compare_headers(&g->current->ip_src, &g->current->ip_dst, - g->current->th_sport, g->current->th_dport, + if(compare_headers(&g->src_address, &g->dst_address, + g->src_port, g->dst_port, &tmp->ip_src, &tmp->ip_dst, tmp->th_sport, tmp->th_dport, COMPARE_CURR_DIR)) { @@ -4286,8 +4326,8 @@ static void rtt_initialize (struct graph *g) rtt_read_config (g); for (tmp=g->segments; tmp; tmp=tmp->next) { - if(compare_headers(&g->current->ip_src, &g->current->ip_dst, - g->current->th_sport, g->current->th_dport, + if(compare_headers(&g->src_address, &g->dst_address, + g->src_port, g->dst_port, &tmp->ip_src, &tmp->ip_dst, tmp->th_sport, tmp->th_dport, COMPARE_CURR_DIR)) { @@ -4410,8 +4450,8 @@ static void rtt_make_elmtlist (struct graph *g) } for (tmp=g->segments; tmp; tmp=tmp->next) { - if(compare_headers(&g->current->ip_src, &g->current->ip_dst, - g->current->th_sport, g->current->th_dport, + if(compare_headers(&g->src_address, &g->dst_address, + g->src_port, g->dst_port, &tmp->ip_src, &tmp->ip_dst, tmp->th_sport, tmp->th_dport, COMPARE_CURR_DIR)) { @@ -4501,8 +4541,8 @@ static void wscale_initialize(struct graph* g) for (segm = g->segments; segm; segm = segm->next) { - if (compare_headers(&g->current->ip_src, &g->current->ip_dst, - g->current->th_sport, g->current->th_dport, + if (compare_headers(&g->src_address, &g->dst_address, + g->src_port, g->dst_port, &segm->ip_src, &segm->ip_dst, segm->th_sport, segm->th_dport, COMPARE_CURR_DIR)) @@ -4560,8 +4600,8 @@ static void wscale_make_elmtlist(struct graph* g) for ( segm = g->segments; segm; segm = segm->next ) { - if (compare_headers(&g->current->ip_src, &g->current->ip_dst, - g->current->th_sport, g->current->th_dport, + if (compare_headers(&g->src_address, &g->dst_address, + g->src_port, g->src_port, &segm->ip_src, &segm->ip_dst, segm->th_sport, segm->th_dport, COMPARE_CURR_DIR)) |