2 * State of a capture session
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 #ifndef __CAPCHILD_CAPTURE_SESSION_H__
12 #define __CAPCHILD_CAPTURE_SESSION_H__
16 #endif /* __cplusplus */
19 #include <sys/types.h>
23 #include "capture_opts.h"
25 #include <wsutil/processes.h>
28 /* Current state of capture engine. XXX - differentiate states */
30 CAPTURE_STOPPED, /**< stopped */
31 CAPTURE_PREPARING, /**< preparing, but still no response from capture child */
32 CAPTURE_RUNNING /**< capture child signalled ok, capture is running now */
38 * State of a capture session.
40 typedef struct _capture_session {
41 ws_process_id fork_child; /**< If not WS_INVALID_PID, in parent, process ID of child */
42 int fork_child_status; /**< Child exit status */
44 int signal_pipe_write_fd; /**< the pipe to signal the child */
46 capture_state state; /**< current state of the capture engine */
48 uid_t owner; /**< owner of the cfile */
49 gid_t group; /**< group of the cfile */
51 gboolean session_started;
52 guint32 count; /**< Total number of frames captured */
53 capture_options *capture_opts; /**< options for this capture */
54 capture_file *cf; /**< handle to cfile */
55 struct _info_data *cap_data_info; /**< stats for this capture */
59 capture_session_init(capture_session *cap_session, capture_file *cf);
62 /* dummy is needed because clang throws the error: empty struct has size 0 in C, size 1 in C++ */
63 typedef struct _capture_session {int dummy;} capture_session;
65 #endif /* HAVE_LIBPCAP */
69 #endif /* __cplusplus */
71 #endif /* __CAPCHILD_CAPTURE_SESSION_H__ */