diff options
author | Tobias Brunner <tobias@strongswan.org> | 2012-09-13 15:50:52 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2012-09-13 15:50:52 +0200 |
commit | 7d786057b4e62bb46fbc33fea6063abc9a13bc66 (patch) | |
tree | 3d35a16fc979238bf7aa6f8b31d08f221eb251dd /src/libhydra/kernel/kernel_interface.h | |
parent | bc6ec4de7314885d2725bccc186a527bda37c2bc (diff) | |
parent | 08ad639f327d2e5445d7274b7705093704151f35 (diff) | |
download | strongswan-7d786057b4e62bb46fbc33fea6063abc9a13bc66.tar.bz2 strongswan-7d786057b4e62bb46fbc33fea6063abc9a13bc66.tar.xz |
Merge branch 'custom-crypto'
This provides plugins with an interface to register keywords for
proposals (e.g. when parsing the esp and ike options from ipsec.conf)
and the possibility to register identifiers for kernel algorithms.
It is based on patches contributed by Nanoteq Pty Ltd.
Diffstat (limited to 'src/libhydra/kernel/kernel_interface.h')
-rw-r--r-- | src/libhydra/kernel/kernel_interface.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/libhydra/kernel/kernel_interface.h b/src/libhydra/kernel/kernel_interface.h index 37b72f8bb..a17e8c6bb 100644 --- a/src/libhydra/kernel/kernel_interface.h +++ b/src/libhydra/kernel/kernel_interface.h @@ -16,6 +16,28 @@ * for more details. */ +/* + * Copyright (c) 2012 Nanoteq Pty Ltd + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + /** * @defgroup kernel_interface kernel_interface * @{ @ingroup hkernel @@ -493,6 +515,32 @@ struct kernel_interface_t { void (*roam)(kernel_interface_t *this, bool address); /** + * Register a new algorithm with the kernel interface. + * + * @param alg_id the IKE id of the algorithm + * @param type the transform type of the algorithm + * @param kernel_id the kernel id of the algorithm + * @param kernel_name the kernel name of the algorithm + */ + void (*register_algorithm)(kernel_interface_t *this, u_int16_t alg_id, + transform_type_t type, u_int16_t kernel_id, + char *kernel_name); + + /** + * Return the kernel-specific id and/or name for an algorithms depending on + * the arguments specified. + * + * @param alg_id the IKE id of the algorithm + * @param type the transform type of the algorithm + * @param kernel_id the kernel id of the algorithm (optional) + * @param kernel_name the kernel name of the algorithm (optional) + * @return TRUE if algorithm was found + */ + bool (*lookup_algorithm)(kernel_interface_t *this, u_int16_t alg_id, + transform_type_t type, u_int16_t *kernel_id, + char **kernel_name); + + /** * Destroys a kernel_interface_manager_t object. */ void (*destroy) (kernel_interface_t *this); |