Open SCAP Library
|
00001 /* 00002 * Copyright 2010 Red Hat Inc., Durham, North Carolina. 00003 * All Rights Reserved. 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Lesser General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2.1 of the License, or (at your option) any later version. 00009 * 00010 * This library is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * Lesser General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Lesser General Public 00016 * License along with this library; if not, write to the Free Software 00017 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 * 00019 * Authors: 00020 * "Daniel Kopecek" <dkopecek@redhat.com> 00021 */ 00022 #ifndef OVAL_PROBE_EXT_H 00023 #define OVAL_PROBE_EXT_H 00024 00025 #include <seap.h> 00026 #include <pthread.h> 00027 #include <stdbool.h> 00028 #include "oval_probe_impl.h" 00029 #include "oval_system_characteristics_impl.h" 00030 #include "common/util.h" 00031 00032 typedef struct { 00033 oval_subtype_t subtype; 00034 int sd; 00035 char *uri; 00036 } oval_pd_t; 00037 00038 typedef struct { 00039 oval_pd_t **memb; 00040 size_t count; 00041 SEAP_CTX_t *ctx; 00042 } oval_pdtbl_t; 00043 00044 struct oval_pdsc { 00045 oval_subtype_t type; 00046 const char *name; 00047 const char *file; 00048 }; 00049 00050 typedef struct oval_pdsc oval_pdsc_t; 00051 00052 struct oval_pext { 00053 pthread_mutex_t lock; 00054 bool do_init; 00055 00056 SEAP_CTX_t *sctx; 00057 oval_pdsc_t *pdsc; 00058 size_t pdsc_cnt; 00059 oval_pdtbl_t *pdtbl; 00060 char *probe_dir; 00061 00062 void *sess_ptr; 00063 struct oval_syschar_model **model; 00064 }; 00065 00066 typedef struct oval_pext oval_pext_t; 00067 00068 oval_pext_t *oval_pext_new(void); 00069 void oval_pext_free(oval_pext_t *pext); 00070 int oval_probe_ext_init(oval_pext_t *pext); 00071 int oval_probe_ext_eval(SEAP_CTX_t *ctx, oval_pd_t *pd, oval_pext_t *pext, struct oval_syschar *syschar, int flags); 00072 int oval_probe_ext_reset(SEAP_CTX_t *ctx, oval_pd_t *pd, oval_pext_t *pext); 00073 int oval_probe_ext_abort(SEAP_CTX_t *ctx, oval_pd_t *pd, oval_pext_t *pext); 00074 00075 int oval_probe_ext_handler(oval_subtype_t type, void *ptr, int act, ...); 00076 int oval_probe_sys_handler(oval_subtype_t type, void *ptr, int act, ...); 00077 00078 extern const oval_pdsc_t OSCAP_GSYM(default_pdsc)[]; 00079 00080 #endif /* OVAL_PROBE_EXT_H */