- kernel interface hacks, works partially
[strongswan.git] / Source / charon / threads / kernel_interface.h
1 /**
2 * @file kernel_interface.h
3 *
4 * @brief Interface of kernel_interface_t.
5 *
6 */
7
8 /*
9 * Copyright (C) 2005 Jan Hutter, Martin Willi
10 * Hochschule fuer Technik Rapperswil
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 * for more details.
21 */
22
23 #ifndef KERNEL_INTERFACE_H_
24 #define KERNEL_INTERFACE_H_
25
26
27 #include <network/host.h>
28 #include <encoding/payloads/proposal_substructure.h>
29
30 typedef struct kernel_interface_t kernel_interface_t;
31
32 /**
33 * @brief
34 *
35 * @ingroup threads
36 */
37 struct kernel_interface_t {
38
39 status_t (*get_spi) (kernel_interface_t *this, host_t *src, host_t *dest, protocol_id_t protocol, bool tunnel_mode, u_int32_t *spi);
40
41 status_t (*add_sa)(kernel_interface_t *this,
42 host_t *me,
43 host_t *other,
44 u_int32_t spi,
45 int protocol,
46 bool tunnel_mode,
47 encryption_algorithm_t enc_alg,
48 size_t enc_size,
49 chunk_t enc_key,
50 integrity_algorithm_t int_alg,
51 size_t int_size,
52 chunk_t int_key,
53 bool replace);
54
55
56 /**
57 * @brief Destroys a kernel_interface object.
58 *
59 * Stopps the prime thread and destroys the pool.
60 *
61 * @param kernel_interface_t calling object
62 */
63 void (*destroy) (kernel_interface_t *kernel_interface);
64 };
65
66 /**
67 * @brief
68 *
69 * @ingroup threads
70 */
71 kernel_interface_t *kernel_interface_create();
72
73 #endif /*KERNEL_INTERFACE_H_*/