Open SCAP Library
/home/pvrabec/project/openscap/openscap-0.7.3/src/OVAL/probes/probe/worker.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 WORKER_H
00023 #define WORKER_H
00024 
00025 #include <seap.h>
00026 #include <sexp.h>
00027 #include <pthread.h>
00028 #include "probe.h"
00029 
00030 #ifndef PROBE_WORKER_DEFAULT_MAX_THREADS
00031 # define PROBE_WORKER_DEFAULT_MAX_THREADS 64 
00032 #endif
00033 
00034 #ifndef PROBE_WORKER_DEFAULT_MAX_CHDEPTH
00035 # define PROBE_WORKER_DEFAULT_MAX_CHDEPTH 8 
00036 #endif
00037 
00038 typedef struct {
00039         SEAP_msgid_t sid; 
00040         pthread_t    tid; 
00041         SEXP_t * (*msg_handler)(probe_t *, SEAP_msg_t *, int *); 
00042         SEAP_msg_t  *msg; 
00043 } probe_worker_t;
00044 
00045 typedef struct {
00046         probe_t        *probe;
00047         probe_worker_t *pth;
00048 } probe_pwpair_t;
00049 
00050 probe_worker_t *probe_worker_new(void);
00051 void *probe_worker_runfn(void *arg);
00052 SEXP_t *probe_worker(probe_t *probe, SEAP_msg_t *msg_in, int *ret);
00053 
00054 #endif /* WORKER_H */