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 
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 
64  size_t optcnt;
65 } probe_t;
66 
67 struct probe_ctx {
72 };
73 
74 typedef enum {
75  PROBE_OFFLINE_NONE = 0x00,
76  PROBE_OFFLINE_CHROOT = 0x01,
77  PROBE_OFFLINE_RPMDB = 0x02,
78  PROBE_OFFLINE_ALL = 0x0f
79 } probe_offline_flags;
80 
81 extern pthread_barrier_t OSCAP_GSYM(th_barrier);
82 extern probe_offline_flags OSCAP_GSYM(offline_mode);
83 extern probe_offline_flags OSCAP_GSYM(offline_mode_supported);
84 extern int OSCAP_GSYM(offline_mode_cobjflag);
85 
86 #endif /* PROBE_H */