diff options
author | Andreas Steffen <andreas.steffen@strongswan.org> | 2010-11-11 07:30:13 +0100 |
---|---|---|
committer | Andreas Steffen <andreas.steffen@strongswan.org> | 2010-11-11 07:30:13 +0100 |
commit | e2a0bea5d6b13f6ced6a04a3beef5a9dc7aadbe2 (patch) | |
tree | e484ddcc4ddb6d351b2f73bd589fa8469c4dbec1 /src/libcharon/plugins/tnc_imc | |
parent | c2835ef29f451226155b2ad413c98ead13a23ff0 (diff) | |
download | strongswan-e2a0bea5d6b13f6ced6a04a3beef5a9dc7aadbe2.tar.bz2 strongswan-e2a0bea5d6b13f6ced6a04a3beef5a9dc7aadbe2.tar.xz |
added get_preferred_language() to tnc_imc
Diffstat (limited to 'src/libcharon/plugins/tnc_imc')
-rw-r--r-- | src/libcharon/plugins/tnc_imc/tnc_imc_manager.c | 8 | ||||
-rw-r--r-- | src/libcharon/plugins/tnc_imc/tnc_imc_plugin.c | 9 |
2 files changed, 11 insertions, 6 deletions
diff --git a/src/libcharon/plugins/tnc_imc/tnc_imc_manager.c b/src/libcharon/plugins/tnc_imc/tnc_imc_manager.c index f8761672f..107c964a6 100644 --- a/src/libcharon/plugins/tnc_imc/tnc_imc_manager.c +++ b/src/libcharon/plugins/tnc_imc/tnc_imc_manager.c @@ -98,6 +98,13 @@ METHOD(imc_manager_t, get_count, int, return this->imcs->get_count(this->imcs); } +METHOD(imc_manager_t, get_preferred_language, char*, + private_tnc_imc_manager_t *this) +{ + return lib->settings->get_str(lib->settings, + "charon.plugins.tnc-imc.preferred_language", "en"); +} + METHOD(imc_manager_t, notify_connection_change, void, private_tnc_imc_manager_t *this, TNC_ConnectionID id, TNC_ConnectionState state) @@ -222,6 +229,7 @@ imc_manager_t* tnc_imc_manager_create(void) .add = _add, .remove = _remove_, /* avoid name conflict with stdio.h */ .get_count = _get_count, + .get_preferred_language = _get_preferred_language, .notify_connection_change = _notify_connection_change, .begin_handshake = _begin_handshake, .set_message_types = _set_message_types, diff --git a/src/libcharon/plugins/tnc_imc/tnc_imc_plugin.c b/src/libcharon/plugins/tnc_imc/tnc_imc_plugin.c index b6effba60..c132f3960 100644 --- a/src/libcharon/plugins/tnc_imc/tnc_imc_plugin.c +++ b/src/libcharon/plugins/tnc_imc/tnc_imc_plugin.c @@ -153,7 +153,7 @@ METHOD(plugin_t, destroy, void, */ plugin_t *tnc_imc_plugin_create() { - char *tnc_config, *pref_lang; + char *tnc_config; tnc_imc_plugin_t *this; INIT(this, @@ -162,15 +162,12 @@ plugin_t *tnc_imc_plugin_create() }, ); - pref_lang = lib->settings->get_str(lib->settings, - "charon.plugins.tnc-imc.preferred_language", "en"); - tnc_config = lib->settings->get_str(lib->settings, - "charon.plugins.tnc-imc.tnc_config", "/etc/tnc_config"); - /* Create IMC manager */ charon->imcs = tnc_imc_manager_create(); /* Load IMCs and abort if not all instances initalize successfully */ + tnc_config = lib->settings->get_str(lib->settings, + "charon.plugins.tnc-imc.tnc_config", "/etc/tnc_config"); if (!load_imcs(tnc_config)) { charon->imcs->destroy(charon->imcs); |