kernel-netlink: Check return value of both halfs when installing default route in...
[strongswan.git] / src / libipsec / ipsec.h
1 /*
2 * Copyright (C) 2012 Giuliano Grassi
3 * Copyright (C) 2012 Ralf Sager
4 * Copyright (C) 2012 Tobias Brunner
5 * HSR Hochschule fuer Technik Rapperswil
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * for more details.
16 */
17
18 /**
19 * @defgroup libipsec libipsec
20 *
21 * @addtogroup libipsec
22 * @{
23 */
24
25 #ifndef IPSEC_H_
26 #define IPSEC_H_
27
28 #include "ipsec_sa_mgr.h"
29 #include "ipsec_policy_mgr.h"
30 #include "ipsec_event_relay.h"
31 #include "ipsec_processor.h"
32
33 #include <library.h>
34
35 typedef struct ipsec_t ipsec_t;
36
37 /**
38 * User space IPsec implementation.
39 */
40 struct ipsec_t {
41
42 /**
43 * IPsec SA manager instance
44 */
45 ipsec_sa_mgr_t *sas;
46
47 /**
48 * IPsec policy manager instance
49 */
50 ipsec_policy_mgr_t *policies;
51
52 /**
53 * Event relay instance
54 */
55 ipsec_event_relay_t *events;
56
57 /**
58 * IPsec processor instance
59 */
60 ipsec_processor_t *processor;
61
62 };
63
64 /**
65 * The single instance of ipsec_t.
66 *
67 * Set between calls to libipsec_init() and libipsec_deinit() calls.
68 */
69 extern ipsec_t *ipsec;
70
71 /**
72 * Initialize libipsec.
73 *
74 * @return FALSE if integrity check failed
75 */
76 bool libipsec_init();
77
78 /**
79 * Deinitialize libipsec.
80 */
81 void libipsec_deinit();
82
83 #endif /** IPSEC_H_ @}*/