Use name from initialization to access settings in libcharon.
authorTobias Brunner <tobias@strongswan.org>
Tue, 24 Apr 2012 12:10:06 +0000 (14:10 +0200)
committerTobias Brunner <tobias@strongswan.org>
Thu, 3 May 2012 11:57:04 +0000 (13:57 +0200)
Also fixes several whitespace errors.

56 files changed:
src/libcharon/daemon.c
src/libcharon/network/receiver.c
src/libcharon/network/sender.c
src/libcharon/plugins/android/android_logger.c
src/libcharon/plugins/certexpire/certexpire_export.c
src/libcharon/plugins/coupling/coupling_validator.c
src/libcharon/plugins/dhcp/dhcp_socket.c
src/libcharon/plugins/duplicheck/duplicheck_plugin.c
src/libcharon/plugins/eap_aka/eap_aka_server.c
src/libcharon/plugins/eap_aka_3gpp2/eap_aka_3gpp2_card.c
src/libcharon/plugins/eap_gtc/eap_gtc.c
src/libcharon/plugins/eap_peap/eap_peap.c
src/libcharon/plugins/eap_peap/eap_peap_server.c
src/libcharon/plugins/eap_radius/eap_radius.c
src/libcharon/plugins/eap_radius/eap_radius_dae.c
src/libcharon/plugins/eap_radius/eap_radius_forward.c
src/libcharon/plugins/eap_radius/eap_radius_plugin.c
src/libcharon/plugins/eap_sim/eap_sim_server.c
src/libcharon/plugins/eap_simaka_sql/eap_simaka_sql_plugin.c
src/libcharon/plugins/eap_tls/eap_tls.c
src/libcharon/plugins/eap_tnc/eap_tnc.c
src/libcharon/plugins/eap_ttls/eap_ttls.c
src/libcharon/plugins/eap_ttls/eap_ttls_server.c
src/libcharon/plugins/ha/ha_attribute.c
src/libcharon/plugins/ha/ha_plugin.c
src/libcharon/plugins/ha/ha_segments.c
src/libcharon/plugins/led/led_listener.c
src/libcharon/plugins/load_tester/load_tester_config.c
src/libcharon/plugins/load_tester/load_tester_creds.c
src/libcharon/plugins/load_tester/load_tester_listener.c
src/libcharon/plugins/load_tester/load_tester_plugin.c
src/libcharon/plugins/radattr/radattr_listener.c
src/libcharon/plugins/socket_default/socket_default_socket.c
src/libcharon/plugins/socket_dynamic/socket_dynamic_socket.c
src/libcharon/plugins/socket_raw/socket_raw_socket.c
src/libcharon/plugins/sql/sql_logger.c
src/libcharon/plugins/sql/sql_plugin.c
src/libcharon/plugins/stroke/stroke_cred.c
src/libcharon/plugins/stroke/stroke_socket.c
src/libcharon/plugins/tnc_ifmap/tnc_ifmap_soap.c
src/libcharon/plugins/tnc_imc/tnc_imc_manager.c
src/libcharon/plugins/tnc_imv/tnc_imv_manager.c
src/libcharon/plugins/tnc_pdp/tnc_pdp.c
src/libcharon/plugins/tnc_pdp/tnc_pdp_plugin.c
src/libcharon/plugins/whitelist/whitelist_listener.c
src/libcharon/plugins/xauth_eap/xauth_eap.c
src/libcharon/sa/ike_sa.c
src/libcharon/sa/ike_sa_manager.c
src/libcharon/sa/ikev1/task_manager_v1.c
src/libcharon/sa/ikev1/tasks/isakmp_vendor.c
src/libcharon/sa/ikev1/tasks/quick_mode.c
src/libcharon/sa/ikev2/task_manager_v2.c
src/libcharon/sa/ikev2/tasks/child_create.c
src/libcharon/sa/ikev2/tasks/ike_auth.c
src/libcharon/sa/ikev2/tasks/ike_cert_pre.c
src/libcharon/sa/ikev2/tasks/ike_vendor.c

index 2cf8d5e..7004ca7 100644 (file)
@@ -202,8 +202,8 @@ METHOD(daemon_t, start, void,
 {
        /* start the engine, go multithreaded */
        lib->processor->set_threads(lib->processor,
-                                               lib->settings->get_int(lib->settings, "charon.threads",
-                                                                                          DEFAULT_THREADS));
+                                               lib->settings->get_int(lib->settings, "%s.threads",
+                                                                                          DEFAULT_THREADS, charon->name));
 }
 
 METHOD(daemon_t, initialize, bool,
index fcc7304..89123b9 100644 (file)
@@ -529,25 +529,26 @@ receiver_t *receiver_create()
                .secret_offset = random() % now,
        );
 
-       if (lib->settings->get_bool(lib->settings, "charon.dos_protection", TRUE))
+       if (lib->settings->get_bool(lib->settings,
+                               "%s.dos_protection", TRUE, charon->name))
        {
                this->cookie_threshold = lib->settings->get_int(lib->settings,
-                                               "charon.cookie_threshold", COOKIE_THRESHOLD_DEFAULT);
+                               "%s.cookie_threshold", COOKIE_THRESHOLD_DEFAULT, charon->name);
                this->block_threshold = lib->settings->get_int(lib->settings,
-                                               "charon.block_threshold", BLOCK_THRESHOLD_DEFAULT);
+                               "%s.block_threshold", BLOCK_THRESHOLD_DEFAULT, charon->name);
        }
        this->init_limit_job_load = lib->settings->get_int(lib->settings,
-                                               "charon.init_limit_job_load", 0);
+                               "%s.init_limit_job_load", 0, charon->name);
        this->init_limit_half_open = lib->settings->get_int(lib->settings,
-                                               "charon.init_limit_half_open", 0);
+                               "%s.init_limit_half_open", 0, charon->name);
        this->receive_delay = lib->settings->get_int(lib->settings,
-                                               "charon.receive_delay", 0);
+                               "%s.receive_delay", 0, charon->name);
        this->receive_delay_type = lib->settings->get_int(lib->settings,
-                                               "charon.receive_delay_type", 0),
+                               "%s.receive_delay_type", 0, charon->name),
        this->receive_delay_request = lib->settings->get_bool(lib->settings,
-                                               "charon.receive_delay_request", TRUE),
+                               "%s.receive_delay_request", TRUE, charon->name),
        this->receive_delay_response = lib->settings->get_int(lib->settings,
-                                               "charon.receive_delay_response", TRUE),
+                               "%s.receive_delay_response", TRUE, charon->name),
 
        this->hasher = lib->crypto->create_hasher(lib->crypto, HASH_PREFERRED);
        if (this->hasher == NULL)
index 6d5ad8f..c0dabd0 100644 (file)
@@ -192,13 +192,13 @@ sender_t * sender_create()
                .job = callback_job_create_with_prio((callback_job_cb_t)send_packets,
                                                                                this, NULL, NULL, JOB_PRIO_CRITICAL),
                .send_delay = lib->settings->get_int(lib->settings,
-                                                                                       "charon.send_delay", 0),
+                                                               "%s.send_delay", 0, charon->name),
                .send_delay_type = lib->settings->get_int(lib->settings,
-                                                                                       "charon.send_delay_type", 0),
+                                                               "%s.send_delay_type", 0, charon->name),
                .send_delay_request = lib->settings->get_bool(lib->settings,
-                                                                                       "charon.send_delay_request", TRUE),
+                                                               "%s.send_delay_request", TRUE, charon->name),
                .send_delay_response = lib->settings->get_int(lib->settings,
-                                                                                       "charon.send_delay_response", TRUE),
+                                                               "%s.send_delay_response", TRUE, charon->name),
        );
 
        lib->processor->queue_job(lib->processor, (job_t*)this->job);
index d551f27..1f6042c 100644 (file)
@@ -99,7 +99,7 @@ android_logger_t *android_logger_create()
                },
                .mutex = mutex_create(MUTEX_TYPE_DEFAULT),
                .level = lib->settings->get_int(lib->settings,
-                                                                               "charon.plugins.android.loglevel", 1),
+                                                               "%s.plugins.android.loglevel", 1, charon->name),
        );
 
        return &this->public;
