strongswan/src/libcharon/sa/ike_sa_id.h

138 lines
3.5 KiB
C
Raw Normal View History

/*
* Copyright (C) 2012 Tobias Brunner
2006-07-07 08:49:06 +00:00
* Copyright (C) 2005-2006 Martin Willi
* Copyright (C) 2005 Jan Hutter
* HSR Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/
/**
* @defgroup ike_sa_id ike_sa_id
* @{ @ingroup sa
*/
#ifndef IKE_SA_ID_H_
#define IKE_SA_ID_H_
2005-12-07 08:08:13 +00:00
typedef struct ike_sa_id_t ike_sa_id_t;
#include <library.h>
/**
* An object of type ike_sa_id_t is used to identify an IKE_SA.
*
* An IKE_SA is identified by its initiator and responder SPIs.
* Additionally, it contains the major IKE version of the IKE_SA and, for IKEv2,
* the role of the daemon (original initiator or responder).
*/
2005-11-24 11:30:19 +00:00
struct ike_sa_id_t {
/**
* Get the major IKE version of this IKE_SA.
*
* @return IKE version
*/
2016-03-22 12:22:01 +00:00
uint8_t (*get_ike_version) (ike_sa_id_t *this);
/**
* Set the SPI of the responder.
*
* This function is called when a request or reply of a IKE_SA_INIT is received.
*
* @param responder_spi SPI of responder to set
*/
2016-03-22 12:22:01 +00:00
void (*set_responder_spi) (ike_sa_id_t *this, uint64_t responder_spi);
/**
* Set the SPI of the initiator.
*
* @param initiator_spi SPI to set
*/
2016-03-22 12:22:01 +00:00
void (*set_initiator_spi) (ike_sa_id_t *this, uint64_t initiator_spi);
/**
* Get the initiator SPI.
*
* @return SPI of the initiator
*/
2016-03-22 12:22:01 +00:00
uint64_t (*get_initiator_spi) (ike_sa_id_t *this);
/**
* Get the responder SPI.
*
* @return SPI of the responder
*/
2016-03-22 12:22:01 +00:00
uint64_t (*get_responder_spi) (ike_sa_id_t *this);
/**
* Check if two ike_sa_id_t objects are equal.
*
* Two ike_sa_id_t objects are equal if version and both SPI values match.
* The role is not compared.
*
* @param other ike_sa_id_t object to check if equal
* @return TRUE if given ike_sa_id_t are equal,
* FALSE otherwise
*/
2005-11-28 20:29:47 +00:00
bool (*equals) (ike_sa_id_t *this, ike_sa_id_t *other);
2005-11-08 09:10:15 +00:00
/**
* Replace all values of a given ike_sa_id_t object with values
2005-11-28 20:29:47 +00:00
* from another ike_sa_id_t object.
*
2005-12-07 08:08:13 +00:00
* After calling this function, both objects are equal.
*
* @param other ike_sa_id_t object from which values will be taken
2005-11-08 10:03:40 +00:00
*/
2005-11-28 20:29:47 +00:00
void (*replace_values) (ike_sa_id_t *this, ike_sa_id_t *other);
/**
* Get the initiator flag.
*
2011-07-20 20:19:01 +00:00
* @return TRUE if we are the original initiator
*/
bool (*is_initiator) (ike_sa_id_t *this);
/**
* Switch the original initiator flag.
*
* @return new value if initiator flag.
*/
bool (*switch_initiator) (ike_sa_id_t *this);
2005-11-08 10:03:40 +00:00
/**
* Clones a given ike_sa_id_t object.
*
* @return cloned ike_sa_id_t object
2005-11-08 09:10:15 +00:00
*/
2005-11-28 20:29:47 +00:00
ike_sa_id_t *(*clone) (ike_sa_id_t *this);
/**
* Destroys an ike_sa_id_t object.
*/
2005-11-28 20:29:47 +00:00
void (*destroy) (ike_sa_id_t *this);
};
/**
* Creates an ike_sa_id_t object.
*
* @param ike_version major IKE version
2005-12-07 08:08:13 +00:00
* @param initiator_spi initiators SPI
* @param responder_spi responders SPI
Spelling fixes * accumulating * acquire * alignment * appropriate * argument * assign * attribute * authenticate * authentication * authenticator * authority * auxiliary * brackets * callback * camellia * can't * cancelability * certificate * choinyambuu * chunk * collector * collision * communicating * compares * compatibility * compressed * confidentiality * configuration * connection * consistency * constraint * construction * constructor * database * decapsulated * declaration * decrypt * derivative * destination * destroyed * details * devised * dynamic * ecapsulation * encoded * encoding * encrypted * enforcing * enumerator * establishment * excluded * exclusively * exited * expecting * expire * extension * filter * firewall * foundation * fulfillment * gateways * hashing * hashtable * heartbeats * identifier * identifiers * identities * identity * implementers * indicating * initialize * initiate * initiation * initiator * inner * instantiate * legitimate * libraries * libstrongswan * logger * malloc * manager * manually * measurement * mechanism * message * network * nonexistent * object * occurrence * optional * outgoing * packages * packets * padding * particular * passphrase * payload * periodically * policies * possible * previously * priority * proposal * protocol * provide * provider * pseudo * pseudonym * public * qualifier * quantum * quintuplets * reached * reading * recommendation to * recommendation * recursive * reestablish * referencing * registered * rekeying * reliable * replacing * representing * represents * request * request * resolver * result * resulting * resynchronization * retriable * revocation * right * rollback * rule * rules * runtime * scenario * scheduled * security * segment * service * setting * signature * specific * specified * speed * started * steffen * strongswan * subjectaltname * supported * threadsafe * traffic * tremendously * treshold * unique * uniqueness * unknown * until * upper * using * validator * verification * version * version * warrior Closes strongswan/strongswan#164.
2020-02-05 04:30:52 +00:00
* @param is_initiator TRUE if we are the original initiator
2005-12-07 08:08:13 +00:00
* @return ike_sa_id_t object
*/
2016-03-22 12:22:01 +00:00
ike_sa_id_t * ike_sa_id_create(uint8_t ike_version, uint64_t initiator_spi,
Spelling fixes * accumulating * acquire * alignment * appropriate * argument * assign * attribute * authenticate * authentication * authenticator * authority * auxiliary * brackets * callback * camellia * can't * cancelability * certificate * choinyambuu * chunk * collector * collision * communicating * compares * compatibility * compressed * confidentiality * configuration * connection * consistency * constraint * construction * constructor * database * decapsulated * declaration * decrypt * derivative * destination * destroyed * details * devised * dynamic * ecapsulation * encoded * encoding * encrypted * enforcing * enumerator * establishment * excluded * exclusively * exited * expecting * expire * extension * filter * firewall * foundation * fulfillment * gateways * hashing * hashtable * heartbeats * identifier * identifiers * identities * identity * implementers * indicating * initialize * initiate * initiation * initiator * inner * instantiate * legitimate * libraries * libstrongswan * logger * malloc * manager * manually * measurement * mechanism * message * network * nonexistent * object * occurrence * optional * outgoing * packages * packets * padding * particular * passphrase * payload * periodically * policies * possible * previously * priority * proposal * protocol * provide * provider * pseudo * pseudonym * public * qualifier * quantum * quintuplets * reached * reading * recommendation to * recommendation * recursive * reestablish * referencing * registered * rekeying * reliable * replacing * representing * represents * request * request * resolver * result * resulting * resynchronization * retriable * revocation * right * rollback * rule * rules * runtime * scenario * scheduled * security * segment * service * setting * signature * specific * specified * speed * started * steffen * strongswan * subjectaltname * supported * threadsafe * traffic * tremendously * treshold * unique * uniqueness * unknown * until * upper * using * validator * verification * version * version * warrior Closes strongswan/strongswan#164.
2020-02-05 04:30:52 +00:00
uint64_t responder_spi, bool is_initiator);
#endif /** IKE_SA_ID_H_ @}*/