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 #include <unistd.h>
27 #include <stdint.h>
28 #include <stddef.h>
29 #include <stdarg.h>
30 #include <pthread.h>
31 #include <seap.h>
32 #include "ncache.h"
33 #include "rcache.h"
34 #include "icache.h"
35 #include "probe-common.h"
36 #include "option.h"
37 #include "common/util.h"
38
39 typedef struct {
40 pthread_rwlock_t rwlock;
41 uint32_t flags;
42
43 char *name;
44 pid_t pid;
45
46 void *probe_arg;
47 int probe_exitcode;
48
49 SEAP_CTX_t *SEAP_ctx;
50 int sd;
52 pthread_t th_input;
53 pthread_t th_signal;
54
55 rbt_t *workers;
56 uint32_t max_threads;
57 uint32_t max_chdepth;
58
59 probe_rcache_t *rcache;
60 probe_ncache_t *ncache;
61 probe_icache_t *icache;
63 probe_option_t *option;
64 size_t optcnt;
65 bool offline_mode;
66 int supported_offline_mode;
67 int selected_offline_mode;
68 } probe_t;
69
70 struct probe_ctx {
71 SEXP_t *probe_in;
72 SEXP_t *probe_out;
73 SEXP_t *filters;
74 probe_icache_t *icache;
75 int offline_mode;
76 };
77
78 typedef enum {
79 PROBE_OFFLINE_NONE = 0x00,
80 PROBE_OFFLINE_CHROOT = 0x01,
81 PROBE_OFFLINE_RPMDB = 0x02,
82 PROBE_OFFLINE_OWN = 0x04,
83 PROBE_OFFLINE_ALL = 0x0f
84 } probe_offline_flags;
85
86 extern pthread_barrier_t OSCAP_GSYM(th_barrier);
87
88 #endif /* PROBE_H */
probe_t::option
probe_option_t * option
probe option handlers
Definition: probe.h:63
SEAP_CTX
Definition: _seap-types.h:37
probe_t
Definition: probe.h:39
probe_t::sd
int sd
SEAP descriptor.
Definition: probe.h:50
probe_ctx::icache
probe_icache_t * icache
item cache
Definition: probe.h:74
probe_option_t
Definition: option.h:14
probe_rcache_t
Probe cache structure.
Definition: rcache.h:32
probe_t::SEAP_ctx
SEAP_CTX_t * SEAP_ctx
SEAP context.
Definition: probe.h:49
probe_ctx::probe_out
SEXP_t * probe_out
collected object
Definition: probe.h:72
probe_ctx::filters
SEXP_t * filters
object filters (OVAL 5.8 and higher)
Definition: probe.h:73
probe_ctx
Definition: probe.h:70
probe_icache_t
Definition: icache.h:41
probe_ncache_t
Element name cache structure.
Definition: ncache.h:36
probe_ctx::probe_in
SEXP_t * probe_in
S-exp representation of the input object.
Definition: probe.h:71
probe_t::rcache
probe_rcache_t * rcache
probe result cache
Definition: probe.h:59
probe_t::ncache
probe_ncache_t * ncache
probe name cache
Definition: probe.h:60
rbt
Definition: rbt_common.h:129
SEXP
Definition: sexp-types.h:82
probe_t::optcnt
size_t optcnt
number of defined options
Definition: probe.h:64
probe_t::icache
probe_icache_t * icache
probe item cache
Definition: probe.h:61