index c73b0be..87678fa 100644 (file)
@@ -364,21 +364,28 @@ certexpire_export_t *certexpire_export_create()
                                                                   (hashtable_equals_t)equals, 32),
                .mutex = mutex_create(MUTEX_TYPE_DEFAULT),
                .local_path = lib->settings->get_str(lib->settings,
-                                                       "charon.plugins.certexpire.csv.local", NULL),
+                                                               "%s.plugins.certexpire.csv.local",
+                                                               NULL, charon->name),
                .remote_path = lib->settings->get_str(lib->settings,
-                                                       "charon.plugins.certexpire.csv.remote", NULL),
+                                                               "%s.plugins.certexpire.csv.remote",
+                                                               NULL, charon->name),
                .separator = lib->settings->get_str(lib->settings,
-                                                       "charon.plugins.certexpire.csv.separator", ","),
+                                                               "%s.plugins.certexpire.csv.separator",
+                                                               ",", charon->name),
                .format = lib->settings->get_str(lib->settings,
-                                                       "charon.plugins.certexpire.csv.format", "%d:%m:%Y"),
+                                                               "%s.plugins.certexpire.csv.format",
+                                                               "%d:%m:%Y", charon->name),
                .fixed_fields = lib->settings->get_bool(lib->settings,
-                                                       "charon.plugins.certexpire.csv.fixed_fields", TRUE),
+                                                               "%s.plugins.certexpire.csv.fixed_fields",
+                                                               TRUE, charon->name),
                .empty_string = lib->settings->get_str(lib->settings,
-                                                       "charon.plugins.certexpire.csv.empty_string", ""),
+                                                               "%s.plugins.certexpire.csv.empty_string",
+                                                               "", charon->name),
        );
 
        cron = lib->settings->get_str(lib->settings,
-                                                                 "charon.plugins.certexpire.csv.cron", NULL);
+                                                                 "%s.plugins.certexpire.csv.cron",
+                                                                 NULL, charon->name);
        if (cron)
        {
                this->cron = certexpire_cron_create(cron,
index 06b6f7d..0289c55 100644 (file)
@@ -216,11 +216,13 @@ coupling_validator_t *coupling_validator_create()
                },
                .mutex = mutex_create(MUTEX_TYPE_DEFAULT),
                .max_couplings = lib->settings->get_int(lib->settings,
-                                                                         "charon.plugins.coupling.max", 1),
+                                                                                               "%s.plugins.coupling.max", 1,
+                                                                                               charon->name),
        );
 
        hash = lib->settings->get_str(lib->settings,
-                                                                 "charon.plugins.coupling.hash", "sha1");
+                                                                 "%s.plugins.coupling.hash", "sha1",
+                                                                 charon->name);
        for (i = 0; i < countof(hash_types); i++)
        {
                if (strcaseeq(hash_types[i].name, hash))
@@ -238,7 +240,8 @@ coupling_validator_t *coupling_validator_create()
        }
 
        path = lib->settings->get_str(lib->settings,
-                                                                 "charon.plugins.coupling.file", NULL);
+                                                                 "%s.plugins.coupling.file", NULL,
+                                                                 charon->name);
        if (!path)
        {
                DBG1(DBG_CFG, "coupling file path unspecified");
index 5d98e5b..091d91c 100644 (file)
@@ -704,10 +704,11 @@ dhcp_socket_t *dhcp_socket_create()
                return NULL;
        }
        this->identity_lease = lib->settings->get_bool(lib->settings,
-                                                       "charon.plugins.dhcp.identity_lease", FALSE);
+                                                               "%s.plugins.dhcp.identity_lease", FALSE,
+                                                               charon->name);
        this->dst = host_create_from_string(lib->settings->get_str(lib->settings,
-                                                       "charon.plugins.dhcp.server", "255.255.255.255"),
-                                                       DHCP_SERVER_PORT);
+                                                               "%s.plugins.dhcp.server", "255.255.255.255",
+                                                               charon->name), DHCP_SERVER_PORT);
        if (!this->dst)
        {
                DBG1(DBG_CFG, "configured DHCP server address invalid");
index df28e7f..100ef0c 100644 (file)
@@ -66,7 +66,7 @@ plugin_t *duplicheck_plugin_create()
        private_duplicheck_plugin_t *this;
 
        if (!lib->settings->get_bool(lib->settings,
-                                                                "charon.plugins.duplicheck.enable", TRUE))
+                                                       "%s.plugins.duplicheck.enable", TRUE, charon->name))
        {
                return NULL;
        }
index d8e85ce..319cc45 100644 (file)
@@ -691,7 +691,7 @@ eap_aka_server_t *eap_aka_server_create(identification_t *server,
        this->permanent = peer->clone(peer);
        this->use_reauth = this->use_pseudonym = this->use_permanent =
                lib->settings->get_bool(lib->settings,
-                                                               "charon.plugins.eap-aka.request_identity", TRUE);
+                                       "%s.plugins.eap-aka.request_identity", TRUE, charon->name);
 
        /* generate a non-zero identifier */
        do {
index cec06fb..2425833 100644 (file)
@@ -160,12 +160,13 @@ eap_aka_3gpp2_card_t *eap_aka_3gpp2_card_create(eap_aka_3gpp2_functions_t *f)
                },
                .f = f,
                .seq_check = lib->settings->get_bool(lib->settings,
-                                                                       "charon.plugins.eap-aka-3gpp2.seq_check",
+                                                                       "%s.plugins.eap-aka-3gpp2.seq_check",
 #ifdef SEQ_CHECK /* handle legacy compile time configuration as default */
-                                                                       TRUE),
+                                                                       TRUE,
 #else /* !SEQ_CHECK */
-                                                                       FALSE),
+                                                                       FALSE,
 #endif /* SEQ_CHECK */
+                                                                       charon->name),
        );
 
        eap_aka_3gpp2_get_sqn(this->sqn, 0);
index c3ab07d..9c26213 100644 (file)
@@ -218,7 +218,8 @@ METHOD(eap_method_t, process_server, status_t,
        password[data.len] = '\0';
 
        service = lib->settings->get_str(lib->settings,
-                                               "charon.plugins.eap-gtc.pam_service", GTC_PAM_SERVICE);
+                                                       "%s.plugins.eap-gtc.pam_service", GTC_PAM_SERVICE,
+                                                       charon->name);
 
        if (!authenticate(service, user, password))
        {
index bd426bb..8aba703 100644 (file)
@@ -156,16 +156,19 @@ static eap_peap_t *eap_peap_create(private_eap_peap_t * this,
        tls_t *tls;
 
        if (is_server && !lib->settings->get_bool(lib->settings,
-                                                       "charon.plugins.eap-peap.request_peer_auth", FALSE))
+                                                               "%s.plugins.eap-peap.request_peer_auth", FALSE,
+                                                               charon->name))
        {
                peer = NULL;
        }
        frag_size = lib->settings->get_int(lib->settings,
-                                       "charon.plugins.eap-peap.fragment_size", MAX_FRAGMENT_LEN);
+                                       "%s.plugins.eap-peap.fragment_size", MAX_FRAGMENT_LEN,
+                                       charon->name);
        max_msg_count = lib->settings->get_int(lib->settings,
-                                       "charon.plugins.eap-peap.max_message_count", MAX_MESSAGE_COUNT);
+                                       "%s.plugins.eap-peap.max_message_count", MAX_MESSAGE_COUNT,
+                                       charon->name);
        include_length = lib->settings->get_bool(lib->settings,
-                                       "charon.plugins.eap-peap.include_length", FALSE);
+                                       "%s.plugins.eap-peap.include_length", FALSE, charon->name);
        tls = tls_create(is_server, server, peer, TLS_PURPOSE_EAP_PEAP,
                                         application, NULL);
        this->tls_eap = tls_eap_create(EAP_PEAP, tls, frag_size, max_msg_count,
@@ -180,7 +183,7 @@ static eap_peap_t *eap_peap_create(private_eap_peap_t * this,
 }
 
 eap_peap_t *eap_peap_create_server(identification_t *server,
-                                                                  identification_t *peer)
+                                                                  identification_t *peer)
 {
        private_eap_peap_t *eap_peap;
        eap_method_t *eap_method;
index 4acdd9f..0e80465 100644 (file)
@@ -91,7 +91,8 @@ static status_t start_phase2_auth(private_eap_peap_server_t *this)
        eap_type_t type;
 
        eap_type_str = lib->settings->get_str(lib->settings,
-                                               "charon.plugins.eap-peap.phase2_method", "mschapv2");
+                                                       "%s.plugins.eap-peap.phase2_method", "mschapv2",
+                                                       charon->name);
        type = eap_type_from_string(eap_type_str);
        if (type == 0)
        {
@@ -128,7 +129,7 @@ static status_t start_phase2_auth(private_eap_peap_server_t *this)
 static status_t start_phase2_tnc(private_eap_peap_server_t *this)
 {
        if (this->start_phase2_tnc && lib->settings->get_bool(lib->settings,
-                                               "charon.plugins.eap-peap.phase2_tnc", FALSE))
+                                               "%s.plugins.eap-peap.phase2_tnc", FALSE, charon->name))
        {
                DBG1(DBG_IKE, "phase2 method %N selected", eap_type_names, EAP_TNC);
                this->ph2_method = charon->eap->create_instance(charon->eap, EAP_TNC,
@@ -197,7 +198,7 @@ METHOD(tls_application_t, process, status_t,
        {
                received_type = in->get_type(in, &received_vendor);
                DBG1(DBG_IKE, "received tunneled EAP-PEAP AVP [EAP/%N/%N]",
-                                                               eap_code_short_names, code,
+                                                               eap_code_short_names, code,
                                                                eap_type_short_names, received_type);
                if (code != EAP_RESPONSE)
                {
@@ -209,7 +210,7 @@ METHOD(tls_application_t, process, status_t,
        else
        {
                DBG1(DBG_IKE, "received tunneled EAP-PEAP AVP [EAP/%N]",
-                                                               eap_code_short_names, code);
+                                                               eap_code_short_names, code);
 
                /* if EAP_SUCCESS check if to continue phase2 with EAP-TNC */
                return (this->phase2_result == EAP_SUCCESS && code == EAP_SUCCESS) ?
@@ -273,7 +274,7 @@ METHOD(tls_application_t, process, status_t,
 
                /* Start Phase 2 of EAP-PEAP authentication */
                if (lib->settings->get_bool(lib->settings,
-                                               "charon.plugins.eap-peap.request_peer_auth", FALSE))
+                               "%s.plugins.eap-peap.request_peer_auth", FALSE, charon->name))
                {
                        return start_phase2_tnc(this);
                }
@@ -302,10 +303,10 @@ METHOD(tls_application_t, process, status_t,
                        this->ph2_method->destroy(this->ph2_method);
                        this->ph2_method = NULL;
 
-                       /* EAP-PEAP requires the sending of an inner EAP_SUCCESS message */     
-                       this->phase2_result = EAP_SUCCESS;              
+                       /* EAP-PEAP requires the sending of an inner EAP_SUCCESS message */
+                       this->phase2_result = EAP_SUCCESS;
                        this->out = eap_payload_create_code(this->phase2_result, 1 +
-                                                       this->ph1_method->get_identifier(this->ph1_method));
+                                                       this->ph1_method->get_identifier(this->ph1_method));
                        return NEED_MORE;
                case NEED_MORE:
                        break;
@@ -321,9 +322,9 @@ METHOD(tls_application_t, process, status_t,
                                DBG1(DBG_IKE, "%N method failed", eap_type_names, type);
                        }
                        /* EAP-PEAP requires the sending of an inner EAP_FAILURE message */
-                       this->phase2_result = EAP_FAILURE;                      
+                       this->phase2_result = EAP_FAILURE;
                        this->out = eap_payload_create_code(this->phase2_result, 1 +
-                                                       this->ph1_method->get_identifier(this->ph1_method));
+                                                       this->ph1_method->get_identifier(this->ph1_method));
                        return NEED_MORE;
        }
        return status;
@@ -360,7 +361,7 @@ METHOD(tls_application_t, build, status_t,
                this->ph2_method->initiate(this->ph2_method, &this->out);
                this->start_phase2 = FALSE;
        }
-       
+
        this->start_phase2_id = TRUE;
 
        if (this->out)
@@ -423,7 +424,8 @@ eap_peap_server_t *eap_peap_server_create(identification_t *server,
                .start_phase2 = TRUE,
                .start_phase2_tnc = TRUE,
                .start_phase2_id = lib->settings->get_bool(lib->settings,
-                                                       "charon.plugins.eap-peap.phase2_piggyback", FALSE),
+                                                                               "%s.plugins.eap-peap.phase2_piggyback",
+                                                                               FALSE, charon->name),
                .phase2_result = EAP_FAILURE,
                .avp = eap_peap_avp_create(TRUE),
        );
index c0a3703..ed142b2 100644 (file)
@@ -453,14 +453,17 @@ eap_radius_t *eap_radius_create(identification_t *server, identification_t *peer
                /* initially EAP_RADIUS, but is set to the method selected by RADIUS */
                .type = EAP_RADIUS,
                .eap_start = lib->settings->get_bool(lib->settings,
-                                                               "charon.plugins.eap-radius.eap_start", FALSE),
+                                                                       "%s.plugins.eap-radius.eap_start", FALSE,
+                                                                       charon->name),
                .id_prefix = lib->settings->get_str(lib->settings,
-                                                               "charon.plugins.eap-radius.id_prefix", ""),
+                                                                       "%s.plugins.eap-radius.id_prefix", "",
+                                                                       charon->name),
                .class_group = lib->settings->get_bool(lib->settings,
-                                                               "charon.plugins.eap-radius.class_group", FALSE),
+                                                                       "%s.plugins.eap-radius.class_group", FALSE,
+                                                                       charon->name),
                .filter_id = lib->settings->get_bool(lib->settings,
-                                                               "charon.plugins.eap-radius.filter_id", FALSE),
-
+                                                                       "%s.plugins.eap-radius.filter_id", FALSE,
+                                                                       charon->name),
        );
        this->client = eap_radius_create_client();
        if (!this->client)
