Open SCAP Library

oval_probe_ext.h
1 /*
2 * Copyright 2010 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 OVAL_PROBE_EXT_H
23 #define OVAL_PROBE_EXT_H
24
25 #include <seap.h>
26 #include <pthread.h>
27 #include <stdbool.h>
28 #include "oval_probe_impl.h"
29 #include "oval_system_characteristics_impl.h"
30 #include "common/util.h"
31
32 typedef struct {
33 oval_subtype_t subtype;
34 int sd;
35 char *uri;
36 } oval_pd_t;
37
38 typedef struct {
39 oval_pd_t **memb;
40 size_t count;
41 SEAP_CTX_t *ctx;
42 } oval_pdtbl_t;
43
44 struct oval_pdsc {
45 oval_subtype_t type;
46 const char *name;
47 const char *file;
48 };
49
50 typedef struct oval_pdsc oval_pdsc_t;
51
52 struct oval_pext {
53 pthread_mutex_t lock;
54 bool do_init;
55
56 SEAP_CTX_t *sctx;
57 oval_pdsc_t *pdsc;
58 size_t pdsc_cnt;
59 oval_pdtbl_t *pdtbl;
60 char *probe_dir;
61
62 void *sess_ptr;
63 struct oval_syschar_model **model;
64 };
65
66 typedef struct oval_pext oval_pext_t;
67
68 oval_pext_t *oval_pext_new(void);
69 void oval_pext_free(oval_pext_t *pext);
70 int oval_probe_ext_init(oval_pext_t *pext);
71 int oval_probe_ext_eval(SEAP_CTX_t *ctx, oval_pd_t *pd, oval_pext_t *pext, struct oval_syschar *syschar, int flags);
72 int oval_probe_ext_reset(SEAP_CTX_t *ctx, oval_pd_t *pd, oval_pext_t *pext);
73 int oval_probe_ext_abort(SEAP_CTX_t *ctx, oval_pd_t *pd, oval_pext_t *pext);
74
75 int oval_probe_ext_handler(oval_subtype_t type, void *ptr, int act, ...);
76 int oval_probe_sys_handler(oval_subtype_t type, void *ptr, int act, ...);
77
78 extern const oval_pdsc_t OSCAP_GSYM(default_pdsc)[];
79
80 #endif /* OVAL_PROBE_EXT_H */
oval_syschar_model
OVAL System Characteristics model.
Definition: oval_sysModel.c:54
oval_subtype_t
oval_subtype_t
Unknown subtypes.
Definition: oval_types.h:120
SEAP_CTX
Definition: _seap-types.h:37
oval_probe_impl.h
OVAL probe interface private header.
oval_system_characteristics_impl.h
Open Vulnerability and Assessment Language.
oval_pext
Definition: oval_probe_ext.h:52
oval_syschar
Characteristics bound to an Oval_object.
Definition: oval_syschar.c:48
oval_pdsc
Definition: oval_probe_ext.h:44
oval_pdtbl_t
Definition: oval_probe_ext.h:38
oval_pd_t
Definition: oval_probe_ext.h:32