Open SCAP Library
probe.h
1 /*
2  * Copyright 2011 Red Hat Inc., Durham, North Carolina.
3  * All Rights Reserved.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Authors:
20  * Daniel Kopecek <dkopecek@redhat.com>
21  */
22 #ifndef PROBE_H
23 #define PROBE_H
24 
25 #include <sys/types.h>
26 #ifdef _WIN32
27 #include <io.h>
28 #else
29 #include <unistd.h>
30 #endif
31 #include <stdint.h>
32 #include <stddef.h>
33 #include <stdarg.h>
34 #include <pthread.h>
35 #include <seap.h>
36 #include "ncache.h"
37 #include "rcache.h"
38 #include "icache.h"
39 #include "probe-common.h"
40 #include "option.h"
41 #include "common/util.h"
42 #include "common/compat_pthread_barrier.h"
43 
44 typedef struct {
45  pthread_rwlock_t rwlock;
46  uint32_t flags;
47 
48  char *name;
49  pid_t pid;
50 
51  void *probe_arg;
52  int probe_exitcode;
53 
55  int sd;
57  pthread_t th_input;
58  pthread_t th_signal;
59 
60  rbt_t *workers;
61  uint32_t max_threads;
62  uint32_t max_chdepth;
63 
69  size_t optcnt;
70  bool offline_mode;
71  int supported_offline_mode;
72  int selected_offline_mode;
73  oval_subtype_t subtype;
74 
75  int real_root_fd;
76  int real_cwd_fd;
77 } probe_t;
78 
79 struct probe_ctx {
84  int offline_mode;
85 };
86 
87 typedef enum {
88  PROBE_OFFLINE_NONE = 0x00,
89  PROBE_OFFLINE_CHROOT = 0x01,
90  PROBE_OFFLINE_RPMDB = 0x02,
91  PROBE_OFFLINE_OWN = 0x04,
92  PROBE_OFFLINE_ALL = 0x0f
93 } probe_offline_flags;
94 
95 extern pthread_barrier_t OSCAP_GSYM(th_barrier);
96 
97 #endif /* PROBE_H */
probe_option_t * option
probe option handlers
Definition: probe.h:68
oval_subtype_t
Unknown subtypes.
Definition: oval_types.h:120
Definition: _seap-types.h:36
Definition: probe.h:44
int sd
SEAP descriptor.
Definition: probe.h:55
probe_icache_t * icache
item cache
Definition: probe.h:83
Definition: option.h:14
Probe cache structure.
Definition: rcache.h:32
SEAP_CTX_t * SEAP_ctx
SEAP context.
Definition: probe.h:54
SEXP_t * probe_out
collected object
Definition: probe.h:81
SEXP_t * filters
object filters (OVAL 5.8 and higher)
Definition: probe.h:82
Definition: probe.h:79
Definition: icache.h:41
Element name cache structure.
Definition: ncache.h:36
SEXP_t * probe_in
S-exp representation of the input object.
Definition: probe.h:80
probe_rcache_t * rcache
probe result cache
Definition: probe.h:64
probe_ncache_t * ncache
probe name cache
Definition: probe.h:65
Definition: rbt_common.h:129
Definition: sexp-types.h:82
size_t optcnt
number of defined options
Definition: probe.h:69
probe_icache_t * icache
probe item cache
Definition: probe.h:66