index e84fe5b..967c731 100644 (file)
@@ -456,9 +456,11 @@ static bool open_socket(private_eap_radius_dae_t *this)
 
        host = host_create_from_string(
                                lib->settings->get_str(lib->settings,
-                                       "charon.plugins.eap-radius.dae.listen", "0.0.0.0"),
+                                               "%s.plugins.eap-radius.dae.listen", "0.0.0.0",
+                                               charon->name),
                                lib->settings->get_int(lib->settings,
-                                       "charon.plugins.eap-radius.dae.port", RADIUS_DAE_PORT));
+                                               "%s.plugins.eap-radius.dae.port", RADIUS_DAE_PORT,
+                                               charon->name));
        if (!host)
        {
                DBG1(DBG_CFG, "invalid RADIUS DAE listen address");
@@ -508,7 +510,8 @@ eap_radius_dae_t *eap_radius_dae_create(eap_radius_accounting_t *accounting)
                .fd = -1,
                .secret = {
                        .ptr = lib->settings->get_str(lib->settings,
-                                                       "charon.plugins.eap-radius.dae.secret", NULL),
+                                                                       "%s.plugins.eap-radius.dae.secret", NULL,
+                                                                       charon->name),
                },
                .hasher = lib->crypto->create_hasher(lib->crypto, HASH_MD5),
                .signer = lib->crypto->create_signer(lib->crypto, AUTH_HMAC_MD5_128),
index 16701bb..2dd38ea 100644 (file)
@@ -436,9 +436,11 @@ eap_radius_forward_t *eap_radius_forward_create()
                        .destroy = _destroy,
                },
                .from_attr = parse_selector(lib->settings->get_str(lib->settings,
-                                               "charon.plugins.eap-radius.forward.ike_to_radius", "")),
+                                                       "%s.plugins.eap-radius.forward.ike_to_radius", "",
+                                                       charon->name)),
                .to_attr = parse_selector(lib->settings->get_str(lib->settings,
-                                               "charon.plugins.eap-radius.forward.radius_to_ike", "")),
+                                                       "%s.plugins.eap-radius.forward.radius_to_ike", "",
+                                                       charon->name)),
                .from = hashtable_create((hashtable_hash_t)hash,
                                                (hashtable_equals_t)equals, 8),
                .to = hashtable_create((hashtable_hash_t)hash,
index 8ee0ab8..9d4bbe1 100644 (file)
@@ -90,22 +90,23 @@ static void load_configs(private_eap_radius_plugin_t *this)
        int auth_port, acct_port, sockets, preference;
 
        address = lib->settings->get_str(lib->settings,
-                                       "charon.plugins.eap-radius.server", NULL);
+                                       "%s.plugins.eap-radius.server", NULL, charon->name);
        if (address)
        {       /* legacy configuration */
                secret = lib->settings->get_str(lib->settings,
-                                       "charon.plugins.eap-radius.secret", NULL);
+                                       "%s.plugins.eap-radius.secret", NULL, charon->name);
                if (!secret)
                {
                        DBG1(DBG_CFG, "no RADUIS secret defined");
                        return;
                }
                nas_identifier = lib->settings->get_str(lib->settings,
-                                       "charon.plugins.eap-radius.nas_identifier", "strongSwan");
+                                       "%s.plugins.eap-radius.nas_identifier", "strongSwan",
+                                       charon->name);
                auth_port = lib->settings->get_int(lib->settings,
-                                       "charon.plugins.eap-radius.port", AUTH_PORT);
+                                       "%s.plugins.eap-radius.port", AUTH_PORT, charon->name);
                sockets = lib->settings->get_int(lib->settings,
-                                       "charon.plugins.eap-radius.sockets", 1);
+                                       "%s.plugins.eap-radius.sockets", 1, charon->name);
                config = radius_config_create(address, address, auth_port, ACCT_PORT,
                                                                          nas_identifier, secret, sockets, 0);
                if (!config)
@@ -118,38 +119,43 @@ static void load_configs(private_eap_radius_plugin_t *this)
        }
 
        enumerator = lib->settings->create_section_enumerator(lib->settings,
-                                                                               "charon.plugins.eap-radius.servers");
+                                                               "%s.plugins.eap-radius.servers", charon->name);
        while (enumerator->enumerate(enumerator, &section))
        {
                address = lib->settings->get_str(lib->settings,
-                       "charon.plugins.eap-radius.servers.%s.address", NULL, section);
+                                                       "%s.plugins.eap-radius.servers.%s.address", NULL,
+                                                       charon->name, section);
                if (!address)
                {
                        DBG1(DBG_CFG, "RADIUS server '%s' misses address, skipped", section);
                        continue;
                }
                secret = lib->settings->get_str(lib->settings,
-                       "charon.plugins.eap-radius.servers.%s.secret", NULL, section);
+                                                       "%s.plugins.eap-radius.servers.%s.secret", NULL,
+                                                       charon->name, section);
                if (!secret)
                {
                        DBG1(DBG_CFG, "RADIUS server '%s' misses secret, skipped", section);
                        continue;
                }
                nas_identifier = lib->settings->get_str(lib->settings,
-                       "charon.plugins.eap-radius.servers.%s.nas_identifier",
-                       "strongSwan", section);
+                               "%s.plugins.eap-radius.servers.%s.nas_identifier", "strongSwan",
+                               charon->name, section);
                auth_port = lib->settings->get_int(lib->settings,
-                       "charon.plugins.eap-radius.servers.%s.auth_port",
+                       "%s.plugins.eap-radius.servers.%s.auth_port",
                                lib->settings->get_int(lib->settings,
-                                       "charon.plugins.eap-radius.servers.%s.port",
-                                       AUTH_PORT, section),
-                       section);
+                                       "%s.plugins.eap-radius.servers.%s.port",
+                                       AUTH_PORT, charon->name, section),
+                       charon->name, section);
                acct_port = lib->settings->get_int(lib->settings,
-                       "charon.plugins.eap-radius.servers.%s.acct_port", ACCT_PORT, section);
+                               "%s.plugins.eap-radius.servers.%s.acct_port", ACCT_PORT,
+                               charon->name, section);
                sockets = lib->settings->get_int(lib->settings,
-                       "charon.plugins.eap-radius.servers.%s.sockets", 1, section);
+                               "%s.plugins.eap-radius.servers.%s.sockets", 1,
+                               charon->name, section);
                preference = lib->settings->get_int(lib->settings,
-                       "charon.plugins.eap-radius.servers.%s.preference", 0, section);
+                               "%s.plugins.eap-radius.servers.%s.preference", 0,
+                               charon->name, section);
                config = radius_config_create(section, address, auth_port, acct_port,
                                                                nas_identifier, secret, sockets, preference);
                if (!config)
@@ -242,12 +248,12 @@ plugin_t *eap_radius_plugin_create()
        instance = this;
 
        if (lib->settings->get_bool(lib->settings,
-                                               "charon.plugins.eap-radius.accounting", FALSE))
+                                       "%s.plugins.eap-radius.accounting", FALSE, charon->name))
        {
                charon->bus->add_listener(charon->bus, &this->accounting->listener);
        }
        if (lib->settings->get_bool(lib->settings,
-                                               "charon.plugins.eap-radius.dae.enable", FALSE))
+                                       "%s.plugins.eap-radius.dae.enable", FALSE, charon->name))
        {
                this->dae = eap_radius_dae_create(this->accounting);
        }
