Open SCAP Library
Toggle main menu visibility
Loading...
Searching...
No Matches
src
OVAL
probes
probe
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
*
19
* Authors:
20
* Daniel Kopecek <dkopecek@redhat.com>
21
*/
22
#ifndef PROBE_H
23
#define PROBE_H
24
25
#include "oscap_platforms.h"
26
27
#include <sys/types.h>
28
#ifdef OS_WINDOWS
29
#include <io.h>
30
#else
31
#include <unistd.h>
32
#endif
33
#include <stdint.h>
34
#include <stddef.h>
35
#include <stdarg.h>
36
#include <pthread.h>
37
#include "_seap.h"
38
#include "ncache.h"
39
#include "rcache.h"
40
#include "icache.h"
41
#include "probe-common.h"
42
#include "option.h"
43
#include "common/util.h"
44
#include "common/compat_pthread_barrier.h"
45
46
/* default max. memory usage ratio - used/total */
47
/* can be overridden by environment variable OSCAP_PROBE_MEMORY_USAGE_RATIO */
48
#define OSCAP_PROBE_MEMORY_USAGE_RATIO_DEFAULT 0.33
49
50
/* By default, probes can collect unlimited amount of items. Ths behavior can
51
* be overridden by environment variable OSCAP_PROBE_MAX_COLLECTED_ITEMS.
52
*/
53
#define OSCAP_PROBE_COLLECT_UNLIMITED 0
54
55
typedef
struct
{
56
pthread_rwlock_t rwlock;
57
uint32_t flags;
58
59
pid_t pid;
60
61
void
*probe_arg;
62
int
probe_exitcode;
63
64
SEAP_CTX_t *
SEAP_ctx
;
65
int
sd
;
66
67
pthread_t th_input;
68
pthread_t th_signal;
69
70
rbt_t *workers;
71
uint32_t max_threads;
72
uint32_t max_chdepth;
73
74
probe_rcache_t
*
rcache
;
75
probe_ncache_t
*
ncache
;
76
probe_icache_t
*
icache
;
77
78
probe_option_t
*
option
;
79
size_t
optcnt
;
80
bool
offline_mode;
81
int
supported_offline_mode;
82
int
selected_offline_mode;
83
oval_subtype_t
subtype;
84
85
int
real_root_fd;
86
int
real_cwd_fd;
87
}
probe_t
;
88
89
struct
probe_ctx
{
90
SEXP_t *
probe_in
;
91
SEXP_t *
probe_out
;
92
SEXP_t *
filters
;
93
probe_icache_t
*
icache
;
94
int
offline_mode;
95
double
max_mem_ratio;
96
size_t
collected_items;
97
size_t
max_collected_items;
98
struct
oscap_list
*blocked_paths;
99
};
100
101
typedef
enum
{
102
PROBE_OFFLINE_NONE = 0x00,
103
PROBE_OFFLINE_CHROOT = 0x01,
104
PROBE_OFFLINE_OWN = 0x04,
105
PROBE_OFFLINE_ALL = 0x0f
106
} probe_offline_flags;
107
108
extern
pthread_barrier_t OSCAP_GSYM(th_barrier);
109
110
#endif
/* PROBE_H */
oval_subtype_t
oval_subtype_t
Unknown subtypes.
Definition
oval_types.h:127
oscap_list
Definition
list.h:53
probe_ctx
Definition
probe.h:89
probe_ctx::icache
probe_icache_t * icache
item cache
Definition
probe.h:93
probe_ctx::probe_in
SEXP_t * probe_in
S-exp representation of the input object.
Definition
probe.h:90
probe_ctx::probe_out
SEXP_t * probe_out
collected object
Definition
probe.h:91
probe_ctx::filters
SEXP_t * filters
object filters (OVAL 5.8 and higher)
Definition
probe.h:92
probe_icache_t
Definition
icache.h:41
probe_ncache_t
Element name cache structure.
Definition
ncache.h:36
probe_option_t
Definition
option.h:14
probe_rcache_t
Probe cache structure.
Definition
rcache.h:32
probe_t
Definition
probe.h:55
probe_t::rcache
probe_rcache_t * rcache
probe result cache
Definition
probe.h:74
probe_t::icache
probe_icache_t * icache
probe item cache
Definition
probe.h:76
probe_t::ncache
probe_ncache_t * ncache
probe name cache
Definition
probe.h:75
probe_t::optcnt
size_t optcnt
number of defined options
Definition
probe.h:79
probe_t::SEAP_ctx
SEAP_CTX_t * SEAP_ctx
SEAP context.
Definition
probe.h:64
probe_t::option
probe_option_t * option
probe option handlers
Definition
probe.h:78
probe_t::sd
int sd
SEAP descriptor.
Definition
probe.h:65
Generated by
1.17.0