aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/ssl_util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/ssl_util.h')
-rw-r--r--src/libutil/ssl_util.h29
1 files changed, 19 insertions, 10 deletions
diff --git a/src/libutil/ssl_util.h b/src/libutil/ssl_util.h
index f7f1652de..75436f2cc 100644
--- a/src/libutil/ssl_util.h
+++ b/src/libutil/ssl_util.h
@@ -20,18 +20,23 @@
#include "libutil/addr.h"
#include "libutil/libev_helper.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct rspamd_ssl_connection;
-typedef void (*rspamd_ssl_handler_t)(gint fd, short what, gpointer d);
-typedef void (*rspamd_ssl_error_handler_t)(gpointer d, GError *err);
+typedef void (*rspamd_ssl_handler_t) (gint fd, short what, gpointer d);
+
+typedef void (*rspamd_ssl_error_handler_t) (gpointer d, GError *err);
/**
* Creates a new ssl connection data structure
* @param ssl_ctx initialized SSL_CTX structure
* @return opaque connection data
*/
-struct rspamd_ssl_connection * rspamd_ssl_connection_new (gpointer ssl_ctx,
- struct ev_loop *ev_base, gboolean verify_peer);
+struct rspamd_ssl_connection *rspamd_ssl_connection_new (gpointer ssl_ctx,
+ struct ev_loop *ev_base, gboolean verify_peer);
/**
* Connects SSL session using the specified (connected) FD
@@ -45,9 +50,9 @@ struct rspamd_ssl_connection * rspamd_ssl_connection_new (gpointer ssl_ctx,
* @return TRUE if a session has been connected
*/
gboolean rspamd_ssl_connect_fd (struct rspamd_ssl_connection *conn, gint fd,
- const gchar *hostname, struct rspamd_io_ev *ev, ev_tstamp timeout,
- rspamd_ssl_handler_t handler, rspamd_ssl_error_handler_t err_handler,
- gpointer handler_data);
+ const gchar *hostname, struct rspamd_io_ev *ev, ev_tstamp timeout,
+ rspamd_ssl_handler_t handler, rspamd_ssl_error_handler_t err_handler,
+ gpointer handler_data);
/**
* Perform async read from SSL socket
@@ -57,7 +62,7 @@ gboolean rspamd_ssl_connect_fd (struct rspamd_ssl_connection *conn, gint fd,
* @return
*/
gssize rspamd_ssl_read (struct rspamd_ssl_connection *conn, gpointer buf,
- gsize buflen);
+ gsize buflen);
/**
* Perform async write to ssl buffer
@@ -69,7 +74,7 @@ gssize rspamd_ssl_read (struct rspamd_ssl_connection *conn, gpointer buf,
* @return
*/
gssize rspamd_ssl_write (struct rspamd_ssl_connection *conn, gconstpointer buf,
- gsize buflen);
+ gsize buflen);
/**
* Emulate writev by copying iovec to a temporary buffer
@@ -79,7 +84,7 @@ gssize rspamd_ssl_write (struct rspamd_ssl_connection *conn, gconstpointer buf,
* @return
*/
gssize rspamd_ssl_writev (struct rspamd_ssl_connection *conn, struct iovec *iov,
- gsize iovlen);
+ gsize iovlen);
/**
* Removes connection data
@@ -87,4 +92,8 @@ gssize rspamd_ssl_writev (struct rspamd_ssl_connection *conn, struct iovec *iov,
*/
void rspamd_ssl_connection_free (struct rspamd_ssl_connection *conn);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* SRC_LIBUTIL_SSL_UTIL_H_ */