index e0f7e92..a965476 100644 (file)
@@ -604,7 +604,8 @@ eap_sim_server_t *eap_sim_server_create(identification_t *server,
        this->permanent = peer->clone(peer);
        this->use_reauth = this->use_pseudonym = this->use_permanent =
                lib->settings->get_bool(lib->settings,
-                                                               "charon.plugins.eap-sim.request_identity", TRUE);
+                                                               "%s.plugins.eap-sim.request_identity", TRUE,
+                                                               charon->name);
 
        /* generate a non-zero identifier */
        do {
index 6e590fa..6bcc58e 100644 (file)
@@ -65,7 +65,8 @@ static bool load_db(private_eap_simaka_sql_t *this,
                char *uri;
 
                uri = lib->settings->get_str(lib->settings,
-                                                       "charon.plugins.eap-simaka-sql.database", NULL);
+                                                                        "%s.plugins.eap-simaka-sql.database", NULL,
+                                                                        charon->name);
                if (!uri)
                {
                        DBG1(DBG_CFG, "eap-simaka-sql database URI missing");
@@ -78,7 +79,8 @@ static bool load_db(private_eap_simaka_sql_t *this,
                        return FALSE;
                }
                remove_used = lib->settings->get_bool(lib->settings,
-                                                       "charon.plugins.eap-simaka-sql.remove_used", FALSE);
+                                                               "%s.plugins.eap-simaka-sql.remove_used", FALSE,
+                                                               charon->name);
 
                this->provider = eap_simaka_sql_provider_create(this->db, remove_used);
                this->card = eap_simaka_sql_card_create(this->db, remove_used);
index dc0289b..48e3875 100644 (file)
@@ -144,11 +144,13 @@ static eap_tls_t *eap_tls_create(identification_t *server,
        );
 
        frag_size = lib->settings->get_int(lib->settings,
-                                       "charon.plugins.eap-tls.fragment_size", MAX_FRAGMENT_LEN);
+                                       "%s.plugins.eap-tls.fragment_size", MAX_FRAGMENT_LEN,
+                                       charon->name);
        max_msg_count = lib->settings->get_int(lib->settings,
-                                       "charon.plugins.eap-tls.max_message_count", MAX_MESSAGE_COUNT);
+                                       "%s.plugins.eap-tls.max_message_count", MAX_MESSAGE_COUNT,
+                                       charon->name);
        include_length = lib->settings->get_bool(lib->settings,
-                                       "charon.plugins.eap-tls.include_length", TRUE);
+                                       "%s.plugins.eap-tls.include_length", TRUE, charon->name);
        tls = tls_create(is_server, server, peer, TLS_PURPOSE_EAP_TLS, NULL, NULL);
        this->tls_eap = tls_eap_create(EAP_TLS, tls, frag_size, max_msg_count,
                                                                                                 include_length);
index 33a83ba..c16f5c8 100644 (file)
@@ -40,7 +40,7 @@ struct private_eap_tnc_t {
 
 
 /** Maximum number of EAP-TNC messages/fragments allowed */
-#define MAX_MESSAGE_COUNT 10 
+#define MAX_MESSAGE_COUNT 10
 /** Default size of a EAP-TNC fragment */
 #define MAX_FRAGMENT_LEN 50000
 
@@ -147,13 +147,15 @@ static eap_tnc_t *eap_tnc_create(identification_t *server,
        );
 
        frag_size = lib->settings->get_int(lib->settings,
-                                       "charon.plugins.eap-tnc.fragment_size", MAX_FRAGMENT_LEN);
+                                       "%s.plugins.eap-tnc.fragment_size", MAX_FRAGMENT_LEN,
+                                       charon->name);
        max_msg_count = lib->settings->get_int(lib->settings,
-                                       "charon.plugins.eap-tnc.max_message_count", MAX_MESSAGE_COUNT);
+                                       "%s.plugins.eap-tnc.max_message_count", MAX_MESSAGE_COUNT,
+                                       charon->name);
        include_length = lib->settings->get_bool(lib->settings,
-                                       "charon.plugins.eap-tnc.include_length", TRUE);
-       protocol = lib->settings->get_str(lib->settings,
-                                       "charon.plugins.eap-tnc.protocol", "tnccs-1.1");
+                                       "%s.plugins.eap-tnc.include_length", TRUE, charon->name);
+       protocol = lib->settings->get_str(lib->settings,
+                                       "%s.plugins.eap-tnc.protocol", "tnccs-1.1", charon->name);
        if (strcaseeq(protocol, "tnccs-2.0"))
        {
                type = TNCCS_2_0;
index ace62f6..ebd1c54 100644 (file)
@@ -146,16 +146,19 @@ static eap_ttls_t *eap_ttls_create(identification_t *server,
                },
        );
        if (is_server && !lib->settings->get_bool(lib->settings,
-                                                       "charon.plugins.eap-ttls.request_peer_auth", FALSE))
+                                                               "%s.plugins.eap-ttls.request_peer_auth", FALSE,
+                                                               charon->name))
        {
                peer = NULL;
        }
        frag_size = lib->settings->get_int(lib->settings,
-                                       "charon.plugins.eap-ttls.fragment_size", MAX_FRAGMENT_LEN);
+                                       "%s.plugins.eap-ttls.fragment_size", MAX_FRAGMENT_LEN,
+                                       charon->name);
        max_msg_count = lib->settings->get_int(lib->settings,
-                                       "charon.plugins.eap-ttls.max_message_count", MAX_MESSAGE_COUNT);
+                                       "%s.plugins.eap-ttls.max_message_count", MAX_MESSAGE_COUNT,
+                                       charon->name);
        include_length = lib->settings->get_bool(lib->settings,
-                                       "charon.plugins.eap-ttls.include_length", TRUE);
+                                       "%s.plugins.eap-ttls.include_length", TRUE, charon->name);
        tls = tls_create(is_server, server, peer, TLS_PURPOSE_EAP_TTLS,
                                         application, NULL);
        this->tls_eap = tls_eap_create(EAP_TTLS, tls, frag_size, max_msg_count,
@@ -170,7 +173,7 @@ static eap_ttls_t *eap_ttls_create(identification_t *server,
 }
 
 eap_ttls_t *eap_ttls_create_server(identification_t *server,
-                                                                  identification_t *peer)
+                                                                  identification_t *peer)
 {
        return eap_ttls_create(server, peer, TRUE,
                                                   &eap_ttls_server_create(server, peer)->application);
index d241765..1418d6a 100644 (file)
@@ -78,7 +78,8 @@ static status_t start_phase2_auth(private_eap_ttls_server_t *this)
        eap_type_t type;
 
        eap_type_str = lib->settings->get_str(lib->settings,
-                                               "charon.plugins.eap-ttls.phase2_method", "md5");
+                                                                       "%s.plugins.eap-ttls.phase2_method", "md5",
+                                                                       charon->name);
        type = eap_type_from_string(eap_type_str);
        if (type == 0)
        {
@@ -110,7 +111,7 @@ static status_t start_phase2_auth(private_eap_ttls_server_t *this)
 static status_t start_phase2_tnc(private_eap_ttls_server_t *this)
 {
        if (this->start_phase2_tnc && lib->settings->get_bool(lib->settings,
-                                               "charon.plugins.eap-ttls.phase2_tnc", FALSE))
+                                               "%s.plugins.eap-ttls.phase2_tnc", FALSE, charon->name))
        {
                DBG1(DBG_IKE, "phase2 method %N selected", eap_type_names, EAP_TNC);
                this->method = charon->eap->create_instance(charon->eap, EAP_TNC,
@@ -168,7 +169,7 @@ METHOD(tls_application_t, process, status_t,
        code = in->get_code(in);
        received_type = in->get_type(in, &received_vendor);
        DBG1(DBG_IKE, "received tunneled EAP-TTLS AVP [EAP/%N/%N]",
-                                                       eap_code_short_names, code,
+                                                       eap_code_short_names, code,
                                                        eap_type_short_names, received_type);
        if (code != EAP_RESPONSE)
        {
@@ -234,7 +235,7 @@ METHOD(tls_application_t, process, status_t,
 
                /* Start Phase 2 of EAP-TTLS authentication */
                if (lib->settings->get_bool(lib->settings,
-                                               "charon.plugins.eap-ttls.request_peer_auth", FALSE))
+                               "%s.plugins.eap-ttls.request_peer_auth", FALSE, charon->name))
                {
                        return start_phase2_tnc(this);
                }
@@ -279,7 +280,7 @@ METHOD(tls_application_t, process, status_t,
                                DBG1(DBG_IKE, "%N method failed", eap_type_names, type);
                        }
                        return FAILED;
-       }
+       }
        return status;
 }
 
