]>
git.ipfire.org Git - people/ms/strongswan.git/blob - src/charon/sa/ike_sa_id.h
4 * @brief Interface of ike_sa_id_t.
9 * Copyright (C) 2005 Jan Hutter, Martin Willi
10 * Hochschule fuer Technik Rapperswil
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
30 typedef struct ike_sa_id_t ike_sa_id_t
;
33 * @brief An object of type ike_sa_id_t is used to identify an IKE_SA.
35 * An IKE_SA is identified by its initiator and responder spi's.
36 * Additionaly it contains the role of the actual running IKEv2-Daemon
37 * for the specific IKE_SA (original initiator or responder).
40 * - ike_sa_id_create()
47 * @brief Set the SPI of the responder.
49 * This function is called when a request or reply of a IKE_SA_INIT is received.
51 * @param this calling object
52 * @param responder_spi SPI of responder to set
54 void (*set_responder_spi
) (ike_sa_id_t
*this, u_int64_t responder_spi
);
57 * @brief Set the SPI of the initiator.
59 * @param this calling object
60 * @param initiator_spi SPI to set
62 void (*set_initiator_spi
) (ike_sa_id_t
*this, u_int64_t initiator_spi
);
65 * @brief Get the initiator SPI.
67 * @param this calling object
68 * @return SPI of the initiator
70 u_int64_t (*get_initiator_spi
) (ike_sa_id_t
*this);
73 * @brief Get the responder SPI.
75 * @param this calling object
76 * @return SPI of the responder
78 u_int64_t (*get_responder_spi
) (ike_sa_id_t
*this);
81 * @brief Check if two ike_sa_id_t objects are equal.
83 * Two ike_sa_id_t objects are equal if both SPI values and the role matches.
85 * @param this calling object
86 * @param other ike_sa_id_t object to check if equal
87 * @return TRUE if given ike_sa_id_t are equal, FALSE otherwise
89 bool (*equals
) (ike_sa_id_t
*this, ike_sa_id_t
*other
);
92 * @brief Replace all values of a given ike_sa_id_t object with values.
93 * from another ike_sa_id_t object.
95 * After calling this function, both objects are equal.
97 * @param this calling object
98 * @param other ike_sa_id_t object from which values will be taken
100 void (*replace_values
) (ike_sa_id_t
*this, ike_sa_id_t
*other
);
103 * @brief Get the initiator flag.
105 * @param this calling object
106 * @return TRUE if we are the original initator
108 bool (*is_initiator
) (ike_sa_id_t
*this);
111 * @brief Switche the original initiator flag.
113 * @param this calling object
114 * @return TRUE if we are the original initator after switch, FALSE otherwise
116 bool (*switch_initiator
) (ike_sa_id_t
*this);
119 * @brief Clones a given ike_sa_id_t object.
121 * @param this calling object
122 * @return cloned ike_sa_id_t object
124 ike_sa_id_t
*(*clone
) (ike_sa_id_t
*this);
127 * @brief Destroys an ike_sa_id_t object.
129 * @param this calling object
131 void (*destroy
) (ike_sa_id_t
*this);
135 * @brief Creates an ike_sa_id_t object with specific SPI's and defined role.
137 * @param initiator_spi initiators SPI
138 * @param responder_spi responders SPI
139 * @param is_initiaor TRUE if we are the original initiator
140 * @return ike_sa_id_t object
144 ike_sa_id_t
* ike_sa_id_create(u_int64_t initiator_spi
, u_int64_t responder_spi
, bool is_initiaor
);
146 #endif /*IKE_SA_ID_H_*/