*
* $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 "gui_utils.h"
#include <epan/stat_cmd_args.h>
#include "../stat_menu.h"
-#include "gtk_stat_menu.h"
+#include "gui_stat_menu.h"
#include <epan/tap.h>
#include "../register.h"
#include "alert_box.h"
ioi->int_max=0;
ioi->int_min=0;
ioi->int_tot=0;
- ioi->time_max.secs=0;
- ioi->time_max.nsecs=0;
- ioi->time_min.secs=0;
- ioi->time_min.nsecs=0;
- ioi->time_tot.secs=0;
- ioi->time_tot.nsecs=0;
+ nstime_set_zero(&ioi->time_max);
+ nstime_set_zero(&ioi->time_min);
+ nstime_set_zero(&ioi->time_tot);
}
}
io->last_interval=0xffffffff;
* Find which interval this is supposed to to in and store the
* interval index as idx
*/
- time_delta.secs=pinfo->fd->rel_secs;
- time_delta.nsecs=pinfo->fd->rel_usecs*1000;
+ time_delta=pinfo->fd->rel_ts;
if(time_delta.nsecs<0){
time_delta.secs--;
time_delta.nsecs+=1000000000;
t=t*1000000+new_time->nsecs/1000;
i=idx;
/* handle current interval */
- pt=pinfo->fd->rel_secs*1000000+pinfo->fd->rel_usecs;
+ pt=pinfo->fd->rel_ts.secs*1000000+pinfo->fd->rel_ts.nsecs/1000;
pt=pt%(git->io->interval*1000);
if(pt>t){
pt=t;
||( (new_time->secs==it->time_max.secs)
&&(new_time->nsecs>it->time_max.nsecs))
||(it->frames==0)){
- it->time_max.secs=new_time->secs;
- it->time_max.nsecs=new_time->nsecs;
+ it->time_max=*new_time;
}
if( (new_time->secs<it->time_min.secs)
||( (new_time->secs==it->time_min.secs)
&&(new_time->nsecs<it->time_min.nsecs))
||(it->frames==0)){
- it->time_min.secs=new_time->secs;
- it->time_min.nsecs=new_time->nsecs;
- }
- it->time_tot.secs+=new_time->secs;
- it->time_tot.nsecs+=new_time->nsecs;
- if(it->time_tot.nsecs>=1000000000){
- it->time_tot.nsecs-=1000000000;
- it->time_tot.secs++;
+ it->time_min=*new_time;
}
+ nstime_add(&it->time_tot, new_time);
}
}
y_pos=draw_height-1-(val*draw_height)/max_y+top_y_border;
}
- /* dont need to draw anything if the segment
- * is entirely above the top of the graph
- */
- if( (prev_y_pos==0) && (y_pos==0) ){
- prev_y_pos=y_pos;
- prev_x_pos=x_pos;
- continue;
- }
-
switch(io->graphs[i].plot_style){
case PLOT_STYLE_LINE:
- gdk_draw_line(io->pixmap, io->graphs[i].gc,
- prev_x_pos, prev_y_pos,
- x_pos, y_pos);
+ /* dont need to draw anything if the segment
+ * is entirely above the top of the graph
+ */
+ if( (prev_y_pos!=0) || (y_pos!=0) ){
+ gdk_draw_line(io->pixmap, io->graphs[i].gc,
+ prev_x_pos, prev_y_pos,
+ x_pos, y_pos);
+ }
break;
case PLOT_STYLE_IMPULSE:
if(val){
}
static void
-gtk_iostat_init(const char *optarg _U_)
+gtk_iostat_init(const char *optarg _U_, void* userdata _U_)
{
io_stat_t *io;
int i=0;
io->graphs[i].args->title = NULL;
io->graphs[i].args->wants_apply_button=TRUE;
io->graphs[i].args->activate_on_ok=TRUE;
+ io->graphs[i].args->modal_and_transient=FALSE;
io->graphs[i].filter_bt=NULL;
}
/* build the GUI */
init_io_stat_window(io);
- cf_retap_packets(&cfile);
+ cf_retap_packets(&cfile, FALSE);
io_stat_redraw(io);
}
val=(int)OBJECT_GET_DATA(item, "tick_interval");
io->interval=val;
- cf_retap_packets(&cfile);
+ cf_retap_packets(&cfile, FALSE);
io_stat_redraw(io);
}
/* warn and bail out if the field could not be found */
hfi=proto_registrar_get_byname(field);
if(hfi==NULL){
- simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "'%s' isn't a valid field name.", field);
+ simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "There is no field named '%s'.", field);
disable_graph(gio);
io_stat_redraw(gio->io);
return 0;
io_stat_reset(gio->io);
enable_graph(gio, filter, field);
- cf_retap_packets(&cfile);
+ cf_retap_packets(&cfile, FALSE);
io_stat_redraw(gio->io);
return 0;
static void
gtk_iostat_cb(GtkWidget *w _U_, gpointer d _U_)
{
- gtk_iostat_init(NULL);
+ gtk_iostat_init(NULL,NULL);
}
void
register_tap_listener_gtk_iostat(void)
{
- register_stat_cmd_arg("io,stat", gtk_iostat_init);
+ register_stat_cmd_arg("io,stat", gtk_iostat_init,NULL);
register_stat_menu_item("_IO Graphs", REGISTER_STAT_GROUP_GENERIC,
gtk_iostat_cb, NULL, NULL, NULL);