Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
capture_sync.h
Go to the documentation of this file.
1 /* capture_sync.h
2  * Synchronisation between Wireshark capture parent and child instances
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 
20 #ifndef __CAPTURE_SYNC_H__
21 #define __CAPTURE_SYNC_H__
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif /* __cplusplus */
26 
27 struct _info_data;
28 
43 extern gboolean
44 sync_pipe_start(capture_options *capture_opts, capture_session *cap_session, struct _info_data* cap_data, void(*update_cb)(void));
45 
47 extern void
48 sync_pipe_stop(capture_session *cap_session);
49 
51 extern void
52 sync_pipe_kill(ws_process_id fork_child);
53 
72 extern int
73 sync_interface_set_80211_chan(const gchar *iface, const char *freq, const gchar *type,
74  const gchar *center_freq1, const gchar *center_freq2,
75  gchar **data, gchar **primary_msg,
76  gchar **secondary_msg, void (*update_cb)(void));
77 
79 extern int
80 sync_interface_list_open(gchar **data, gchar **primary_msg,
81  gchar **secondary_msg, void (*update_cb)(void));
82 
84 extern int
85 sync_if_capabilities_open(const gchar *ifname, gboolean monitor_mode, const gchar* auth,
86  gchar **data, gchar **primary_msg,
87  gchar **secondary_msg, void (*update_cb)(void));
88 
90 extern int
91 sync_interface_stats_open(int *read_fd, ws_process_id *fork_child, gchar **msg, void (*update_cb)(void));
92 
94 extern int
95 sync_interface_stats_close(int *read_fd, ws_process_id *fork_child, gchar **msg);
96 
98 extern int
99 sync_pipe_gets_nonblock(int pipe_fd, char *bytes, int max);
100 
101 /*
102  * Routines supplied by our caller; we call them back to notify them
103  * of various events.
104  *
105  * XXX - this is *really* ugly. We should do this better.
106  */
107 
111 extern gboolean
112 capture_input_new_file(capture_session *cap_session, gchar *new_file);
113 
117 extern void
118 capture_input_new_packets(capture_session *cap_session, int to_read);
119 
123 extern void
124 capture_input_drops(capture_session *cap_session, guint32 dropped);
125 
129 extern void
130 capture_input_error_message(capture_session *cap_session, char *error_message,
131  char *secondary_error_msg);
132 
137 extern void
139  char *error_message);
140 
145 extern void
146 capture_input_closed(capture_session *cap_session, gchar *msg);
147 
148 /* set a callback to be called after fork with the pid of the forked child */
149 extern void capture_sync_set_fetch_dumpcap_pid_cb(void(*cb)(ws_process_id pid));
150 
151 #ifdef __cplusplus
152 }
153 #endif /* __cplusplus */
154 
155 #endif /* __CAPTURE_SYNC_H__ */
int sync_pipe_gets_nonblock(int pipe_fd, char *bytes, int max)
gboolean capture_input_new_file(capture_session *cap_session, gchar *new_file)
void capture_input_new_packets(capture_session *cap_session, int to_read)
gboolean sync_pipe_start(capture_options *capture_opts, capture_session *cap_session, struct _info_data *cap_data, void(*update_cb)(void))
void capture_input_drops(capture_session *cap_session, guint32 dropped)
int sync_interface_set_80211_chan(const gchar *iface, const char *freq, const gchar *type, const gchar *center_freq1, const gchar *center_freq2, gchar **data, gchar **primary_msg, gchar **secondary_msg, void(*update_cb)(void))
Definition: capture_info.h:46
void sync_pipe_kill(ws_process_id fork_child)
void capture_input_closed(capture_session *cap_session, gchar *msg)
int sync_interface_stats_close(int *read_fd, ws_process_id *fork_child, gchar **msg)
void capture_input_error_message(capture_session *cap_session, char *error_message, char *secondary_error_msg)
void sync_pipe_stop(capture_session *cap_session)
int sync_interface_list_open(gchar **data, gchar **primary_msg, gchar **secondary_msg, void(*update_cb)(void))
void capture_input_cfilter_error_message(capture_session *cap_session, guint i, char *error_message)
int sync_if_capabilities_open(const gchar *ifname, gboolean monitor_mode, const gchar *auth, gchar **data, gchar **primary_msg, gchar **secondary_msg, void(*update_cb)(void))
int sync_interface_stats_open(int *read_fd, ws_process_id *fork_child, gchar **msg, void(*update_cb)(void))
Definition: capture_opts.h:249
Definition: capture_session.h:63