]> git.samba.org - obnox/wireshark/wip.git/blobdiff - gtk/dcerpc_stat.c
some more : try to make read/write not break the build if the return value is not...
[obnox/wireshark/wip.git] / gtk / dcerpc_stat.c
index ee67f3ee988a061c63fa205c7de484851f4b8644..f4aa3c6ddb3585e42c0c747c70ee12e5b0a28b17 100644 (file)
@@ -3,8 +3,8 @@
  *
  * $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
@@ -22,9 +22,9 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
-/* This module provides rpc call/reply SRT statistics to ethereal,
+/* This module provides rpc call/reply SRT statistics to Wireshark,
  * and displays them graphically.
- * It is only used by ethereal and not tethereal
+ * It is only used by Wireshark and not tshark
  *
  * It serves as an example on how to use the tap api.
  */
@@ -41,7 +41,8 @@
 #include <epan/epan.h>
 
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gui_stat_menu.h"
 #include "simple_dialog.h"
 #include "dlg_utils.h"
 #include "gui_utils.h"
@@ -185,7 +186,7 @@ win_destroy_cb(GtkWindow *win _U_, gpointer data)
 /* When called, this function will create a new instance of gtk-dcerpcstat.
  */
 static void
-gtk_dcerpcstat_init(const char *optarg)
+gtk_dcerpcstat_init(const char *optarg, void* userdata _U_)
 {
        rpcstat_t *rs;
        guint32 i, max_procs;
@@ -236,15 +237,15 @@ gtk_dcerpcstat_init(const char *optarg)
                        filter=NULL;
                }
        } else {
-               fprintf(stderr, "ethereal: invalid \"-z dcerpc,srt,<uuid>,<major version>.<minor version>[,<filter>]\" argument\n");
+               fprintf(stderr, "wireshark: invalid \"-z dcerpc,srt,<uuid>,<major version>.<minor version>[,<filter>]\" argument\n");
                exit(1);
        }
        if (major < 0 || major > 65535) {
-               fprintf(stderr,"ethereal: dcerpcstat_init() Major version number %d is invalid - must be positive and <= 65535\n", major);
+               fprintf(stderr,"wireshark: dcerpcstat_init() Major version number %d is invalid - must be positive and <= 65535\n", major);
                exit(1);
        }
        if (minor < 0 || minor > 65535) {
-               fprintf(stderr,"ethereal: dcerpcstat_init() Minor version number %d is invalid - must be positive and <= 65535\n", minor);
+               fprintf(stderr,"wireshark: dcerpcstat_init() Minor version number %d is invalid - must be positive and <= 65535\n", minor);
                exit(1);
        }
        ver = major;
@@ -253,7 +254,7 @@ gtk_dcerpcstat_init(const char *optarg)
        rs->prog=dcerpc_get_proto_name(&uuid, ver);
        if(!rs->prog){
                g_free(rs);
-               fprintf(stderr,"ethereal: dcerpcstat_init() Protocol with uuid:%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x v%u not supported\n",uuid.Data1,uuid.Data2,uuid.Data3,uuid.Data4[0],uuid.Data4[1],uuid.Data4[2],uuid.Data4[3],uuid.Data4[4],uuid.Data4[5],uuid.Data4[6],uuid.Data4[7],ver);
+               fprintf(stderr,"wireshark: dcerpcstat_init() Protocol with uuid:%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x v%u not supported\n",uuid.Data1,uuid.Data2,uuid.Data3,uuid.Data4[0],uuid.Data4[1],uuid.Data4[2],uuid.Data4[3],uuid.Data4[4],uuid.Data4[5],uuid.Data4[6],uuid.Data4[7],ver);
                exit(1);
        }
        hf_opnum=dcerpc_get_proto_hf_opnum(&uuid, ver);
@@ -332,7 +333,7 @@ gtk_dcerpcstat_init(const char *optarg)
        gtk_widget_show_all(rs->win);
        window_present(rs->win);
 
