.BR charon.plugins.stroke.max_concurrent " [4]"
Maximum number of stroke messages handled concurrently
.TP
+.BR charon.plugins.stroke.prevent_loglevel_changes " [no]"
+If enabled log level changes via stroke socket are not allowed.
+.TP
.BR charon.plugins.stroke.socket " [unix://@piddir@/charon.ctl]"
Socket provided by the stroke plugin
.TP
/*
- * Copyright (C) 2011-2012 Tobias Brunner
+ * Copyright (C) 2011-2013 Tobias Brunner
* Copyright (C) 2008 Martin Willi
* Hochschule fuer Technik Rapperswil
*
* Counter values for IKE events
*/
stroke_counter_t *counter;
+
+ /**
+ * TRUE if log level changes are not allowed
+ */
+ bool prevent_loglevel_changes;
};
/**
DBG1(DBG_CFG, "received stroke: loglevel %d for %s",
msg->loglevel.level, msg->loglevel.type);
+ if (this->prevent_loglevel_changes)
+ {
+ DBG1(DBG_CFG, "prevented log level change");
+ fprintf(out, "command not allowed!\n");
+ return;
+ }
if (strcaseeq(msg->loglevel.type, "any"))
{
group = DBG_ANY;
group = enum_from_name(debug_names, msg->loglevel.type);
if ((int)group < 0)
{
- fprintf(out, "invalid type (%s)!\n", msg->loglevel.type);
+ fprintf(out, "unknown type '%s'!\n", msg->loglevel.type);
return;
}
}
.public = {
.destroy = _destroy,
},
+ .prevent_loglevel_changes = lib->settings->get_bool(lib->settings,
+ "%s.plugins.stroke.prevent_loglevel_changes", FALSE, charon->name),
);
this->cred = stroke_cred_create();