ARG_WITH_SUBST([plugindir], [${ipseclibdir%/}/plugins], [set the installation path of plugins])
ARG_WITH_SUBST([imcvdir], [${ipseclibdir%/}/imcvs], [set the installation path of IMC and IMV dynamic librariers])
ARG_WITH_SUBST([nm-ca-dir], [/usr/share/ca-certificates], [directory the NM backend uses to look up trusted root certificates])
+ARG_WITH_SUBST([swanctldir], [${sysconfdir}/swanctl], [base directory for swanctl configuration files and credentials])
ARG_WITH_SUBST([linux-headers], [\${top_srcdir}/src/include], [set directory of linux header files to use])
ARG_WITH_SUBST([routing-table], [220], [set routing table to use for IPsec routes])
ARG_WITH_SUBST([routing-table-prio], [220], [set priority for IPsec routing table])
sbin_PROGRAMS = swanctl
-conffile = `dirname $(strongswan_conf)`/strongswan.d/swanctl.conf
-
swanctl_SOURCES = \
command.c command.h \
commands/initiate.c \
commands/list_sas.c \
commands/list_pols.c \
commands/load_conns.c \
- swanctl.c
+ swanctl.c swanctl.h
swanctl_LDADD = \
$(top_builddir)/src/libcharon/plugins/vici/libvici.la \
AM_CPPFLAGS = \
-I$(top_srcdir)/src/libstrongswan \
-I$(top_srcdir)/src/libcharon/plugins/vici \
- -DCONF_FILE=\""${conffile}\"" \
+ -DSWANCTLDIR=\""${swanctldir}\"" \
-DPLUGINS=\""${s_plugins}\""
#include <errno.h>
#include "command.h"
+#include "swanctl.h"
/**
* Check if we should handle a key as a list of comma separated values
break;
}
- cfg = settings_create(CONF_FILE);
+ cfg = settings_create(SWANCTL_CONF);
if (!cfg)
{
- fprintf(stderr, "parsing '%s' failed\n", CONF_FILE);
+ fprintf(stderr, "parsing '%s' failed\n", SWANCTL_CONF);
return EINVAL;
}
--- /dev/null
+/*
+ * Copyright (C) 2014 Martin Willi
+ * Copyright (C) 2014 revosec AG
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ */
+
+/**
+ * @defgroup swanctl swanctl
+ * @{ @ingroup swanctl
+ */
+
+#ifndef SWANCTL_H_
+#define SWANCTL_H_
+
+/**
+ * Configuration file for connections, etc.
+ */
+#define SWANCTL_CONF SWANCTLDIR "/swanctl.conf"
+
+#endif /** SWANCTL_H_ @}*/