Get rid of unnecessary include of ctype.h.
[metze/wireshark/wip.git] / capchild / 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  * 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.
12  *
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.
17  *
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.
21  */
22
23 #ifndef __CAPCHILD_CAPTURE_SESSION_H__
24 #define __CAPCHILD_CAPTURE_SESSION_H__
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif /* __cplusplus */
29
30 #ifndef _WIN32
31 #include <sys/types.h>
32 #endif
33
34 #include "capture_opts.h"
35
36 #ifdef HAVE_LIBPCAP
37 /* Current state of capture engine. XXX - differentiate states */
38 typedef enum {
39     CAPTURE_STOPPED,        /**< stopped */
40     CAPTURE_PREPARING,      /**< preparing, but still no response from capture child */
41     CAPTURE_RUNNING         /**< capture child signalled ok, capture is running now */
42 } capture_state;
43
44 /*
45  * State of a capture session.
46  */
47 typedef struct {
48     int fork_child;                 /**< If not -1, in parent, process ID of child */
49     int fork_child_status;          /**< Child exit status */
50 #ifdef _WIN32
51     int signal_pipe_write_fd;       /**< the pipe to signal the child */
52 #endif
53     capture_state state;            /**< current state of the capture engine */
54 #ifndef _WIN32
55     uid_t owner;                    /**< owner of the cfile */
56     gid_t group;                    /**< group of the cfile */
57 #endif
58     gboolean session_started;
59     capture_options *capture_opts;  /**< options for this capture */
60     void *cf;                       /**< handle to cfile (note: untyped handle) */
61 } capture_session;
62
63 extern void
64 capture_session_init(capture_session *cap_session, void *cf);
65 #else
66
67 /* dummy is needed because clang throws the error: empty struct has size 0 in C, size 1 in C++ */
68 typedef struct {int dummy;} capture_session;
69
70 #endif /* HAVE_LIBPCAP */
71
72 #ifdef __cplusplus
73 }
74 #endif /* __cplusplus */
75
76 #endif /* __CAPCHILD_CAPTURE_SESSION_H__ */