9a5cdd5b53fa35660c125d62c51e5da18f43491a
[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  * SPDX-License-Identifier: GPL-2.0+
9  */
10
11
12 /** @file
13  *
14  * Capture info functions.
15  *
16  */
17
18 /*
19  * GTK+ only.
20  * If we add this to the Qt UI we should modernize the statistics we show.
21  * At the very least we should remove or hide IPX and VINES.
22  */
23
24 #ifndef __CAPTURE_INFO_H__
25 #define __CAPTURE_INFO_H__
26
27 #include "capture_opts.h"
28 #include <capchild/capture_session.h>
29 #include <epan/capture_dissectors.h>
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif /* __cplusplus */
34
35 /** Current Capture info. */
36 typedef struct {
37     /* handle */
38     gpointer        ui;             /**< user interface handle */
39
40     /* capture info */
41     packet_counts   *counts;        /**< protocol specific counters */
42     time_t          running_time;   /**< running time since last update */
43     gint            new_packets;    /**< packets since last update */
44 } capture_info;
45
46 typedef struct _info_data {
47     packet_counts     counts;     /* Packet counting */
48     struct wtap*      wtap;       /* current wtap file */
49     capture_info      ui;         /* user interface data */
50 } info_data_t;
51
52 /* open the info - init values (wtap, counts), create dialog */
53 extern void capture_info_open(capture_session *cap_session, info_data_t* cap_info);
54
55 /* new file arrived - (eventually close old wtap), open wtap */
56 extern gboolean capture_info_new_file(const char *new_filename, info_data_t* cap_info);
57
58 /* new packets arrived - read from wtap, count */
59 extern void capture_info_new_packets(int to_read, info_data_t* cap_info);
60
61 /* close the info - close wtap, destroy dialog */
62 extern void capture_info_close(info_data_t* cap_info);
63
64 /** Create the capture info dialog */
65 extern void
66 capture_info_ui_create(capture_info *cinfo, capture_session *cap_session);
67
68 /** Update the capture info counters in the dialog */
69 extern void capture_info_ui_update(
70 capture_info    *cinfo);
71
72 /** Destroy the capture info dialog again */
73 extern void capture_info_ui_destroy(
74 capture_info    *cinfo);
75
76 #ifdef __cplusplus
77 }
78 #endif /* __cplusplus */
79
80 #endif /* capture_info.h */
81
82 /*
83  * Editor modelines  -  http://www.wireshark.org/tools/modelines.html
84  *
85  * Local variables:
86  * c-basic-offset: 4
87  * tab-width: 8
88  * indent-tabs-mode: nil
89  * End:
90  *
91  * vi: set shiftwidth=4 tabstop=8 expandtab:
92  * :indentSize=4:tabSize=8:noTabs=true:
93  */