revert to standard TNCC/TNCS Initialization function
authorAndreas Steffen <andreas.steffen@strongswan.org>
Fri, 8 Oct 2010 22:35:45 +0000 (00:35 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Fri, 8 Oct 2010 22:35:45 +0000 (00:35 +0200)
src/libcharon/plugins/tnc_imc/tnc_imc_plugin.c
src/libcharon/plugins/tnc_imv/tnc_imv_plugin.c

index 43ba844..cc1d246 100644 (file)
@@ -32,7 +32,6 @@ METHOD(plugin_t, destroy, void,
 plugin_t *tnc_imc_plugin_create()
 {
        char *tnc_config, *pref_lang;
-       int imc_count;
        tnc_imc_plugin_t *this;
 
        INIT(this,
@@ -46,19 +45,12 @@ plugin_t *tnc_imc_plugin_create()
        tnc_config = lib->settings->get_str(lib->settings,
                                        "charon.plugins.tnc-imc.tnc_config", "/etc/tnc_config");
 
-       imc_count = libtnc_imc_load_config(tnc_config);
-       if (imc_count < 0)
+       if (libtnc_tncc_Initialize(tnc_config) != TNC_RESULT_SUCCESS)
        {
                free(this);
                DBG1(DBG_IKE, "TNC IMC initialization failed");
                return NULL;
        }
-       else
-       {
-               DBG1(DBG_IKE, "loaded %d TNC IMC%s", imc_count,
-                                                                                       (imc_count == 1) ? "":"s");
-               libtnc_tncc_PreferredLanguage(pref_lang);
-       }
 
        return &this->plugin;
 }
index af4d6e6..4b5c06b 100644 (file)
@@ -32,7 +32,6 @@ METHOD(plugin_t, destroy, void,
 plugin_t *tnc_imv_plugin_create()
 {
        char *tnc_config;
-       int imv_count;
        tnc_imv_plugin_t *this;
 
        INIT(this,
@@ -43,18 +42,12 @@ plugin_t *tnc_imv_plugin_create()
 
        tnc_config = lib->settings->get_str(lib->settings,
                                        "charon.plugins.tnc-imv.tnc_config", "/etc/tnc_config");
-       imv_count = libtnc_imv_load_config(tnc_config);
-       if (imv_count < 0)
+       if (libtnc_tncs_Initialize(tnc_config) != TNC_RESULT_SUCCESS)
        {
                free(this);
                DBG1(DBG_IKE, "TNC IMV initialization failed");
                return NULL;
        }
-       else
-       {
-               DBG1(DBG_IKE, "loaded %d TNC IMV%s", imv_count,
-                                                                                       (imv_count == 1) ? "":"s");
-       }
 
        return &this->plugin;
 }