starter: Load plugins specific to starter.
authorTobias Brunner <tobias@strongswan.org>
Fri, 21 Oct 2011 12:07:42 +0000 (14:07 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 21 Oct 2011 12:24:34 +0000 (14:24 +0200)
configure.in
src/starter/Makefile.am
src/starter/starter.c

index 6db8276..abde287 100644 (file)
@@ -752,6 +752,7 @@ m4_include(m4/macros/add-plugin.m4)
 # plugin lists for all components
 libcharon_plugins=
 pluto_plugins=
+starter_plugins=
 pool_plugins=
 openac_plugins=
 scepclient_plugins=
@@ -860,6 +861,7 @@ ADD_PLUGIN([unit-tester],          [c libcharon])
 
 AC_SUBST(libcharon_plugins)
 AC_SUBST(pluto_plugins)
+AC_SUBST(starter_plugins)
 AC_SUBST(pool_plugins)
 AC_SUBST(openac_plugins)
 AC_SUBST(scepclient_plugins)
index 6f7f288..c512898 100644 (file)
@@ -22,6 +22,7 @@ AM_CFLAGS = \
 -DIPSEC_EAPDIR=\"${eapdir}\" \
 -DDEV_RANDOM=\"${random_device}\" \
 -DDEV_URANDOM=\"${urandom_device}\" \
+-DPLUGINS=\""${starter_plugins}\"" \
 -DDEBUG
 
 AM_YFLAGS = -v -d
index 5cf842f..db3ca43 100644 (file)
@@ -465,6 +465,13 @@ int main (int argc, char **argv)
                }
        }
 
+       /* load plugins */
+       if (!lib->plugins->load(lib->plugins, NULL,
+                       lib->settings->get_str(lib->settings, "starter.load", PLUGINS)))
+       {
+               exit(LSB_RC_FAILURE);
+       }
+
        for (;;)
        {
                /*
@@ -484,6 +491,7 @@ int main (int argc, char **argv)
                        confread_free(cfg);
                        unlink(STARTER_PID_FILE);
                        plog("ipsec starter stopped");
+                       lib->plugins->unload(lib->plugins);
                        close_log();
                        exit(LSB_RC_SUCCESS);
                }