Make IKE and EES sockets configurable

The IKE and EES sockets are now read from strongswan.conf. They can be
specified like this:

charon-tkm {
	ike_socket = /tmp/tkm.rpc.ike
	ees_socket = /tmp/tkm.rpc.ees
}

The socket names given above are used by default if none are configured.
This commit is contained in:
Adrian-Ken Rueegsegger 2012-12-18 17:15:58 +01:00 committed by Tobias Brunner
parent f47ea969f8
commit 140a6b7b34
1 changed files with 14 additions and 3 deletions

View File

@ -14,6 +14,8 @@
* for more details.
*/
#include <daemon.h>
#include <tkm/client.h>
#include <tkm/constants.h>
@ -61,16 +63,25 @@ bool tkm_init()
/* initialize TKM client library */
tkmlib_init();
ehandler_init();
if (ike_init(IKE_SOCKET) != TKM_OK)
const char * const ikesock = lib->settings->get_str(lib->settings,
"%s.ike_socket",
IKE_SOCKET,
charon->name);
if (ike_init(ikesock) != TKM_OK)
{
tkmlib_final();
return FALSE;
}
DBG1(DBG_DMN, "connected to TKM via socket '%s'", ikesock);
ees_server_init(EES_SOCKET);
const char * const eessock = lib->settings->get_str(lib->settings,
"%s.ees_socket",
EES_SOCKET,
charon->name);
ees_server_init(eessock);
DBG1(DBG_DMN, "serving EES requests on socket '%s'", eessock);
if (ike_tkm_reset() != TKM_OK)
{