-       cf_retap_packets(&cfile);
+       cf_retap_packets(&cfile, FALSE);
 }
 
 
@@ -370,7 +371,7 @@ dcerpcstat_start_button_clicked(GtkWidget *item _U_, gpointer data _U_)
                g_string_sprintfa(str, ",%s", filter);
        }
 
-       gtk_dcerpcstat_init(str->str);
+       gtk_dcerpcstat_init(str->str,NULL);
        g_string_free(str, TRUE);
 }
 
@@ -549,7 +550,8 @@ gtk_dcerpcstat_cb(GtkWidget *w _U_, gpointer d _U_)
        static construct_args_t args = {
          "Service Response Time Statistics Filter",
          FALSE,
-         FALSE
+         FALSE,
+      FALSE
        };
 
        /* if the window is already open, bring it to front and
@@ -559,7 +561,7 @@ gtk_dcerpcstat_cb(GtkWidget *w _U_, gpointer d _U_)
                return;
        }
 
-       dlg=dlg_window_new("Ethereal: Compute DCE-RPC SRT statistics");
+       dlg=dlg_window_new("Wireshark: Compute DCE-RPC SRT statistics");
        gtk_window_set_default_size(GTK_WINDOW(dlg), 400, -1);
 
        dlg_box=gtk_vbox_new(FALSE, 10);
@@ -622,7 +624,7 @@ gtk_dcerpcstat_cb(GtkWidget *w _U_, gpointer d _U_)
        filter_box=gtk_hbox_new(FALSE, 3);
 
        /* Filter label */
-       filter_bt=BUTTON_NEW_FROM_STOCK(ETHEREAL_STOCK_DISPLAY_FILTER_ENTRY);
+       filter_bt=BUTTON_NEW_FROM_STOCK(WIRESHARK_STOCK_DISPLAY_FILTER_ENTRY);
        SIGNAL_CONNECT(filter_bt, "clicked", display_filter_construct_cb, &args);
        gtk_box_pack_start(GTK_BOX(filter_box), filter_bt, FALSE, FALSE, 0);
        gtk_widget_show(filter_bt);
@@ -643,11 +645,11 @@ gtk_dcerpcstat_cb(GtkWidget *w _U_, gpointer d _U_)
        OBJECT_SET_DATA(filter_bt, E_FILT_TE_PTR_KEY, filter_entry);
 
        /* button box */
-    bbox = dlg_button_row_new(ETHEREAL_STOCK_CREATE_STAT, GTK_STOCK_CANCEL, NULL);
+    bbox = dlg_button_row_new(WIRESHARK_STOCK_CREATE_STAT, GTK_STOCK_CANCEL, NULL);
        gtk_box_pack_start(GTK_BOX(dlg_box), bbox, FALSE, FALSE, 0);
     gtk_widget_show(bbox);
 
-    start_button = OBJECT_GET_DATA(bbox, ETHEREAL_STOCK_CREATE_STAT);
+    start_button = OBJECT_GET_DATA(bbox, WIRESHARK_STOCK_CREATE_STAT);
        SIGNAL_CONNECT_OBJECT(start_button, "clicked", 
                               dcerpcstat_start_button_clicked, NULL);
 
@@ -676,7 +678,7 @@ gtk_dcerpcstat_cb(GtkWidget *w _U_, gpointer d _U_)
 void
 register_tap_listener_gtkdcerpcstat(void)
 {
-       register_stat_cmd_arg("dcerpc,srt,", gtk_dcerpcstat_init);
+       register_stat_cmd_arg("dcerpc,srt,", gtk_dcerpcstat_init,NULL);
 
        register_stat_menu_item("DCE-RPC...", REGISTER_STAT_GROUP_RESPONSE_TIME,
            gtk_dcerpcstat_cb, NULL, NULL, NULL);