@@ -293,7 +294,7 @@ METHOD(tls_application_t, build, status_t,
 
        if (this->method == NULL && this->start_phase2 &&
                lib->settings->get_bool(lib->settings,
-                               "charon.plugins.eap-ttls.phase2_piggyback", FALSE))
+                               "%s.plugins.eap-ttls.phase2_piggyback", FALSE, charon->name))
        {
                /* generate an EAP Identity request which will be piggybacked right
                 * onto the TLS Finished message thus initiating EAP-TTLS phase2
index b08abe1..64bd2b8 100644 (file)
@@ -281,7 +281,7 @@ static void load_pools(private_ha_attribute_t *this)
        pool_t *pool;
 
        enumerator = lib->settings->create_key_value_enumerator(lib->settings,
-                                                                                                       "charon.plugins.ha.pools");
+                                                                               "%s.plugins.ha.pools", charon->name);
        while (enumerator->enumerate(enumerator, &name, &net))
        {
                net = strdup(net);
index b4bde5e..255eeaf 100644 (file)
@@ -128,19 +128,19 @@ plugin_t *ha_plugin_create()
        bool fifo, monitor, resync;
 
        local = lib->settings->get_str(lib->settings,
-                                                               "charon.plugins.ha.local", NULL);
+                                                       "%s.plugins.ha.local", NULL, charon->name);
        remote = lib->settings->get_str(lib->settings,
-                                                               "charon.plugins.ha.remote", NULL);
+                                                       "%s.plugins.ha.remote", NULL, charon->name);
        secret = lib->settings->get_str(lib->settings,
-                                                               "charon.plugins.ha.secret", NULL);
+                                                       "%s.plugins.ha.secret", NULL, charon->name);
        fifo = lib->settings->get_bool(lib->settings,
-                                                               "charon.plugins.ha.fifo_interface", TRUE);
+                                                       "%s.plugins.ha.fifo_interface", TRUE, charon->name);
        monitor = lib->settings->get_bool(lib->settings,
-                                                               "charon.plugins.ha.monitor", TRUE);
+                                                       "%s.plugins.ha.monitor", TRUE, charon->name);
        resync = lib->settings->get_bool(lib->settings,
-                                                               "charon.plugins.ha.resync", TRUE);
+                                                       "%s.plugins.ha.resync", TRUE, charon->name);
        count = min(SEGMENTS_MAX, lib->settings->get_int(lib->settings,
-                                                               "charon.plugins.ha.segment_count", 1));
+                                                       "%s.plugins.ha.segment_count", 1, charon->name));
        if (!local || !remote)
        {
                DBG1(DBG_CFG, "HA config misses local/remote address");
index c5a1806..f947970 100644 (file)
@@ -398,9 +398,11 @@ ha_segments_t *ha_segments_create(ha_socket_t *socket, ha_kernel_t *kernel,
                .mutex = mutex_create(MUTEX_TYPE_DEFAULT),
                .condvar = condvar_create(CONDVAR_TYPE_DEFAULT),
                .heartbeat_delay = lib->settings->get_int(lib->settings,
-                       "charon.plugins.ha.heartbeat_delay", DEFAULT_HEARTBEAT_DELAY),
+                               "%s.plugins.ha.heartbeat_delay", DEFAULT_HEARTBEAT_DELAY,
+                               charon->name),
                .heartbeat_timeout = lib->settings->get_int(lib->settings,
-                       "charon.plugins.ha.heartbeat_timeout", DEFAULT_HEARTBEAT_TIMEOUT),
+                               "%s.plugins.ha.heartbeat_timeout", DEFAULT_HEARTBEAT_TIMEOUT,
+                               charon->name),
        );
 
        if (monitor)
index 9d6c5a6..be80bcd 100644 (file)
@@ -230,11 +230,12 @@ led_listener_t *led_listener_create()
                },
                .mutex = mutex_create(MUTEX_TYPE_DEFAULT),
                .blink_time = lib->settings->get_int(lib->settings,
-                               "charon.plugins.led.blink_time", 50),
+                                                       "%s.plugins.led.blink_time", 50, charon->name),
        );
 
        this->activity = open_led(lib->settings->get_str(lib->settings,
-                               "charon.plugins.led.activity_led", NULL), &this->activity_max);
+                                                       "%s.plugins.led.activity_led", NULL, charon->name),
+                                                       &this->activity_max);
        set_led(this->activity, 0);
 
        return &this->public;
index 83853b8..684ce08 100644 (file)
@@ -336,41 +336,42 @@ load_tester_config_t *load_tester_config_create()
        );
 
        if (lib->settings->get_bool(lib->settings,
-                               "charon.plugins.load-tester.request_virtual_ip", FALSE))
+                       "%s.plugins.load-tester.request_virtual_ip", FALSE, charon->name))
        {
                this->vip = host_create_from_string("0.0.0.0", 0);
        }
        this->pool = lib->settings->get_str(lib->settings,
-                               "charon.plugins.load-tester.pool", NULL);
+                       "%s.plugins.load-tester.pool", NULL, charon->name);
        this->remote = lib->settings->get_str(lib->settings,
-                               "charon.plugins.load-tester.remote", "127.0.0.1");
+                       "%s.plugins.load-tester.remote", "127.0.0.1", charon->name);
 
        this->proposal = proposal_create_from_string(PROTO_IKE,
-                       lib->settings->get_str(lib->settings,
-                               "charon.plugins.load-tester.proposal", "aes128-sha1-modp768"));
+                               lib->settings->get_str(lib->settings,
+                                       "%s.plugins.load-tester.proposal", "aes128-sha1-modp768",
+                                       charon->name));
        if (!this->proposal)
        {       /* fallback */
                this->proposal = proposal_create_from_string(PROTO_IKE,
                                                                                                         "aes128-sha1-modp768");
        }
        this->ike_rekey = lib->settings->get_int(lib->settings,
-                               "charon.plugins.load-tester.ike_rekey", 0);
+                       "%s.plugins.load-tester.ike_rekey", 0, charon->name);
        this->child_rekey = lib->settings->get_int(lib->settings,
-                               "charon.plugins.load-tester.child_rekey", 600);
+                       "%s.plugins.load-tester.child_rekey", 600, charon->name);
        this->dpd_delay = lib->settings->get_int(lib->settings,
-                               "charon.plugins.load-tester.dpd_delay", 0);
+                       "%s.plugins.load-tester.dpd_delay", 0, charon->name);
 
        this->initiator_auth = lib->settings->get_str(lib->settings,
-                               "charon.plugins.load-tester.initiator_auth", "pubkey");
+                       "%s.plugins.load-tester.initiator_auth", "pubkey", charon->name);
        this->responder_auth = lib->settings->get_str(lib->settings,
-                               "charon.plugins.load-tester.responder_auth", "pubkey");
+                       "%s.plugins.load-tester.responder_auth", "pubkey", charon->name);
        this->initiator_id = lib->settings->get_str(lib->settings,
-                               "charon.plugins.load-tester.initiator_id", NULL);
+                       "%s.plugins.load-tester.initiator_id", NULL, charon->name);
        this->responder_id = lib->settings->get_str(lib->settings,
-                               "charon.plugins.load-tester.responder_id", NULL);
+                       "%s.plugins.load-tester.responder_id", NULL, charon->name);
 
        this->port = lib->settings->get_int(lib->settings,
-                               "charon.plugins.load-tester.dynamic_port", 0);
+                       "%s.plugins.load-tester.dynamic_port", 0, charon->name);
 
        this->peer_cfg = generate_config(this, 0);
 
index c34ea73..6d3b693 100644 (file)
@@ -321,9 +321,9 @@ load_tester_creds_t *load_tester_creds_create()
        char *pwd, *psk;
 
        psk = lib->settings->get_str(lib->settings,
-                                       "charon.plugins.load-tester.preshared_key", default_psk);
+                       "%s.plugins.load-tester.preshared_key", default_psk, charon->name);
        pwd = lib->settings->get_str(lib->settings,
-                                       "charon.plugins.load-tester.eap_password", default_pwd);
+                       "%s.plugins.load-tester.eap_password", default_pwd, charon->name);
 
        INIT(this,
                .public = {
index 7c96f7d..92073e6 100644 (file)
@@ -108,7 +108,8 @@ load_tester_listener_t *load_tester_listener_create(u_int shutdown_on)
                        .destroy = _destroy,
                },
                .delete_after_established = lib->settings->get_bool(lib->settings,
-                               "charon.plugins.load-tester.delete_after_established", FALSE),
+                                       "%s.plugins.load-tester.delete_after_established", FALSE,
+                                       charon->name),
                .shutdown_on = shutdown_on,
        );
 
index b260a97..a918bad 100644 (file)
@@ -205,7 +205,7 @@ plugin_t *load_tester_plugin_create()
        u_int i, shutdown_on = 0;
 
        if (!lib->settings->get_bool(lib->settings,
-                                                                "charon.plugins.load-tester.enable", FALSE))
+                                               "%s.plugins.load-tester.enable", FALSE, charon->name))
        {
                DBG1(DBG_CFG, "disabling load-tester plugin, not configured");
                return NULL;
@@ -220,13 +220,13 @@ plugin_t *load_tester_plugin_create()
                        },
                },
                .delay = lib->settings->get_int(lib->settings,
-                                       "charon.plugins.load-tester.delay", 0),
+                                               "%s.plugins.load-tester.delay", 0, charon->name),
                .iterations = lib->settings->get_int(lib->settings,
-                                       "charon.plugins.load-tester.iterations", 1),
+                                               "%s.plugins.load-tester.iterations", 1, charon->name),
                .initiators = lib->settings->get_int(lib->settings,
-                                       "charon.plugins.load-tester.initiators", 0),
+                                               "%s.plugins.load-tester.initiators", 0, charon->name),
                .init_limit = lib->settings->get_int(lib->settings,
-                                       "charon.plugins.load-tester.init_limit", 0),
+                                               "%s.plugins.load-tester.init_limit", 0, charon->name),
                .mutex = mutex_create(MUTEX_TYPE_DEFAULT),
                .condvar = condvar_create(CONDVAR_TYPE_DEFAULT),
                .config = load_tester_config_create(),
@@ -239,7 +239,7 @@ plugin_t *load_tester_plugin_create()
        lib->credmgr->add_set(lib->credmgr, &this->creds->credential_set);
 
        if (lib->settings->get_bool(lib->settings,
-                                       "charon.plugins.load-tester.shutdown_when_complete", 0))
+                       "%s.plugins.load-tester.shutdown_when_complete", 0, charon->name))
        {
                shutdown_on = this->iterations * this->initiators;
        }
@@ -247,7 +247,7 @@ plugin_t *load_tester_plugin_create()
        charon->bus->add_listener(charon->bus, &this->listener->listener);
 
        if (lib->settings->get_bool(lib->settings,
-                                       "charon.plugins.load-tester.fake_kernel", FALSE))
+                       "%s.plugins.load-tester.fake_kernel", FALSE, charon->name))
        {
                hydra->kernel_interface->add_ipsec_interface(hydra->kernel_interface,
                                                (kernel_ipsec_constructor_t)load_tester_ipsec_create);
index 88ab605..5443800 100644 (file)
@@ -212,9 +212,9 @@ radattr_listener_t *radattr_listener_create()
                        .destroy = _destroy,
                },
                .dir = lib->settings->get_str(lib->settings,
-                                                                         "charon.plugins.radattr.dir", NULL),
+                                                       "%s.plugins.radattr.dir", NULL, charon->name),
                .mid = lib->settings->get_int(lib->settings,
-                                                                         "charon.plugins.radattr.message_id", -1),
+                                                       "%s.plugins.radattr.message_id", -1, charon->name),
        );
 
        return &this->public;
index 76ca1df..0ed1f82 100644 (file)
@@ -583,7 +583,7 @@ socket_default_socket_t *socket_default_socket_create()
                        },
                },
                .max_packet = lib->settings->get_int(lib->settings,
-                                                                               "charon.max_packet", MAX_PACKET),
+                                                                       "%s.max_packet", MAX_PACKET, charon->name),
        );
 
 #ifdef __APPLE__
