From: Tobias Brunner Date: Wed, 24 Apr 2019 14:37:11 +0000 (+0200) Subject: vici: Update command wrappers of the Ruby bindings X-Git-Tag: 5.8.0rc1~22^2~3 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fstrongswan.git;a=commitdiff_plain;h=1fef01af58e17d69b05bd337455c89843c35d4ef vici: Update command wrappers of the Ruby bindings Also reorder them to match README.md. --- diff --git a/src/libcharon/plugins/vici/ruby/lib/vici.rb b/src/libcharon/plugins/vici/ruby/lib/vici.rb index 8dd4366129..0fd4b37bb3 100644 --- a/src/libcharon/plugins/vici/ruby/lib/vici.rb +++ b/src/libcharon/plugins/vici/ruby/lib/vici.rb @@ -404,10 +404,57 @@ module Vici end ## - # List matching loaded connections. The provided closure is invoked - # for each matching connection. - def list_conns(match = nil, &block) - call_with_event("list-conns", Message.new(match), "list-conn", &block) + # Get daemon version information + def version + call("version") + end + + ## + # Get daemon statistics and information. + def stats + call("stats") + end + + ## + # Reload strongswan.conf settings. + def reload_settings + call("reload-settings") + end + + ## + # Initiate a connection. The provided closure is invoked for each log line. + def initiate(options, &block) + call_with_event("initiate", Message.new(options), "control-log", &block) + end + + ## + # Terminate a connection. The provided closure is invoked for each log line. + def terminate(options, &block) + call_with_event("terminate", Message.new(options), "control-log", &block) + end + + ## + # Initiate the rekeying of an SA. + def rekey(options) + call("rekey", Message.new(options)) + end + + ## + # Redirect an IKE_SA. + def redirect(options) + call("redirect", Message.new(options)) + end + + ## + # Install a shunt/route policy. + def install(policy) + call("install", Message.new(policy)) + end + + ## + # Uninstall a shunt/route policy. + def uninstall(policy) + call("uninstall", Message.new(policy)) end ## @@ -425,6 +472,19 @@ module Vici &block) end + ## + # List matching loaded connections. The provided closure is invoked + # for each matching connection. + def list_conns(match = nil, &block) + call_with_event("list-conns", Message.new(match), "list-conn", &block) + end + + ## + # Get the names of connections managed by vici. + def get_conns() + call("get-conns") + end + ## # List matching loaded certificates. The provided closure is invoked # for each matching certificate definition. @@ -432,6 +492,20 @@ module Vici call_with_event("list-certs", Message.new(match), "list-cert", &block) end + ## + # List matching loaded certification authorities. The provided closure is + # invoked for each matching certification authority definition. + def list_authorities(match = nil, &block) + call_with_event("list-authorities", Message.new(match), "list-authority", + &block) + end + + ## + # Get the names of certification authorities managed by vici. + def get_authorities() + call("get-authorities") + end + ## # Load a connection into the daemon. def load_conn(conn) @@ -445,33 +519,33 @@ module Vici end ## - # Get the names of connections managed by vici. - def get_conns() - call("get-conns") + # Load a certificate into the daemon. + def load_cert(cert) + call("load-cert", Message.new(cert)) end ## - # Flush credential cache. - def flush_certs(match = nil) - call("flush-certs", Message.new(match)) + # Load a private key into the daemon. + def load_key(key) + call("load-key", Message.new(key)) end ## - # Clear all loaded credentials. - def clear_creds() - call("clear-creds") + # Unload a private key from the daemon. + def unload_key(key) + call("unload-key", Message.new(key)) end ## - # Load a certificate into the daemon. - def load_cert(cert) - call("load-cert", Message.new(cert)) + # Get the identifiers of private keys loaded via vici. + def get_keys() + call("get-keys") end ## - # Load a private key into the daemon. - def load_key(key) - call("load-key", Message.new(key)) + # Load a private key located on a token into the daemon. + def load_token(token) + call("load-token", Message.new(token)) end ## @@ -481,69 +555,75 @@ module Vici end ## - # Load a virtual IP / attribute pool - def load_pool(pool) - call("load-pool", Message.new(pool)) + # Unload a shared key from the daemon. + def unload_shared(shared) + call("unload-shared", Message.new(shared)) end ## - # Unload a virtual IP / attribute pool - def unload_pool(pool) - call("unload-pool", Message.new(pool)) + # Get the unique identifiers of shared keys loaded via vici. + def get_shared() + call("get-shared") end ## - # Get the currently loaded pools. - def get_pools(options) - call("get-pools", Message.new(options)) + # Flush credential cache. + def flush_certs(match = nil) + call("flush-certs", Message.new(match)) end ## - # Initiate a connection. The provided closure is invoked for each log line. - def initiate(options, &block) - call_with_event("initiate", Message.new(options), "control-log", &block) + # Clear all loaded credentials. + def clear_creds() + call("clear-creds") end ## - # Terminate a connection. The provided closure is invoked for each log line. - def terminate(options, &block) - call_with_event("terminate", Message.new(options), "control-log", &block) + # Load a certification authority into the daemon. + def load_authority(authority) + call("load-authority", Message.new(authority)) end ## - # Redirect an IKE_SA. - def redirect(options) - call("redirect", Message.new(options)) + # Unload a certification authority from the daemon. + def unload_authority(authority) + call("unload-authority", Message.new(authority)) end ## - # Install a shunt/route policy. - def install(policy) - call("install", Message.new(policy)) + # Load a virtual IP / attribute pool into the daemon. + def load_pool(pool) + call("load-pool", Message.new(pool)) end ## - # Uninstall a shunt/route policy. - def uninstall(policy) - call("uninstall", Message.new(policy)) + # Unload a virtual IP / attribute pool from the daemon. + def unload_pool(pool) + call("unload-pool", Message.new(pool)) end ## - # Reload strongswan.conf settings. - def reload_settings - call("reload-settings") + # Get the currently loaded pools. + def get_pools(options) + call("get-pools", Message.new(options)) end ## - # Get daemon statistics and information. - def stats - call("stats") + # Get currently loaded algorithms and their implementation. + def get_algorithms() + call("get-algorithms") end ## - # Get daemon version information - def version - call("version") + # Get global or connection-specific counters for IKE events. + def get_counters(options = nil) + call("get-counters", Message.new(options)) + end + + ## + # Reset global or connection-specific IKE event counters. + def reset_counters(options = nil) + call("reset-counters", Message.new(options)) end ##