diff options
author | Tobias Brunner <tobias@strongswan.org> | 2012-10-10 15:29:25 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2012-10-16 14:16:17 +0200 |
commit | 7622c5e97e65493cd20c6dac1bf2382cfb04a9d8 (patch) | |
tree | 86c65486658f2bca3a16f7c958af4caba11c37b2 /src/libipsec/ipsec_sa.c | |
parent | 5b88d80f22a105c93a8af6297dd40fc8222a7fb6 (diff) | |
download | strongswan-7622c5e97e65493cd20c6dac1bf2382cfb04a9d8.tar.bz2 strongswan-7622c5e97e65493cd20c6dac1bf2382cfb04a9d8.tar.xz |
Setter for src and destination address of ipsec_sa_t added
Diffstat (limited to 'src/libipsec/ipsec_sa.c')
-rw-r--r-- | src/libipsec/ipsec_sa.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/libipsec/ipsec_sa.c b/src/libipsec/ipsec_sa.c index cccd16404..66852259c 100644 --- a/src/libipsec/ipsec_sa.c +++ b/src/libipsec/ipsec_sa.c @@ -95,6 +95,20 @@ METHOD(ipsec_sa_t, get_destination, host_t*, return this->dst; } +METHOD(ipsec_sa_t, set_source, void, + private_ipsec_sa_t *this, host_t *addr) +{ + this->src->destroy(this->src); + this->src = addr->clone(addr); +} + +METHOD(ipsec_sa_t, set_destination, void, + private_ipsec_sa_t *this, host_t *addr) +{ + this->dst->destroy(this->dst); + this->dst = addr->clone(addr); +} + METHOD(ipsec_sa_t, get_spi, u_int32_t, private_ipsec_sa_t *this) { @@ -202,6 +216,8 @@ ipsec_sa_t *ipsec_sa_create(u_int32_t spi, host_t *src, host_t *dst, .destroy = _destroy, .get_source = _get_source, .get_destination = _get_destination, + .set_source = _set_source, + .set_destination = _set_destination, .get_spi = _get_spi, .get_reqid = _get_reqid, .get_protocol = _get_protocol, |