pluto uses optionsfrom from libstrongswan

This commit is contained in:
Andreas Steffen
2009-05-24 20:03:01 +02:00
parent 96d42f445e
commit 7d858a9d3c
+12 -2
View File
@@ -37,9 +37,11 @@
#endif /* CAPABILITIES */ #endif /* CAPABILITIES */
#include <freeswan.h> #include <freeswan.h>
#include <library.h> #include <library.h>
#include <debug.h> #include <debug.h>
#include <utils/enumerator.h> #include <utils/enumerator.h>
#include <utils/optionsfrom.h>
#include <pfkeyv2.h> #include <pfkeyv2.h>
#include <pfkey.h> #include <pfkey.h>
@@ -221,6 +223,9 @@ bool pkcs11_proxy = FALSE;
*/ */
static const char *pkcs11_init_args = NULL; static const char *pkcs11_init_args = NULL;
/* options read by optionsfrom */
options_t *options;
/** /**
* Log loaded plugins * Log loaded plugins
*/ */
@@ -255,7 +260,9 @@ int main(int argc, char **argv)
int keep[] = { CAP_NET_ADMIN, CAP_NET_BIND_SERVICE }; int keep[] = { CAP_NET_ADMIN, CAP_NET_BIND_SERVICE };
#endif /* CAPABILITIES */ #endif /* CAPABILITIES */
/* initialize library and optionsfrom */
library_init(STRONGSWAN_CONF); library_init(STRONGSWAN_CONF);
options = options_create();
/* handle arguments */ /* handle arguments */
for (;;) for (;;)
@@ -356,8 +363,10 @@ int main(int argc, char **argv)
break; /* not actually reached */ break; /* not actually reached */
case '+': /* --optionsfrom <filename> */ case '+': /* --optionsfrom <filename> */
optionsfrom(optarg, &argc, &argv, optind, stderr); if (!options->from(options, optarg, &argc, &argv, optind))
/* does not return on error */ {
exit_pluto(1);
}
continue; continue;
case 'd': /* --nofork*/ case 'd': /* --nofork*/
@@ -734,6 +743,7 @@ void exit_pluto(int status)
free_events(); /* free remaining events */ free_events(); /* free remaining events */
free_vendorid(); /* free all vendor id records */ free_vendorid(); /* free all vendor id records */
delete_lock(); delete_lock();
options->destroy(options);
library_deinit(); library_deinit();
close_log(); close_log();
exit(status); exit(status);