index eee3814..d4a9552 100644 (file)
@@ -610,7 +610,7 @@ socket_dynamic_socket_t *socket_dynamic_socket_create()
                },
                .lock = rwlock_create(RWLOCK_TYPE_DEFAULT),
                .max_packet = lib->settings->get_int(lib->settings,
-                                                                               "charon.max_packet", MAX_PACKET),
+                                                                       "%s.max_packet", MAX_PACKET, charon->name),
        );
 
        if (pipe(this->notify) != 0)
index ae37d8f..6557fc1 100644 (file)
@@ -657,7 +657,7 @@ socket_raw_socket_t *socket_raw_socket_create()
                        },
                },
                .max_packet = lib->settings->get_int(lib->settings,
-                                                                               "charon.max_packet", MAX_PACKET),
+                                                                       "%s.max_packet", MAX_PACKET, charon->name),
        );
 
        this->recv4 = open_recv_socket(this, AF_INET);
index e7267b8..0930535 100644 (file)
@@ -140,7 +140,7 @@ sql_logger_t *sql_logger_create(database_t *db)
                .db = db,
                .recursive = thread_value_create(NULL),
                .level = lib->settings->get_int(lib->settings,
-                                                                               "charon.plugins.sql.loglevel", -1),
+                                                               "%s.plugins.sql.loglevel", -1, charon->name),
        );
 
        return &this->public;
index fc05fa5..afbb89c 100644 (file)
@@ -80,7 +80,8 @@ plugin_t *sql_plugin_create()
        char *uri;
        private_sql_plugin_t *this;
 
-       uri = lib->settings->get_str(lib->settings, "charon.plugins.sql.database", NULL);
+       uri = lib->settings->get_str(lib->settings, "%s.plugins.sql.database",
+                                                                NULL, charon->name);
        if (!uri)
        {
                DBG1(DBG_CFG, "sql plugin: database URI not set");
index 535ece2..f09d144 100644 (file)
@@ -1181,7 +1181,8 @@ stroke_cred_t *stroke_cred_create()
        lib->credmgr->add_set(lib->credmgr, &this->creds->set);
 
        this->force_ca_cert = lib->settings->get_bool(lib->settings,
-                       "charon.plugins.stroke.ignore_missing_ca_basic_constraint", FALSE);
+                                               "%s.plugins.stroke.ignore_missing_ca_basic_constraint",
+                                               FALSE, charon->name);
 
        load_certs(this);
        load_secrets(this, SECRETS_FILE, 0, NULL);
index 2d061a4..8a52e0e 100644 (file)
@@ -834,7 +834,8 @@ stroke_socket_t *stroke_socket_create()
        this->condvar = condvar_create(CONDVAR_TYPE_DEFAULT);
        this->commands = linked_list_create();
        this->max_concurrent = lib->settings->get_int(lib->settings,
-                               "charon.plugins.stroke.max_concurrent", MAX_CONCURRENT_DEFAULT);
+                                       "%s.plugins.stroke.max_concurrent", MAX_CONCURRENT_DEFAULT,
+                                       charon->name);
 
        lib->credmgr->add_set(lib->credmgr, &this->ca->set);
        lib->credmgr->add_set(lib->credmgr, &this->cred->set);
index 913cdab..c431310 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 Andreas Steffen 
+ * Copyright (C) 2011 Andreas Steffen
  * HSR Hochschule fuer Technik Rapperswil
  *
  * This program is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
 #define IFMAP_META_NS "http://www.trustedcomputinggroup.org/2010/IFMAP-METADATA/2"
 #define IFMAP_LOGFILE "strongswan_ifmap.log"
 #define IFMAP_SERVER  "https://localhost:8443/"
-       
+
 typedef struct private_tnc_ifmap_soap_t private_tnc_ifmap_soap_t;
 
 /**
@@ -41,7 +41,7 @@ struct private_tnc_ifmap_soap_t {
        tnc_ifmap_soap_t public;
 
        /**
-        * Axis2/C environment 
+        * Axis2/C environment
         */
        axutil_env_t *env;
 
@@ -155,8 +155,8 @@ METHOD(tnc_ifmap_soap_t, newSession, bool,
 
        /* set PEP and PDP device name (defaults to IF-MAP Publisher ID) */
        this->device_name = lib->settings->get_str(lib->settings,
-                                                               "charon.plugins.tnc-ifmap.device_name",
-                                                                this->ifmap_publisher_id);
+                                                                       "%s.plugins.tnc-ifmap.device_name",
+                                                                        this->ifmap_publisher_id, charon->name);
        this->device_name = strdup(this->device_name);
 
        /* free result */
@@ -174,13 +174,13 @@ METHOD(tnc_ifmap_soap_t, purgePublisher, bool,
        axiom_attribute_t *attr;
 
        /* build purgePublisher request */
-       ns = axiom_namespace_create(this->env, IFMAP_NS, "ifmap");
+       ns = axiom_namespace_create(this->env, IFMAP_NS, "ifmap");
        el = axiom_element_create(this->env, NULL, "purgePublisher", ns, &request);
        attr = axiom_attribute_create(this->env, "session-id",
-                                                                 this->session_id, NULL);      
+                                                                 this->session_id, NULL);
        axiom_element_add_attribute(el, this->env, attr, request);
        attr = axiom_attribute_create(this->env, "ifmap-publisher-id",
-                                                                 this->ifmap_publisher_id, NULL);      
+                                                                 this->ifmap_publisher_id, NULL);
        axiom_element_add_attribute(el, this->env, attr, request);
 
        /* send purgePublisher request and receive purgePublisherReceived */
@@ -202,7 +202,7 @@ static axiom_node_t* create_access_request(private_tnc_ifmap_soap_t *this,
        el = axiom_element_create(this->env, NULL, "access-request", NULL, &node);
 
        snprintf(buf, BUF_LEN, "%s:%d", this->device_name, id);
-       attr = axiom_attribute_create(this->env, "name", buf, NULL);    
+       attr = axiom_attribute_create(this->env, "name", buf, NULL);
        axiom_element_add_attribute(el, this->env, attr, node);
 
        return node;
@@ -222,7 +222,7 @@ static axiom_node_t* create_identity(private_tnc_ifmap_soap_t *this,
        el = axiom_element_create(this->env, NULL, "identity", NULL, &node);
 
        snprintf(buf, BUF_LEN, "%Y", id);
-       attr = axiom_attribute_create(this->env, "name", buf, NULL);    
+       attr = axiom_attribute_create(this->env, "name", buf, NULL);
        axiom_element_add_attribute(el, this->env, attr, node);
 
        switch (id->get_type(id))
@@ -260,7 +260,7 @@ static axiom_node_t* create_identity(private_tnc_ifmap_soap_t *this,
                                                                                  "36906:other", NULL);
                        axiom_element_add_attribute(el, this->env, attr, node);
        }
-       attr = axiom_attribute_create(this->env, "type", id_type, NULL);        
+       attr = axiom_attribute_create(this->env, "type", id_type, NULL);
        axiom_element_add_attribute(el, this->env, attr, node);
 
        return node;
@@ -308,11 +308,11 @@ static axiom_node_t* create_ip_address(private_tnc_ifmap_soap_t *this,
        {
                snprintf(buf, BUF_LEN, "%H", host);
        }
-       attr = axiom_attribute_create(this->env, "value", buf, NULL);   
+       attr = axiom_attribute_create(this->env, "value", buf, NULL);
        axiom_element_add_attribute(el, this->env, attr, node);
 
        attr = axiom_attribute_create(this->env, "type",
-                                host->get_family(host) == AF_INET ? "IPv4" : "IPv6", NULL);    
+                                host->get_family(host) == AF_INET ? "IPv4" : "IPv6", NULL);
        axiom_element_add_attribute(el, this->env, attr, node);
 
        return node;
@@ -352,7 +352,7 @@ static axiom_node_t* create_metadata(private_tnc_ifmap_soap_t *this,
        el = axiom_element_create(this->env, NULL, metadata, ns_meta, &node2);
        axiom_node_add_child(node, this->env, node2);
        attr = axiom_attribute_create(this->env, "ifmap-cardinality", "singleValue",
-                                                                 NULL);        
+                                                                 NULL);
        axiom_element_add_attribute(el, this->env, attr, node2);
 
        return node;
@@ -374,7 +374,7 @@ static axiom_node_t* create_capability(private_tnc_ifmap_soap_t *this,
        ns_meta = axiom_namespace_create(this->env, IFMAP_META_NS, "meta");
        el = axiom_element_create(this->env, NULL, "capability", ns_meta, &node);
        attr = axiom_attribute_create(this->env, "ifmap-cardinality", "multiValue",
-                                                                 NULL);        
+                                                                 NULL);
        axiom_element_add_attribute(el, this->env, attr, node);
 
        el = axiom_element_create(this->env, NULL, "name", NULL, &node2);
@@ -385,7 +385,7 @@ static axiom_node_t* create_capability(private_tnc_ifmap_soap_t *this,
        el = axiom_element_create(this->env, NULL, "administrative-domain", NULL, &node2);
        axiom_node_add_child(node, this->env, node2);
        text = axiom_text_create(this->env, node2, "strongswan", &node3);
-       
+
        return node;
 }
 
@@ -439,7 +439,7 @@ static axiom_node_t* create_delete_filter(private_tnc_ifmap_soap_t *this,
 
        snprintf(buf, BUF_LEN, "meta:%s[@ifmap-publisher-id='%s']",
                         metadata, this->ifmap_publisher_id);
-       attr = axiom_attribute_create(this->env, "filter", buf, NULL);  
+       attr = axiom_attribute_create(this->env, "filter", buf, NULL);
        axiom_element_add_attribute(el, this->env, attr, node);
 
        return node;
@@ -506,11 +506,11 @@ METHOD(tnc_ifmap_soap_t, publish_ike_sa, bool,
                axiom_node_add_child(node, this->env,
                                                         create_device(this));
        }
-       
+
        /**
         * update or delete authenticated-as metadata
         */
-       if (up)
+       if (up)
        {
                el = axiom_element_create(this->env, NULL, "update", NULL, &node);
        }
@@ -534,7 +534,7 @@ METHOD(tnc_ifmap_soap_t, publish_ike_sa, bool,
        /**
         * update or delete access-request-ip metadata
         */
-       if (up)
+       if (up)
        {
                el = axiom_element_create(this->env, NULL, "update", NULL, &node);
        }
@@ -558,7 +558,7 @@ METHOD(tnc_ifmap_soap_t, publish_ike_sa, bool,
        /**
         * update or delete authenticated-by metadata
         */
-       if (up)
+       if (up)
        {
                el = axiom_element_create(this->env, NULL, "update", NULL, &node);
        }
@@ -605,7 +605,7 @@ METHOD(tnc_ifmap_soap_t, publish_ike_sa, bool,
                                                node = create_delete_filter(this, "capability");
                                        }
                                        axiom_node_add_child(request, this->env, node);
+
                                        /* add access-request */
                                        axiom_node_add_child(node, this->env,
                                                                         create_access_request(this, ike_sa_id));
@@ -688,9 +688,9 @@ METHOD(tnc_ifmap_soap_t, endSession, bool,
        axiom_attribute_t *attr;
 
        /* build endSession request */
-       ns = axiom_namespace_create(this->env, IFMAP_NS, "ifmap");
+       ns = axiom_namespace_create(this->env, IFMAP_NS, "ifmap");
        el = axiom_element_create(this->env, NULL, "endSession", ns, &request);
-       attr = axiom_attribute_create(this->env, "session-id", this->session_id, NULL); 
+       attr = axiom_attribute_create(this->env, "session-id", this->session_id, NULL);
        axiom_element_add_attribute(el, this->env, attr, request);
 
        /* send endSession request and receive end SessionResult */
@@ -705,7 +705,7 @@ METHOD(tnc_ifmap_soap_t, destroy, void,
                endSession(this);
                free(this->session_id);
                free(this->ifmap_publisher_id);
-               free(this->device_name);        
+               free(this->device_name);
        }
        if (this->svc_client)
        {
@@ -731,20 +731,20 @@ static bool axis2c_init(private_tnc_ifmap_soap_t *this)
 
        /* Getting configuration parameters from strongswan.conf */
        client_home = lib->settings->get_str(lib->settings,
-                                       "charon.plugins.tnc-ifmap.client_home",
-                                       AXIS2_GETENV("AXIS2C_HOME"));
+                                       "%s.plugins.tnc-ifmap.client_home",
+                                       AXIS2_GETENV("AXIS2C_HOME"), charon->name);
        server = lib->settings->get_str(lib->settings,
-                                       "charon.plugins.tnc-ifmap.server", IFMAP_SERVER);
+                                       "%s.plugins.tnc-ifmap.server", IFMAP_SERVER, charon->name);
        server_cert = lib->settings->get_str(lib->settings,
-                                       "charon.plugins.tnc-ifmap.server_cert", NULL);
+                                       "%s.plugins.tnc-ifmap.server_cert", NULL, charon->name);
        key_file = lib->settings->get_str(lib->settings,
-                                       "charon.plugins.tnc-ifmap.key_file", NULL);
+                                       "%s.plugins.tnc-ifmap.key_file", NULL, charon->name);
        ssl_passphrase = lib->settings->get_str(lib->settings,
-                                       "charon.plugins.tnc-ifmap.ssl_passphrase", NULL);
+                                       "%s.plugins.tnc-ifmap.ssl_passphrase", NULL, charon->name);
        username = lib->settings->get_str(lib->settings,
-                                       "charon.plugins.tnc-ifmap.username", NULL);
+                                       "%s.plugins.tnc-ifmap.username", NULL, charon->name);
        password = lib->settings->get_str(lib->settings,
-                                       "charon.plugins.tnc-ifmap.password", NULL);
+                                       "%s.plugins.tnc-ifmap.password", NULL, charon->name);
 
        if (!server_cert)
        {
@@ -785,9 +785,9 @@ static bool axis2c_init(private_tnc_ifmap_soap_t *this)
                                                    ssl_passphrase);
                        axis2_options_set_property(options, this->env,
                                                                           AXIS2_SSL_PASSPHRASE, property);
