libcharon: Use lib->ns instead of charon->name
This commit is contained in:
parent
10c4f4e1fd
commit
d223fe807a
|
@ -181,7 +181,7 @@ static void handle_syslog_identifier(private_daemon_t *this)
|
|||
char *identifier;
|
||||
|
||||
identifier = lib->settings->get_str(lib->settings, "%s.syslog.identifier",
|
||||
NULL, charon->name);
|
||||
NULL, lib->ns);
|
||||
if (identifier)
|
||||
{ /* set identifier, which is prepended to each log line */
|
||||
if (!this->syslog_identifier ||
|
||||
|
@ -292,15 +292,15 @@ static void load_sys_logger(private_daemon_t *this, char *facility,
|
|||
sys_logger = add_sys_logger(this, facility, current_loggers);
|
||||
sys_logger->set_options(sys_logger,
|
||||
lib->settings->get_bool(lib->settings, "%s.syslog.%s.ike_name",
|
||||
FALSE, charon->name, facility));
|
||||
FALSE, lib->ns, facility));
|
||||
|
||||
def = lib->settings->get_int(lib->settings, "%s.syslog.%s.default", 1,
|
||||
charon->name, facility);
|
||||
lib->ns, facility);
|
||||
for (group = 0; group < DBG_MAX; group++)
|
||||
{
|
||||
sys_logger->set_level(sys_logger, group,
|
||||
lib->settings->get_int(lib->settings, "%s.syslog.%s.%N", def,
|
||||
charon->name, facility, debug_lower_names, group));
|
||||
lib->ns, facility, debug_lower_names, group));
|
||||
}
|
||||
charon->bus->add_logger(charon->bus, &sys_logger->logger);
|
||||
}
|
||||
|
@ -318,25 +318,25 @@ static void load_file_logger(private_daemon_t *this, char *filename,
|
|||
char *time_format;
|
||||
|
||||
time_format = lib->settings->get_str(lib->settings,
|
||||
"%s.filelog.%s.time_format", NULL, charon->name, filename);
|
||||
"%s.filelog.%s.time_format", NULL, lib->ns, filename);
|
||||
ike_name = lib->settings->get_bool(lib->settings,
|
||||
"%s.filelog.%s.ike_name", FALSE, charon->name, filename);
|
||||
"%s.filelog.%s.ike_name", FALSE, lib->ns, filename);
|
||||
flush_line = lib->settings->get_bool(lib->settings,
|
||||
"%s.filelog.%s.flush_line", FALSE, charon->name, filename);
|
||||
"%s.filelog.%s.flush_line", FALSE, lib->ns, filename);
|
||||
append = lib->settings->get_bool(lib->settings,
|
||||
"%s.filelog.%s.append", TRUE, charon->name, filename);
|
||||
"%s.filelog.%s.append", TRUE, lib->ns, filename);
|
||||
|
||||
file_logger = add_file_logger(this, filename, current_loggers);
|
||||
file_logger->set_options(file_logger, time_format, ike_name);
|
||||
file_logger->open(file_logger, flush_line, append);
|
||||
|
||||
def = lib->settings->get_int(lib->settings, "%s.filelog.%s.default", 1,
|
||||
charon->name, filename);
|
||||
lib->ns, filename);
|
||||
for (group = 0; group < DBG_MAX; group++)
|
||||
{
|
||||
file_logger->set_level(file_logger, group,
|
||||
lib->settings->get_int(lib->settings, "%s.filelog.%s.%N", def,
|
||||
charon->name, filename, debug_lower_names, group));
|
||||
lib->ns, filename, debug_lower_names, group));
|
||||
}
|
||||
charon->bus->add_logger(charon->bus, &file_logger->logger);
|
||||
}
|
||||
|
@ -353,7 +353,7 @@ METHOD(daemon_t, load_loggers, void,
|
|||
current_loggers = this->loggers;
|
||||
this->loggers = linked_list_create();
|
||||
enumerator = lib->settings->create_section_enumerator(lib->settings,
|
||||
"%s.syslog", charon->name);
|
||||
"%s.syslog", lib->ns);
|
||||
while (enumerator->enumerate(enumerator, &target))
|
||||
{
|
||||
load_sys_logger(this, target, current_loggers);
|
||||
|
@ -361,7 +361,7 @@ METHOD(daemon_t, load_loggers, void,
|
|||
enumerator->destroy(enumerator);
|
||||
|
||||
enumerator = lib->settings->create_section_enumerator(lib->settings,
|
||||
"%s.filelog", charon->name);
|
||||
"%s.filelog", lib->ns);
|
||||
while (enumerator->enumerate(enumerator, &target))
|
||||
{
|
||||
load_file_logger(this, target, current_loggers);
|
||||
|
@ -483,7 +483,7 @@ METHOD(daemon_t, start, void,
|
|||
/* start the engine, go multithreaded */
|
||||
lib->processor->set_threads(lib->processor,
|
||||
lib->settings->get_int(lib->settings, "%s.threads",
|
||||
DEFAULT_THREADS, charon->name));
|
||||
DEFAULT_THREADS, lib->ns));
|
||||
}
|
||||
|
||||
|
||||
|
@ -525,7 +525,7 @@ METHOD(daemon_t, initialize, bool,
|
|||
PLUGIN_DEPENDS(RNG, RNG_STRONG),
|
||||
PLUGIN_DEPENDS(CUSTOM, "socket"),
|
||||
};
|
||||
lib->plugins->add_static_features(lib->plugins, charon->name, features,
|
||||
lib->plugins->add_static_features(lib->plugins, lib->ns, features,
|
||||
countof(features), TRUE);
|
||||
|
||||
/* load plugins, further infrastructure may need it */
|
||||
|
|
|
@ -633,27 +633,27 @@ receiver_t *receiver_create()
|
|||
);
|
||||
|
||||
if (lib->settings->get_bool(lib->settings,
|
||||
"%s.dos_protection", TRUE, charon->name))
|
||||
"%s.dos_protection", TRUE, lib->ns))
|
||||
{
|
||||
this->cookie_threshold = lib->settings->get_int(lib->settings,
|
||||
"%s.cookie_threshold", COOKIE_THRESHOLD_DEFAULT, charon->name);
|
||||
"%s.cookie_threshold", COOKIE_THRESHOLD_DEFAULT, lib->ns);
|
||||
this->block_threshold = lib->settings->get_int(lib->settings,
|
||||
"%s.block_threshold", BLOCK_THRESHOLD_DEFAULT, charon->name);
|
||||
"%s.block_threshold", BLOCK_THRESHOLD_DEFAULT, lib->ns);
|
||||
}
|
||||
this->init_limit_job_load = lib->settings->get_int(lib->settings,
|
||||
"%s.init_limit_job_load", 0, charon->name);
|
||||
"%s.init_limit_job_load", 0, lib->ns);
|
||||
this->init_limit_half_open = lib->settings->get_int(lib->settings,
|
||||
"%s.init_limit_half_open", 0, charon->name);
|
||||
"%s.init_limit_half_open", 0, lib->ns);
|
||||
this->receive_delay = lib->settings->get_int(lib->settings,
|
||||
"%s.receive_delay", 0, charon->name);
|
||||
"%s.receive_delay", 0, lib->ns);
|
||||
this->receive_delay_type = lib->settings->get_int(lib->settings,
|
||||
"%s.receive_delay_type", 0, charon->name),
|
||||
"%s.receive_delay_type", 0, lib->ns),
|
||||
this->receive_delay_request = lib->settings->get_bool(lib->settings,
|
||||
"%s.receive_delay_request", TRUE, charon->name),
|
||||
"%s.receive_delay_request", TRUE, lib->ns),
|
||||
this->receive_delay_response = lib->settings->get_bool(lib->settings,
|
||||
"%s.receive_delay_response", TRUE, charon->name),
|
||||
"%s.receive_delay_response", TRUE, lib->ns),
|
||||
this->initiator_only = lib->settings->get_bool(lib->settings,
|
||||
"%s.initiator_only", FALSE, charon->name),
|
||||
"%s.initiator_only", FALSE, lib->ns),
|
||||
|
||||
this->hasher = lib->crypto->create_hasher(lib->crypto, HASH_SHA1);
|
||||
if (!this->hasher)
|
||||
|
|
|
@ -204,13 +204,13 @@ sender_t * sender_create()
|
|||
.got = condvar_create(CONDVAR_TYPE_DEFAULT),
|
||||
.sent = condvar_create(CONDVAR_TYPE_DEFAULT),
|
||||
.send_delay = lib->settings->get_int(lib->settings,
|
||||
"%s.send_delay", 0, charon->name),
|
||||
"%s.send_delay", 0, lib->ns),
|
||||
.send_delay_type = lib->settings->get_int(lib->settings,
|
||||
"%s.send_delay_type", 0, charon->name),
|
||||
"%s.send_delay_type", 0, lib->ns),
|
||||
.send_delay_request = lib->settings->get_bool(lib->settings,
|
||||
"%s.send_delay_request", TRUE, charon->name),
|
||||
"%s.send_delay_request", TRUE, lib->ns),
|
||||
.send_delay_response = lib->settings->get_bool(lib->settings,
|
||||
"%s.send_delay_response", TRUE, charon->name),
|
||||
"%s.send_delay_response", TRUE, lib->ns),
|
||||
);
|
||||
|
||||
lib->processor->queue_job(lib->processor,
|
||||
|
|
|
@ -100,7 +100,7 @@ android_log_logger_t *android_log_logger_create()
|
|||
},
|
||||
.mutex = mutex_create(MUTEX_TYPE_DEFAULT),
|
||||
.level = lib->settings->get_int(lib->settings,
|
||||
"%s.plugins.android_log.loglevel", 1, charon->name),
|
||||
"%s.plugins.android_log.loglevel", 1, lib->ns),
|
||||
);
|
||||
|
||||
return &this->public;
|
||||
|
|
|
@ -430,31 +430,31 @@ 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,
|
||||
"%s.plugins.certexpire.csv.local",
|
||||
NULL, charon->name),
|
||||
"%s.plugins.certexpire.csv.local",
|
||||
NULL, lib->ns),
|
||||
.remote_path = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.certexpire.csv.remote",
|
||||
NULL, charon->name),
|
||||
"%s.plugins.certexpire.csv.remote",
|
||||
NULL, lib->ns),
|
||||
.separator = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.certexpire.csv.separator",
|
||||
",", charon->name),
|
||||
"%s.plugins.certexpire.csv.separator",
|
||||
",", lib->ns),
|
||||
.format = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.certexpire.csv.format",
|
||||
"%d:%m:%Y", charon->name),
|
||||
"%s.plugins.certexpire.csv.format",
|
||||
"%d:%m:%Y", lib->ns),
|
||||
.fixed_fields = lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.certexpire.csv.fixed_fields",
|
||||
TRUE, charon->name),
|
||||
"%s.plugins.certexpire.csv.fixed_fields",
|
||||
TRUE, lib->ns),
|
||||
.empty_string = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.certexpire.csv.empty_string",
|
||||
"", charon->name),
|
||||
"%s.plugins.certexpire.csv.empty_string",
|
||||
"", lib->ns),
|
||||
.force = lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.certexpire.csv.force",
|
||||
TRUE, charon->name),
|
||||
"%s.plugins.certexpire.csv.force",
|
||||
TRUE, lib->ns),
|
||||
);
|
||||
|
||||
cron = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.certexpire.csv.cron",
|
||||
NULL, charon->name);
|
||||
NULL, lib->ns);
|
||||
if (cron)
|
||||
{
|
||||
this->cron = certexpire_cron_create(cron,
|
||||
|
|
|
@ -214,12 +214,11 @@ coupling_validator_t *coupling_validator_create()
|
|||
.mutex = mutex_create(MUTEX_TYPE_DEFAULT),
|
||||
.max_couplings = lib->settings->get_int(lib->settings,
|
||||
"%s.plugins.coupling.max", 1,
|
||||
charon->name),
|
||||
lib->ns),
|
||||
);
|
||||
|
||||
hash = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.coupling.hash", "sha1",
|
||||
charon->name);
|
||||
"%s.plugins.coupling.hash", "sha1", lib->ns);
|
||||
this->hasher = lib->crypto->create_hasher(lib->crypto,
|
||||
enum_from_name(hash_algorithm_short_names, hash));
|
||||
if (!this->hasher)
|
||||
|
@ -230,8 +229,7 @@ coupling_validator_t *coupling_validator_create()
|
|||
}
|
||||
|
||||
path = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.coupling.file", NULL,
|
||||
charon->name);
|
||||
"%s.plugins.coupling.file", NULL, lib->ns);
|
||||
if (!path)
|
||||
{
|
||||
DBG1(DBG_CFG, "coupling file path unspecified");
|
||||
|
|
|
@ -734,15 +734,15 @@ dhcp_socket_t *dhcp_socket_create()
|
|||
}
|
||||
this->identity_lease = lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.dhcp.identity_lease", FALSE,
|
||||
charon->name);
|
||||
lib->ns);
|
||||
this->force_dst = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.dhcp.force_server_address", FALSE,
|
||||
charon->name);
|
||||
lib->ns);
|
||||
this->dst = host_create_from_string(lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.dhcp.server", "255.255.255.255",
|
||||
charon->name), DHCP_SERVER_PORT);
|
||||
lib->ns), DHCP_SERVER_PORT);
|
||||
iface = lib->settings->get_str(lib->settings, "%s.plugins.dhcp.interface",
|
||||
NULL, charon->name);
|
||||
NULL, lib->ns);
|
||||
if (!this->dst)
|
||||
{
|
||||
DBG1(DBG_CFG, "configured DHCP server address invalid");
|
||||
|
|
|
@ -74,7 +74,7 @@ METHOD(plugin_t, reload, bool,
|
|||
private_dnscert_plugin_t *this)
|
||||
{
|
||||
bool enabled = lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.dnscert.enable", FALSE, charon->name);
|
||||
"%s.plugins.dnscert.enable", FALSE, lib->ns);
|
||||
|
||||
if (enabled != this->enabled)
|
||||
{
|
||||
|
|
|
@ -130,7 +130,7 @@ duplicheck_notify_t *duplicheck_notify_create()
|
|||
|
||||
uri = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.duplicheck.socket", "unix://" DUPLICHECK_SOCKET,
|
||||
charon->name);
|
||||
lib->ns);
|
||||
this->service = lib->streams->create_service(lib->streams, uri, 3);
|
||||
if (!this->service)
|
||||
{
|
||||
|
|
|
@ -93,7 +93,7 @@ plugin_t *duplicheck_plugin_create()
|
|||
private_duplicheck_plugin_t *this;
|
||||
|
||||
if (!lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.duplicheck.enable", TRUE, charon->name))
|
||||
"%s.plugins.duplicheck.enable", TRUE, lib->ns))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -721,7 +721,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,
|
||||
"%s.plugins.eap-aka.request_identity", TRUE, charon->name);
|
||||
"%s.plugins.eap-aka.request_identity", TRUE, lib->ns);
|
||||
|
||||
/* generate a non-zero identifier */
|
||||
do {
|
||||
|
|
|
@ -177,7 +177,7 @@ eap_aka_3gpp2_card_t *eap_aka_3gpp2_card_create(eap_aka_3gpp2_functions_t *f)
|
|||
#else /* !SEQ_CHECK */
|
||||
FALSE,
|
||||
#endif /* SEQ_CHECK */
|
||||
charon->name),
|
||||
lib->ns),
|
||||
);
|
||||
|
||||
eap_aka_3gpp2_get_sqn(this->sqn, 0);
|
||||
|
|
|
@ -377,14 +377,14 @@ eap_dynamic_t *eap_dynamic_create(identification_t *server,
|
|||
.server = server->clone(server),
|
||||
.types = linked_list_create(),
|
||||
.prefer_peer = lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.eap-dynamic.prefer_peer", FALSE, charon->name),
|
||||
"%s.plugins.eap-dynamic.prefer_peer", FALSE, lib->ns),
|
||||
);
|
||||
|
||||
/* get all supported EAP methods */
|
||||
get_supported_eap_types(this);
|
||||
/* move preferred methods to the front */
|
||||
preferred = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.eap-dynamic.preferred", NULL, charon->name);
|
||||
"%s.plugins.eap-dynamic.preferred", NULL, lib->ns);
|
||||
if (preferred)
|
||||
{
|
||||
handle_preferred_eap_types(this, preferred);
|
||||
|
|
|
@ -149,7 +149,7 @@ METHOD(eap_method_t, process_server, status_t,
|
|||
/* get XAuth backend to use for credential verification. Default to PAM
|
||||
* to support legacy EAP-GTC configurations */
|
||||
backend = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.eap-gtc.backend", "pam", charon->name);
|
||||
"%s.plugins.eap-gtc.backend", "pam", lib->ns);
|
||||
xauth = charon->xauth->create_instance(charon->xauth, backend, XAUTH_SERVER,
|
||||
this->server, this->peer);
|
||||
if (!xauth)
|
||||
|
|
|
@ -157,18 +157,18 @@ static eap_peap_t *eap_peap_create(private_eap_peap_t * this,
|
|||
|
||||
if (is_server && !lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.eap-peap.request_peer_auth", FALSE,
|
||||
charon->name))
|
||||
lib->ns))
|
||||
{
|
||||
peer = NULL;
|
||||
}
|
||||
frag_size = lib->settings->get_int(lib->settings,
|
||||
"%s.plugins.eap-peap.fragment_size", MAX_FRAGMENT_LEN,
|
||||
charon->name);
|
||||
lib->ns);
|
||||
max_msg_count = lib->settings->get_int(lib->settings,
|
||||
"%s.plugins.eap-peap.max_message_count", MAX_MESSAGE_COUNT,
|
||||
charon->name);
|
||||
lib->ns);
|
||||
include_length = lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.eap-peap.include_length", FALSE, charon->name);
|
||||
"%s.plugins.eap-peap.include_length", FALSE, lib->ns);
|
||||
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,
|
||||
|
|
|
@ -92,7 +92,7 @@ static status_t start_phase2_auth(private_eap_peap_server_t *this)
|
|||
|
||||
eap_type_str = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.eap-peap.phase2_method", "mschapv2",
|
||||
charon->name);
|
||||
lib->ns);
|
||||
type = eap_type_from_string(eap_type_str);
|
||||
if (type == 0)
|
||||
{
|
||||
|
@ -129,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,
|
||||
"%s.plugins.eap-peap.phase2_tnc", FALSE, charon->name))
|
||||
"%s.plugins.eap-peap.phase2_tnc", FALSE, lib->ns))
|
||||
{
|
||||
DBG1(DBG_IKE, "phase2 method %N selected", eap_type_names, EAP_TNC);
|
||||
this->ph2_method = charon->eap->create_instance(charon->eap, EAP_TNC,
|
||||
|
@ -274,7 +274,7 @@ METHOD(tls_application_t, process, status_t,
|
|||
|
||||
/* Start Phase 2 of EAP-PEAP authentication */
|
||||
if (lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.eap-peap.request_peer_auth", FALSE, charon->name))
|
||||
"%s.plugins.eap-peap.request_peer_auth", FALSE, lib->ns))
|
||||
{
|
||||
return start_phase2_tnc(this);
|
||||
}
|
||||
|
@ -425,7 +425,7 @@ eap_peap_server_t *eap_peap_server_create(identification_t *server,
|
|||
.start_phase2_tnc = TRUE,
|
||||
.start_phase2_id = lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.eap-peap.phase2_piggyback",
|
||||
FALSE, charon->name),
|
||||
FALSE, lib->ns),
|
||||
.phase2_result = EAP_FAILURE,
|
||||
.avp = eap_peap_avp_create(TRUE),
|
||||
);
|
||||
|
|
|
@ -188,7 +188,7 @@ void eap_radius_build_attributes(radius_message_t *request)
|
|||
}
|
||||
if (lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.eap-radius.station_id_with_port",
|
||||
TRUE, charon->name))
|
||||
TRUE, lib->ns))
|
||||
{
|
||||
station_id_fmt = "%#H";
|
||||
}
|
||||
|
@ -573,12 +573,12 @@ static void process_cfg_attributes(radius_message_t *msg)
|
|||
void eap_radius_process_attributes(radius_message_t *message)
|
||||
{
|
||||
if (lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.eap-radius.class_group", FALSE, charon->name))
|
||||
"%s.plugins.eap-radius.class_group", FALSE, lib->ns))
|
||||
{
|
||||
process_class(message);
|
||||
}
|
||||
if (lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.eap-radius.filter_id", FALSE, charon->name))
|
||||
"%s.plugins.eap-radius.filter_id", FALSE, lib->ns))
|
||||
{
|
||||
process_filter_id(message);
|
||||
}
|
||||
|
@ -720,10 +720,10 @@ eap_radius_t *eap_radius_create(identification_t *server, identification_t *peer
|
|||
.type = EAP_RADIUS,
|
||||
.eap_start = lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.eap-radius.eap_start", FALSE,
|
||||
charon->name),
|
||||
lib->ns),
|
||||
.id_prefix = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.eap-radius.id_prefix", "",
|
||||
charon->name),
|
||||
lib->ns),
|
||||
);
|
||||
this->client = eap_radius_create_client();
|
||||
if (!this->client)
|
||||
|
|
|
@ -712,7 +712,7 @@ eap_radius_accounting_t *eap_radius_accounting_create()
|
|||
.mutex = mutex_create(MUTEX_TYPE_DEFAULT),
|
||||
);
|
||||
if (lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.eap-radius.station_id_with_port", TRUE, charon->name))
|
||||
"%s.plugins.eap-radius.station_id_with_port", TRUE, lib->ns))
|
||||
{
|
||||
this->station_id_fmt = "%#H";
|
||||
}
|
||||
|
@ -721,14 +721,14 @@ eap_radius_accounting_t *eap_radius_accounting_create()
|
|||
this->station_id_fmt = "%H";
|
||||
}
|
||||
if (lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.eap-radius.accounting", FALSE, charon->name))
|
||||
"%s.plugins.eap-radius.accounting", FALSE, lib->ns))
|
||||
{
|
||||
singleton = this;
|
||||
charon->bus->add_listener(charon->bus, &this->public.listener);
|
||||
}
|
||||
this->acct_req_vip = lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.eap-radius.accounting_requires_vip",
|
||||
FALSE, charon->name);
|
||||
FALSE, lib->ns);
|
||||
|
||||
return &this->public;
|
||||
}
|
||||
|
|
|
@ -452,11 +452,11 @@ static bool open_socket(private_eap_radius_dae_t *this)
|
|||
|
||||
host = host_create_from_string(
|
||||
lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.eap-radius.dae.listen", "0.0.0.0",
|
||||
charon->name),
|
||||
"%s.plugins.eap-radius.dae.listen", "0.0.0.0",
|
||||
lib->ns),
|
||||
lib->settings->get_int(lib->settings,
|
||||
"%s.plugins.eap-radius.dae.port", RADIUS_DAE_PORT,
|
||||
charon->name));
|
||||
"%s.plugins.eap-radius.dae.port", RADIUS_DAE_PORT,
|
||||
lib->ns));
|
||||
if (!host)
|
||||
{
|
||||
DBG1(DBG_CFG, "invalid RADIUS DAE listen address");
|
||||
|
@ -504,7 +504,7 @@ eap_radius_dae_t *eap_radius_dae_create(eap_radius_accounting_t *accounting)
|
|||
.secret = {
|
||||
.ptr = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.eap-radius.dae.secret", NULL,
|
||||
charon->name),
|
||||
lib->ns),
|
||||
},
|
||||
.hasher = lib->crypto->create_hasher(lib->crypto, HASH_MD5),
|
||||
.signer = lib->crypto->create_signer(lib->crypto, AUTH_HMAC_MD5_128),
|
||||
|
|
|
@ -438,10 +438,10 @@ eap_radius_forward_t *eap_radius_forward_create()
|
|||
},
|
||||
.from_attr = parse_selector(lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.eap-radius.forward.ike_to_radius", "",
|
||||
charon->name)),
|
||||
lib->ns)),
|
||||
.to_attr = parse_selector(lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.eap-radius.forward.radius_to_ike", "",
|
||||
charon->name)),
|
||||
lib->ns)),
|
||||
.from = hashtable_create((hashtable_hash_t)hash,
|
||||
(hashtable_equals_t)equals, 8),
|
||||
.to = hashtable_create((hashtable_hash_t)hash,
|
||||
|
|
|
@ -100,23 +100,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,
|
||||
"%s.plugins.eap-radius.server", NULL, charon->name);
|
||||
"%s.plugins.eap-radius.server", NULL, lib->ns);
|
||||
if (address)
|
||||
{ /* legacy configuration */
|
||||
secret = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.eap-radius.secret", NULL, charon->name);
|
||||
"%s.plugins.eap-radius.secret", NULL, lib->ns);
|
||||
if (!secret)
|
||||
{
|
||||
DBG1(DBG_CFG, "no RADIUS secret defined");
|
||||
return;
|
||||
}
|
||||
nas_identifier = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.eap-radius.nas_identifier", "strongSwan",
|
||||
charon->name);
|
||||
"%s.plugins.eap-radius.nas_identifier", "strongSwan",
|
||||
lib->ns);
|
||||
auth_port = lib->settings->get_int(lib->settings,
|
||||
"%s.plugins.eap-radius.port", AUTH_PORT, charon->name);
|
||||
"%s.plugins.eap-radius.port", AUTH_PORT, lib->ns);
|
||||
sockets = lib->settings->get_int(lib->settings,
|
||||
"%s.plugins.eap-radius.sockets", 1, charon->name);
|
||||
"%s.plugins.eap-radius.sockets", 1, lib->ns);
|
||||
config = radius_config_create(address, address, auth_port, ACCT_PORT,
|
||||
nas_identifier, secret, sockets, 0);
|
||||
if (!config)
|
||||
|
@ -129,12 +129,12 @@ static void load_configs(private_eap_radius_plugin_t *this)
|
|||
}
|
||||
|
||||
enumerator = lib->settings->create_section_enumerator(lib->settings,
|
||||
"%s.plugins.eap-radius.servers", charon->name);
|
||||
"%s.plugins.eap-radius.servers", lib->ns);
|
||||
while (enumerator->enumerate(enumerator, §ion))
|
||||
{
|
||||
address = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.eap-radius.servers.%s.address", NULL,
|
||||
charon->name, section);
|
||||
lib->ns, section);
|
||||
if (!address)
|
||||
{
|
||||
DBG1(DBG_CFG, "RADIUS server '%s' misses address, skipped", section);
|
||||
|
@ -142,7 +142,7 @@ static void load_configs(private_eap_radius_plugin_t *this)
|
|||
}
|
||||
secret = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.eap-radius.servers.%s.secret", NULL,
|
||||
charon->name, section);
|
||||
lib->ns, section);
|
||||
if (!secret)
|
||||
{
|
||||
DBG1(DBG_CFG, "RADIUS server '%s' misses secret, skipped", section);
|
||||
|
@ -150,22 +150,22 @@ static void load_configs(private_eap_radius_plugin_t *this)
|
|||
}
|
||||
nas_identifier = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.eap-radius.servers.%s.nas_identifier", "strongSwan",
|
||||
charon->name, section);
|
||||
lib->ns, section);
|
||||
auth_port = lib->settings->get_int(lib->settings,
|
||||
"%s.plugins.eap-radius.servers.%s.auth_port",
|
||||
lib->settings->get_int(lib->settings,
|
||||
"%s.plugins.eap-radius.servers.%s.port",
|
||||
AUTH_PORT, charon->name, section),
|
||||
charon->name, section);
|
||||
AUTH_PORT, lib->ns, section),
|
||||
lib->ns, section);
|
||||
acct_port = lib->settings->get_int(lib->settings,
|
||||
"%s.plugins.eap-radius.servers.%s.acct_port", ACCT_PORT,
|
||||
charon->name, section);
|
||||
lib->ns, section);
|
||||
sockets = lib->settings->get_int(lib->settings,
|
||||
"%s.plugins.eap-radius.servers.%s.sockets", 1,
|
||||
charon->name, section);
|
||||
lib->ns, section);
|
||||
preference = lib->settings->get_int(lib->settings,
|
||||
"%s.plugins.eap-radius.servers.%s.preference", 0,
|
||||
charon->name, section);
|
||||
lib->ns, section);
|
||||
config = radius_config_create(section, address, auth_port, acct_port,
|
||||
nas_identifier, secret, sockets, preference);
|
||||
if (!config)
|
||||
|
@ -203,7 +203,7 @@ static bool plugin_cb(private_eap_radius_plugin_t *this,
|
|||
load_configs(this);
|
||||
|
||||
if (lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.eap-radius.dae.enable", FALSE, charon->name))
|
||||
"%s.plugins.eap-radius.dae.enable", FALSE, lib->ns))
|
||||
{
|
||||
this->dae = eap_radius_dae_create(this->accounting);
|
||||
}
|
||||
|
@ -368,7 +368,7 @@ void eap_radius_handle_timeout(ike_sa_id_t *id)
|
|||
|
||||
if (lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.eap-radius.close_all_on_timeout",
|
||||
FALSE, charon->name))
|
||||
FALSE, lib->ns))
|
||||
{
|
||||
DBG1(DBG_CFG, "deleting all IKE_SAs after RADIUS timeout");
|
||||
lib->processor->queue_job(lib->processor,
|
||||
|
|
|
@ -256,7 +256,7 @@ static bool parse_rounds(private_eap_radius_xauth_t *this, char *profile)
|
|||
}
|
||||
|
||||
enumerator = lib->settings->create_key_value_enumerator(lib->settings,
|
||||
"%s.plugins.eap-radius.xauth.%s", charon->name, profile);
|
||||
"%s.plugins.eap-radius.xauth.%s", lib->ns, profile);
|
||||
while (enumerator->enumerate(enumerator, &type, &message))
|
||||
{
|
||||
bool invalid = TRUE;
|
||||
|
|
|
@ -635,7 +635,7 @@ eap_sim_server_t *eap_sim_server_create(identification_t *server,
|
|||
this->use_reauth = this->use_pseudonym = this->use_permanent =
|
||||
lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.eap-sim.request_identity", TRUE,
|
||||
charon->name);
|
||||
lib->ns);
|
||||
|
||||
/* generate a non-zero identifier */
|
||||
do {
|
||||
|
|
|
@ -66,7 +66,7 @@ static bool load_db(private_eap_simaka_sql_t *this,
|
|||
|
||||
uri = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.eap-simaka-sql.database", NULL,
|
||||
charon->name);
|
||||
lib->ns);
|
||||
if (!uri)
|
||||
{
|
||||
DBG1(DBG_CFG, "eap-simaka-sql database URI missing");
|
||||
|
@ -80,7 +80,7 @@ static bool load_db(private_eap_simaka_sql_t *this,
|
|||
}
|
||||
remove_used = lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.eap-simaka-sql.remove_used", FALSE,
|
||||
charon->name);
|
||||
lib->ns);
|
||||
|
||||
this->provider = eap_simaka_sql_provider_create(this->db, remove_used);
|
||||
this->card = eap_simaka_sql_card_create(this->db, remove_used);
|
||||
|
|
|
@ -145,12 +145,12 @@ static eap_tls_t *eap_tls_create(identification_t *server,
|
|||
|
||||
frag_size = lib->settings->get_int(lib->settings,
|
||||
"%s.plugins.eap-tls.fragment_size", MAX_FRAGMENT_LEN,
|
||||
charon->name);
|
||||
lib->ns);
|
||||
max_msg_count = lib->settings->get_int(lib->settings,
|
||||
"%s.plugins.eap-tls.max_message_count", MAX_MESSAGE_COUNT,
|
||||
charon->name);
|
||||
lib->ns);
|
||||
include_length = lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.eap-tls.include_length", TRUE, charon->name);
|
||||
"%s.plugins.eap-tls.include_length", TRUE, lib->ns);
|
||||
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);
|
||||
|
|
|
@ -273,10 +273,10 @@ static eap_tnc_t *eap_tnc_create(identification_t *server,
|
|||
);
|
||||
|
||||
max_msg_count = lib->settings->get_int(lib->settings,
|
||||
"%s.plugins.eap-tnc.max_message_count",
|
||||
EAP_TNC_MAX_MESSAGE_COUNT, charon->name);
|
||||
"%s.plugins.eap-tnc.max_message_count",
|
||||
EAP_TNC_MAX_MESSAGE_COUNT, lib->ns);
|
||||
protocol = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.eap-tnc.protocol", "tnccs-1.1", charon->name);
|
||||
"%s.plugins.eap-tnc.protocol", "tnccs-1.1", lib->ns);
|
||||
if (strcaseeq(protocol, "tnccs-2.0"))
|
||||
{
|
||||
type = TNCCS_2_0;
|
||||
|
|
|
@ -147,18 +147,18 @@ static eap_ttls_t *eap_ttls_create(identification_t *server,
|
|||
);
|
||||
if (is_server && !lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.eap-ttls.request_peer_auth", FALSE,
|
||||
charon->name))
|
||||
lib->ns))
|
||||
{
|
||||
peer = NULL;
|
||||
}
|
||||
frag_size = lib->settings->get_int(lib->settings,
|
||||
"%s.plugins.eap-ttls.fragment_size", MAX_FRAGMENT_LEN,
|
||||
charon->name);
|
||||
lib->ns);
|
||||
max_msg_count = lib->settings->get_int(lib->settings,
|
||||
"%s.plugins.eap-ttls.max_message_count", MAX_MESSAGE_COUNT,
|
||||
charon->name);
|
||||
lib->ns);
|
||||
include_length = lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.eap-ttls.include_length", TRUE, charon->name);
|
||||
"%s.plugins.eap-ttls.include_length", TRUE, lib->ns);
|
||||
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,
|
||||
|
|
|
@ -80,7 +80,7 @@ static status_t start_phase2_auth(private_eap_ttls_server_t *this)
|
|||
|
||||
eap_type_str = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.eap-ttls.phase2_method", "md5",
|
||||
charon->name);
|
||||
lib->ns);
|
||||
type = eap_type_from_string(eap_type_str);
|
||||
if (type == 0)
|
||||
{
|
||||
|
@ -115,7 +115,7 @@ static status_t start_phase2_tnc(private_eap_ttls_server_t *this,
|
|||
eap_inner_method_t *inner_method;
|
||||
|
||||
if (this->start_phase2_tnc && lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.eap-ttls.phase2_tnc", FALSE, charon->name))
|
||||
"%s.plugins.eap-ttls.phase2_tnc", FALSE, lib->ns))
|
||||
{
|
||||
DBG1(DBG_IKE, "phase2 method %N selected", eap_type_names, EAP_TNC);
|
||||
this->method = charon->eap->create_instance(charon->eap, EAP_TNC,
|
||||
|
@ -242,7 +242,7 @@ METHOD(tls_application_t, process, status_t,
|
|||
|
||||
/* Start Phase 2 of EAP-TTLS authentication */
|
||||
if (lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.eap-ttls.request_peer_auth", FALSE, charon->name))
|
||||
"%s.plugins.eap-ttls.request_peer_auth", FALSE, lib->ns))
|
||||
{
|
||||
return start_phase2_tnc(this, EAP_TLS);
|
||||
}
|
||||
|
@ -301,7 +301,7 @@ METHOD(tls_application_t, build, status_t,
|
|||
|
||||
if (this->method == NULL && this->start_phase2 &&
|
||||
lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.eap-ttls.phase2_piggyback", FALSE, charon->name))
|
||||
"%s.plugins.eap-ttls.phase2_piggyback", FALSE, lib->ns))
|
||||
{
|
||||
/* generate an EAP Identity request which will be piggybacked right
|
||||
* onto the TLS Finished message thus initiating EAP-TTLS phase2
|
||||
|
|
|
@ -142,7 +142,7 @@ error_notify_socket_t *error_notify_socket_create()
|
|||
|
||||
uri = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.error-notify.socket", "unix://" ERROR_NOTIFY_SOCKET,
|
||||
charon->name);
|
||||
lib->ns);
|
||||
this->service = lib->streams->create_service(lib->streams, uri, 10);
|
||||
if (!this->service)
|
||||
{
|
||||
|
|
|
@ -309,7 +309,7 @@ static void load_pools(private_ha_attribute_t *this)
|
|||
pool_t *pool;
|
||||
|
||||
enumerator = lib->settings->create_key_value_enumerator(lib->settings,
|
||||
"%s.plugins.ha.pools", charon->name);
|
||||
"%s.plugins.ha.pools", lib->ns);
|
||||
while (enumerator->enumerate(enumerator, &name, &net))
|
||||
{
|
||||
net = strdup(net);
|
||||
|
|
|
@ -160,19 +160,19 @@ plugin_t *ha_plugin_create()
|
|||
bool fifo, monitor, resync;
|
||||
|
||||
local = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.ha.local", NULL, charon->name);
|
||||
"%s.plugins.ha.local", NULL, lib->ns);
|
||||
remote = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.ha.remote", NULL, charon->name);
|
||||
"%s.plugins.ha.remote", NULL, lib->ns);
|
||||
secret = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.ha.secret", NULL, charon->name);
|
||||
"%s.plugins.ha.secret", NULL, lib->ns);
|
||||
fifo = lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.ha.fifo_interface", TRUE, charon->name);
|
||||
"%s.plugins.ha.fifo_interface", TRUE, lib->ns);
|
||||
monitor = lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.ha.monitor", TRUE, charon->name);
|
||||
"%s.plugins.ha.monitor", TRUE, lib->ns);
|
||||
resync = lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.ha.resync", TRUE, charon->name);
|
||||
"%s.plugins.ha.resync", TRUE, lib->ns);
|
||||
count = min(SEGMENTS_MAX, lib->settings->get_int(lib->settings,
|
||||
"%s.plugins.ha.segment_count", 1, charon->name));
|
||||
"%s.plugins.ha.segment_count", 1, lib->ns));
|
||||
if (!local || !remote)
|
||||
{
|
||||
DBG1(DBG_CFG, "HA config misses local/remote address");
|
||||
|
|
|
@ -470,12 +470,12 @@ ha_segments_t *ha_segments_create(ha_socket_t *socket, ha_kernel_t *kernel,
|
|||
.condvar = condvar_create(CONDVAR_TYPE_DEFAULT),
|
||||
.heartbeat_delay = lib->settings->get_int(lib->settings,
|
||||
"%s.plugins.ha.heartbeat_delay", DEFAULT_HEARTBEAT_DELAY,
|
||||
charon->name),
|
||||
lib->ns),
|
||||
.heartbeat_timeout = lib->settings->get_int(lib->settings,
|
||||
"%s.plugins.ha.heartbeat_timeout", DEFAULT_HEARTBEAT_TIMEOUT,
|
||||
charon->name),
|
||||
lib->ns),
|
||||
.autobalance = lib->settings->get_int(lib->settings,
|
||||
"%s.plugins.ha.autobalance", 0, charon->name),
|
||||
"%s.plugins.ha.autobalance", 0, lib->ns),
|
||||
);
|
||||
|
||||
if (monitor)
|
||||
|
|
|
@ -53,7 +53,7 @@ METHOD(plugin_t, reload, bool,
|
|||
private_ipseckey_plugin_t *this)
|
||||
{
|
||||
bool enabled = lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.ipseckey.enable", FALSE, charon->name);
|
||||
"%s.plugins.ipseckey.enable", FALSE, lib->ns);
|
||||
|
||||
if (enabled != this->enabled)
|
||||
{
|
||||
|
|
|
@ -144,6 +144,6 @@ plugin_t *kernel_libipsec_plugin_create()
|
|||
|
||||
/* set TUN device as default to install VIPs */
|
||||
lib->settings->set_str(lib->settings, "%s.install_virtual_ip_on",
|
||||
this->tun->get_name(this->tun), charon->name);
|
||||
this->tun->get_name(this->tun), lib->ns);
|
||||
return &this->public.plugin;
|
||||
}
|
||||
|
|
|
@ -230,12 +230,12 @@ led_listener_t *led_listener_create()
|
|||
},
|
||||
.mutex = mutex_create(MUTEX_TYPE_DEFAULT),
|
||||
.blink_time = lib->settings->get_int(lib->settings,
|
||||
"%s.plugins.led.blink_time", 50, charon->name),
|
||||
"%s.plugins.led.blink_time", 50, lib->ns),
|
||||
);
|
||||
|
||||
this->activity = open_led(lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.led.activity_led", NULL, charon->name),
|
||||
&this->activity_max);
|
||||
"%s.plugins.led.activity_led", NULL, lib->ns),
|
||||
&this->activity_max);
|
||||
set_led(this->activity, 0);
|
||||
|
||||
return &this->public;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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,
|
||||
);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -393,8 +393,8 @@ lookip_socket_t *lookip_socket_create(lookip_listener_t *listener)
|
|||
);
|
||||
|
||||
uri = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.lookip.socket", "unix://" LOOKIP_SOCKET,
|
||||
charon->name);
|
||||
"%s.plugins.lookip.socket", "unix://" LOOKIP_SOCKET,
|
||||
lib->ns);
|
||||
this->service = lib->streams->create_service(lib->streams, uri, 10);
|
||||
if (!this->service)
|
||||
{
|
||||
|
|
|
@ -180,9 +180,9 @@ radattr_listener_t *radattr_listener_create()
|
|||
.destroy = _destroy,
|
||||
},
|
||||
.dir = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.radattr.dir", NULL, charon->name),
|
||||
"%s.plugins.radattr.dir", NULL, lib->ns),
|
||||
.mid = lib->settings->get_int(lib->settings,
|
||||
"%s.plugins.radattr.message_id", -1, charon->name),
|
||||
"%s.plugins.radattr.message_id", -1, lib->ns),
|
||||
);
|
||||
|
||||
return &this->public;
|
||||
|
|
|
@ -617,7 +617,7 @@ static int open_socket(private_socket_default_socket_t *this,
|
|||
mark_t mark;
|
||||
|
||||
fwmark = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.socket-default.fwmark", NULL, charon->name);
|
||||
"%s.plugins.socket-default.fwmark", NULL, lib->ns);
|
||||
if (fwmark && mark_from_string(fwmark, &mark))
|
||||
{
|
||||
if (setsockopt(skt, SOL_SOCKET, SO_MARK, &mark.value,
|
||||
|
@ -657,10 +657,10 @@ static bool use_family(int family)
|
|||
{
|
||||
case AF_INET:
|
||||
return lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.socket-default.use_ipv4", TRUE, charon->name);
|
||||
"%s.plugins.socket-default.use_ipv4", TRUE, lib->ns);
|
||||
case AF_INET6:
|
||||
return lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.socket-default.use_ipv6", TRUE, charon->name);
|
||||
"%s.plugins.socket-default.use_ipv6", TRUE, lib->ns);
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -735,14 +735,14 @@ socket_default_socket_t *socket_default_socket_create()
|
|||
},
|
||||
},
|
||||
.port = lib->settings->get_int(lib->settings,
|
||||
"%s.port", CHARON_UDP_PORT, charon->name),
|
||||
"%s.port", CHARON_UDP_PORT, lib->ns),
|
||||
.natt = lib->settings->get_int(lib->settings,
|
||||
"%s.port_nat_t", CHARON_NATT_PORT, charon->name),
|
||||
"%s.port_nat_t", CHARON_NATT_PORT, lib->ns),
|
||||
.max_packet = lib->settings->get_int(lib->settings,
|
||||
"%s.max_packet", MAX_PACKET, charon->name),
|
||||
"%s.max_packet", MAX_PACKET, lib->ns),
|
||||
.set_source = lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.socket-default.set_source", TRUE,
|
||||
charon->name),
|
||||
lib->ns),
|
||||
);
|
||||
|
||||
if (this->port && this->port == this->natt)
|
||||
|
|
|
@ -668,7 +668,7 @@ socket_dynamic_socket_t *socket_dynamic_socket_create()
|
|||
},
|
||||
.lock = rwlock_create(RWLOCK_TYPE_DEFAULT),
|
||||
.max_packet = lib->settings->get_int(lib->settings,
|
||||
"%s.max_packet", MAX_PACKET, charon->name),
|
||||
"%s.max_packet", MAX_PACKET, lib->ns),
|
||||
);
|
||||
|
||||
if (pipe(this->notify) != 0)
|
||||
|
|
|
@ -141,7 +141,7 @@ sql_logger_t *sql_logger_create(database_t *db)
|
|||
.db = db,
|
||||
.recursive = thread_value_create(NULL),
|
||||
.level = lib->settings->get_int(lib->settings,
|
||||
"%s.plugins.sql.loglevel", -1, charon->name),
|
||||
"%s.plugins.sql.loglevel", -1, lib->ns),
|
||||
);
|
||||
|
||||
return &this->public;
|
||||
|
|
|
@ -73,7 +73,7 @@ static bool open_database(private_sql_plugin_t *this,
|
|||
char *uri;
|
||||
|
||||
uri = lib->settings->get_str(lib->settings, "%s.plugins.sql.database",
|
||||
NULL, charon->name);
|
||||
NULL, lib->ns);
|
||||
if (!uri)
|
||||
{
|
||||
DBG1(DBG_CFG, "sql plugin: database URI not set");
|
||||
|
|
|
@ -778,7 +778,7 @@ stroke_control_t *stroke_control_create()
|
|||
.destroy = _destroy,
|
||||
},
|
||||
.timeout = lib->settings->get_int(lib->settings,
|
||||
"%s.plugins.stroke.timeout", 0, charon->name),
|
||||
"%s.plugins.stroke.timeout", 0, lib->ns),
|
||||
);
|
||||
|
||||
return &this->public;
|
||||
|
|
|
@ -1379,7 +1379,7 @@ stroke_cred_t *stroke_cred_create()
|
|||
|
||||
this->force_ca_cert = lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.stroke.ignore_missing_ca_basic_constraint",
|
||||
FALSE, charon->name);
|
||||
FALSE, lib->ns);
|
||||
|
||||
load_certs(this);
|
||||
load_secrets(this, NULL, SECRETS_FILE, 0, NULL);
|
||||
|
|
|
@ -763,7 +763,7 @@ stroke_socket_t *stroke_socket_create()
|
|||
.destroy = _destroy,
|
||||
},
|
||||
.prevent_loglevel_changes = lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.stroke.prevent_loglevel_changes", FALSE, charon->name),
|
||||
"%s.plugins.stroke.prevent_loglevel_changes", FALSE, lib->ns),
|
||||
);
|
||||
|
||||
this->cred = stroke_cred_create();
|
||||
|
@ -783,10 +783,10 @@ stroke_socket_t *stroke_socket_create()
|
|||
charon->bus->add_listener(charon->bus, &this->counter->listener);
|
||||
|
||||
max_concurrent = lib->settings->get_int(lib->settings,
|
||||
"%s.plugins.stroke.max_concurrent", MAX_CONCURRENT_DEFAULT,
|
||||
charon->name);
|
||||
"%s.plugins.stroke.max_concurrent", MAX_CONCURRENT_DEFAULT,
|
||||
lib->ns);
|
||||
uri = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.stroke.socket", "unix://" STROKE_SOCKET, charon->name);
|
||||
"%s.plugins.stroke.socket", "unix://" STROKE_SOCKET, lib->ns);
|
||||
this->service = lib->streams->create_service(lib->streams, uri, 10);
|
||||
if (!this->service)
|
||||
{
|
||||
|
|
|
@ -178,9 +178,9 @@ static bool load_validator(private_systime_fix_plugin_t *this)
|
|||
char *str, *fmt;
|
||||
|
||||
fmt = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.%s.threshold_format", "%Y", charon->name, get_name(this));
|
||||
"%s.plugins.%s.threshold_format", "%Y", lib->ns, get_name(this));
|
||||
str = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.%s.threshold", NULL, charon->name, get_name(this));
|
||||
"%s.plugins.%s.threshold", NULL, lib->ns, get_name(this));
|
||||
if (!str)
|
||||
{
|
||||
DBG1(DBG_CFG, "no threshold configured for %s, disabled",
|
||||
|
@ -274,9 +274,9 @@ plugin_t *systime_fix_plugin_create()
|
|||
},
|
||||
},
|
||||
.interval = lib->settings->get_int(lib->settings,
|
||||
"%s.plugins.%s.interval", 0, charon->name, get_name(this)),
|
||||
"%s.plugins.%s.interval", 0, lib->ns, get_name(this)),
|
||||
.reauth = lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.%s.reauth", FALSE, charon->name, get_name(this)),
|
||||
"%s.plugins.%s.reauth", FALSE, lib->ns, get_name(this)),
|
||||
);
|
||||
|
||||
return &this->public.plugin;
|
||||
|
|
|
@ -191,8 +191,8 @@ tnc_ifmap_listener_t *tnc_ifmap_listener_create(bool reload)
|
|||
|
||||
/* schedule periodic transmission of IF-MAP renewSession request */
|
||||
reschedule = lib->settings->get_int(lib->settings,
|
||||
"%s.plugins.tnc-ifmap.renew_session_interval",
|
||||
IFMAP_RENEW_SESSION_INTERVAL, charon->name);
|
||||
"%s.plugins.tnc-ifmap.renew_session_interval",
|
||||
IFMAP_RENEW_SESSION_INTERVAL, lib->ns);
|
||||
|
||||
job = (job_t*)tnc_ifmap_renew_session_job_create(
|
||||
this->ifmap->get_ref(this->ifmap), reschedule);
|
||||
|
|
|
@ -134,8 +134,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,
|
||||
"%s.plugins.tnc-ifmap.device_name",
|
||||
this->ifmap_publisher_id, charon->name);
|
||||
"%s.plugins.tnc-ifmap.device_name",
|
||||
this->ifmap_publisher_id, lib->ns);
|
||||
this->device_name = strdup(this->device_name);
|
||||
|
||||
return this->session_id && this->ifmap_publisher_id;
|
||||
|
@ -731,15 +731,15 @@ static bool soap_init(private_tnc_ifmap_soap_t *this)
|
|||
|
||||
/* getting configuration parameters from strongswan.conf */
|
||||
server_uri = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.tnc-ifmap.server_uri", IFMAP_URI, charon->name);
|
||||
"%s.plugins.tnc-ifmap.server_uri", IFMAP_URI, lib->ns);
|
||||
server_cert = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.tnc-ifmap.server_cert", NULL, charon->name);
|
||||
"%s.plugins.tnc-ifmap.server_cert", NULL, lib->ns);
|
||||
client_cert = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.tnc-ifmap.client_cert", NULL, charon->name);
|
||||
"%s.plugins.tnc-ifmap.client_cert", NULL, lib->ns);
|
||||
client_key = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.tnc-ifmap.client_key", NULL, charon->name);
|
||||
"%s.plugins.tnc-ifmap.client_key", NULL, lib->ns);
|
||||
user_pass = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.tnc-ifmap.username_password", NULL, charon->name);
|
||||
"%s.plugins.tnc-ifmap.username_password", NULL, lib->ns);
|
||||
|
||||
/* load [self-signed] MAP server certificate */
|
||||
if (!server_cert)
|
||||
|
|
|
@ -758,19 +758,19 @@ tnc_pdp_t *tnc_pdp_create(void)
|
|||
bool radius_enable, pt_tls_enable;
|
||||
|
||||
server = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.tnc-pdp.server", NULL, charon->name);
|
||||
"%s.plugins.tnc-pdp.server", NULL, lib->ns);
|
||||
pt_tls_enable = lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.tnc-pdp.pt_tls.enable", TRUE, charon->name);
|
||||
"%s.plugins.tnc-pdp.pt_tls.enable", TRUE, lib->ns);
|
||||
pt_tls_port = lib->settings->get_int(lib->settings,
|
||||
"%s.plugins.tnc-pdp.pt_tls.port", PT_TLS_PORT, charon->name);
|
||||
"%s.plugins.tnc-pdp.pt_tls.port", PT_TLS_PORT, lib->ns);
|
||||
radius_enable = lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.tnc-pdp.radius.enable", TRUE, charon->name);
|
||||
"%s.plugins.tnc-pdp.radius.enable", TRUE, lib->ns);
|
||||
radius_port = lib->settings->get_int(lib->settings,
|
||||
"%s.plugins.tnc-pdp.radius.port", RADIUS_PORT, charon->name);
|
||||
"%s.plugins.tnc-pdp.radius.port", RADIUS_PORT, lib->ns);
|
||||
secret = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.tnc-pdp.radius.secret", NULL, charon->name);
|
||||
"%s.plugins.tnc-pdp.radius.secret", NULL, lib->ns);
|
||||
eap_type_str = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.tnc-pdp.radius.method", "ttls", charon->name);
|
||||
"%s.plugins.tnc-pdp.radius.method", "ttls", lib->ns);
|
||||
|
||||
if (!pt_tls_enable && !radius_enable)
|
||||
{
|
||||
|
|
|
@ -298,7 +298,7 @@ tnc_pdp_connections_t *tnc_pdp_connections_create(void)
|
|||
.list = linked_list_create(),
|
||||
.lock = rwlock_create(RWLOCK_TYPE_DEFAULT),
|
||||
.timeout = lib->settings->get_int(lib->settings,
|
||||
"%s.plugins.tnc-pdp.timeout", DEFAULT_TIMEOUT, charon->name),
|
||||
"%s.plugins.tnc-pdp.timeout", DEFAULT_TIMEOUT, lib->ns),
|
||||
);
|
||||
|
||||
return &this->public;
|
||||
|
|
|
@ -58,7 +58,7 @@ static bool plugin_cb(private_updown_plugin_t *this,
|
|||
if (reg)
|
||||
{
|
||||
if (lib->settings->get_bool(lib->settings,
|
||||
"charon.plugins.updown.dns_handler", FALSE))
|
||||
"%s.plugins.updown.dns_handler", FALSE, lib->ns))
|
||||
{
|
||||
this->handler = updown_handler_create();
|
||||
hydra->attributes->add_handler(hydra->attributes,
|
||||
|
|
|
@ -157,7 +157,7 @@ whitelist_control_t *whitelist_control_create(whitelist_listener_t *listener)
|
|||
|
||||
uri = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.whitelist.socket", "unix://" WHITELIST_SOCKET,
|
||||
charon->name);
|
||||
lib->ns);
|
||||
this->service = lib->streams->create_service(lib->streams, uri, 10);
|
||||
if (!this->service)
|
||||
{
|
||||
|
|
|
@ -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,
|
||||
"%s.plugins.whitelist.enable", FALSE, charon->name),
|
||||
"%s.plugins.whitelist.enable", FALSE, lib->ns),
|
||||
);
|
||||
|
||||
return &this->public;
|
||||
|
|
|
@ -224,7 +224,7 @@ METHOD(xauth_method_t, process, status_t,
|
|||
|
||||
name = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.xauth-eap.backend", "radius",
|
||||
charon->name);
|
||||
lib->ns);
|
||||
type = eap_type_from_string(name);
|
||||
if (!type)
|
||||
{
|
||||
|
|
|
@ -142,7 +142,7 @@ METHOD(xauth_method_t, process, status_t,
|
|||
/* trim to username part if email address given */
|
||||
if (lib->settings->get_bool(lib->settings,
|
||||
"%s.plugins.xauth-pam.trim_email",
|
||||
TRUE, charon->name))
|
||||
TRUE, lib->ns))
|
||||
{
|
||||
pos = memchr(chunk.ptr, '@', chunk.len);
|
||||
if (pos)
|
||||
|
@ -175,9 +175,8 @@ METHOD(xauth_method_t, process, status_t,
|
|||
service = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.xauth-pam.pam_service",
|
||||
lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.eap-gtc.pam_service",
|
||||
"login", charon->name),
|
||||
charon->name);
|
||||
"%s.plugins.eap-gtc.pam_service", "login", lib->ns),
|
||||
lib->ns);
|
||||
|
||||
if (authenticate(service, user, pass))
|
||||
{
|
||||
|
|
|
@ -136,8 +136,8 @@ xauth_pam_listener_t *xauth_pam_listener_create()
|
|||
"%s.plugins.xauth-pam.pam_service",
|
||||
lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.eap-gtc.pam_service",
|
||||
"login", charon->name),
|
||||
charon->name),
|
||||
"login", lib->ns),
|
||||
lib->ns),
|
||||
);
|
||||
|
||||
return &this->public;
|
||||
|
|
|
@ -116,7 +116,7 @@ plugin_t *xauth_pam_plugin_create()
|
|||
},
|
||||
},
|
||||
.session = lib->settings->get_str(lib->settings,
|
||||
"%s.plugins.xauth-pam.session", FALSE, charon->name),
|
||||
"%s.plugins.xauth-pam.session", FALSE, lib->ns),
|
||||
.listener = xauth_pam_listener_create(),
|
||||
);
|
||||
|
||||
|
|
|
@ -2329,11 +2329,11 @@ ike_sa_t * ike_sa_create(ike_sa_id_t *ike_sa_id, bool initiator,
|
|||
.attributes = array_create(sizeof(attribute_entry_t), 0),
|
||||
.unique_id = ref_get(&unique_id),
|
||||
.keepalive_interval = lib->settings->get_time(lib->settings,
|
||||
"%s.keep_alive", KEEPALIVE_INTERVAL, charon->name),
|
||||
"%s.keep_alive", KEEPALIVE_INTERVAL, lib->ns),
|
||||
.retry_initiate_interval = lib->settings->get_time(lib->settings,
|
||||
"%s.retry_initiate_interval", 0, charon->name),
|
||||
"%s.retry_initiate_interval", 0, lib->ns),
|
||||
.flush_auth_cfg = lib->settings->get_bool(lib->settings,
|
||||
"%s.flush_auth_cfg", FALSE, charon->name),
|
||||
"%s.flush_auth_cfg", FALSE, lib->ns),
|
||||
);
|
||||
|
||||
if (version == IKEV2)
|
||||
|
|
|
@ -2150,17 +2150,17 @@ ike_sa_manager_t *ike_sa_manager_create()
|
|||
}
|
||||
|
||||
this->ikesa_limit = lib->settings->get_int(lib->settings,
|
||||
"%s.ikesa_limit", 0, charon->name);
|
||||
"%s.ikesa_limit", 0, lib->ns);
|
||||
|
||||
this->table_size = get_nearest_powerof2(lib->settings->get_int(
|
||||
lib->settings, "%s.ikesa_table_size",
|
||||
DEFAULT_HASHTABLE_SIZE, charon->name));
|
||||
DEFAULT_HASHTABLE_SIZE, lib->ns));
|
||||
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, "%s.ikesa_table_segments",
|
||||
DEFAULT_SEGMENT_COUNT, charon->name));
|
||||
DEFAULT_SEGMENT_COUNT, lib->ns));
|
||||
this->segment_count = max(1, min(this->segment_count, this->table_size));
|
||||
this->segment_mask = this->segment_count - 1;
|
||||
|
||||
|
@ -2200,6 +2200,6 @@ ike_sa_manager_t *ike_sa_manager_create()
|
|||
}
|
||||
|
||||
this->reuse_ikesa = lib->settings->get_bool(lib->settings,
|
||||
"%s.reuse_ikesa", TRUE, charon->name);
|
||||
"%s.reuse_ikesa", TRUE, lib->ns);
|
||||
return &this->public;
|
||||
}
|
||||
|
|
|
@ -1579,7 +1579,7 @@ METHOD(task_manager_t, process_message, status_t,
|
|||
lib->scheduler->schedule_job(lib->scheduler, job,
|
||||
lib->settings->get_int(lib->settings,
|
||||
"%s.half_open_timeout", HALF_OPEN_IKE_SA_TIMEOUT,
|
||||
charon->name));
|
||||
lib->ns));
|
||||
}
|
||||
this->ike_sa->update_hosts(this->ike_sa, me, other, TRUE);
|
||||
charon->bus->message(charon->bus, msg, TRUE, TRUE);
|
||||
|
@ -2082,9 +2082,9 @@ task_manager_v1_t *task_manager_v1_create(ike_sa_t *ike_sa)
|
|||
.frag = {
|
||||
.exchange = ID_PROT,
|
||||
.max_packet = lib->settings->get_int(lib->settings,
|
||||
"%s.max_packet", MAX_PACKET, charon->name),
|
||||
"%s.max_packet", MAX_PACKET, lib->ns),
|
||||
.size = lib->settings->get_int(lib->settings,
|
||||
"%s.fragment_size", MAX_FRAGMENT_SIZE, charon->name),
|
||||
"%s.fragment_size", MAX_FRAGMENT_SIZE, lib->ns),
|
||||
},
|
||||
.ike_sa = ike_sa,
|
||||
.rng = lib->crypto->create_rng(lib->crypto, RNG_WEAK),
|
||||
|
@ -2092,11 +2092,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,
|
||||
"%s.retransmit_tries", RETRANSMIT_TRIES, charon->name),
|
||||
"%s.retransmit_tries", RETRANSMIT_TRIES, lib->ns),
|
||||
.retransmit_timeout = lib->settings->get_double(lib->settings,
|
||||
"%s.retransmit_timeout", RETRANSMIT_TIMEOUT, charon->name),
|
||||
"%s.retransmit_timeout", RETRANSMIT_TIMEOUT, lib->ns),
|
||||
.retransmit_base = lib->settings->get_double(lib->settings,
|
||||
"%s.retransmit_base", RETRANSMIT_BASE, charon->name),
|
||||
"%s.retransmit_base", RETRANSMIT_BASE, lib->ns),
|
||||
);
|
||||
|
||||
if (!this->rng)
|
||||
|
|
|
@ -421,7 +421,7 @@ METHOD(task_t, process_r, status_t,
|
|||
case AUTH_PSK:
|
||||
if (!lib->settings->get_bool(lib->settings, "%s.i_dont_care"
|
||||
"_about_security_and_use_aggressive_mode_psk",
|
||||
FALSE, charon->name))
|
||||
FALSE, lib->ns))
|
||||
{
|
||||
DBG1(DBG_IKE, "Aggressive Mode PSK disabled for "
|
||||
"security reasons");
|
||||
|
|
|
@ -191,9 +191,9 @@ static void build(private_isakmp_vendor_t *this, message_t *message)
|
|||
int i;
|
||||
|
||||
strongswan = lib->settings->get_bool(lib->settings,
|
||||
"%s.send_vendor_id", FALSE, charon->name);
|
||||
"%s.send_vendor_id", FALSE, lib->ns);
|
||||
cisco_unity = lib->settings->get_bool(lib->settings,
|
||||
"%s.cisco_unity", FALSE, charon->name);
|
||||
"%s.cisco_unity", FALSE, lib->ns);
|
||||
ike_cfg = this->ike_sa->get_ike_cfg(this->ike_sa);
|
||||
fragmentation = ike_cfg->fragmentation(ike_cfg) != FRAGMENTATION_NO;
|
||||
if (!this->initiator && fragmentation)
|
||||
|
|
|
@ -194,7 +194,7 @@ static void schedule_inactivity_timeout(private_quick_mode_t *this)
|
|||
if (timeout)
|
||||
{
|
||||
close_ike = lib->settings->get_bool(lib->settings,
|
||||
"%s.inactivity_close_ike", FALSE, charon->name);
|
||||
"%s.inactivity_close_ike", FALSE, lib->ns);
|
||||
lib->scheduler->schedule_job(lib->scheduler, (job_t*)
|
||||
inactivity_job_create(this->child_sa->get_reqid(this->child_sa),
|
||||
timeout, close_ike), timeout);
|
||||
|
|
|
@ -1229,7 +1229,7 @@ METHOD(task_manager_t, process_message, status_t,
|
|||
lib->scheduler->schedule_job(lib->scheduler, job,
|
||||
lib->settings->get_int(lib->settings,
|
||||
"%s.half_open_timeout", HALF_OPEN_IKE_SA_TIMEOUT,
|
||||
charon->name));
|
||||
lib->ns));
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
|
@ -1578,11 +1578,11 @@ task_manager_v2_t *task_manager_v2_create(ike_sa_t *ike_sa)
|
|||
.active_tasks = array_create(0, 0),
|
||||
.passive_tasks = array_create(0, 0),
|
||||
.retransmit_tries = lib->settings->get_int(lib->settings,
|
||||
"%s.retransmit_tries", RETRANSMIT_TRIES, charon->name),
|
||||
"%s.retransmit_tries", RETRANSMIT_TRIES, lib->ns),
|
||||
.retransmit_timeout = lib->settings->get_double(lib->settings,
|
||||
"%s.retransmit_timeout", RETRANSMIT_TIMEOUT, charon->name),
|
||||
"%s.retransmit_timeout", RETRANSMIT_TIMEOUT, lib->ns),
|
||||
.retransmit_base = lib->settings->get_double(lib->settings,
|
||||
"%s.retransmit_base", RETRANSMIT_BASE, charon->name),
|
||||
"%s.retransmit_base", RETRANSMIT_BASE, lib->ns),
|
||||
);
|
||||
|
||||
return &this->public;
|
||||
|
|
|
@ -293,7 +293,7 @@ static void schedule_inactivity_timeout(private_child_create_t *this)
|
|||
if (timeout)
|
||||
{
|
||||
close_ike = lib->settings->get_bool(lib->settings,
|
||||
"%s.inactivity_close_ike", FALSE, charon->name);
|
||||
"%s.inactivity_close_ike", FALSE, lib->ns);
|
||||
lib->scheduler->schedule_job(lib->scheduler, (job_t*)
|
||||
inactivity_job_create(this->child_sa->get_reqid(this->child_sa),
|
||||
timeout, close_ike), timeout);
|
||||
|
@ -1072,7 +1072,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,
|
||||
"%s.close_ike_on_child_failure", FALSE, charon->name))
|
||||
"%s.close_ike_on_child_failure", FALSE, lib->ns))
|
||||
{
|
||||
/* we delay the delete for 100ms, as the IKE_AUTH response must arrive
|
||||
* first */
|
||||
|
|
|
@ -120,7 +120,7 @@ struct private_ike_auth_t {
|
|||
static bool multiple_auth_enabled()
|
||||
{
|
||||
return lib->settings->get_bool(lib->settings,
|
||||
"%s.multiple_authentication", TRUE, charon->name);
|
||||
"%s.multiple_authentication", TRUE, lib->ns);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -428,7 +428,7 @@ 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,
|
||||
"%s.hash_and_url", FALSE, charon->name))
|
||||
"%s.hash_and_url", FALSE, lib->ns))
|
||||
{
|
||||
message->add_notify(message, FALSE, HTTP_CERT_LOOKUP_SUPPORTED,
|
||||
chunk_empty);
|
||||
|
|
|
@ -86,7 +86,7 @@ METHOD(task_t, build, status_t,
|
|||
int i;
|
||||
|
||||
strongswan = lib->settings->get_bool(lib->settings,
|
||||
"%s.send_vendor_id", FALSE, charon->name);
|
||||
"%s.send_vendor_id", FALSE, lib->ns);
|
||||
for (i = 0; i < countof(vids); i++)
|
||||
{
|
||||
if (vids[i].extension == EXT_STRONGSWAN && strongswan)
|
||||
|
|
Loading…
Reference in New Issue