1 /*
2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
5 * 1.0 of the CDDL.
6 *
7 * A full copy of the text of the CDDL should have accompanied this
8 * source. A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
10 */
11
12 /*
13 * Copyright 2017 Joyent, Inc.
14 */
15
16 #ifndef _WORKER_H
17 #define _WORKER_H
18
19 #include <stddef.h>
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24
25 typedef enum worker_evt {
26 EVT_NONE,
27 EVT_PACKET,
28 EVT_PFKEY
29 } worker_evt_t;
30
31 extern size_t nworkers;
32
33 void worker_init(size_t, size_t);
34 void worker_suspend(void);
35 void worker_resume(void);
36 boolean_t worker_add(void);
37 void worker_del(void);
38 void worker_stop(void);
39 boolean_t worker_dispatch(worker_evt_t, void *, size_t);
40
41 #ifdef __cplusplus
42 }
43 #endif
44
45 #endif /* _WORKER_H */