]> git.ipfire.org Git - thirdparty/strongswan.git/commit
ike-sa: Add possibility to store private extensions/conditions
authorTobias Brunner <tobias@strongswan.org>
Fri, 28 Mar 2025 14:06:52 +0000 (15:06 +0100)
committerTobias Brunner <tobias@strongswan.org>
Thu, 10 Apr 2025 06:31:09 +0000 (08:31 +0200)
commit07978c16b3f2e42529eed255dc1cebcf3757162f
treea8fdbcbe1959b2905bd7f2c016a1820247a7c820
parent6ed63be6125ba7a7c23e95a0a4e39e2a26b9b8b8
ike-sa: Add possibility to store private extensions/conditions

This avoids conflicts with upstream changes if patched versions of
strongSwan require a number of private extensions and conditions.  For
example, the following extensions can be used as usual via the
`enable|supports_extension()` methods:

#define PRIVATE_EXT_1 (EXT_PRIVATE_MARKER | (1<<0))
#define PRIVATE_EXT_2 (EXT_PRIVATE_MARKER | (1<<1))

Defining an enum would also be possible but because the type won't match
the values would have to be cast to `ike_extension_t` when using the
methods.

Similarly, `COND_PRIVATE_MARKER` may be used to define private conditions
that can be used with the `set|has_condition()` methods.

Because the MSB is explicitly not set in `private_extensions|conditions`,
these members may directly be checked against private values, e.g.:

if (this->private_extensions & PRIVATE_EXT_1)
{
}
src/libcharon/sa/ike_sa.c
src/libcharon/sa/ike_sa.h