Add chunk map
[strongswan.git] / src / charon-tkm / src / tkm / tkm.h
1 /*
2 * Copyright (C) 2012 Reto Buerki
3 * Copyright (C) 2012 Adrian-Ken Rueegsegger
4 * Hochschule fuer Technik Rapperswil
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 */
16
17 #ifndef TKM_H_
18 #define TKM_H_
19
20 #include "tkm_id_manager.h"
21 #include "tkm_chunk_map.h"
22
23 typedef struct tkm_t tkm_t;
24
25 /**
26 * Trusted key manager context, contains tkm related globals.
27 */
28 struct tkm_t {
29
30 /**
31 * Context ID manager.
32 */
33 tkm_id_manager_t *idmgr;
34
35 /**
36 * Chunk-to-ID mappings.
37 */
38 tkm_chunk_map_t *chunk_map;
39
40 };
41
42 /**
43 * Initialize trusted key manager, creates "tkm" instance.
44 *
45 * @return FALSE if initialization error occured
46 */
47 bool tkm_init();
48
49 /**
50 * Deinitialize trusted key manager, destroys "tkm" instance.
51 */
52 void tkm_deinit();
53
54 /**
55 * Trusted key manager instance, set after tkm_init() and before tkm_deinit()
56 * calls.
57 */
58 extern tkm_t *tkm;
59
60 #endif /** TKM_H_ */