1 /* service_response_time_table.h
2 * service_response_time_table 2003 Ronnie Sahlberg
3 * Helper routines common to all service response time statistics
8 * Ethereal - Network traffic analyzer
9 * By Gerald Combs <gerald@ethereal.com>
10 * Copyright 1998 Gerald Combs
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 #include "epan/nstime.h"
31 * Helper routines common to all service response time statistics tap.
35 typedef struct _srt_procedure_t {
36 char *entries[6]; /**< column entries */
37 int num; /**< number of calls seen */
38 nstime_t min; /**< minimum srt */
39 nstime_t max; /**< maximum srt */
40 nstime_t tot; /**< average srt */
43 /** Statistics table */
44 typedef struct _srt_stat_table {
45 GtkWidget *scrolled_window; /**< window widget */
46 GtkCList *table; /**< table widget */
47 GtkWidget *menu; /**< context menu */
48 char *filter_string; /**< append procedure number (%d) to this string
49 to create a display filter */
50 int num_procs; /**< number of elements on procedures array */
51 srt_procedure_t *procedures;/**< the procedures array */
54 /** Init an srt table data structure.
56 * @param rst the srt table to init
57 * @param num_procs number of procedures
58 * @param vbox the corresponding GtkVBox to fill in
59 * @param filter_string filter string or NULL
61 void init_srt_table(srt_stat_table *rst, int num_procs, GtkWidget *vbox, char *filter_string);
63 /** Init an srt table row data structure.
65 * @param rst the srt table
66 * @param index number of procedure
67 * @param procedure the procedures name
69 void init_srt_table_row(srt_stat_table *rst, int index, char *procedure);
71 /** Add srt response to table row data. This will not draw the data!
73 * @param rst the srt table
74 * @param index number of procedure
75 * @param req_time the time of the corresponding request
76 * @param pinfo current packet info
78 void add_srt_table_data(srt_stat_table *rst, int index, const nstime_t *req_time, packet_info *pinfo);
80 /** Draw the srt table data.
82 * @param rst the srt table
84 void draw_srt_table_data(srt_stat_table *rst);
86 /** Reset the srt table data.
88 * @param rst the srt table
90 void reset_srt_table_data(srt_stat_table *rst);
92 /** Free the srt table data.
94 * @param rst the srt table
96 void free_srt_table_data(srt_stat_table *rst);