Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
capture.h
Go to the documentation of this file.
1 /* capture.h
2  * Definitions for packet capture windows
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-or-later
9  */
10 
11 /* This file should only be included if libpcap is present */
12 
13 #ifndef __CAPTURE_H__
14 #define __CAPTURE_H__
15 
20 #include "capture_opts.h"
21 #include "capture_info.h"
22 #include "capchild/capture_session.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif /* __cplusplus */
27 
28 typedef enum {
29  capture_cb_capture_prepared,
30  capture_cb_capture_update_started,
31  capture_cb_capture_update_continue,
32  capture_cb_capture_update_finished,
33  capture_cb_capture_fixed_started,
34  capture_cb_capture_fixed_continue,
35  capture_cb_capture_fixed_finished,
36  capture_cb_capture_stopping,
37  capture_cb_capture_failed
38 } capture_cbs;
39 
40 typedef void (*capture_callback_t) (gint event, capture_session *cap_session,
41  gpointer user_data);
42 
43 extern void
44 capture_callback_add(capture_callback_t func, gpointer user_data);
45 
46 extern void
47 capture_callback_remove(capture_callback_t func, gpointer user_data);
48 
58 extern gboolean
59 capture_start(capture_options *capture_opts, capture_session *cap_session, info_data_t* cap_data, void(*update_cb)(void));
60 
62 extern void
63 capture_stop(capture_session *cap_session);
64 
66 extern void
67 capture_restart(capture_session *cap_session);
68 
70 extern void
72 
73 struct if_stat_cache_s;
74 typedef struct if_stat_cache_s if_stat_cache_t;
75 
81 extern if_stat_cache_t * capture_stat_start(capture_options *capture_opts);
82 
86 struct pcap_stat; /* Stub in case we don't or haven't yet included pcap.h */
87 extern gboolean capture_stats(if_stat_cache_t *sc, char *ifname, struct pcap_stat *ps);
88 
92 void capture_stat_stop(if_stat_cache_t *sc);
93 
94 #ifdef __cplusplus
95 }
96 #endif /* __cplusplus */
97 
98 #endif /* capture.h */
99 
100 /*
101  * Editor modelines - http://www.wireshark.org/tools/modelines.html
102  *
103  * Local Variables:
104  * c-basic-offset: 4
105  * tab-width: 8
106  * indent-tabs-mode: nil
107  * End:
108  *
109  * vi: set shiftwidth=4 tabstop=8 expandtab:
110  * :indentSize=4:tabSize=8:noTabs=true:
111  */
if_stat_cache_t * capture_stat_start(capture_options *capture_opts)
void capture_stat_stop(if_stat_cache_t *sc)
void capture_kill_child(capture_session *cap_session)
Definition: capture_info.h:46
gboolean capture_start(capture_options *capture_opts, capture_session *cap_session, info_data_t *cap_data, void(*update_cb)(void))
void capture_restart(capture_session *cap_session)
Definition: capture_opts.h:249
void capture_stop(capture_session *cap_session)
Definition: capture_session.h:63