Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
capture_session.h
1 /* capture_session.h
2  * State of a capture session
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 #ifndef __CAPCHILD_CAPTURE_SESSION_H__
12 #define __CAPCHILD_CAPTURE_SESSION_H__
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif /* __cplusplus */
17 
18 #ifndef _WIN32
19 #include <sys/types.h>
20 #include <stdint.h>
21 #endif
22 
23 #include "capture_opts.h"
24 
25 #include <wsutil/processes.h>
26 
27 #ifdef HAVE_LIBPCAP
28 /* Current state of capture engine. XXX - differentiate states */
29 typedef enum {
30  CAPTURE_STOPPED,
31  CAPTURE_PREPARING,
32  CAPTURE_RUNNING
33 } capture_state;
34 
35 #include "cfile.h"
36 struct _info_data;
37 /*
38  * State of a capture session.
39  */
40 typedef struct _capture_session {
41  ws_process_id fork_child;
42  int fork_child_status;
43 #ifdef _WIN32
44  int signal_pipe_write_fd;
45 #endif
46  capture_state state;
47 #ifndef _WIN32
48  uid_t owner;
49  gid_t group;
50 #endif
51  gboolean session_started;
52  guint32 count;
53  capture_options *capture_opts;
54  capture_file *cf;
55  struct _info_data *cap_data_info;
57 
58 extern void
59 capture_session_init(capture_session *cap_session, capture_file *cf);
60 #else
61 
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;
64 
65 #endif /* HAVE_LIBPCAP */
66 
67 #ifdef __cplusplus
68 }
69 #endif /* __cplusplus */
70 
71 #endif /* __CAPCHILD_CAPTURE_SESSION_H__ */
Definition: capture_info.h:46
Definition: cfile.h:58
Definition: capture_opts.h:249
Definition: capture_session.h:63