INCLUDES = -I$(top_srcdir)/src/libstrongswan
AM_CFLAGS = \
--DPLUGINS="\"${libstrongswan_plugins}\"" \
--DSTRONGSWAN_CONF=\"${strongswan_conf}\"
+-DPLUGINS="\"${libstrongswan_plugins}\""
noinst_PROGRAMS = bin2array bin2sql id2sql key2keyid keyid2sql \
thread_analysis dh_speed pubkey_speed
usage();
}
- library_init(STRONGSWAN_CONF);
+ library_init(NULL);
lib->plugins->load(lib->plugins, NULL, argv[1]);
atexit(library_deinit);
usage();
}
- library_init(STRONGSWAN_CONF);
+ library_init(NULL);
lib->plugins->load(lib->plugins, NULL, argv[1]);
atexit(library_deinit);
INCLUDES = -I${linux_headers} -I$(top_srcdir)/src/libstrongswan -I$(top_srcdir)/src/charon
AM_CFLAGS = -rdynamic \
-DIPSEC_DIR=\"${ipsecdir}\" \
- -DIPSEC_PIDDIR=\"${piddir}\" \
- -DSTRONGSWAN_CONF=\"${strongswan_conf}\"
+ -DIPSEC_PIDDIR=\"${piddir}\"
charon_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la -lpthread -lm $(DLLIB) $(SOCKLIB)
# compile options
dbg = dbg_stderr;
/* initialize library */
- if (!library_init(STRONGSWAN_CONF))
+ if (!library_init(NULL))
{
library_deinit();
exit(SS_RC_LIBSTRONGSWAN_INTEGRITY);
INCLUDES = -I$(top_srcdir)/src/libstrongswan -I$(top_srcdir)/src/charon
AM_CFLAGS = -rdynamic \
- -DSTRONGSWAN_CONF=\"${strongswan_conf}\" \
-DPLUGINS=\""${libstrongswan_plugins}\""
plugin_LTLIBRARIES = libstrongswan-sql.la
atexit(library_deinit);
/* initialize library */
- if (!library_init(STRONGSWAN_CONF))
+ if (!library_init(NULL))
{
exit(SS_RC_LIBSTRONGSWAN_INTEGRITY);
}
INCLUDES = -I$(top_srcdir)/src/libstrongswan
AM_CFLAGS = \
-DIPSEC_DIR=\"${ipsecdir}\" \
--DPLUGINDIR=\"${plugindir}\"
+-DPLUGINDIR=\"${plugindir}\" \
+-DSTRONGSWAN_CONF=\"${strongswan_conf}\"
if USE_LEAK_DETECTIVE
AM_CFLAGS += -DLEAK_DETECTIVE
*/
settings_t *settings_create(char *file)
{
- private_settings_t *this = malloc_thing(private_settings_t);
+ private_settings_t *this;
+ char *pos;
+ FILE *fd;
+ int len;
+ this = malloc_thing(private_settings_t);
this->public.get_str = (char*(*)(settings_t*, char *key, char* def, ...))get_str;
this->public.get_int = (int(*)(settings_t*, char *key, int def, ...))get_int;
this->public.get_time = (u_int32_t(*)(settings_t*, char *key, u_int32_t def, ...))get_time;
this->top = NULL;
this->text = NULL;
- if (file)
+ if (file == NULL)
{
- FILE *fd;
- int len;
- char *pos;
-
- fd = fopen(file, "r");
- if (fd == NULL)
- {
- DBG1("'%s' does not exist or is not readable", file);
- return &this->public;
- }
- fseek(fd, 0, SEEK_END);
- len = ftell(fd);
- rewind(fd);
- this->text = malloc(len + 1);
- this->text[len] = '\0';
- if (fread(this->text, 1, len, fd) != len)
- {
- free(this->text);
- this->text = NULL;
- return &this->public;
- }
- fclose(fd);
+ file = STRONGSWAN_CONF;
+ }
+ fd = fopen(file, "r");
+ if (fd == NULL)
+ {
+ DBG1("'%s' does not exist or is not readable", file);
+ return &this->public;
+ }
+ fseek(fd, 0, SEEK_END);
+ len = ftell(fd);
+ rewind(fd);
+ this->text = malloc(len + 1);
+ this->text[len] = '\0';
+ if (fread(this->text, 1, len, fd) != len)
+ {
+ free(this->text);
+ this->text = NULL;
+ return &this->public;
+ }
+ fclose(fd);
- pos = this->text;
- this->top = parse_section(&pos, NULL);
- if (this->top == NULL)
- {
- free(this->text);
- this->text = NULL;
- return &this->public;
- }
+ pos = this->text;
+ this->top = parse_section(&pos, NULL);
+ if (this->top == NULL)
+ {
+ free(this->text);
+ this->text = NULL;
}
return &this->public;
}
};
/**
- * Load setings from a file.
+ * Load settings from a file.
+ *
+ * @param file file to read settings from, NULL for default
+ * @return settings object
*/
settings_t *settings_create(char *file);
INCLUDES = -I$(top_srcdir)/src/libstrongswan -I$(top_srcdir)/src/libfast ${xml_CFLAGS}
AM_CFLAGS = -rdynamic \
- -DSTRONGSWAN_CONF=\"${strongswan_conf}\" \
-DIPSECDIR=\"${ipsecdir}\" \
-DIPSEC_PIDDIR=\"${piddir}\" \
-DPLUGINS=\""${libstrongswan_plugins}\""
bool debug;
int threads, timeout;
- library_init(STRONGSWAN_CONF);
+ library_init(NULL);
if (!lib->plugins->load(lib->plugins, NULL,
lib->settings->get_str(lib->settings, "manager.load", PLUGINS)))
{
INCLUDES = -I$(top_srcdir)/src/libstrongswan -I$(top_srcdir)/src/libfast
AM_CFLAGS = -rdynamic \
- -DSTRONGSWAN_CONF=\"${strongswan_conf}\" \
-DIPSECDIR=\"${ipsecdir}\" \
-DIPSEC_PIDDIR=\"${piddir}\" \
-DPLUGINS=\""${libstrongswan_plugins}\""
char *uri;
int timeout, threads;
- library_init(STRONGSWAN_CONF);
+ library_init(NULL);
if (!lib->plugins->load(lib->plugins, NULL,
lib->settings->get_str(lib->settings, "medsrv.load", PLUGINS)))
{
INCLUDES = -I$(top_srcdir)/src/libstrongswan
AM_CFLAGS = \
-DIPSEC_CONFDIR=\"${sysconfdir}\" \
- -DSTRONGSWAN_CONF=\"${strongswan_conf}\" \
-DPLUGINS=\""${libstrongswan_plugins}\""
openac_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la
/* initialize library */
atexit(library_deinit);
- if (!library_init(STRONGSWAN_CONF))
+ if (!library_init(NULL))
{
exit(SS_RC_LIBSTRONGSWAN_INTEGRITY);
}
pki_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la
INCLUDES = -I$(top_srcdir)/src/libstrongswan
AM_CFLAGS = \
- -DPLUGINS=\""${libstrongswan_plugins}\"" \
- -DSTRONGSWAN_CONF=\"${strongswan_conf}\"
+ -DPLUGINS=\""${libstrongswan_plugins}\""
int main(int argc, char *argv[])
{
atexit(library_deinit);
- if (!library_init(STRONGSWAN_CONF))
+ if (!library_init(NULL))
{
exit(SS_RC_LIBSTRONGSWAN_INTEGRITY);
}
-DIPSEC_PIDDIR=\"${piddir}\" \
-DSHARED_SECRETS_FILE=\"${confdir}/ipsec.secrets\" \
-DPLUGINS=\""${pluto_plugins}\"" \
--DSTRONGSWAN_CONF=\"${strongswan_conf}\" \
-DPKCS11_DEFAULT_LIB=\"${default_pkcs11}\" \
-DKERNEL26_SUPPORT -DKERNEL26_HAS_KAME_DUPLICATES \
-DPLUTO -DKLIPS -DDEBUG
#endif /* CAPABILITIES */
/* initialize library and optionsfrom */
- if (!library_init(STRONGSWAN_CONF))
+ if (!library_init(NULL))
{
library_deinit();
exit(SS_RC_LIBSTRONGSWAN_INTEGRITY);
AM_CFLAGS = \
-DIPSEC_CONFDIR=\"${sysconfdir}\" \
-DPLUGINS=\""${pluto_plugins}\"" \
--DSTRONGSWAN_CONF=\"${strongswan_conf}\" \
-DDEBUG -DNO_PLUTO
LIBSTRONGSWANBUILDDIR=$(top_builddir)/src/libstrongswan
log_to_stderr = TRUE;
/* initialize library */
- if (!library_init(STRONGSWAN_CONF))
+ if (!library_init(NULL))
{
library_deinit();
exit(SS_RC_LIBSTRONGSWAN_INTEGRITY);