aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2010-12-04 10:07:56 +0100
committerAndreas Steffen <andreas.steffen@strongswan.org>2010-12-04 10:07:56 +0100
commit36e4aa7b9eb8f4ea3ee27a6df61c3495d87c015b (patch)
treeeb4a013dbf1b6b4ef529acdd75b3182d3f5f1ec4 /src
parentb5eeebe6578d9ce65b37706ea09599b1fef1b3bc (diff)
downloadstrongswan-36e4aa7b9eb8f4ea3ee27a6df61c3495d87c015b.tar.bz2
strongswan-36e4aa7b9eb8f4ea3ee27a6df61c3495d87c015b.tar.xz
Migrated x509_plugin_t to INIT/METHOD macros
Diffstat (limited to 'src')
-rw-r--r--src/libstrongswan/plugins/x509/x509_plugin.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/libstrongswan/plugins/x509/x509_plugin.c b/src/libstrongswan/plugins/x509/x509_plugin.c
index 11a7f023c..d40cc3567 100644
--- a/src/libstrongswan/plugins/x509/x509_plugin.c
+++ b/src/libstrongswan/plugins/x509/x509_plugin.c
@@ -36,10 +36,8 @@ struct private_x509_plugin_t {
x509_plugin_t public;
};
-/**
- * Implementation of x509_plugin_t.x509troy
- */
-static void destroy(private_x509_plugin_t *this)
+METHOD(plugin_t, destroy, void,
+ private_x509_plugin_t *this)
{
lib->creds->remove_builder(lib->creds,
(builder_function_t)x509_cert_gen);
@@ -69,9 +67,15 @@ static void destroy(private_x509_plugin_t *this)
*/
plugin_t *x509_plugin_create()
{
- private_x509_plugin_t *this = malloc_thing(private_x509_plugin_t);
+ private_x509_plugin_t *this;
- this->public.plugin.destroy = (void(*)(plugin_t*))destroy;
+ INIT(this,
+ .public = {
+ .plugin = {
+ .destroy = _destroy,
+ },
+ },
+ );
lib->creds->add_builder(lib->creds, CRED_CERTIFICATE, CERT_X509, FALSE,
(builder_function_t)x509_cert_gen);