]>
Commit | Line | Data |
---|---|---|
f9b1db16 TB |
1 | /* |
2 | * Copyright (C) 2010 Tobias Brunner | |
3 | * Hochschule fuer Technik Rapperswil | |
4 | * | |
5 | * This program is free software; you can redistribute it and/or modify it | |
6 | * under the terms of the GNU General Public License as published by the | |
7 | * Free Software Foundation; either version 2 of the License, or (at your | |
8 | * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>. | |
9 | * | |
10 | * This program is distributed in the hope that it will be useful, but | |
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | |
12 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
13 | * for more details. | |
14 | */ | |
15 | ||
16 | /** | |
17 | * @defgroup libhydra libhydra | |
18 | * | |
567d3f14 TB |
19 | * @defgroup attributes attributes |
20 | * @ingroup libhydra | |
21 | * | |
6f449d2e TB |
22 | * @defgroup hkernel kernel |
23 | * @ingroup libhydra | |
24 | * | |
83218f0d TB |
25 | * @defgroup hplugins plugins |
26 | * @ingroup libhydra | |
27 | * | |
222a64d8 | 28 | * @defgroup hprocessing processing |
633fbe4f TB |
29 | * @ingroup libhydra |
30 | * | |
222a64d8 TB |
31 | * @defgroup hjobs jobs |
32 | * @ingroup hprocessing | |
633fbe4f | 33 | * |
83218f0d TB |
34 | * @addtogroup libhydra |
35 | * @{ | |
f9b1db16 TB |
36 | */ |
37 | ||
38 | #ifndef HYDRA_H_ | |
39 | #define HYDRA_H_ | |
40 | ||
567d3f14 TB |
41 | typedef struct hydra_t hydra_t; |
42 | ||
43 | #include <attributes/attribute_manager.h> | |
6f449d2e | 44 | #include <kernel/kernel_interface.h> |
633fbe4f | 45 | #include <processing/processor.h> |
8c387909 | 46 | #include <processing/scheduler.h> |
567d3f14 | 47 | |
f9b1db16 TB |
48 | #include <library.h> |
49 | ||
567d3f14 TB |
50 | /** |
51 | * IKE Daemon support object. | |
52 | */ | |
53 | struct hydra_t { | |
89bf11d2 | 54 | |
567d3f14 TB |
55 | /** |
56 | * manager for payload attributes | |
57 | */ | |
58 | attribute_manager_t *attributes; | |
facf8872 | 59 | |
6f449d2e TB |
60 | /** |
61 | * kernel interface to communicate with kernel | |
62 | */ | |
63 | kernel_interface_t *kernel_interface; | |
64 | ||
633fbe4f TB |
65 | /** |
66 | * process jobs using a thread pool | |
67 | */ | |
68 | processor_t *processor; | |
69 | ||
8c387909 TB |
70 | /** |
71 | * schedule jobs | |
72 | */ | |
73 | scheduler_t *scheduler; | |
74 | ||
facf8872 TB |
75 | /** |
76 | * name of the daemon that initialized the library | |
77 | */ | |
78 | const char *daemon; | |
567d3f14 TB |
79 | }; |
80 | ||
81 | /** | |
89bf11d2 MW |
82 | * The single instance of hydra_t. |
83 | * | |
84 | * Set between calls to libhydra_init() and libhydra_deinit() calls. | |
567d3f14 TB |
85 | */ |
86 | extern hydra_t *hydra; | |
87 | ||
f9b1db16 TB |
88 | /** |
89 | * Initialize libhydra. | |
89bf11d2 | 90 | * |
facf8872 TB |
91 | * The daemon's name is used to load daemon-specific settings. |
92 | * | |
93 | * @param daemon name of the daemon that initializes the library | |
f9b1db16 TB |
94 | * @return FALSE if integrity check failed |
95 | */ | |
facf8872 | 96 | bool libhydra_init(const char *daemon); |
f9b1db16 TB |
97 | |
98 | /** | |
99 | * Deinitialize libhydra. | |
100 | */ | |
101 | void libhydra_deinit(); | |
102 | ||
103 | #endif /** HYDRA_H_ @}*/ |