Fix for bug 2964.
[obnox/wireshark/wip.git] / gtk / service_response_time_table.h
1 /* service_response_time_table.h
2  * service_response_time_table   2003 Ronnie Sahlberg
3  * Helper routines common to all service response time statistics
4  * tap.
5  *
6  * $Id$
7  *
8  * Wireshark - Network traffic analyzer
9  * By Gerald Combs <gerald@wireshark.org>
10  * Copyright 1998 Gerald Combs
11  * 
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.
16  * 
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.
21  * 
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.
25  */
26
27 #include <gtk/gtk.h>
28 #include "epan/nstime.h"
29 #include "../timestats.h"
30
31 /** @file
32  *  Helper routines common to all service response time statistics tap.
33  */
34
35 /** Procedure data */
36 typedef struct _srt_procedure_t {
37         char *entries[6];   /**< column entries */
38         timestat_t stats;   /**< stats */
39 } srt_procedure_t;
40
41 /** Statistics table */
42 typedef struct _srt_stat_table {
43         GtkWidget *scrolled_window; /**< window widget */
44         GtkCList *table;            /**< table widget */
45         GtkWidget *menu;            /**< context menu */
46         char *filter_string;        /**< append procedure number (%d) to this string 
47                                 to create a display filter */
48         int num_procs;              /**< number of elements on procedures array */
49         srt_procedure_t *procedures;/**< the procedures array */
50 } srt_stat_table;
51
52 /** Init an srt table data structure.
53  *
54  * @param rst the srt table to init
55  * @param num_procs number of procedures
56  * @param vbox the corresponding GtkVBox to fill in
57  * @param filter_string filter string or NULL
58  */
59 void init_srt_table(srt_stat_table *rst, int num_procs, GtkWidget *vbox,
60                     const char *filter_string);
61
62 /** Init an srt table row data structure.
63  *
64  * @param rst the srt table
65  * @param index number of procedure
66  * @param procedure the procedures name
67  */
68 void init_srt_table_row(srt_stat_table *rst, int index, const char *procedure);
69
70 /** Add srt response to table row data. This will not draw the data!
71  *
72  * @param rst the srt table
73  * @param index number of procedure
74  * @param req_time the time of the corresponding request
75  * @param pinfo current packet info
76  */
77 void add_srt_table_data(srt_stat_table *rst, int index, const nstime_t *req_time, packet_info *pinfo);
78
79 /** Draw the srt table data.
80  *
81  * @param rst the srt table
82  */
83 void draw_srt_table_data(srt_stat_table *rst);
84
85 /** Reset the srt table data.
86  *
87  * @param rst the srt table
88  */
89 void reset_srt_table_data(srt_stat_table *rst);
90
91 /** Free the srt table data.
92  *
93  * @param rst the srt table
94  */
95 void free_srt_table_data(srt_stat_table *rst);
96