]>
git.ipfire.org Git - thirdparty/strongswan.git/blob - src/libcharon/sa/ike_sa_id.h
065c2a897c5660cfce99ffc81ae6bbf6bf4cac33
2 * Copyright (C) 2005-2006 Martin Willi
3 * Copyright (C) 2005 Jan Hutter
4 * Hochschule fuer Technik Rapperswil
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 * @defgroup ike_sa_id ike_sa_id
25 typedef struct ike_sa_id_t ike_sa_id_t
;
30 * An object of type ike_sa_id_t is used to identify an IKE_SA.
32 * An IKE_SA is identified by its initiator and responder spi's.
33 * Additionally it contains the role of the actual running IKEv2-Daemon
34 * for the specific IKE_SA (original initiator or responder).
39 * Set the SPI of the responder.
41 * This function is called when a request or reply of a IKE_SA_INIT is received.
43 * @param responder_spi SPI of responder to set
45 void (*set_responder_spi
) (ike_sa_id_t
*this, u_int64_t responder_spi
);
48 * Set the SPI of the initiator.
50 * @param initiator_spi SPI to set
52 void (*set_initiator_spi
) (ike_sa_id_t
*this, u_int64_t initiator_spi
);
55 * Get the initiator SPI.
57 * @return SPI of the initiator
59 u_int64_t (*get_initiator_spi
) (ike_sa_id_t
*this);
62 * Get the responder SPI.
64 * @return SPI of the responder
66 u_int64_t (*get_responder_spi
) (ike_sa_id_t
*this);
69 * Check if two ike_sa_id_t objects are equal.
71 * Two ike_sa_id_t objects are equal if both SPI values and the role matches.
73 * @param other ike_sa_id_t object to check if equal
74 * @return TRUE if given ike_sa_id_t are equal, FALSE otherwise
76 bool (*equals
) (ike_sa_id_t
*this, ike_sa_id_t
*other
);
79 * Replace all values of a given ike_sa_id_t object with values.
80 * from another ike_sa_id_t object.
82 * After calling this function, both objects are equal.
84 * @param other ike_sa_id_t object from which values will be taken
86 void (*replace_values
) (ike_sa_id_t
*this, ike_sa_id_t
*other
);
89 * Get the initiator flag.
91 * @return TRUE if we are the original initator
93 bool (*is_initiator
) (ike_sa_id_t
*this);
96 * Switche the original initiator flag.
98 * @return TRUE if we are the original initator after switch, FALSE otherwise
100 bool (*switch_initiator
) (ike_sa_id_t
*this);
103 * Clones a given ike_sa_id_t object.
105 * @return cloned ike_sa_id_t object
107 ike_sa_id_t
*(*clone
) (ike_sa_id_t
*this);
110 * Destroys an ike_sa_id_t object.
112 void (*destroy
) (ike_sa_id_t
*this);
116 * Creates an ike_sa_id_t object with specific SPI's and defined role.
118 * @param initiator_spi initiators SPI
119 * @param responder_spi responders SPI
120 * @param is_initiaor TRUE if we are the original initiator
121 * @return ike_sa_id_t object
123 ike_sa_id_t
* ike_sa_id_create(u_int64_t initiator_spi
, u_int64_t responder_spi
,
126 #endif /** IKE_SA_ID_H_ @}*/