2003-01-22 00:42:05 +00:00
|
|
|
/* smb_stat.c
|
|
|
|
* smb_stat 2003 Ronnie Sahlberg
|
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
2003-01-22 00:42:05 +00:00
|
|
|
*
|
|
|
|
* Ethereal - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@ethereal.com>
|
|
|
|
* Copyright 1998 Gerald Combs
|
2003-04-25 20:54:18 +00:00
|
|
|
*
|
2003-01-22 00:42:05 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2003-04-25 20:54:18 +00:00
|
|
|
*
|
2003-01-22 00:42:05 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2003-04-25 20:54:18 +00:00
|
|
|
*
|
2003-01-22 00:42:05 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
|
|
|
# include <sys/types.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <string.h>
|
2004-02-13 00:53:37 +00:00
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
|
|
|
#include <epan/packet_info.h>
|
|
|
|
#include <epan/epan.h>
|
|
|
|
#include <epan/value_string.h>
|
|
|
|
|
2004-02-11 04:17:05 +00:00
|
|
|
#include "tap_menu.h"
|
2004-09-29 00:06:36 +00:00
|
|
|
#include <epan/tap.h>
|
2003-01-22 00:42:05 +00:00
|
|
|
#include "../smb.h"
|
|
|
|
#include "../register.h"
|
2003-04-25 20:54:18 +00:00
|
|
|
#include "../timestats.h"
|
2003-01-22 00:42:05 +00:00
|
|
|
#include "compat_macros.h"
|
|
|
|
#include "../simple_dialog.h"
|
2004-02-13 00:53:37 +00:00
|
|
|
#include "ui_util.h"
|
2003-09-26 02:09:44 +00:00
|
|
|
#include "dlg_utils.h"
|
2003-01-22 00:42:05 +00:00
|
|
|
#include "../file.h"
|
|
|
|
#include "../globals.h"
|
2004-07-19 21:42:01 +00:00
|
|
|
#include "filter_dlg.h"
|
2003-06-21 06:40:48 +00:00
|
|
|
#include "service_response_time_table.h"
|
2004-06-02 07:12:11 +00:00
|
|
|
#include "gtkglobals.h"
|
2003-01-22 00:42:05 +00:00
|
|
|
|
2003-08-19 10:09:20 +00:00
|
|
|
|
2003-01-22 00:42:05 +00:00
|
|
|
/* used to keep track of the statistics for an entire program interface */
|
|
|
|
typedef struct _smbstat_t {
|
|
|
|
GtkWidget *win;
|
2003-06-21 06:40:48 +00:00
|
|
|
srt_stat_table smb_srt_table;
|
|
|
|
srt_stat_table trans2_srt_table;
|
|
|
|
srt_stat_table nt_trans_srt_table;
|
2003-01-22 00:42:05 +00:00
|
|
|
} smbstat_t;
|
|
|
|
|
2003-09-26 02:09:44 +00:00
|
|
|
static void
|
|
|
|
smbstat_set_title(smbstat_t *ss)
|
|
|
|
{
|
|
|
|
char *title;
|
2003-01-22 00:42:05 +00:00
|
|
|
|
2003-09-26 02:09:44 +00:00
|
|
|
title = g_strdup_printf("SMB Service Response Time statistics: %s",
|
|
|
|
cf_get_display_name(&cfile));
|
|
|
|
gtk_window_set_title(GTK_WINDOW(ss->win), title);
|
|
|
|
g_free(title);
|
|
|
|
}
|
2003-01-22 00:42:05 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
smbstat_reset(void *pss)
|
|
|
|
{
|
|
|
|
smbstat_t *ss=(smbstat_t *)pss;
|
|
|
|
|
2003-06-21 06:40:48 +00:00
|
|
|
reset_srt_table_data(&ss->smb_srt_table);
|
|
|
|
reset_srt_table_data(&ss->trans2_srt_table);
|
|
|
|
reset_srt_table_data(&ss->nt_trans_srt_table);
|
2003-09-26 02:09:44 +00:00
|
|
|
smbstat_set_title(ss);
|
2003-01-22 00:42:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2005-01-01 02:57:02 +00:00
|
|
|
smbstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const void *psi)
|
2003-01-22 00:42:05 +00:00
|
|
|
{
|
|
|
|
smbstat_t *ss=(smbstat_t *)pss;
|
2005-01-01 02:57:02 +00:00
|
|
|
const smb_info_t *si=psi;
|
2003-01-22 00:42:05 +00:00
|
|
|
|
|
|
|
/* we are only interested in reply packets */
|
|
|
|
if(si->request){
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
/* if we havnt seen the request, just ignore it */
|
|
|
|
if(!si->sip){
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2003-06-21 06:40:48 +00:00
|
|
|
add_srt_table_data(&ss->smb_srt_table, si->cmd, &si->sip->req_time, pinfo);
|
|
|
|
|
2003-01-22 00:42:05 +00:00
|
|
|
if(si->cmd==0xA0){
|
|
|
|
smb_nt_transact_info_t *sti=(smb_nt_transact_info_t *)si->sip->extra_info;
|
|
|
|
|
2003-09-28 00:00:36 +00:00
|
|
|
if(sti){
|
|
|
|
add_srt_table_data(&ss->nt_trans_srt_table, sti->subcmd, &si->sip->req_time, pinfo);
|
|
|
|
}
|
2003-01-22 00:42:05 +00:00
|
|
|
} else if(si->cmd==0x32){
|
|
|
|
smb_transact2_info_t *st2i=(smb_transact2_info_t *)si->sip->extra_info;
|
|
|
|
|
2003-09-28 00:00:36 +00:00
|
|
|
if(st2i){
|
|
|
|
add_srt_table_data(&ss->trans2_srt_table, st2i->subcmd, &si->sip->req_time, pinfo);
|
|
|
|
}
|
2003-01-22 00:42:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2003-06-21 06:40:48 +00:00
|
|
|
|
|
|
|
|
2003-01-22 00:42:05 +00:00
|
|
|
static void
|
|
|
|
smbstat_draw(void *pss)
|
|
|
|
{
|
|
|
|
smbstat_t *ss=(smbstat_t *)pss;
|
|
|
|
|
2003-06-21 06:40:48 +00:00
|
|
|
draw_srt_table_data(&ss->smb_srt_table);
|
|
|
|
draw_srt_table_data(&ss->trans2_srt_table);
|
|
|
|
draw_srt_table_data(&ss->nt_trans_srt_table);
|
2003-01-22 00:42:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void protect_thread_critical_region(void);
|
|
|
|
void unprotect_thread_critical_region(void);
|
|
|
|
static void
|
|
|
|
win_destroy_cb(GtkWindow *win _U_, gpointer data)
|
|
|
|
{
|
|
|
|
smbstat_t *ss=(smbstat_t *)data;
|
|
|
|
|
|
|
|
protect_thread_critical_region();
|
|
|
|
remove_tap_listener(ss);
|
|
|
|
unprotect_thread_critical_region();
|
|
|
|
|
2003-06-21 06:40:48 +00:00
|
|
|
free_srt_table_data(&ss->smb_srt_table);
|
|
|
|
free_srt_table_data(&ss->trans2_srt_table);
|
|
|
|
free_srt_table_data(&ss->nt_trans_srt_table);
|
2003-01-22 00:42:05 +00:00
|
|
|
g_free(ss);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_smbstat_init(char *optarg)
|
|
|
|
{
|
|
|
|
smbstat_t *ss;
|
|
|
|
char *filter=NULL;
|
2003-06-21 06:40:48 +00:00
|
|
|
GtkWidget *label;
|
2003-01-22 00:42:05 +00:00
|
|
|
char filter_string[256];
|
2003-04-23 08:20:06 +00:00
|
|
|
GString *error_string;
|
2003-06-21 06:40:48 +00:00
|
|
|
int i;
|
|
|
|
GtkWidget *vbox;
|
2004-04-12 08:53:02 +00:00
|
|
|
GtkWidget *bbox;
|
|
|
|
GtkWidget *close_bt;
|
2003-01-22 00:42:05 +00:00
|
|
|
|
2003-06-21 06:40:48 +00:00
|
|
|
if(!strncmp(optarg,"smb,srt,",8)){
|
2003-01-22 00:42:05 +00:00
|
|
|
filter=optarg+8;
|
|
|
|
} else {
|
|
|
|
filter=NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
ss=g_malloc(sizeof(smbstat_t));
|
|
|
|
|
2004-05-23 23:24:07 +00:00
|
|
|
ss->win=window_new(GTK_WINDOW_TOPLEVEL, "smb-stat");
|
2003-06-21 09:50:19 +00:00
|
|
|
gtk_window_set_default_size(GTK_WINDOW(ss->win), 550, 600);
|
2003-09-26 02:09:44 +00:00
|
|
|
smbstat_set_title(ss);
|
2003-01-22 00:42:05 +00:00
|
|
|
|
2004-04-12 08:53:02 +00:00
|
|
|
vbox=gtk_vbox_new(FALSE, 3);
|
2003-06-21 06:40:48 +00:00
|
|
|
gtk_container_add(GTK_CONTAINER(ss->win), vbox);
|
2004-04-12 08:53:02 +00:00
|
|
|
gtk_container_set_border_width(GTK_CONTAINER(vbox), 12);
|
2003-01-22 00:42:05 +00:00
|
|
|
|
2003-06-21 06:40:48 +00:00
|
|
|
label=gtk_label_new("SMB Service Response Time statistics");
|
|
|
|
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
|
2003-01-22 00:42:05 +00:00
|
|
|
|
2004-03-13 15:15:26 +00:00
|
|
|
g_snprintf(filter_string,255,"Filter:%s",filter?filter:"");
|
2003-06-21 06:40:48 +00:00
|
|
|
label=gtk_label_new(filter_string);
|
|
|
|
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
|
2003-01-22 00:42:05 +00:00
|
|
|
|
2003-06-21 06:40:48 +00:00
|
|
|
label=gtk_label_new("SMB Commands");
|
|
|
|
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
|
2003-06-22 04:00:21 +00:00
|
|
|
|
|
|
|
/* We must display TOP LEVEL Widget before calling init_srt_table() */
|
2004-04-12 08:53:02 +00:00
|
|
|
gtk_widget_show_all(ss->win);
|
2003-06-22 04:00:21 +00:00
|
|
|
|
2003-09-05 10:26:44 +00:00
|
|
|
init_srt_table(&ss->smb_srt_table, 256, vbox, "smb.cmd");
|
2003-06-21 06:40:48 +00:00
|
|
|
for(i=0;i<256;i++){
|
|
|
|
init_srt_table_row(&ss->smb_srt_table, i, val_to_str(i, smb_cmd_vals, "Unknown(0x%02x)"));
|
|
|
|
}
|
2003-01-22 00:42:05 +00:00
|
|
|
|
|
|
|
|
2003-06-21 06:40:48 +00:00
|
|
|
label=gtk_label_new("Transaction2 Sub-Commands");
|
|
|
|
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
|
2003-09-05 10:26:44 +00:00
|
|
|
init_srt_table(&ss->trans2_srt_table, 256, vbox, "smb.trans2.cmd");
|
2003-06-21 06:40:48 +00:00
|
|
|
for(i=0;i<256;i++){
|
|
|
|
init_srt_table_row(&ss->trans2_srt_table, i, val_to_str(i, trans2_cmd_vals, "Unknown(0x%02x)"));
|
|
|
|
}
|
2003-01-22 00:42:05 +00:00
|
|
|
|
|
|
|
|
2003-06-21 06:40:48 +00:00
|
|
|
label=gtk_label_new("NT Transaction Sub-Commands");
|
|
|
|
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
|
2003-09-05 10:26:44 +00:00
|
|
|
init_srt_table(&ss->nt_trans_srt_table, 256, vbox, "smb.nt.function");
|
2003-06-21 06:40:48 +00:00
|
|
|
for(i=0;i<256;i++){
|
|
|
|
init_srt_table_row(&ss->nt_trans_srt_table, i, val_to_str(i, nt_cmd_vals, "Unknown(0x%02x)"));
|
|
|
|
}
|
2003-01-22 00:42:05 +00:00
|
|
|
|
|
|
|
|
2003-04-23 08:20:06 +00:00
|
|
|
error_string=register_tap_listener("smb", ss, filter, smbstat_reset, smbstat_packet, smbstat_draw);
|
|
|
|
if(error_string){
|
2004-01-31 03:22:42 +00:00
|
|
|
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, error_string->str);
|
2003-04-23 08:20:06 +00:00
|
|
|
g_string_free(error_string, TRUE);
|
2003-01-22 00:42:05 +00:00
|
|
|
g_free(ss);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2004-04-12 08:53:02 +00:00
|
|
|
/* Button row. */
|
|
|
|
bbox = dlg_button_row_new(GTK_STOCK_CLOSE, NULL);
|
|
|
|
gtk_box_pack_end(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
|
|
|
|
|
|
|
|
close_bt = OBJECT_GET_DATA(bbox, GTK_STOCK_CLOSE);
|
2004-05-23 23:24:07 +00:00
|
|
|
window_set_cancel_button(ss->win, close_bt, window_cancel_button_cb);
|
2004-04-12 08:53:02 +00:00
|
|
|
|
2004-05-23 23:24:07 +00:00
|
|
|
SIGNAL_CONNECT(ss->win, "delete_event", window_delete_event_cb, NULL);
|
|
|
|
SIGNAL_CONNECT(ss->win, "destroy", win_destroy_cb, ss);
|
2004-04-12 08:53:02 +00:00
|
|
|
|
2004-05-23 23:24:07 +00:00
|
|
|
gtk_widget_show_all(ss->win);
|
|
|
|
window_present(ss->win);
|
|
|
|
|
2005-02-04 18:44:44 +00:00
|
|
|
cf_retap_packets(&cfile);
|
2003-01-22 00:42:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2003-09-26 02:09:44 +00:00
|
|
|
static GtkWidget *dlg=NULL;
|
|
|
|
static GtkWidget *filter_entry;
|
2003-04-22 09:30:59 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
dlg_destroy_cb(void)
|
|
|
|
{
|
|
|
|
dlg=NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
smbstat_start_button_clicked(GtkWidget *item _U_, gpointer data _U_)
|
|
|
|
{
|
2003-09-26 02:09:44 +00:00
|
|
|
GString *str;
|
"gtk_entry_get_text()" returns a "const char *" - assign the result to
one.
"get_basename()" doesn't modify its argument, and its callers don't
modify the substring pointed to by the result, so make it take a "const
char *" as an argument and return a "const char *".
"find_last_pathname_separator()" doesn't modify its argument, so make it
a "const char *" - but some of its callers pass a non-"const" "char *"
and modify the result, so don't make its return value a "const char *".
And, as none of its callers are outside "filesystem.c", make it static.
In "about_folders_page_new()", have separate variables for pathnames
returned as "const char *" (which are cached by the routine that returns
them, so you can't modify them - and can't free them, so get rid of the
commented-out "g_free()" calls for them) and pathnames returned as "char
*" (which are allocated anew for each call, and can be modified, but
have to be freed).
Clean up white space.
svn path=/trunk/; revision=12881
2004-12-31 00:26:36 +00:00
|
|
|
const char *filter;
|
2003-04-22 09:30:59 +00:00
|
|
|
|
2003-09-26 02:09:44 +00:00
|
|
|
str = g_string_new("smb,srt");
|
"gtk_entry_get_text()" returns a "const char *" - assign the result to
one.
"get_basename()" doesn't modify its argument, and its callers don't
modify the substring pointed to by the result, so make it take a "const
char *" as an argument and return a "const char *".
"find_last_pathname_separator()" doesn't modify its argument, so make it
a "const char *" - but some of its callers pass a non-"const" "char *"
and modify the result, so don't make its return value a "const char *".
And, as none of its callers are outside "filesystem.c", make it static.
In "about_folders_page_new()", have separate variables for pathnames
returned as "const char *" (which are cached by the routine that returns
them, so you can't modify them - and can't free them, so get rid of the
commented-out "g_free()" calls for them) and pathnames returned as "char
*" (which are allocated anew for each call, and can be modified, but
have to be freed).
Clean up white space.
svn path=/trunk/; revision=12881
2004-12-31 00:26:36 +00:00
|
|
|
filter=gtk_entry_get_text(GTK_ENTRY(filter_entry));
|
2003-09-26 02:09:44 +00:00
|
|
|
if(filter[0]!=0){
|
|
|
|
g_string_sprintfa(str,",%s", filter);
|
2003-04-22 09:30:59 +00:00
|
|
|
}
|
2003-09-26 02:09:44 +00:00
|
|
|
gtk_smbstat_init(str->str);
|
|
|
|
g_string_free(str, TRUE);
|
2003-04-22 09:30:59 +00:00
|
|
|
}
|
|
|
|
|
2003-04-23 05:37:23 +00:00
|
|
|
static void
|
2003-01-22 00:42:05 +00:00
|
|
|
gtk_smbstat_cb(GtkWidget *w _U_, gpointer d _U_)
|
|
|
|
{
|
2003-09-26 02:09:44 +00:00
|
|
|
GtkWidget *dlg_box;
|
2003-10-27 01:20:16 +00:00
|
|
|
GtkWidget *filter_box, *filter_bt;
|
2003-09-26 02:09:44 +00:00
|
|
|
GtkWidget *bbox, *start_button, *cancel_button;
|
2003-12-04 00:45:39 +00:00
|
|
|
const char *filter;
|
2003-10-27 00:54:02 +00:00
|
|
|
static construct_args_t args = {
|
|
|
|
"Service Response Time Statistics Filter",
|
|
|
|
TRUE,
|
2003-10-27 01:09:32 +00:00
|
|
|
FALSE
|
2003-10-27 00:54:02 +00:00
|
|
|
};
|
2003-08-19 10:09:20 +00:00
|
|
|
|
2003-04-22 09:30:59 +00:00
|
|
|
/* if the window is already open, bring it to front */
|
|
|
|
if(dlg){
|
|
|
|
gdk_window_raise(dlg->window);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2003-09-26 02:09:44 +00:00
|
|
|
dlg=dlg_window_new("Ethereal: Compute SMB SRT statistics");
|
2004-05-27 19:59:50 +00:00
|
|
|
gtk_window_set_default_size(GTK_WINDOW(dlg), 300, -1);
|
2003-09-26 02:09:44 +00:00
|
|
|
|
|
|
|
dlg_box=gtk_vbox_new(FALSE, 10);
|
|
|
|
gtk_container_border_width(GTK_CONTAINER(dlg_box), 10);
|
2003-04-22 09:30:59 +00:00
|
|
|
gtk_container_add(GTK_CONTAINER(dlg), dlg_box);
|
|
|
|
gtk_widget_show(dlg_box);
|
|
|
|
|
2003-09-26 02:09:44 +00:00
|
|
|
/* Filter box */
|
|
|
|
filter_box=gtk_hbox_new(FALSE, 3);
|
2003-04-22 09:30:59 +00:00
|
|
|
|
2003-10-27 00:54:02 +00:00
|
|
|
/* Filter button */
|
2004-01-21 03:54:32 +00:00
|
|
|
filter_bt=BUTTON_NEW_FROM_STOCK(ETHEREAL_STOCK_DISPLAY_FILTER_ENTRY);
|
2003-10-27 00:54:02 +00:00
|
|
|
SIGNAL_CONNECT(filter_bt, "clicked", display_filter_construct_cb, &args);
|
|
|
|
gtk_box_pack_start(GTK_BOX(filter_box), filter_bt, FALSE, TRUE, 0);
|
|
|
|
gtk_widget_show(filter_bt);
|
2003-04-22 09:30:59 +00:00
|
|
|
|
2003-09-26 02:09:44 +00:00
|
|
|
/* Filter entry */
|
|
|
|
filter_entry=gtk_entry_new();
|
2004-02-27 19:07:20 +00:00
|
|
|
SIGNAL_CONNECT(filter_entry, "changed", filter_te_syntax_check_cb, NULL);
|
2003-10-27 00:54:02 +00:00
|
|
|
|
|
|
|
/* filter prefs dialog */
|
|
|
|
OBJECT_SET_DATA(filter_bt, E_FILT_TE_PTR_KEY, filter_entry);
|
|
|
|
/* filter prefs dialog */
|
|
|
|
|
2003-09-26 02:09:44 +00:00
|
|
|
gtk_box_pack_start(GTK_BOX(filter_box), filter_entry, TRUE, TRUE, 0);
|
2003-08-19 10:09:20 +00:00
|
|
|
filter=gtk_entry_get_text(GTK_ENTRY(main_display_filter_widget));
|
|
|
|
if(filter){
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(filter_entry), filter);
|
|
|
|
}
|
2003-04-22 09:30:59 +00:00
|
|
|
gtk_widget_show(filter_entry);
|
2003-04-25 20:54:18 +00:00
|
|
|
|
2003-04-22 09:30:59 +00:00
|
|
|
gtk_box_pack_start(GTK_BOX(dlg_box), filter_box, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show(filter_box);
|
|
|
|
|
2003-09-26 02:09:44 +00:00
|
|
|
/* button box */
|
2004-01-21 21:19:34 +00:00
|
|
|
bbox = dlg_button_row_new(ETHEREAL_STOCK_CREATE_STAT, GTK_STOCK_CANCEL, NULL);
|
2003-09-26 02:09:44 +00:00
|
|
|
gtk_box_pack_start(GTK_BOX(dlg_box), bbox, FALSE, FALSE, 0);
|
2004-01-21 21:19:34 +00:00
|
|
|
gtk_widget_show(bbox);
|
2003-04-22 09:30:59 +00:00
|
|
|
|
2004-01-21 21:19:34 +00:00
|
|
|
start_button = OBJECT_GET_DATA(bbox, ETHEREAL_STOCK_CREATE_STAT);
|
|
|
|
SIGNAL_CONNECT_OBJECT(start_button, "clicked",
|
2003-04-22 09:30:59 +00:00
|
|
|
smbstat_start_button_clicked, NULL);
|
2004-01-21 21:19:34 +00:00
|
|
|
|
|
|
|
cancel_button = OBJECT_GET_DATA(bbox, GTK_STOCK_CANCEL);
|
2004-05-23 23:24:07 +00:00
|
|
|
window_set_cancel_button(dlg, cancel_button, window_cancel_button_cb);
|
2003-09-26 02:09:44 +00:00
|
|
|
|
|
|
|
/* Catch the "activate" signal on the filter text entry, so that
|
|
|
|
if the user types Return there, we act as if the "Create Stat"
|
|
|
|
button had been selected, as happens if Return is typed if some
|
|
|
|
widget that *doesn't* handle the Return key has the input
|
|
|
|
focus. */
|
|
|
|
dlg_set_activate(filter_entry, start_button);
|
|
|
|
|
2004-05-23 23:24:07 +00:00
|
|
|
gtk_widget_grab_default(start_button );
|
2003-09-26 02:09:44 +00:00
|
|
|
|
2004-05-23 23:24:07 +00:00
|
|
|
/* Give the initial focus to the "Filter" entry box. */
|
2003-09-26 02:09:44 +00:00
|
|
|
gtk_widget_grab_focus(filter_entry);
|
|
|
|
|
2004-05-23 23:24:07 +00:00
|
|
|
SIGNAL_CONNECT(dlg, "delete_event", window_delete_event_cb, NULL);
|
|
|
|
SIGNAL_CONNECT(dlg, "destroy", dlg_destroy_cb, NULL);
|
|
|
|
|
|
|
|
gtk_widget_show_all(dlg);
|
|
|
|
window_present(dlg);
|
2003-01-22 00:42:05 +00:00
|
|
|
}
|
|
|
|
|
2003-04-23 05:37:23 +00:00
|
|
|
void
|
|
|
|
register_tap_listener_gtksmbstat(void)
|
|
|
|
{
|
2003-06-21 06:40:48 +00:00
|
|
|
register_ethereal_tap("smb,srt", gtk_smbstat_init);
|
2003-04-23 05:37:23 +00:00
|
|
|
|
2004-02-23 19:19:39 +00:00
|
|
|
register_tap_menu_item("SMB...", REGISTER_TAP_GROUP_RESPONSE_TIME,
|
2003-12-17 22:13:08 +00:00
|
|
|
gtk_smbstat_cb, NULL, NULL, NULL);
|
2003-04-23 05:37:23 +00:00
|
|
|
}
|