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