-               } 
+               }
        }
-       else 
+       else
        {
                /* Set up HTTP Basic MAP client authentication */
                axis2_options_set_http_auth_info(options, this->env,
@@ -800,14 +800,14 @@ static bool axis2c_init(private_tnc_ifmap_soap_t *this)
 
        /* Set up https transport */
        transport_in = axis2_transport_in_desc_create(this->env,
-                                                                                                 AXIS2_TRANSPORT_ENUM_HTTPS); 
+                                                                                                 AXIS2_TRANSPORT_ENUM_HTTPS);
        transport_out = axis2_transport_out_desc_create(this->env,
                                                                                                  AXIS2_TRANSPORT_ENUM_HTTPS);
        transport_sender = axis2_http_transport_sender_create(this->env);
        axis2_transport_out_desc_set_sender(transport_out, this->env,
                                                                                transport_sender);
        axis2_options_set_transport_in(options, this->env, transport_in);
-       axis2_options_set_transport_out(options, this->env, transport_out); 
+       axis2_options_set_transport_out(options, this->env, transport_out);
 
        /* Create the axis2 service client */
        this->svc_client = axis2_svc_client_create(this->env, client_home);
index e101cf9..5582373 100644 (file)
@@ -171,7 +171,7 @@ 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");
+                               "%s.plugins.tnc-imc.preferred_language", "en", charon->name);
 }
 
 METHOD(imc_manager_t, notify_connection_change, void,
index b1da731..0985a47 100644 (file)
@@ -241,7 +241,7 @@ METHOD(imv_manager_t, enforce_recommendation, bool,
                return FALSE;
        }
        else
-       {       
+       {
                auth = ike_sa->get_auth_cfg(ike_sa, FALSE);
                id = identification_create_from_string(group);
                auth->add(auth, AUTH_RULE_GROUP, id);
@@ -452,7 +452,8 @@ imv_manager_t* tnc_imv_manager_create(void)
 
        policy = enum_from_name(recommendation_policy_names,
                                lib->settings->get_str(lib->settings,
-                                       "charon.plugins.tnc-imv.recommendation_policy", "default"));
+                                       "%s.plugins.tnc-imv.recommendation_policy", "default",
+                                       charon->name));
        this->policy = (policy != -1) ? policy : RECOMMENDATION_POLICY_DEFAULT;
        DBG1(DBG_TNC, "TNC recommendation policy is '%N'",
                                   recommendation_policy_names, this->policy);
index 26d777a..c5509a2 100644 (file)
@@ -291,7 +291,7 @@ static void send_response(private_tnc_pdp_t *this, radius_message_t *request,
                data = encrypt_mppe_key(this, MS_MPPE_RECV_KEY, recv, &salt, request);
                response->add(response, RAT_VENDOR_SPECIFIC, data);
                chunk_free(&data);
-               
+
                send = chunk_create(msk.ptr + recv.len, msk.len - recv.len);
                data = encrypt_mppe_key(this, MS_MPPE_SEND_KEY, send, &salt, request);
                response->add(response, RAT_VENDOR_SPECIFIC, data);
@@ -368,7 +368,7 @@ static void process_eap(private_tnc_pdp_t *this, radius_message_t *request,
                        eap_identity = chunk_create(message.ptr + 5, message.len - 5);
                        peer = identification_create_from_data(eap_identity);
                        method = charon->eap->create_instance(charon->eap, this->type,
-                                                                               0, EAP_SERVER, this->server, peer); 
+                                                                               0, EAP_SERVER, this->server, peer);
                        if (!method)
                        {
                                peer->destroy(peer);
@@ -524,7 +524,7 @@ static job_requeue_t receive(private_tnc_pdp_t *this)
                if (request)
                {
                        DBG1(DBG_CFG, "received RADIUS %N from client '%H'",
-                                radius_message_code_names, request->get_code(request), source);
+                                radius_message_code_names, request->get_code(request), source);
 
                        if (request->verify(request, NULL, this->secret, this->hasher,
                                                                                           this->signer))
@@ -532,7 +532,7 @@ static job_requeue_t receive(private_tnc_pdp_t *this)
                                process_eap(this, request, source);
                        }
                        request->destroy(request);
-                       
+
                }
                else
                {
@@ -608,7 +608,7 @@ tnc_pdp_t *tnc_pdp_create(u_int16_t port)
        }
 
        server = lib->settings->get_str(lib->settings,
-                                               "charon.plugins.tnc-pdp.server", NULL);
+                                               "%s.plugins.tnc-pdp.server", NULL, charon->name);
        if (!server)
        {
                DBG1(DBG_CFG, "missing PDP server name, PDP disabled");
@@ -618,7 +618,7 @@ tnc_pdp_t *tnc_pdp_create(u_int16_t port)
        this->server = identification_create_from_string(server);
 
        secret = lib->settings->get_str(lib->settings,
-                                               "charon.plugins.tnc-pdp.secret", NULL);
+                                               "%s.plugins.tnc-pdp.secret", NULL, charon->name);
        if (!secret)
        {
                DBG1(DBG_CFG, "missing RADIUS secret, PDP disabled");
@@ -629,7 +629,7 @@ tnc_pdp_t *tnc_pdp_create(u_int16_t port)
        this->signer->set_key(this->signer, this->secret);
 
        eap_type_str = lib->settings->get_str(lib->settings,
-                                               "charon.plugins.tnc-pdp.method", "ttls");
+                                               "%s.plugins.tnc-pdp.method", "ttls", charon->name);
        this->type = eap_type_from_string(eap_type_str);
        if (this->type == 0)
        {
index 9abe02a..2cb06d8 100644 (file)
@@ -73,7 +73,7 @@ plugin_t *tnc_pdp_plugin_create()
        int port;
 
        port = lib->settings->get_int(lib->settings,
-                                               "charon.plugins.tnc_pdp.port", RADIUS_PORT);
+                                               "%s.plugins.tnc_pdp.port", RADIUS_PORT, charon->name);
 
        INIT(this,
                .public = {
index 5634e3e..64ef048 100644 (file)
@@ -206,7 +206,7 @@ whitelist_listener_t *whitelist_listener_create()
                .ids = hashtable_create((hashtable_hash_t)hash,
                                                                (hashtable_equals_t)equals, 32),
                .enabled = lib->settings->get_bool(lib->settings,
-                                                               "charon.plugins.whitelist.enable", FALSE),
+                                                               "%s.plugins.whitelist.enable", FALSE, charon->name),
        );
 
        return &this->public;
