diff options
author | Martin Willi <martin@revosec.ch> | 2014-07-17 18:02:09 +0200 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2014-09-22 13:44:27 +0200 |
commit | 455e213cb0ee365572f14d269c1a89f66a95287b (patch) | |
tree | 06fb5a9c9e59b20918b98c79b9edba445c312472 | |
parent | 2dee0a85a6923da94d669dc5de337dc5ef1806e7 (diff) | |
download | strongswan-455e213cb0ee365572f14d269c1a89f66a95287b.tar.bz2 strongswan-455e213cb0ee365572f14d269c1a89f66a95287b.tar.xz |
vici: Add a command to reload strongswan.conf
-rw-r--r-- | src/libcharon/plugins/vici/vici_control.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libcharon/plugins/vici/vici_control.c b/src/libcharon/plugins/vici/vici_control.c index 3cd008162..292a40032 100644 --- a/src/libcharon/plugins/vici/vici_control.c +++ b/src/libcharon/plugins/vici/vici_control.c @@ -450,6 +450,17 @@ CALLBACK(uninstall, vici_message_t*, return send_reply(this, "policy '%s' not found", child); } +CALLBACK(reload_settings, vici_message_t*, + private_vici_control_t *this, char *name, u_int id, vici_message_t *request) +{ + if (lib->settings->load_files(lib->settings, lib->conf, FALSE)) + { + lib->plugins->reload(lib->plugins, NULL); + return send_reply(this, NULL); + } + return send_reply(this, "reloading '%s' failed", lib->conf); +} + static void manage_command(private_vici_control_t *this, char *name, vici_command_cb_t cb, bool reg) { @@ -466,6 +477,7 @@ static void manage_commands(private_vici_control_t *this, bool reg) manage_command(this, "terminate", terminate, reg); manage_command(this, "install", install, reg); manage_command(this, "uninstall", uninstall, reg); + manage_command(this, "reload-settings", reload_settings, reg); this->dispatcher->manage_event(this->dispatcher, "control-log", reg); } |