aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/plugins/load_tester
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2014-01-22 15:18:58 +0100
committerTobias Brunner <tobias@strongswan.org>2014-02-12 14:34:32 +0100
commitd223fe807a0a7fe6f358420256d11d407f7c9f07 (patch)
tree4c9edc8328a3d8b062bf423847b9ba2f3f2879c7 /src/libcharon/plugins/load_tester
parent10c4f4e1fd572d731aaf0c456dfa9dcd7894a554 (diff)
downloadstrongswan-d223fe807a0a7fe6f358420256d11d407f7c9f07.tar.bz2
strongswan-d223fe807a0a7fe6f358420256d11d407f7c9f07.tar.xz
libcharon: Use lib->ns instead of charon->name
Diffstat (limited to 'src/libcharon/plugins/load_tester')
-rw-r--r--src/libcharon/plugins/load_tester/load_tester_config.c57
-rw-r--r--src/libcharon/plugins/load_tester/load_tester_control.c2
-rw-r--r--src/libcharon/plugins/load_tester/load_tester_creds.c12
-rw-r--r--src/libcharon/plugins/load_tester/load_tester_listener.c2
-rw-r--r--src/libcharon/plugins/load_tester/load_tester_plugin.c16
5 files changed, 44 insertions, 45 deletions
diff --git a/src/libcharon/plugins/load_tester/load_tester_config.c b/src/libcharon/plugins/load_tester/load_tester_config.c
index e4e47c1ac..e133190b4 100644
--- a/src/libcharon/plugins/load_tester/load_tester_config.c
+++ b/src/libcharon/plugins/load_tester/load_tester_config.c
@@ -236,11 +236,11 @@ static void load_addrs(private_load_tester_config_t *this)
mem_pool_t *pool;
this->keep = lib->settings->get_bool(lib->settings,
- "%s.plugins.load-tester.addrs_keep", FALSE, charon->name);
+ "%s.plugins.load-tester.addrs_keep", FALSE, lib->ns);
this->prefix = lib->settings->get_int(lib->settings,
- "%s.plugins.load-tester.addrs_prefix", 16, charon->name);
+ "%s.plugins.load-tester.addrs_prefix", 16, lib->ns);
enumerator = lib->settings->create_key_value_enumerator(lib->settings,
- "%s.plugins.load-tester.addrs", charon->name);
+ "%s.plugins.load-tester.addrs", lib->ns);
while (enumerator->enumerate(enumerator, &iface, &token))
{
tokens = enumerator_create_token(token, ",", " ");
@@ -917,72 +917,71 @@ load_tester_config_t *load_tester_config_create()
);
if (lib->settings->get_bool(lib->settings,
- "%s.plugins.load-tester.request_virtual_ip", FALSE, charon->name))
+ "%s.plugins.load-tester.request_virtual_ip", FALSE, lib->ns))
{
this->vip = host_create_from_string("0.0.0.0", 0);
}
this->pool = lib->settings->get_str(lib->settings,
- "%s.plugins.load-tester.pool", NULL, charon->name);
+ "%s.plugins.load-tester.pool", NULL, lib->ns);
this->initiator = lib->settings->get_str(lib->settings,
- "%s.plugins.load-tester.initiator", "0.0.0.0", charon->name);
+ "%s.plugins.load-tester.initiator", "0.0.0.0", lib->ns);
this->responder = lib->settings->get_str(lib->settings,
- "%s.plugins.load-tester.responder", "127.0.0.1", charon->name);
+ "%s.plugins.load-tester.responder", "127.0.0.1", lib->ns);
this->proposal = proposal_create_from_string(PROTO_IKE,
lib->settings->get_str(lib->settings,
"%s.plugins.load-tester.proposal", "aes128-sha1-modp768",
- charon->name));
+ lib->ns));
if (!this->proposal)
{ /* fallback */
this->proposal = proposal_create_from_string(PROTO_IKE,
"aes128-sha1-modp768");
}
this->esp = proposal_create_from_string(PROTO_ESP,
- lib->settings->get_str(lib->settings,
- "%s.plugins.load-tester.esp", "aes128-sha1",
- charon->name));
+ lib->settings->get_str(lib->settings,
+ "%s.plugins.load-tester.esp", "aes128-sha1", lib->ns));
if (!this->esp)
{ /* fallback */
this->esp = proposal_create_from_string(PROTO_ESP, "aes128-sha1");
}
this->ike_rekey = lib->settings->get_int(lib->settings,
- "%s.plugins.load-tester.ike_rekey", 0, charon->name);
+ "%s.plugins.load-tester.ike_rekey", 0, lib->ns);
this->child_rekey = lib->settings->get_int(lib->settings,
- "%s.plugins.load-tester.child_rekey", 600, charon->name);
+ "%s.plugins.load-tester.child_rekey", 600, lib->ns);
this->dpd_delay = lib->settings->get_int(lib->settings,
- "%s.plugins.load-tester.dpd_delay", 0, charon->name);
+ "%s.plugins.load-tester.dpd_delay", 0, lib->ns);
this->dpd_timeout = lib->settings->get_int(lib->settings,
- "%s.plugins.load-tester.dpd_timeout", 0, charon->name);
+ "%s.plugins.load-tester.dpd_timeout", 0, lib->ns);
this->initiator_auth = lib->settings->get_str(lib->settings,
- "%s.plugins.load-tester.initiator_auth", "pubkey", charon->name);
+ "%s.plugins.load-tester.initiator_auth", "pubkey", lib->ns);
this->responder_auth = lib->settings->get_str(lib->settings,
- "%s.plugins.load-tester.responder_auth", "pubkey", charon->name);
+ "%s.plugins.load-tester.responder_auth", "pubkey", lib->ns);
this->initiator_id = lib->settings->get_str(lib->settings,
- "%s.plugins.load-tester.initiator_id", NULL, charon->name);
+ "%s.plugins.load-tester.initiator_id", NULL, lib->ns);
this->initiator_match = lib->settings->get_str(lib->settings,
- "%s.plugins.load-tester.initiator_match", NULL, charon->name);
+ "%s.plugins.load-tester.initiator_match", NULL, lib->ns);
this->responder_id = lib->settings->get_str(lib->settings,
- "%s.plugins.load-tester.responder_id", NULL, charon->name);
+ "%s.plugins.load-tester.responder_id", NULL, lib->ns);
this->mode = lib->settings->get_str(lib->settings,
- "%s.plugins.load-tester.mode", NULL, charon->name);
+ "%s.plugins.load-tester.mode", NULL, lib->ns);
this->initiator_tsi = lib->settings->get_str(lib->settings,
- "%s.plugins.load-tester.initiator_tsi", NULL, charon->name);
+ "%s.plugins.load-tester.initiator_tsi", NULL, lib->ns);
this->responder_tsi =lib->settings->get_str(lib->settings,
- "%s.plugins.load-tester.responder_tsi",
- this->initiator_tsi, charon->name);
+ "%s.plugins.load-tester.responder_tsi",
+ this->initiator_tsi, lib->ns);
this->initiator_tsr = lib->settings->get_str(lib->settings,
- "%s.plugins.load-tester.initiator_tsr", NULL, charon->name);
+ "%s.plugins.load-tester.initiator_tsr", NULL, lib->ns);
this->responder_tsr =lib->settings->get_str(lib->settings,
- "%s.plugins.load-tester.responder_tsr",
- this->initiator_tsr, charon->name);
+ "%s.plugins.load-tester.responder_tsr",
+ this->initiator_tsr, lib->ns);
this->port = lib->settings->get_int(lib->settings,
- "%s.plugins.load-tester.dynamic_port", 0, charon->name);
+ "%s.plugins.load-tester.dynamic_port", 0, lib->ns);
this->version = lib->settings->get_int(lib->settings,
- "%s.plugins.load-tester.version", IKE_ANY, charon->name);
+ "%s.plugins.load-tester.version", IKE_ANY, lib->ns);
load_addrs(this);
diff --git a/src/libcharon/plugins/load_tester/load_tester_control.c b/src/libcharon/plugins/load_tester/load_tester_control.c
index f9ec9142f..5f089f5db 100644
--- a/src/libcharon/plugins/load_tester/load_tester_control.c
+++ b/src/libcharon/plugins/load_tester/load_tester_control.c
@@ -302,7 +302,7 @@ load_tester_control_t *load_tester_control_create()
uri = lib->settings->get_str(lib->settings,
"%s.plugins.load-tester.socket", "unix://" LOAD_TESTER_SOCKET,
- charon->name);
+ lib->ns);
this->service = lib->streams->create_service(lib->streams, uri, 10);
if (this->service)
{
diff --git a/src/libcharon/plugins/load_tester/load_tester_creds.c b/src/libcharon/plugins/load_tester/load_tester_creds.c
index 028205bd2..f17d41f46 100644
--- a/src/libcharon/plugins/load_tester/load_tester_creds.c
+++ b/src/libcharon/plugins/load_tester/load_tester_creds.c
@@ -202,7 +202,7 @@ static private_key_t *load_issuer_key()
char *path;
path = lib->settings->get_str(lib->settings,
- "%s.plugins.load-tester.issuer_key", NULL, charon->name);
+ "%s.plugins.load-tester.issuer_key", NULL, lib->ns);
if (!path)
{
return lib->creds->create(lib->creds, CRED_PRIVATE_KEY, KEY_RSA,
@@ -222,7 +222,7 @@ static certificate_t *load_issuer_cert()
char *path;
path = lib->settings->get_str(lib->settings,
- "%s.plugins.load-tester.issuer_cert", NULL, charon->name);
+ "%s.plugins.load-tester.issuer_cert", NULL, lib->ns);
if (!path)
{
return lib->creds->create(lib->creds, CRED_CERTIFICATE, CERT_X509,
@@ -246,7 +246,7 @@ static void load_ca_certs(private_load_tester_creds_t *this)
char *path;
path = lib->settings->get_str(lib->settings,
- "%s.plugins.load-tester.ca_dir", NULL, charon->name);
+ "%s.plugins.load-tester.ca_dir", NULL, lib->ns);
if (path)
{
enumerator = enumerator_create_directory(path);
@@ -445,11 +445,11 @@ load_tester_creds_t *load_tester_creds_create()
char *pwd, *psk, *digest;
psk = lib->settings->get_str(lib->settings,
- "%s.plugins.load-tester.preshared_key", default_psk, charon->name);
+ "%s.plugins.load-tester.preshared_key", default_psk, lib->ns);
pwd = lib->settings->get_str(lib->settings,
- "%s.plugins.load-tester.eap_password", default_pwd, charon->name);
+ "%s.plugins.load-tester.eap_password", default_pwd, lib->ns);
digest = lib->settings->get_str(lib->settings,
- "%s.plugins.load-tester.digest", "sha1", charon->name);
+ "%s.plugins.load-tester.digest", "sha1", lib->ns);
INIT(this,
.public = {
diff --git a/src/libcharon/plugins/load_tester/load_tester_listener.c b/src/libcharon/plugins/load_tester/load_tester_listener.c
index 7e832ddc0..068020ef7 100644
--- a/src/libcharon/plugins/load_tester/load_tester_listener.c
+++ b/src/libcharon/plugins/load_tester/load_tester_listener.c
@@ -126,7 +126,7 @@ load_tester_listener_t *load_tester_listener_create(u_int shutdown_on,
},
.delete_after_established = lib->settings->get_bool(lib->settings,
"%s.plugins.load-tester.delete_after_established", FALSE,
- charon->name),
+ lib->ns),
.shutdown_on = shutdown_on,
.config = config,
);
diff --git a/src/libcharon/plugins/load_tester/load_tester_plugin.c b/src/libcharon/plugins/load_tester/load_tester_plugin.c
index 03557a269..e684f22ce 100644
--- a/src/libcharon/plugins/load_tester/load_tester_plugin.c
+++ b/src/libcharon/plugins/load_tester/load_tester_plugin.c
@@ -193,7 +193,7 @@ static bool register_load_tester(private_load_tester_plugin_t *this,
lib->credmgr->add_set(lib->credmgr, &this->creds->credential_set);
if (lib->settings->get_bool(lib->settings,
- "%s.plugins.load-tester.shutdown_when_complete", 0, charon->name))
+ "%s.plugins.load-tester.shutdown_when_complete", 0, lib->ns))
{
shutdown_on = this->iterations * this->initiators;
}
@@ -262,8 +262,8 @@ plugin_t *load_tester_plugin_create()
{
private_load_tester_plugin_t *this;
- if (!lib->settings->get_bool(lib->settings,
- "%s.plugins.load-tester.enable", FALSE, charon->name))
+ if (!lib->settings->get_bool(lib->settings, "%s.plugins.load-tester.enable",
+ FALSE, lib->ns))
{
DBG1(DBG_CFG, "disabling load-tester plugin, not configured");
return NULL;
@@ -279,19 +279,19 @@ plugin_t *load_tester_plugin_create()
},
},
.delay = lib->settings->get_int(lib->settings,
- "%s.plugins.load-tester.delay", 0, charon->name),
+ "%s.plugins.load-tester.delay", 0, lib->ns),
.iterations = lib->settings->get_int(lib->settings,
- "%s.plugins.load-tester.iterations", 1, charon->name),
+ "%s.plugins.load-tester.iterations", 1, lib->ns),
.initiators = lib->settings->get_int(lib->settings,
- "%s.plugins.load-tester.initiators", 0, charon->name),
+ "%s.plugins.load-tester.initiators", 0, lib->ns),
.init_limit = lib->settings->get_int(lib->settings,
- "%s.plugins.load-tester.init_limit", 0, charon->name),
+ "%s.plugins.load-tester.init_limit", 0, lib->ns),
.mutex = mutex_create(MUTEX_TYPE_DEFAULT),
.condvar = condvar_create(CONDVAR_TYPE_DEFAULT),
);
if (lib->settings->get_bool(lib->settings,
- "%s.plugins.load-tester.fake_kernel", FALSE, charon->name))
+ "%s.plugins.load-tester.fake_kernel", FALSE, lib->ns))
{
hydra->kernel_interface->add_ipsec_interface(hydra->kernel_interface,
(kernel_ipsec_constructor_t)load_tester_ipsec_create);