aboutsummaryrefslogtreecommitdiffstats
path: root/src/frontends/osx
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2013-05-22 17:22:47 +0200
committerMartin Willi <martin@revosec.ch>2013-07-18 12:17:56 +0200
commite37c5d46d3fb5ea5c441b809a12c4538ee818ef5 (patch)
treed62674417586489dd05c33c987eebea5d754bf6c /src/frontends/osx
parent3ffa310c44e0627cdfa918e44901e537043920f4 (diff)
downloadstrongswan-e37c5d46d3fb5ea5c441b809a12c4538ee818ef5.tar.bz2
strongswan-e37c5d46d3fb5ea5c441b809a12c4538ee818ef5.tar.xz
xpc: send a "connecting" event when establishing a connection starts
Diffstat (limited to 'src/frontends/osx')
-rw-r--r--src/frontends/osx/charon-xpc/xpc_channels.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/frontends/osx/charon-xpc/xpc_channels.c b/src/frontends/osx/charon-xpc/xpc_channels.c
index 1310b37f6..92a1049fa 100644
--- a/src/frontends/osx/charon-xpc/xpc_channels.c
+++ b/src/frontends/osx/charon-xpc/xpc_channels.c
@@ -254,6 +254,32 @@ METHOD(listener_t, ike_rekey, bool,
return TRUE;
}
+METHOD(listener_t, ike_state_change, bool,
+ private_xpc_channels_t *this, ike_sa_t *ike_sa, ike_sa_state_t state)
+{
+ if (state == IKE_CONNECTING)
+ {
+ entry_t *entry;
+ uintptr_t sa;
+
+ sa = ike_sa->get_unique_id(ike_sa);
+ this->lock->read_lock(this->lock);
+ entry = this->channels->get(this->channels, (void*)sa);
+ if (entry)
+ {
+ xpc_object_t msg;
+
+ msg = xpc_dictionary_create(NULL, NULL, 0);
+ xpc_dictionary_set_string(msg, "type", "event");
+ xpc_dictionary_set_string(msg, "event", "connecting");
+ xpc_connection_send_message(entry->conn, msg);
+ xpc_release(msg);
+ }
+ this->lock->unlock(this->lock);
+ }
+ return TRUE;
+}
+
METHOD(listener_t, child_updown, bool,
private_xpc_channels_t *this, ike_sa_t *ike_sa,
child_sa_t *child_sa, bool up)
@@ -438,6 +464,7 @@ xpc_channels_t *xpc_channels_create()
.listener = {
.ike_updown = _ike_updown,
.ike_rekey = _ike_rekey,
+ .ike_state_change = _ike_state_change,
.child_updown = _child_updown,
},
.add = _add,