version 1.1, 2020/06/03 09:46:45
|
version 1.1.1.2, 2021/03/17 00:20:09
|
Line 1
|
Line 1
|
/* |
/* |
* Copyright (C) 2008-2017 Tobias Brunner | * Copyright (C) 2008-2021 Tobias Brunner |
* Copyright (C) 2005-2008 Martin Willi |
* Copyright (C) 2005-2008 Martin Willi |
* Copyright (C) 2005 Jan Hutter |
* Copyright (C) 2005 Jan Hutter |
* HSR Hochschule fuer Technik Rapperswil |
* HSR Hochschule fuer Technik Rapperswil |
Line 50 typedef uint64_t (*spi_cb_t)(void *data);
|
Line 50 typedef uint64_t (*spi_cb_t)(void *data);
|
struct ike_sa_manager_t { |
struct ike_sa_manager_t { |
|
|
/** |
/** |
|
* Create a new IKE_SA. |
|
* |
|
* @param version IKE version of this SA |
|
* @param initiator TRUE for initiator, FALSE otherwise |
|
* @returns created IKE_SA (not registered/checked out) |
|
*/ |
|
ike_sa_t *(*create_new)(ike_sa_manager_t* this, ike_version_t version, |
|
bool initiator); |
|
|
|
/** |
|
* Register/checkout an IKE_SA created with create_new(). |
|
* |
|
* This may be used shortly before calling checkin() for unregistered SAs |
|
* created via create_new() to avoid race conditions so e.g. jobs may |
|
* find the SA and block on it until checkin() is called. |
|
* |
|
* @note There is no check that verifies that the IKE_SA is not yet |
|
* registered. |
|
* |
|
* @note The IKE_SA on the bus is not changed by this method. |
|
* |
|
* @param ike_sa IKE_SA to register |
|
*/ |
|
void (*checkout_new)(ike_sa_manager_t* this, ike_sa_t *ike_sa); |
|
|
|
/** |
* Checkout an existing IKE_SA. |
* Checkout an existing IKE_SA. |
* |
* |
* @param ike_sa_id the SA identifier, will be updated |
* @param ike_sa_id the SA identifier, will be updated |
Line 60 struct ike_sa_manager_t {
|
Line 86 struct ike_sa_manager_t {
|
ike_sa_t* (*checkout) (ike_sa_manager_t* this, ike_sa_id_t *sa_id); |
ike_sa_t* (*checkout) (ike_sa_manager_t* this, ike_sa_id_t *sa_id); |
|
|
/** |
/** |
* Create and check out a new IKE_SA. |
|
* |
|
* @param version IKE version of this SA |
|
* @param initiator TRUE for initiator, FALSE otherwise |
|
* @returns created and checked out IKE_SA |
|
*/ |
|
ike_sa_t* (*checkout_new) (ike_sa_manager_t* this, ike_version_t version, |
|
bool initiator); |
|
|
|
/** |
|
* Checkout an IKE_SA by a message. |
* Checkout an IKE_SA by a message. |
* |
* |
* In some situations, it is necessary that the manager knows the |
* In some situations, it is necessary that the manager knows the |
Line 99 struct ike_sa_manager_t {
|
Line 115 struct ike_sa_manager_t {
|
* This call checks for an existing IKE_SA by comparing the configuration. |
* This call checks for an existing IKE_SA by comparing the configuration. |
* If the CHILD_SA can be created in an existing IKE_SA, the matching SA |
* If the CHILD_SA can be created in an existing IKE_SA, the matching SA |
* is returned. |
* is returned. |
* If no IKE_SA is found, a new one is created. This is also the case when | * If no IKE_SA is found, a new one is created and registered in the |
* the found IKE_SA is in the DELETING state. | * manager. This is also the case when the found IKE_SA is in an unusable |
| * state (e.g. DELETING). |
* |
* |
|
* @note The peer_config is always set on the returned IKE_SA. |
|
* |
* @param peer_cfg configuration used to find an existing IKE_SA |
* @param peer_cfg configuration used to find an existing IKE_SA |
* @return checked out/created IKE_SA |
* @return checked out/created IKE_SA |
*/ |
*/ |
ike_sa_t* (*checkout_by_config) (ike_sa_manager_t* this, | ike_sa_t *(*checkout_by_config)(ike_sa_manager_t* this, peer_cfg_t *peer_cfg); |
peer_cfg_t *peer_cfg); | |
|
|
/** |
/** |
* Reset initiator SPI. |
* Reset initiator SPI. |