aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/swanctl/Makefile.am6
-rw-r--r--src/swanctl/commands/load_conns.c5
-rw-r--r--src/swanctl/swanctl.h29
3 files changed, 34 insertions, 6 deletions
diff --git a/src/swanctl/Makefile.am b/src/swanctl/Makefile.am
index 58995cdda..c6b71c8b2 100644
--- a/src/swanctl/Makefile.am
+++ b/src/swanctl/Makefile.am
@@ -1,7 +1,5 @@
sbin_PROGRAMS = swanctl
-conffile = `dirname $(strongswan_conf)`/strongswan.d/swanctl.conf
-
swanctl_SOURCES = \
command.c command.h \
commands/initiate.c \
@@ -11,7 +9,7 @@ swanctl_SOURCES = \
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 \
@@ -22,5 +20,5 @@ swanctl.o : $(top_builddir)/config.status
AM_CPPFLAGS = \
-I$(top_srcdir)/src/libstrongswan \
-I$(top_srcdir)/src/libcharon/plugins/vici \
- -DCONF_FILE=\""${conffile}\"" \
+ -DSWANCTLDIR=\""${swanctldir}\"" \
-DPLUGINS=\""${s_plugins}\""
diff --git a/src/swanctl/commands/load_conns.c b/src/swanctl/commands/load_conns.c
index 7fcf87f87..2c9884dc0 100644
--- a/src/swanctl/commands/load_conns.c
+++ b/src/swanctl/commands/load_conns.c
@@ -18,6 +18,7 @@
#include <errno.h>
#include "command.h"
+#include "swanctl.h"
/**
* Check if we should handle a key as a list of comma separated values
@@ -262,10 +263,10 @@ static int load_conns(vici_conn_t *conn)
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;
}
diff --git a/src/swanctl/swanctl.h b/src/swanctl/swanctl.h
new file mode 100644
index 000000000..8497f230b
--- /dev/null
+++ b/src/swanctl/swanctl.h
@@ -0,0 +1,29 @@
+/*
+ * 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_ @}*/