2 * Copyright 2004, Irene Ruengeler <i.ruengeler [AT] fh-muenster.de>
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
32 #include "epan/filesystem.h"
34 #include "../globals.h"
35 #include "../stat_menu.h"
37 #include "gtk/gui_stat_menu.h"
38 #include "gtk/dlg_utils.h"
39 #include "gtk/gui_utils.h"
41 #include "gtk/sctp_stat.h"
42 #include "gtk/gtkglobals.h"
44 #include "image/clist_ascend.xpm"
45 #include "image/clist_descend.xpm"
48 static GtkWidget *sctp_stat_dlg=NULL;
49 static GtkWidget *clist = NULL;
50 static GList *last_list = NULL;
51 static gchar *filter_string = NULL;
52 static sctp_assoc_info_t* selected_stream=NULL; /* current selection */
53 static sctp_allassocs_info_t *sctp_assocs=NULL;
54 static guint16 n_children=0;
55 static GtkWidget *bt_afilter = NULL, *bt_unselect=NULL, *bt_analyse=NULL, *bt_filter=NULL;
56 static gboolean prevent_update = FALSE, filter_applied = FALSE;
60 typedef struct column_arrows {
63 GtkWidget *descend_pm;
72 struct sctp_analyse *child_data;
77 list=g_list_last(sctp_assocs->children);
78 child_data=(struct sctp_analyse *)list->data;
79 gtk_grab_remove(GTK_WIDGET(child_data->window));
80 gtk_widget_destroy(GTK_WIDGET(child_data->window));
81 list=g_list_previous(list);
83 g_list_free(sctp_assocs->children);
84 sctp_assocs->children = NULL;
86 prevent_update = FALSE;
87 filter_applied = FALSE;
91 decrease_analyse_childcount()
97 increase_analyse_childcount()
103 set_analyse_child(struct sctp_analyse *child)
105 sctp_assocs->children=g_list_append(sctp_assocs->children, child);
109 remove_analyse_child(struct sctp_analyse *child)
111 sctp_assocs->children=g_list_remove(sctp_assocs->children, child);
115 static void add_to_clist(sctp_assoc_info_t* assinfo)
118 gchar *data[NUM_COLS];
119 gchar field[NUM_COLS][30];
121 for (i=0; i<NUM_COLS; i++)
122 data[i]=&field[i][0];
124 g_snprintf(field[0], 20, "%u", assinfo->port1);
125 g_snprintf(field[1], 20, "%u", assinfo->port2);
126 g_snprintf(field[2], 20, "%u", assinfo->n_packets);
127 g_snprintf(field[3], 20, "%s", assinfo->checksum_type);
128 g_snprintf(field[4], 20, "%u", assinfo->n_checksum_errors);
129 g_snprintf(field[5], 20, "%u", assinfo->n_data_chunks);
130 g_snprintf(field[6], 20, "%u", assinfo->n_data_bytes);
131 g_snprintf(field[7], 20, "0x%x", assinfo->verification_tag1);
132 g_snprintf(field[8], 20, "0x%x", assinfo->verification_tag2);
134 added_row = gtk_clist_append(GTK_CLIST(clist), data);
135 gtk_clist_set_row_data(GTK_CLIST(clist), added_row, assinfo);
139 sctp_stat_on_unselect(GtkButton *button _U_, gpointer user_data _U_)
141 if (filter_string != NULL) {
142 g_free(filter_string);
143 filter_string = NULL;
146 selected_stream = NULL;
147 gtk_entry_set_text(GTK_ENTRY(main_display_filter_widget), "");
148 main_filter_packets(&cfile, "", FALSE);
149 gtk_clist_unselect_all(GTK_CLIST(clist));
150 gtk_widget_set_sensitive(bt_unselect,FALSE);
151 gtk_widget_set_sensitive(bt_filter,FALSE);
152 gtk_widget_set_sensitive(bt_analyse,FALSE);
153 gtk_widget_set_sensitive(bt_afilter,FALSE);
154 prevent_update = FALSE;
155 filter_applied = FALSE;
158 void sctp_stat_dlg_update(void)
162 list=(sctp_stat_get_info()->assoc_info_list);
163 if (sctp_stat_dlg != NULL && !prevent_update)
165 gtk_clist_clear(GTK_CLIST(clist));
166 list = g_list_first(sctp_stat_get_info()->assoc_info_list);
170 add_to_clist((sctp_assoc_info_t*)(list->data));
171 list = g_list_next(list);
179 sctp_stat_on_select_row(GtkCList *clist, gint row, gint column _U_,
180 GdkEventButton *event _U_, gpointer user_data _U_)
183 guint16 port1, port2;
184 guint32 checksum, data_chunks, data_bytes, packets, vtag1, vtag2;
186 sctp_assoc_info_t* assoc;
187 gboolean stream_found=FALSE;
189 gtk_clist_get_row_data(GTK_CLIST(clist), row);
190 gtk_clist_get_text(GTK_CLIST(clist), row, 0, text);
192 gtk_clist_get_text(GTK_CLIST(clist), row, 1, text);
194 gtk_clist_get_text(GTK_CLIST(clist), row, 7, text);
195 sscanf(text[0],"0x%x",&vtag1);
196 gtk_clist_get_text(GTK_CLIST(clist), row, 8, text);
197 sscanf(text[0],"0x%x",&vtag2);
198 gtk_clist_get_text(GTK_CLIST(clist), row, 2, text);
199 packets=atoi(text[0]);
200 gtk_clist_get_text(GTK_CLIST(clist), row, 4, text);
201 checksum=atoi(text[0]);
202 gtk_clist_get_text(GTK_CLIST(clist), row, 5, text);
203 data_chunks=atoi(text[0]);
204 gtk_clist_get_text(GTK_CLIST(clist), row, 6, text);
205 data_bytes=atoi(text[0]);
207 list = g_list_first(sctp_assocs->assoc_info_list);
211 assoc = (sctp_assoc_info_t*)(list->data);
212 if (assoc->port1==port1 && assoc->port2==port2
213 && assoc->n_packets==packets && assoc->n_data_chunks==data_chunks && assoc->n_data_bytes==data_bytes
214 && assoc->verification_tag1==vtag1 && assoc->verification_tag2==vtag2)
216 selected_stream=assoc;
220 list=g_list_next(list);
224 selected_stream = NULL;
226 gtk_widget_set_sensitive(bt_unselect,TRUE);
227 gtk_widget_set_sensitive(bt_analyse,TRUE);
228 gtk_widget_set_sensitive(bt_filter,TRUE);
232 sctp_stat_on_apply_filter (GtkButton *button _U_, gpointer user_data _U_)
235 sctp_assoc_info_t* assoc;
236 guint16 port1, port2;
237 guint32 checksum, data_chunks, data_bytes, packets, vtag1, vtag2;
239 if (filter_string != NULL)
241 port1 = selected_stream->port1;
242 port2 = selected_stream->port2;
243 checksum = selected_stream->n_checksum_errors;
244 data_chunks = selected_stream->n_data_chunks;
245 data_bytes = selected_stream->n_data_bytes;
246 packets = selected_stream->n_packets;
247 vtag1 = selected_stream->verification_tag1;
248 vtag2 = selected_stream->verification_tag2;
249 main_filter_packets(&cfile, filter_string, FALSE);
250 list = g_list_first(sctp_assocs->assoc_info_list);
254 assoc = (sctp_assoc_info_t*)(list->data);
255 if (assoc->port1==port1 && assoc->port2==port2
256 && assoc->n_packets==packets && assoc->n_data_chunks==data_chunks && assoc->n_data_bytes==data_bytes
257 && assoc->verification_tag1==vtag1 && assoc->verification_tag2==vtag2)
259 selected_stream=assoc;
262 list=g_list_next(list);
264 gtk_widget_set_sensitive(bt_afilter,FALSE);
266 filter_applied = TRUE;
271 sctp_stat_on_filter (GtkButton *button _U_, gpointer user_data _U_)
273 gchar *f_string = NULL;
274 GList *srclist, *dstlist;
276 GString *gstring=NULL;
277 struct sockaddr_in *infosrc=NULL;
278 struct sockaddr_in *infodst=NULL;
280 if (selected_stream==NULL) {
281 gtk_entry_set_text(GTK_ENTRY(main_display_filter_widget), "");
285 if (selected_stream->check_address==FALSE)
287 f_string = g_strdup_printf("((sctp.srcport==%u && sctp.dstport==%u && "
288 "((sctp.verification_tag==0x%x && sctp.verification_tag!=0x0) || "
289 "(sctp.verification_tag==0x0 && sctp.initiate_tag==0x%x) || "
290 "(sctp.verification_tag==0x%x && (sctp.abort_t_bit==1 || "
291 "sctp.shutdown_complete_t_bit==1)))) ||"
292 "(sctp.srcport==%u && sctp.dstport==%u && ((sctp.verification_tag==0x%x "
293 "&& sctp.verification_tag!=0x0) || "
294 "(sctp.verification_tag==0x0 && sctp.initiate_tag==0x%x) ||"
295 "(sctp.verification_tag==0x%x && (sctp.abort_t_bit==1 ||"
296 " sctp.shutdown_complete_t_bit==1)))))",
297 selected_stream->port1,
298 selected_stream->port2,
299 selected_stream->verification_tag1,
300 selected_stream->initiate_tag,
301 selected_stream->verification_tag2,
302 selected_stream->port2,
303 selected_stream->port1,
304 selected_stream->verification_tag2,
305 selected_stream->initiate_tag,
306 selected_stream->verification_tag1);
307 filter_string = f_string;
312 srclist = g_list_first(selected_stream->addr1);
313 infosrc=(struct sockaddr_in *) (srclist->data);
314 gstring = g_string_new(g_strdup_printf("((sctp.srcport==%u && sctp.dstport==%u && (ip.src==%s",
315 selected_stream->port1, selected_stream->port2, ip_to_str((const guint8 *)&(infosrc->sin_addr.s_addr))));
316 srclist= g_list_next(srclist);
320 infosrc=(struct sockaddr_in *) (srclist->data);
321 str =g_strdup_printf("|| ip.src==%s",ip_to_str((const guint8 *)&(infosrc->sin_addr.s_addr)));
322 g_string_append(gstring, str);
323 srclist= g_list_next(srclist);
325 dstlist = g_list_first(selected_stream->addr2);
326 infodst=(struct sockaddr_in *) (dstlist->data);
327 str = g_strdup_printf(") && (ip.dst==%s",ip_to_str((const guint8 *)&(infodst->sin_addr.s_addr)));
328 g_string_append(gstring, str);
329 dstlist= g_list_next(dstlist);
332 infodst=(struct sockaddr_in *) (dstlist->data);
333 str =g_strdup_printf("|| ip.dst==%s",ip_to_str((const guint8 *)&(infodst->sin_addr.s_addr)));
334 g_string_append(gstring, str);
335 dstlist= g_list_next(dstlist);
337 srclist = g_list_first(selected_stream->addr1);
338 infosrc=(struct sockaddr_in *) (srclist->data);
339 str = g_strdup_printf(")) || (sctp.dstport==%u && sctp.srcport==%u && (ip.dst==%s",
340 selected_stream->port1, selected_stream->port2, ip_to_str((const guint8 *)&(infosrc->sin_addr.s_addr)));
341 g_string_append(gstring, str);
342 srclist= g_list_next(srclist);
346 infosrc=(struct sockaddr_in *) (srclist->data);
347 str =g_strdup_printf("|| ip.dst==%s",ip_to_str((const guint8 *)&(infosrc->sin_addr.s_addr)));
348 g_string_append(gstring, str);
349 srclist= g_list_next(srclist);
352 dstlist = g_list_first(selected_stream->addr2);
353 infodst=(struct sockaddr_in *) (dstlist->data);
354 str = g_strdup_printf(") && (ip.src==%s",ip_to_str((const guint8 *)&(infodst->sin_addr.s_addr)));
355 g_string_append(gstring, str);
356 dstlist= g_list_next(dstlist);
359 infodst=(struct sockaddr_in *) (dstlist->data);
360 str =g_strdup_printf("|| ip.src==%s",ip_to_str((const guint8 *)&(infodst->sin_addr.s_addr)));
361 g_string_append(gstring, str);
362 dstlist= g_list_next(dstlist);
364 str = g_strdup_printf(")))");
365 g_string_append(gstring, str);
366 filter_string = gstring->str;
367 g_string_free(gstring,FALSE);
370 if (filter_string != NULL) {
371 gtk_entry_set_text(GTK_ENTRY(main_display_filter_widget), filter_string);
373 g_assert_not_reached();
375 gtk_widget_set_sensitive(bt_afilter,TRUE);
376 gtk_widget_set_sensitive(bt_filter,FALSE);
377 prevent_update = TRUE;
378 filter_applied = FALSE;
383 sctp_stat_on_close (GtkWidget *button _U_, gpointer user_data _U_)
385 gtk_grab_remove(sctp_stat_dlg);
386 gtk_widget_destroy(sctp_stat_dlg);
387 prevent_update = FALSE;
388 filter_applied = FALSE;
392 sctp_stat_on_analyse (GtkButton *button _U_, gpointer user_data _U_)
394 if (selected_stream==NULL)
397 assoc_analyse(selected_stream);
398 gtk_widget_set_sensitive(bt_analyse,FALSE);
400 gtk_widget_set_sensitive(bt_filter,TRUE);
401 prevent_update = TRUE;
405 clist_sort_column(GtkCList *clist, gconstpointer ptr1, gconstpointer ptr2)
411 GtkCListRow *row1 = (GtkCListRow *) ptr1;
412 GtkCListRow *row2 = (GtkCListRow *) ptr2;
413 prevent_update = FALSE;
414 text1 = GTK_CELL_TEXT (row1->cell[clist->sort_column])->text;
415 text2 = GTK_CELL_TEXT (row2->cell[clist->sort_column])->text;
417 switch(clist->sort_column){
420 return strcmp (text1, text2);
431 g_assert_not_reached();
436 clist_click_column_cb(GtkCList *list, gint column, gpointer data)
438 column_arrows *col_arrows = (column_arrows *) data;
441 prevent_update = FALSE;
442 gtk_clist_freeze(list);
444 for (i = 0; i < NUM_COLS; i++) {
445 gtk_widget_hide(col_arrows[i].ascend_pm);
446 gtk_widget_hide(col_arrows[i].descend_pm);
449 if (column == list->sort_column) {
450 if (list->sort_type == GTK_SORT_ASCENDING) {
451 list->sort_type = GTK_SORT_DESCENDING;
452 gtk_widget_show(col_arrows[column].descend_pm);
454 list->sort_type = GTK_SORT_ASCENDING;
455 gtk_widget_show(col_arrows[column].ascend_pm);
458 list->sort_type = GTK_SORT_DESCENDING;
459 gtk_widget_show(col_arrows[column].descend_pm);
460 gtk_clist_set_sort_column(list, column);
462 gtk_clist_thaw(list);
464 gtk_clist_sort(list);
468 gtk_sctpstat_dlg(void)
470 GtkWidget *sctp_stat_dlg_w;
472 GtkWidget *scrolledwindow1;
473 GtkWidget *hbuttonbox2;
476 const gchar *titles[NUM_COLS] = {"Port 1","Port 2","No of Packets", "Checksum", "No of Errors", "Data Chunks", "Data Bytes", "VTag 1","VTag 2"};
477 column_arrows *col_arrows;
478 GdkBitmap *ascend_bm, *descend_bm;
479 GdkPixmap *ascend_pm, *descend_pm;
481 GtkWidget *column_lb;
484 sctp_stat_dlg_w = window_new (GTK_WINDOW_TOPLEVEL, "Wireshark: SCTP Associations");
485 gtk_window_set_position (GTK_WINDOW (sctp_stat_dlg_w), GTK_WIN_POS_CENTER);
486 g_signal_connect(sctp_stat_dlg_w, "destroy", G_CALLBACK(dlg_destroy), NULL);
488 /* Container for each row of widgets */
489 vbox1 = gtk_vbox_new(FALSE, 2);
490 gtk_container_set_border_width(GTK_CONTAINER(vbox1), 8);
491 gtk_container_add(GTK_CONTAINER(sctp_stat_dlg_w), vbox1);
492 gtk_widget_show(vbox1);
494 scrolledwindow1 = scrolled_window_new (NULL, NULL);
495 gtk_widget_show (scrolledwindow1);
496 gtk_box_pack_start (GTK_BOX (vbox1), scrolledwindow1, TRUE, TRUE, 0);
498 clist = gtk_clist_new (NUM_COLS);
499 gtk_widget_show (clist);
500 gtk_container_add (GTK_CONTAINER (scrolledwindow1), clist);
501 gtk_widget_set_size_request(clist, 650, 200);
503 gtk_clist_set_column_width (GTK_CLIST (clist), 0, 50);
504 gtk_clist_set_column_width (GTK_CLIST (clist), 1, 50);
505 gtk_clist_set_column_width (GTK_CLIST (clist), 2, 100);
506 gtk_clist_set_column_width (GTK_CLIST (clist), 3, 100);
507 gtk_clist_set_column_width (GTK_CLIST (clist), 4, 100);
508 gtk_clist_set_column_width (GTK_CLIST (clist), 5, 100);
509 gtk_clist_set_column_width (GTK_CLIST (clist), 6, 100);
510 gtk_clist_set_column_width (GTK_CLIST (clist), 7, 100);
511 gtk_clist_set_column_width (GTK_CLIST (clist), 8, 100);
513 gtk_clist_set_column_justification(GTK_CLIST(clist), 0, GTK_JUSTIFY_CENTER);
514 gtk_clist_set_column_justification(GTK_CLIST(clist), 1, GTK_JUSTIFY_CENTER);
515 gtk_clist_set_column_justification(GTK_CLIST(clist), 2, GTK_JUSTIFY_CENTER);
516 gtk_clist_set_column_justification(GTK_CLIST(clist), 3, GTK_JUSTIFY_CENTER);
517 gtk_clist_set_column_justification(GTK_CLIST(clist), 4, GTK_JUSTIFY_CENTER);
518 gtk_clist_set_column_justification(GTK_CLIST(clist), 5, GTK_JUSTIFY_CENTER);
519 gtk_clist_set_column_justification(GTK_CLIST(clist), 6, GTK_JUSTIFY_CENTER);
520 gtk_clist_set_column_justification(GTK_CLIST(clist), 7, GTK_JUSTIFY_CENTER);
521 gtk_clist_set_column_justification(GTK_CLIST(clist), 8, GTK_JUSTIFY_CENTER);
522 gtk_clist_column_titles_show (GTK_CLIST (clist));
524 gtk_clist_set_compare_func(GTK_CLIST(clist), clist_sort_column);
525 gtk_clist_set_sort_column(GTK_CLIST(clist), 0);
526 gtk_clist_set_sort_type(GTK_CLIST(clist), GTK_SORT_ASCENDING);
528 gtk_widget_show(sctp_stat_dlg_w);
530 col_arrows = (column_arrows *) g_malloc(sizeof(column_arrows) * NUM_COLS);
531 win_style = gtk_widget_get_style(scrolledwindow1);
533 ascend_pm = gdk_pixmap_create_from_xpm_d(scrolledwindow1->window,
535 &win_style->bg[GTK_STATE_NORMAL],
536 (gchar **)clist_ascend_xpm);
537 descend_pm = gdk_pixmap_create_from_xpm_d(scrolledwindow1->window,
539 &win_style->bg[GTK_STATE_NORMAL],
540 (gchar **)clist_descend_xpm);
541 for (i=0; i<NUM_COLS; i++)
543 col_arrows[i].table = gtk_table_new(2, 2, FALSE);
544 gtk_table_set_col_spacings(GTK_TABLE(col_arrows[i].table), 5);
545 column_lb = gtk_label_new(titles[i]);
546 gtk_table_attach(GTK_TABLE(col_arrows[i].table), column_lb, 0, 1, 0, 2, GTK_SHRINK, GTK_SHRINK, 0, 0);
547 gtk_widget_show(column_lb);
548 col_arrows[i].ascend_pm = gtk_pixmap_new(ascend_pm, ascend_bm);
549 gtk_table_attach(GTK_TABLE(col_arrows[i].table), col_arrows[i].ascend_pm, 1, 2, 1, 2, GTK_SHRINK, GTK_SHRINK, 0, 0);
550 col_arrows[i].descend_pm = gtk_pixmap_new(descend_pm, descend_bm);
551 gtk_table_attach(GTK_TABLE(col_arrows[i].table), col_arrows[i].descend_pm, 1, 2, 0, 1, GTK_SHRINK, GTK_SHRINK, 0, 0);
552 /* make src-ip be the default sort order */
555 gtk_widget_show(col_arrows[i].ascend_pm);
558 gtk_clist_set_column_widget(GTK_CLIST(clist), i, col_arrows[i].table);
559 gtk_widget_show(col_arrows[i].table);
562 g_signal_connect(clist, "click-column", G_CALLBACK(clist_click_column_cb), col_arrows);
564 hbuttonbox2 = gtk_hbutton_box_new();
565 gtk_box_pack_start(GTK_BOX(vbox1), hbuttonbox2, FALSE, FALSE, 0);
566 gtk_container_set_border_width(GTK_CONTAINER(hbuttonbox2), 10);
567 gtk_button_box_set_layout(GTK_BUTTON_BOX (hbuttonbox2), GTK_BUTTONBOX_SPREAD);
568 gtk_box_set_spacing(GTK_BOX (hbuttonbox2), 0);
569 gtk_widget_show(hbuttonbox2);
571 bt_unselect = gtk_button_new_with_label ("Unselect");
572 gtk_container_add (GTK_CONTAINER (hbuttonbox2), bt_unselect);
573 gtk_widget_show (bt_unselect);
574 gtk_widget_set_sensitive(bt_unselect,FALSE);
576 bt_filter = gtk_button_new_with_label ("Set filter");
577 gtk_container_add (GTK_CONTAINER (hbuttonbox2), bt_filter);
578 gtk_widget_show (bt_filter);
579 gtk_widget_set_sensitive(bt_filter,FALSE);
581 bt_afilter = gtk_button_new_with_label ("Apply filter");
582 gtk_container_add (GTK_CONTAINER (hbuttonbox2), bt_afilter);
583 gtk_widget_show (bt_afilter);
584 gtk_widget_set_sensitive(bt_afilter,FALSE);
586 bt_analyse = gtk_button_new_with_label ("Analyse");
587 gtk_container_add (GTK_CONTAINER (hbuttonbox2), bt_analyse);
588 gtk_widget_show (bt_analyse);
589 gtk_widget_set_sensitive(bt_analyse,FALSE);
591 bt_close = gtk_button_new_from_stock(GTK_STOCK_CLOSE);
592 gtk_container_add (GTK_CONTAINER (hbuttonbox2), bt_close);
593 GTK_WIDGET_SET_FLAGS(bt_close, GTK_CAN_DEFAULT);
594 window_set_cancel_button( sctp_stat_dlg_w, bt_close, sctp_stat_on_close);
595 gtk_widget_grab_focus(bt_close);
596 gtk_widget_show (bt_close);
598 g_signal_connect(sctp_stat_dlg_w, "destroy", G_CALLBACK(dlg_destroy), NULL);
599 g_signal_connect(clist, "select_row", G_CALLBACK(sctp_stat_on_select_row), NULL);
600 g_signal_connect(bt_unselect, "clicked", G_CALLBACK(sctp_stat_on_unselect), NULL);
601 g_signal_connect(bt_filter, "clicked", G_CALLBACK(sctp_stat_on_filter), NULL);
602 g_signal_connect(bt_afilter, "clicked", G_CALLBACK(sctp_stat_on_apply_filter), NULL);
603 g_signal_connect(bt_analyse, "clicked", G_CALLBACK(sctp_stat_on_analyse), NULL);
605 sctp_stat_dlg = sctp_stat_dlg_w;
606 cf_retap_packets(&cfile);
607 gdk_window_raise(sctp_stat_dlg_w->window);
611 static void sctp_stat_dlg_show(void)
613 if (sctp_stat_dlg != NULL)
615 /* There's already a dialog box; reactivate it. */
616 reactivate_window(sctp_stat_dlg);
617 /* Another list since last call? */
618 if ((sctp_stat_get_info()->assoc_info_list) != last_list)
619 sctp_stat_dlg_update();
623 /* Create and show the dialog box */
625 sctp_stat_dlg_update();
630 static void sctp_stat_start(GtkWidget *w _U_, gpointer data _U_)
632 prevent_update = FALSE;
633 filter_applied = FALSE;
634 sctp_assocs = g_malloc(sizeof(sctp_allassocs_info_t));
635 sctp_assocs = (sctp_allassocs_info_t*)sctp_stat_get_info();
636 /* Register the tap listener */
637 if (sctp_stat_get_info()->is_registered==FALSE)
638 register_tap_listener_sctp_stat();
639 /* (redissect all packets) */
642 /* Show the dialog box with the list of streams */
643 /* sctp_stat_dlg_show(sctp_stat_get_info()->assoc_info_list); */
644 sctp_stat_dlg_show();
647 /****************************************************************************/
649 register_tap_listener_sctp_stat_dlg(void)
651 register_stat_menu_item("SCTP/Show All Associations...", REGISTER_STAT_GROUP_TELEPHONY,
652 sctp_stat_start, NULL, NULL, NULL);
656 GtkWidget* get_stat_dlg(void)
658 return sctp_stat_dlg;