From Alfred Alinazar:
[obnox/wireshark/wip.git] / capture_info.h
1 /* capture_info.h
2  * capture info functions
3  *
4  * $Id$
5  *
6  * Wireshark - Network traffic analyzer
7  * By Gerald Combs <gerald@wireshark.org>
8  * Copyright 1998 Gerald Combs
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * as published by the Free Software Foundation; either version 2
13  * of the License, or (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
23  */
24
25
26 /** @file
27  *  
28  * capture info functions
29  *
30  */
31
32 #ifndef __CAPTURE_INFO_H__
33 #define __CAPTURE_INFO_H__
34
35
36 /* open the info - init values (wtap, counts), create dialog */
37 extern void capture_info_open(const char *iface);
38
39 /* new file arrived - (eventually close old wtap), open wtap */
40 extern gboolean capture_info_new_file(const char *new_filename);
41
42 /* new packets arrived - read from wtap, count */
43 extern void capture_info_new_packets(int to_read);
44
45 /* close the info - close wtap, destroy dialog */
46 extern void capture_info_close(void);
47
48
49
50 /** Current Capture info. */
51 typedef struct {
52     /* handle */
53     gpointer        ui;             /**< user interface handle */
54
55     /* capture info */
56     packet_counts   *counts;        /**< protocol specific counters */
57     time_t          running_time;   /**< running time since last update */
58     gint            new_packets;    /**< packets since last update */
59 } capture_info;
60
61
62 /** Create the capture info dialog */
63 extern void capture_info_ui_create(
64 capture_info    *cinfo,
65 const gchar     *iface);
66
67 /** Update the capture info counters in the dialog */
68 extern void capture_info_ui_update(
69 capture_info    *cinfo);
70
71 /** Destroy the capture info dialog again */
72 extern void capture_info_ui_destroy(
73 capture_info    *cinfo);
74
75
76 #endif /* capture_info.h */