2 * Definitions for packet capture windows
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * SPDX-License-Identifier: GPL-2.0-or-later
11 /* This file should only be included if libpcap is present */
17 * Capture related things.
20 #include "capture_opts.h"
21 #include "capture_info.h"
22 #include "capchild/capture_session.h"
26 #endif /* __cplusplus */
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
40 typedef void (*capture_callback_t) (gint event, capture_session *cap_session,
44 capture_callback_add(capture_callback_t func, gpointer user_data);
47 capture_callback_remove(capture_callback_t func, gpointer user_data);
50 * Start a capture session.
52 * @param capture_opts the numerous capture options
53 * @param cap_session a handle for the capture session
54 * @param cap_data a struct with capture info data
55 * @param update_cb update screen
56 * @return TRUE if the capture starts successfully, FALSE otherwise.
59 capture_start(capture_options *capture_opts, capture_session *cap_session, info_data_t* cap_data, void(*update_cb)(void));
61 /** Stop a capture session (usually from a menu item). */
63 capture_stop(capture_session *cap_session);
65 /** Restart the current captured packets and start again. */
67 capture_restart(capture_session *cap_session);
69 /** Terminate the capture child cleanly when exiting. */
71 capture_kill_child(capture_session *cap_session);
73 struct if_stat_cache_s;
74 typedef struct if_stat_cache_s if_stat_cache_t;
77 * Start gathering capture statistics for the interfaces specified.
78 * @param capture_opts A structure containing options for the capture.
79 * @return A pointer to the statistics state data.
81 extern if_stat_cache_t * capture_stat_start(capture_options *capture_opts);
84 * Fetch capture statistics, similar to pcap_stats().
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);
90 * Stop gathering capture statistics.
92 void capture_stat_stop(if_stat_cache_t *sc);
96 #endif /* __cplusplus */
98 #endif /* capture.h */
101 * Editor modelines - http://www.wireshark.org/tools/modelines.html
106 * indent-tabs-mode: nil
109 * vi: set shiftwidth=4 tabstop=8 expandtab:
110 * :indentSize=4:tabSize=8:noTabs=true: