[strongSwan-dev] [PATCH] vici: Report mobike status in list-sas command
Olivier Matz
olivier.matz at 6wind.com
Fri May 24 13:35:05 CEST 2019
Add a 'mobike = yes' entry in the vici list-sas message if
mobike is enabled for the ike sa.
Signed-off-by: Olivier Matz <olivier.matz at 6wind.com>
---
src/libcharon/plugins/vici/README.md | 1 +
src/libcharon/plugins/vici/vici_query.c | 5 +++++
2 files changed, 6 insertions(+)
diff --git a/src/libcharon/plugins/vici/README.md b/src/libcharon/plugins/vici/README.md
index a0ab5608a..14a0c7c38 100644
--- a/src/libcharon/plugins/vici/README.md
+++ b/src/libcharon/plugins/vici/README.md
@@ -768,6 +768,7 @@ command.
initiator = <yes, if initiator of IKE_SA>
initiator-spi = <hex encoded initiator SPI / cookie>
responder-spi = <hex encoded responder SPI / cookie>
+ mobike = <yes, if MOBIKE extension is enabled>
nat-local = <yes, if local endpoint is behind a NAT>
nat-remote = <yes, if remote endpoint is behind a NAT>
nat-fake = <yes, if NAT situation has been faked as responder>
diff --git a/src/libcharon/plugins/vici/vici_query.c b/src/libcharon/plugins/vici/vici_query.c
index 16e3c8b1f..2c58d74fe 100644
--- a/src/libcharon/plugins/vici/vici_query.c
+++ b/src/libcharon/plugins/vici/vici_query.c
@@ -396,6 +396,11 @@ static void list_ike(private_vici_query_t *this, vici_builder_t *b,
b->add_kv(b, "responder-spi", "%.16"PRIx64,
be64toh(id->get_responder_spi(id)));
+ if (ike_sa->supports_extension(ike_sa, EXT_MOBIKE))
+ {
+ b->add_kv(b, "mobike", "yes");
+ }
+
add_condition(b, ike_sa, "nat-local", COND_NAT_HERE);
add_condition(b, ike_sa, "nat-remote", COND_NAT_THERE);
add_condition(b, ike_sa, "nat-fake", COND_NAT_FAKE);
--
2.11.0
More information about the Dev
mailing list