index 8d7bcc0..1da1d9f 100644 (file)
@@ -223,7 +223,8 @@ METHOD(xauth_method_t, process, status_t,
        }
 
        name = lib->settings->get_str(lib->settings,
-                                                                 "charon.plugins.xauth-eap.backend", "radius");
+                                                                 "%s.plugins.xauth-eap.backend", "radius",
+                                                                 charon->name);
        type = eap_type_from_string(name);
        if (!type)
        {
index e94ebb1..54bc109 100644 (file)
@@ -2090,9 +2090,9 @@ ike_sa_t * ike_sa_create(ike_sa_id_t *ike_sa_id, bool initiator,
                .peer_addresses = linked_list_create(),
                .attributes = linked_list_create(),
                .keepalive_interval = lib->settings->get_time(lib->settings,
-                                                                       "charon.keep_alive", KEEPALIVE_INTERVAL),
+                                                       "%s.keep_alive", KEEPALIVE_INTERVAL, charon->name),
                .flush_auth_cfg = lib->settings->get_bool(lib->settings,
-                                                                       "charon.flush_auth_cfg", FALSE),
+                                                       "%s.flush_auth_cfg", FALSE, charon->name),
        );
 
        if (version == IKEV2)
index 56d6172..47662ad 100644 (file)
@@ -1982,13 +1982,15 @@ ike_sa_manager_t *ike_sa_manager_create()
                return NULL;
        }
 
-       this->table_size = get_nearest_powerof2(lib->settings->get_int(lib->settings,
-                                               "charon.ikesa_table_size", DEFAULT_HASHTABLE_SIZE));
+       this->table_size = get_nearest_powerof2(lib->settings->get_int(
+                                                                       lib->settings, "%s.ikesa_table_size",
+                                                                       DEFAULT_HASHTABLE_SIZE, charon->name));
        this->table_size = max(1, min(this->table_size, MAX_HASHTABLE_SIZE));
        this->table_mask = this->table_size - 1;
 
-       this->segment_count = get_nearest_powerof2(lib->settings->get_int(lib->settings,
-                                               "charon.ikesa_table_segments", DEFAULT_SEGMENT_COUNT));
+       this->segment_count = get_nearest_powerof2(lib->settings->get_int(
+                                                                       lib->settings, "%s.ikesa_table_segments",
+                                                                       DEFAULT_SEGMENT_COUNT, charon->name));
        this->segment_count = max(1, min(this->segment_count, this->table_size));
        this->segment_mask = this->segment_count - 1;
 
@@ -2028,6 +2030,6 @@ ike_sa_manager_t *ike_sa_manager_create()
        }
 
        this->reuse_ikesa = lib->settings->get_bool(lib->settings,
-                                                                                               "charon.reuse_ikesa", TRUE);
+                                                                               "%s.reuse_ikesa", TRUE, charon->name);
        return &this->public;
 }
index b58e501..d2245cb 100755 (executable)
@@ -1140,7 +1140,8 @@ METHOD(task_manager_t, process_message, status_t,
                        job = (job_t*)delete_ike_sa_job_create(ike_sa_id, FALSE);
                        lib->scheduler->schedule_job(lib->scheduler, job,
                                        lib->settings->get_int(lib->settings,
-                                               "charon.half_open_timeout", HALF_OPEN_IKE_SA_TIMEOUT));
+                                                       "%s.half_open_timeout", HALF_OPEN_IKE_SA_TIMEOUT,
+                                                       charon->name));
                }
                this->ike_sa->update_hosts(this->ike_sa, me, other, TRUE);
                charon->bus->message(charon->bus, msg, TRUE, TRUE);
@@ -1511,11 +1512,11 @@ task_manager_v1_t *task_manager_v1_create(ike_sa_t *ike_sa)
                .active_tasks = linked_list_create(),
                .passive_tasks = linked_list_create(),
                .retransmit_tries = lib->settings->get_int(lib->settings,
-                                                               "charon.retransmit_tries", RETRANSMIT_TRIES),
+                                       "%s.retransmit_tries", RETRANSMIT_TRIES, charon->name),
                .retransmit_timeout = lib->settings->get_double(lib->settings,
-                                                               "charon.retransmit_timeout", RETRANSMIT_TIMEOUT),
+                                       "%s.retransmit_timeout", RETRANSMIT_TIMEOUT, charon->name),
                .retransmit_base = lib->settings->get_double(lib->settings,
-                                                               "charon.retransmit_base", RETRANSMIT_BASE),
+                                       "%s.retransmit_base", RETRANSMIT_BASE, charon->name),
        );
 
        if (!this->rng)
index 8d93cc7..1ad4cdf 100755 (executable)
@@ -121,7 +121,7 @@ METHOD(task_t, build, status_t,
        int i;
 
        strongswan = lib->settings->get_bool(lib->settings,
-                                                                                "charon.send_vendor_id", FALSE);
+                                                                       "%s.send_vendor_id", FALSE, charon->name);
        for (i = 0; i < countof(vendor_ids); i++)
        {
                if (vendor_ids[i].send ||
index 30dc956..b67af5c 100755 (executable)
@@ -154,7 +154,7 @@ static void schedule_inactivity_timeout(private_quick_mode_t *this)
        if (timeout)
        {
                close_ike = lib->settings->get_bool(lib->settings,
-                                                                               "charon.inactivity_close_ike", FALSE);
+                                                               "%s.inactivity_close_ike", FALSE, charon->name);
                lib->scheduler->schedule_job(lib->scheduler, (job_t*)
                                inactivity_job_create(this->child_sa->get_reqid(this->child_sa),
                                                                          timeout, close_ike), timeout);
index cc6d378..5cca529 100644 (file)
@@ -1078,7 +1078,8 @@ METHOD(task_manager_t, process_message, status_t,
                job = (job_t*)delete_ike_sa_job_create(ike_sa_id, FALSE);
                lib->scheduler->schedule_job(lib->scheduler, job,
                                lib->settings->get_int(lib->settings,
-                                       "charon.half_open_timeout",  HALF_OPEN_IKE_SA_TIMEOUT));
+                                               "%s.half_open_timeout", HALF_OPEN_IKE_SA_TIMEOUT,
+                                               charon->name));
        }
        this->ike_sa->set_statistic(this->ike_sa, STAT_INBOUND,
                                                                time_monotonic(NULL));
@@ -1473,11 +1474,11 @@ task_manager_v2_t *task_manager_v2_create(ike_sa_t *ike_sa)
                .active_tasks = linked_list_create(),
                .passive_tasks = linked_list_create(),
                .retransmit_tries = lib->settings->get_int(lib->settings,
-                                                               "charon.retransmit_tries", RETRANSMIT_TRIES),
+                                       "%s.retransmit_tries", RETRANSMIT_TRIES, charon->name),
                .retransmit_timeout = lib->settings->get_double(lib->settings,
-                                                               "charon.retransmit_timeout", RETRANSMIT_TIMEOUT),
+                                       "%s.retransmit_timeout", RETRANSMIT_TIMEOUT, charon->name),
                .retransmit_base = lib->settings->get_double(lib->settings,
-                                                               "charon.retransmit_base", RETRANSMIT_BASE),
+                                       "%s.retransmit_base", RETRANSMIT_BASE, charon->name),
        );
 
        return &this->public;
index 023334b..eeb9209 100644 (file)
@@ -266,7 +266,7 @@ static void schedule_inactivity_timeout(private_child_create_t *this)
        if (timeout)
        {
                close_ike = lib->settings->get_bool(lib->settings,
-                                                                               "charon.inactivity_close_ike", FALSE);
+                                                               "%s.inactivity_close_ike", FALSE, charon->name);
                lib->scheduler->schedule_job(lib->scheduler, (job_t*)
                                inactivity_job_create(this->child_sa->get_reqid(this->child_sa),
                                                                          timeout, close_ike), timeout);
@@ -881,7 +881,7 @@ static void handle_child_sa_failure(private_child_create_t *this,
 {
        if (message->get_exchange_type(message) == IKE_AUTH &&
                lib->settings->get_bool(lib->settings,
-                                                               "charon.close_ike_on_child_failure", FALSE))
+                                                               "%s.close_ike_on_child_failure", FALSE, charon->name))
        {
                /* we delay the delete for 100ms, as the IKE_AUTH response must arrive
                 * first */
index 6af0b37..36f8acf 100644 (file)
@@ -120,7 +120,7 @@ struct private_ike_auth_t {
 static bool multiple_auth_enabled()
 {
        return lib->settings->get_bool(lib->settings,
-                                                                  "charon.multiple_authentication", TRUE);
+                                                       "%s.multiple_authentication", TRUE, charon->name);
 }
 
 /**
index 7583710..60e8787 100644 (file)
@@ -398,7 +398,8 @@ static void build_certreqs(private_ike_cert_pre_t *this, message_t *message)
        {
                message->add_payload(message, (payload_t*)req);
 
-               if (lib->settings->get_bool(lib->settings, "charon.hash_and_url", FALSE))
+               if (lib->settings->get_bool(lib->settings,
+                                                                       "%s.hash_and_url", FALSE, charon->name))
                {
                        message->add_notify(message, FALSE, HTTP_CERT_LOOKUP_SUPPORTED,
                                                                chunk_empty);
index b2b965a..7ea338e 100644 (file)
@@ -53,7 +53,7 @@ METHOD(task_t, build, status_t,
        private_ike_vendor_t *this, message_t *message)
 {
        if (lib->settings->get_bool(lib->settings,
-                                                               "charon.send_vendor_id", FALSE))
+                                                               "%s.send_vendor_id", FALSE, charon->name))
        {
                vendor_id_payload_t *vid;