Code

store, plugin: Let the plugin module determine an objects backends.
[sysdb.git] / src / include / utils / ssl.h
index 6489f8b01f871535b9e47f24e46580f3164c7e4b..53a794f68b3c9add760ba43a7e4bb6a9f3d6fe75 100644 (file)
@@ -67,13 +67,23 @@ typedef struct sdb_ssl_server sdb_ssl_server_t;
 struct sdb_ssl_session;
 typedef struct sdb_ssl_session sdb_ssl_session_t;
 
+/*
+ * sdb_ssl_init, sdb_ssl_shutdown:
+ * Global setup and shutdown of SSL/TLS. This is required before any other
+ * function can be used.
+ */
+int
+sdb_ssl_init(void);
+void
+sdb_ssl_shutdown(void);
+
 /*
  * sdb_ssl_client_create:
  * Allocate and initialize a TLS/SSL client using the specified options. If no
  * options are specified, default values will be used instead.
  */
 sdb_ssl_client_t *
-sdb_ssl_client_create(sdb_ssl_options_t *opts);
+sdb_ssl_client_create(const sdb_ssl_options_t *opts);
 
 /*
  * sdb_ssl_client_destroy:
@@ -95,7 +105,7 @@ sdb_ssl_client_connect(sdb_ssl_client_t *client, int fd);
  * options are specified, default values will be used instead.
  */
 sdb_ssl_server_t *
-sdb_ssl_server_create(sdb_ssl_options_t *opts);
+sdb_ssl_server_create(const sdb_ssl_options_t *opts);
 
 /*
  * sdb_ssl_server_destroy:
@@ -143,6 +153,14 @@ sdb_ssl_session_write(sdb_ssl_session_t *session, const void *buf, size_t n);
 ssize_t
 sdb_ssl_session_read(sdb_ssl_session_t *session, void *buf, size_t n);
 
+/*
+ * sdb_ssl_free_options:
+ * Free all strings stored in the specified options. All fields will be set to
+ * NULL.
+ */
+void
+sdb_ssl_free_options(sdb_ssl_options_t *opts);
+
 #ifdef __cplusplus
 } /* extern "C" */
 #endif