2 * State of a capture session
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #ifndef __CAPCHILD_CAPTURE_SESSION_H__
24 #define __CAPCHILD_CAPTURE_SESSION_H__
28 #endif /* __cplusplus */
31 #include <sys/types.h>
35 #include "capture_opts.h"
37 #include <wsutil/processes.h>
40 /* Current state of capture engine. XXX - differentiate states */
42 CAPTURE_STOPPED, /**< stopped */
43 CAPTURE_PREPARING, /**< preparing, but still no response from capture child */
44 CAPTURE_RUNNING /**< capture child signalled ok, capture is running now */
50 * State of a capture session.
52 typedef struct _capture_session {
53 ws_process_id fork_child; /**< If not -1, in parent, process ID of child */
54 int fork_child_status; /**< Child exit status */
56 int signal_pipe_write_fd; /**< the pipe to signal the child */
58 capture_state state; /**< current state of the capture engine */
60 uid_t owner; /**< owner of the cfile */
61 gid_t group; /**< group of the cfile */
63 gboolean session_started;
64 guint32 count; /**< Total number of frames captured */
65 capture_options *capture_opts; /**< options for this capture */
66 struct _capture_file *cf; /**< handle to cfile */
67 struct _info_data *cap_data_info; /**< stats for this capture */
71 capture_session_init(capture_session *cap_session, struct _capture_file *cf);
74 /* dummy is needed because clang throws the error: empty struct has size 0 in C, size 1 in C++ */
75 typedef struct _capture_session {int dummy;} capture_session;
77 #endif /* HAVE_LIBPCAP */
81 #endif /* __cplusplus */
83 #endif /* __CAPCHILD_CAPTURE_SESSION_H__ */