aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2009-05-24 20:03:01 +0200
committerAndreas Steffen <andreas.steffen@strongswan.org>2009-05-24 20:03:01 +0200
commit7d858a9d3cd89b9bd5d8542c9db5130a79269f6f (patch)
treec7e073b8b58b2fff5f6967d9e7d0c05769b5c7c0 /src
parent96d42f445eadf430f845c3513e2e7c97f09ffa87 (diff)
downloadstrongswan-7d858a9d3cd89b9bd5d8542c9db5130a79269f6f.tar.bz2
strongswan-7d858a9d3cd89b9bd5d8542c9db5130a79269f6f.tar.xz
pluto uses optionsfrom from libstrongswan
Diffstat (limited to 'src')
-rw-r--r--src/pluto/plutomain.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/pluto/plutomain.c b/src/pluto/plutomain.c
index f7d854352..ebd020100 100644
--- a/src/pluto/plutomain.c
+++ b/src/pluto/plutomain.c
@@ -37,9 +37,11 @@
#endif /* CAPABILITIES */
#include <freeswan.h>
+
#include <library.h>
#include <debug.h>
#include <utils/enumerator.h>
+#include <utils/optionsfrom.h>
#include <pfkeyv2.h>
#include <pfkey.h>
@@ -221,6 +223,9 @@ bool pkcs11_proxy = FALSE;
*/
static const char *pkcs11_init_args = NULL;
+/* options read by optionsfrom */
+options_t *options;
+
/**
* Log loaded plugins
*/
@@ -255,7 +260,9 @@ int main(int argc, char **argv)
int keep[] = { CAP_NET_ADMIN, CAP_NET_BIND_SERVICE };
#endif /* CAPABILITIES */
+ /* initialize library and optionsfrom */
library_init(STRONGSWAN_CONF);
+ options = options_create();
/* handle arguments */
for (;;)
@@ -356,8 +363,10 @@ int main(int argc, char **argv)
break; /* not actually reached */
case '+': /* --optionsfrom <filename> */
- optionsfrom(optarg, &argc, &argv, optind, stderr);
- /* does not return on error */
+ if (!options->from(options, optarg, &argc, &argv, optind))
+ {
+ exit_pluto(1);
+ }
continue;
case 'd': /* --nofork*/
@@ -734,6 +743,7 @@ void exit_pluto(int status)
free_events(); /* free remaining events */
free_vendorid(); /* free all vendor id records */
delete_lock();
+ options->destroy(options);
library_deinit();
close_log();
exit(status);