Adapted the kernel interfaces to the new lifetime configuration.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2008 Tobias Brunner
|
||||
* Copyright (C) 2008-2009 Tobias Brunner
|
||||
* Hochschule fuer Technik Rapperswil
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
@@ -73,7 +73,7 @@ static status_t get_cpi(private_kernel_interface_t *this, host_t *src, host_t *d
|
||||
*/
|
||||
static status_t add_sa(private_kernel_interface_t *this, host_t *src, host_t *dst,
|
||||
u_int32_t spi, protocol_id_t protocol, u_int32_t reqid,
|
||||
u_int64_t expire_soft, u_int64_t expire_hard,
|
||||
lifetime_cfg_t *lifetime,
|
||||
u_int16_t enc_alg, chunk_t enc_key,
|
||||
u_int16_t int_alg, chunk_t int_key,
|
||||
ipsec_mode_t mode, u_int16_t ipcomp, u_int16_t cpi, bool encap,
|
||||
@@ -84,8 +84,8 @@ static status_t add_sa(private_kernel_interface_t *this, host_t *src, host_t *ds
|
||||
return NOT_SUPPORTED;
|
||||
}
|
||||
return this->ipsec->add_sa(this->ipsec, src, dst, spi, protocol, reqid,
|
||||
expire_soft, expire_hard, enc_alg, enc_key, int_alg, int_key,
|
||||
mode, ipcomp, cpi, encap, inbound);
|
||||
lifetime, enc_alg, enc_key, int_alg, int_key, mode, ipcomp, cpi,
|
||||
encap, inbound);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -398,7 +398,7 @@ kernel_interface_t *kernel_interface_create()
|
||||
|
||||
this->public.get_spi = (status_t(*)(kernel_interface_t*,host_t*,host_t*,protocol_id_t,u_int32_t,u_int32_t*))get_spi;
|
||||
this->public.get_cpi = (status_t(*)(kernel_interface_t*,host_t*,host_t*,u_int32_t,u_int16_t*))get_cpi;
|
||||
this->public.add_sa = (status_t(*)(kernel_interface_t *,host_t*,host_t*,u_int32_t,protocol_id_t,u_int32_t,u_int64_t,u_int64_t,u_int16_t,chunk_t,u_int16_t,chunk_t,ipsec_mode_t,u_int16_t,u_int16_t,bool,bool))add_sa;
|
||||
this->public.add_sa = (status_t(*)(kernel_interface_t *,host_t*,host_t*,u_int32_t,protocol_id_t,u_int32_t,lifetime_cfg_t*,u_int16_t,chunk_t,u_int16_t,chunk_t,ipsec_mode_t,u_int16_t,u_int16_t,bool,bool))add_sa;
|
||||
this->public.update_sa = (status_t(*)(kernel_interface_t*,u_int32_t,protocol_id_t,u_int16_t,host_t*,host_t*,host_t*,host_t*,bool,bool))update_sa;
|
||||
this->public.query_sa = (status_t(*)(kernel_interface_t*,host_t*,host_t*,u_int32_t,protocol_id_t,u_int64_t*))query_sa;
|
||||
this->public.del_sa = (status_t(*)(kernel_interface_t*,host_t*,host_t*,u_int32_t,protocol_id_t,u_int16_t))del_sa;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2006-2008 Tobias Brunner
|
||||
* Copyright (C) 2006-2009 Tobias Brunner
|
||||
* Copyright (C) 2006 Daniel Roethlisberger
|
||||
* Copyright (C) 2005-2006 Martin Willi
|
||||
* Copyright (C) 2005 Jan Hutter
|
||||
@@ -78,22 +78,19 @@ struct kernel_interface_t {
|
||||
|
||||
/**
|
||||
* Add an SA to the SAD.
|
||||
*
|
||||
*
|
||||
* add_sa() may update an already allocated
|
||||
* SPI (via get_spi). In this case, the replace
|
||||
* flag must be set.
|
||||
* This function does install a single SA for a
|
||||
* single protocol in one direction. The kernel-interface
|
||||
* gets the keys itself from the PRF, as we don't know
|
||||
* his algorithms and key sizes.
|
||||
*
|
||||
* single protocol in one direction.
|
||||
*
|
||||
* @param src source address for this SA
|
||||
* @param dst destination address for this SA
|
||||
* @param spi SPI allocated by us or remote peer
|
||||
* @param protocol protocol for this SA (ESP/AH)
|
||||
* @param reqid unique ID for this SA
|
||||
* @param expire_soft lifetime in seconds before rekeying
|
||||
* @param expire_hard lifetime in seconds before delete
|
||||
* @param lifetime lifetime_cfg_t for this SA
|
||||
* @param enc_alg Algorithm to use for encryption (ESP only)
|
||||
* @param enc_key key to use for encryption
|
||||
* @param int_alg Algorithm to use for integrity protection
|
||||
@@ -108,9 +105,9 @@ struct kernel_interface_t {
|
||||
status_t (*add_sa) (kernel_interface_t *this,
|
||||
host_t *src, host_t *dst, u_int32_t spi,
|
||||
protocol_id_t protocol, u_int32_t reqid,
|
||||
u_int64_t expire_soft, u_int64_t expire_hard,
|
||||
u_int16_t enc_alg, chunk_t enc_key,
|
||||
u_int16_t int_alg, chunk_t int_key,
|
||||
lifetime_cfg_t *lifetime,
|
||||
u_int16_t enc_alg, chunk_t enc_key,
|
||||
u_int16_t int_alg, chunk_t int_key,
|
||||
ipsec_mode_t mode, u_int16_t ipcomp, u_int16_t cpi,
|
||||
bool encap, bool inbound);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2006-2008 Tobias Brunner
|
||||
* Copyright (C) 2006-2009 Tobias Brunner
|
||||
* Copyright (C) 2006 Daniel Roethlisberger
|
||||
* Copyright (C) 2005-2006 Martin Willi
|
||||
* Copyright (C) 2005 Jan Hutter
|
||||
@@ -30,7 +30,8 @@ typedef struct kernel_ipsec_t kernel_ipsec_t;
|
||||
|
||||
#include <utils/host.h>
|
||||
#include <crypto/prf_plus.h>
|
||||
#include <encoding/payloads/proposal_substructure.h>
|
||||
#include <config/proposal.h>
|
||||
#include <config/child_cfg.h>
|
||||
|
||||
/**
|
||||
* Mode of a CHILD_SA.
|
||||
@@ -108,22 +109,19 @@ struct kernel_ipsec_t {
|
||||
|
||||
/**
|
||||
* Add an SA to the SAD.
|
||||
*
|
||||
*
|
||||
* add_sa() may update an already allocated
|
||||
* SPI (via get_spi). In this case, the replace
|
||||
* flag must be set.
|
||||
* This function does install a single SA for a
|
||||
* single protocol in one direction. The kernel-interface
|
||||
* gets the keys itself from the PRF, as we don't know
|
||||
* his algorithms and key sizes.
|
||||
*
|
||||
* single protocol in one direction.
|
||||
*
|
||||
* @param src source address for this SA
|
||||
* @param dst destination address for this SA
|
||||
* @param spi SPI allocated by us or remote peer
|
||||
* @param protocol protocol for this SA (ESP/AH)
|
||||
* @param reqid unique ID for this SA
|
||||
* @param expire_soft lifetime in seconds before rekeying
|
||||
* @param expire_hard lifetime in seconds before delete
|
||||
* @param lifetime lifetime_cfg_t for this SA
|
||||
* @param enc_alg Algorithm to use for encryption (ESP only)
|
||||
* @param enc_key key to use for encryption
|
||||
* @param int_alg Algorithm to use for integrity protection
|
||||
@@ -138,9 +136,9 @@ struct kernel_ipsec_t {
|
||||
status_t (*add_sa) (kernel_ipsec_t *this,
|
||||
host_t *src, host_t *dst, u_int32_t spi,
|
||||
protocol_id_t protocol, u_int32_t reqid,
|
||||
u_int64_t expire_soft, u_int64_t expire_hard,
|
||||
u_int16_t enc_alg, chunk_t enc_key,
|
||||
u_int16_t int_alg, chunk_t int_key,
|
||||
lifetime_cfg_t *lifetime,
|
||||
u_int16_t enc_alg, chunk_t enc_key,
|
||||
u_int16_t int_alg, chunk_t int_key,
|
||||
ipsec_mode_t mode, u_int16_t ipcomp, u_int16_t cpi,
|
||||
bool encap, bool inbound);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user