}
}
+### ike-update ###
+
+The _ike-update_ event is issued when the local or remote endpoint address of an
+IKE_SA is about to change (at least one address/port is different).
+
+ {
+ local-host = <new/current local IKE endpoint address>
+ local-port = <new/current local IKE endpoint port>
+ remote-host = <new/current remote IKE endpoint address>
+ remote-port = <new/current remote IKE endpoint port>
+ <IKE_SA config name> = {
+ <same data as in the list-sas event, but without child-sas section
+ and listing the old addresses/ports>
+ }
+ }
+
### child-updown ###
The _child-updown_ event is issued when a CHILD_SA is established or terminated.
/*
- * Copyright (C) 2015-2017 Tobias Brunner
+ * Copyright (C) 2015-2020 Tobias Brunner
* Copyright (C) 2015-2018 Andreas Steffen
* HSR Hochschule fuer Technik Rapperswil
*
bool bl;
char buf[BUF_LEN];
+
bl = request->get_str(request, NULL, "noblock") == NULL;
ike = request->get_str(request, NULL, "ike");
ike_id = request->get_int(request, 0, "ike-id");
this->dispatcher->manage_event(this->dispatcher, "list-cert", reg);
this->dispatcher->manage_event(this->dispatcher, "ike-updown", reg);
this->dispatcher->manage_event(this->dispatcher, "ike-rekey", reg);
+ this->dispatcher->manage_event(this->dispatcher, "ike-update", reg);
this->dispatcher->manage_event(this->dispatcher, "child-updown", reg);
this->dispatcher->manage_event(this->dispatcher, "child-rekey", reg);
manage_command(this, "list-sas", list_sas, reg);
return TRUE;
}
+METHOD(listener_t, ike_update, bool,
+ private_vici_query_t *this, ike_sa_t *ike_sa, host_t *local, host_t *remote)
+{
+ vici_builder_t *b;
+ time_t now;
+
+ if (!this->dispatcher->has_event_listeners(this->dispatcher, "ike-update"))
+ {
+ return TRUE;
+ }
+
+ now = time_monotonic(NULL);
+
+ b = vici_builder_create();
+
+ b->add_kv(b, "local-host", "%H", local);
+ b->add_kv(b, "local-port", "%d", local->get_port(local));
+ b->add_kv(b, "remote-host", "%H", remote);
+ b->add_kv(b, "remote-port", "%d", remote->get_port(remote));
+
+ b->begin_section(b, ike_sa->get_name(ike_sa));
+ list_ike(this, b, ike_sa, now);
+ b->end_section(b);
+
+ this->dispatcher->raise_event(this->dispatcher,
+ "ike-update", 0, b->finalize(b));
+
+ return TRUE;
+}
+
METHOD(listener_t, child_updown, bool,
private_vici_query_t *this, ike_sa_t *ike_sa, child_sa_t *child_sa, bool up)
{
.listener = {
.ike_updown = _ike_updown,
.ike_rekey = _ike_rekey,
+ .ike_update = _ike_update,
.child_updown = _child_updown,
.child_rekey = _child_rekey,
},