Open SCAP Library
Loading...
Searching...
No Matches
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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
38typedef struct {
39 SEAP_msgid_t sid;
40 pthread_t tid;
41 SEXP_t * (*msg_handler)(probe_t *, SEAP_msg_t *, int *);
44
45typedef struct {
46 probe_t *probe;
47 probe_worker_t *pth;
49
50probe_worker_t *probe_worker_new(void);
51void *probe_worker_runfn(void *arg);
52SEXP_t *probe_worker(probe_t *probe, SEAP_msg_t *msg_in, int *ret);
53
54#endif /* WORKER_H */
Definition _seap-message.h:44
Definition sexp-types.h:82
Definition worker.h:45
Definition probe.h:55
Definition worker.h:38
SEAP_msg_t * msg
the message being handled
Definition worker.h:42
pthread_t tid
thread ID
Definition worker.h:40
SEAP_msgid_t sid
SEAP message handled by this thread.
Definition worker.h:39