]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
vici: Update command wrappers of the Ruby bindings
authorTobias Brunner <tobias@strongswan.org>
Wed, 24 Apr 2019 14:37:11 +0000 (16:37 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 26 Apr 2019 07:35:37 +0000 (09:35 +0200)
Also reorder them to match README.md.

src/libcharon/plugins/vici/ruby/lib/vici.rb

index 8dd4366129690ffcf7dd6d087371883c18dc3124..0fd4b37bb341e34a3183f603ad7e8eef97bd14bd 100644 (file)
@@ -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
 
     ##