Open SCAP Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
worker.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 WORKER_H
23 #define WORKER_H
24 
25 #include <seap.h>
26 #include <sexp.h>
27 #include <pthread.h>
28 #include "probe.h"
29 
30 #ifndef PROBE_WORKER_DEFAULT_MAX_THREADS
31 # define PROBE_WORKER_DEFAULT_MAX_THREADS 64
32 #endif
33 
34 #ifndef PROBE_WORKER_DEFAULT_MAX_CHDEPTH
35 # define PROBE_WORKER_DEFAULT_MAX_CHDEPTH 8
36 #endif
37 
38 typedef struct {
39  SEAP_msgid_t sid;
40  pthread_t tid;
41  SEXP_t * (*msg_handler)(probe_t *, SEAP_msg_t *, int *);
42  SEAP_msg_t *msg;
44 
45 typedef struct {
46  probe_t *probe;
47  probe_worker_t *pth;
49 
50 probe_worker_t *probe_worker_new(void);
51 void *probe_worker_runfn(void *arg);
52 SEXP_t *probe_worker(probe_t *probe, SEAP_msg_t *msg_in, int *ret);
53 
54 #endif /* WORKER_H */
Definition: worker.h:45
Definition: probe.h:39
Definition: worker.h:38
pthread_t tid
thread ID
Definition: worker.h:40
SEAP_msgid_t sid
SEAP message handled by this thread.
Definition: worker.h:39
Definition: sexp-types.h:82
SEAP_msg_t * msg
the message being handled
Definition: worker.h:42
Definition: _seap-message.h:39