*
* $Id$
*
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@ethereal.com>
+ * 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
#include "globals.h"
#include "epan/filesystem.h"
#include "simple_dialog.h"
-#include "tap_menu.h"
#include "dlg_utils.h"
-#include "ui_util.h"
+#include "gui_utils.h"
#include "main.h"
#include "compat_macros.h"
static GList *last_list = NULL;
static sctp_error_info_t* selected_packet = NULL;/* current selection */
/*static sctp_assoc_info_t* selected_assoc = NULL; */
-extern GtkWidget *main_display_filter_widget;
-
#define NUM_COLS 3
gtk_clist_unselect_all(GTK_CLIST(clist));
}
-void sctp_error_dlg_update(GList *list)
+static void sctp_error_dlg_update(GList *list)
{
-GList *ilist=NULL;
-printf("dlg_update\n");
- if (sctp_error_dlg != NULL) {
- gtk_clist_clear(GTK_CLIST(clist));
-printf("vor ilist\n");
- ilist=list;
- if (ilist==NULL)
- printf("=NULL\n");
- printf("nach ilist\n");
+ GList *ilist=NULL;
+
+ if (sctp_error_dlg != NULL)
+ {
+ gtk_clist_clear(GTK_CLIST(clist));
+ ilist=list;
while (ilist)
{
- printf("while\n");
add_to_clist((sctp_error_info_t*)(ilist->data));
ilist = g_list_next(ilist);
}
sctp_error_on_unselect(NULL, NULL);
}
-printf("vor last_list\n");
last_list = ilist;
}
static void
-sctp_error_on_select_row(GtkCList *clist,
- gint row,
- gint column _U_,
- GdkEventButton *event _U_,
- gpointer user_data _U_)
+sctp_error_on_select_row(GtkCList *clist, gint row,gint column _U_, GdkEventButton *event _U_, gpointer user_data _U_)
{
-selected_packet = gtk_clist_get_row_data(GTK_CLIST(clist), row);
+ selected_packet = gtk_clist_get_row_data(GTK_CLIST(clist), row);
}
static void
-sctp_error_on_close (GtkButton *button _U_, gpointer user_data _U_)
+sctp_error_on_close (GtkButton *button _U_, gpointer user_data _U_)
{
gtk_grab_remove(sctp_error_dlg);
gtk_widget_destroy(sctp_error_dlg);
GtkWidget *bt_frame;
GtkWidget *bt_close;
- gchar *titles[NUM_COLS] = {"Framenumber","Chunk Types", "Info"};
+ const gchar *titles[NUM_COLS] = {"Framenumber","Chunk Types", "Info"};
column_arrows *col_arrows;
GtkStyle *win_style;
GtkWidget *column_lb;
int i;
- sctp_error_dlg_w = window_new (GTK_WINDOW_TOPLEVEL, "Ethereal: SCTP Associations");
+ sctp_error_dlg_w = window_new (GTK_WINDOW_TOPLEVEL, "Wireshark: SCTP Associations");
gtk_window_set_position (GTK_WINDOW (sctp_error_dlg_w), GTK_WIN_POS_CENTER);
SIGNAL_CONNECT(sctp_error_dlg_w, "destroy", dlg_destroy,NULL);
gtk_container_add(GTK_CONTAINER(sctp_error_dlg_w), vbox1);
gtk_widget_show(vbox1);
-/* sctp_error_dlg_w = gtk_dialog_new();
- gtk_window_set_title (GTK_WINDOW (sctp_error_dlg_w), "Ethereal: SCTP Malformed Packets");
-
- dialog_vbox1 = GTK_DIALOG (sctp_error_dlg_w)->vbox;
- gtk_widget_show (dialog_vbox1);
-
- vbox1 = gtk_vbox_new (FALSE, 0);
- gtk_widget_show (vbox1);
- gtk_box_pack_start (GTK_BOX (dialog_vbox1), vbox1, TRUE, TRUE, 0);
- gtk_container_set_border_width (GTK_CONTAINER (vbox1), 8);*/
-
scrolledwindow1 = scrolled_window_new (NULL, NULL);
gtk_widget_show (scrolledwindow1);
gtk_box_pack_start (GTK_BOX (vbox1), scrolledwindow1, TRUE, TRUE, 0);
gtk_widget_show (bt_frame);
gtk_container_add (GTK_CONTAINER (hbuttonbox2), bt_frame);
- bt_close = BUTTON_NEW_FROM_STOCK(GTK_STOCK_CLOSE);
+ bt_close = BUTTON_NEW_FROM_STOCK(GTK_STOCK_CLOSE);
gtk_widget_show (bt_close);
gtk_container_add (GTK_CONTAINER (hbuttonbox2), bt_close);
SIGNAL_CONNECT(bt_close, "clicked", sctp_error_on_close, NULL);
sctp_error_dlg = sctp_error_dlg_w;
-
-
}
void sctp_error_dlg_show(sctp_assoc_info_t* assoc)
{
-GList *list;
+ GList *list;
-
- /* selected_assoc=(sctp_assoc_info_t*)get_selected_assoc(); */
list =assoc->error_info_list;
if (list != NULL)
{
- if (sctp_error_dlg != NULL) {
- /* There's already a dialog box; reactivate it. */
- reactivate_window(sctp_error_dlg);
- /* Another list since last call? */
- if (list != last_list) {
+ if (sctp_error_dlg != NULL) {
+ /* There's already a dialog box; reactivate it. */
+ reactivate_window(sctp_error_dlg);
+ /* Another list since last call? */
+ if (list != last_list) {
+ sctp_error_dlg_update(list);
+ }
+ }
+ else {
+ /* Create and show the dialog box */
+ gtk_sctperror_dlg();
sctp_error_dlg_update(list);
}
}
- else {
- /* Create and show the dialog box */
- gtk_sctperror_dlg();
- sctp_error_dlg_update(list);
- }
- }
else
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
"No errors found!");
}
-
-/*void sctp_error_start(GtkWidget *w _U_, gpointer data _U_)
-{
- if (sctp_stat_get_info()->is_registered==FALSE)
- register_tap_listener_sctp_stat();
- sctp_stat_scan();
- sctp_error_dlg_show(sctp_stat_get_info()->error_info_list);
-}*/
-
-/****************************************************************************/
-/*void
-register_tap_listener_sctp_error_dlg(void)
-{
- register_tap_menu_item("SCTP/Show All Malformed Packets...", REGISTER_TAP_GROUP_NONE,
- sctp_error_start, NULL, NULL, NULL);
-}*/