Open SCAP Library
/home/pvrabec/project/openscap/openscap-0.7.4/src/OVAL/probes/probe/probe.h
00001 /*
00002  * Copyright 2011 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 PROBE_H
00023 #define PROBE_H
00024 
00025 #include <sys/types.h>
00026 #include <unistd.h>
00027 #include <stdint.h>
00028 #include <stddef.h>
00029 #include <stdarg.h>
00030 #include <pthread.h>
00031 #include <seap.h>
00032 #include "ncache.h"
00033 #include "rcache.h"
00034 #include "icache.h"
00035 #include "probe-common.h"
00036 
00037 #if 0
00038 
00042 struct id_desc_t {
00043 #ifndef HAVE_ATOMIC_FUNCTIONS
00044         pthread_mutex_t item_id_ctr_lock;       
00045 #endif
00046         int item_id_ctr;        
00047 };
00048 #endif
00049 
00050 typedef struct {
00051         int option;
00052         int (*handler)(int, va_list);
00053 } probe_option_t;
00054 
00055 typedef struct {
00056         pthread_rwlock_t rwlock;
00057         uint32_t         flags;
00058 
00059         char       *name;
00060         pid_t       pid;
00061 
00062         void       *probe_arg;
00063         int         probe_exitcode;
00064 
00065         SEAP_CTX_t *SEAP_ctx; 
00066         int         sd;       
00068         pthread_t th_input;
00069         pthread_t th_signal;
00070 
00071         rbt_t    *workers;
00072         uint32_t  max_threads;
00073         uint32_t  max_chdepth;
00074 
00075         probe_rcache_t *rcache; 
00076         probe_ncache_t *ncache; 
00077         probe_icache_t *icache; 
00079         probe_option_t *option; 
00080         size_t          optcnt; 
00081 } probe_t;
00082 
00083 struct probe_ctx {
00084         SEXP_t         *probe_in;  
00085         SEXP_t         *probe_out; 
00086         SEXP_t         *filters;   
00087         probe_icache_t *icache;    
00088 };
00089 
00090 
00091 
00092 #endif /* PROBE_H */