- code cleaned up
[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 Interface to the kernel.
34 *
35 * @b Constructors:
36 * - kernel_interface_create()
37 *
38 * @ingroup threads
39 */
40 struct kernel_interface_t {
41
42 /**
43 * Not yet fully implemented!
44 */
45 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);
46
47 /**
48 * Not yet fully implemented!
49 */
50 status_t (*add_sa)(kernel_interface_t *this,
51 host_t *me,
52 host_t *other,
53 u_int32_t spi,
54 int protocol,
55 bool tunnel_mode,
56 encryption_algorithm_t enc_alg,
57 size_t enc_size,
58 chunk_t enc_key,
59 integrity_algorithm_t int_alg,
60 size_t int_size,
61 chunk_t int_key,
62 bool replace);
63
64
65 /**
66 * @brief Destroys a kernel_interface object.
67 *
68 * @param kernel_interface_t calling object
69 */
70 void (*destroy) (kernel_interface_t *kernel_interface);
71 };
72
73 /**
74 * @brief Creates an object of type kernel_interface_t.
75 *
76 * @ingroup threads
77 */
78 kernel_interface_t *kernel_interface_create();
79
80 #endif /*KERNEL_INTERFACE_H_*/