summaryrefslogtreecommitdiff
path: root/ustream-ssl.h
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-10-23 04:01:09 +0200
committerFelix Fietkau <nbd@openwrt.org>2012-10-23 04:01:09 +0200
commitfdbedf748f4c2654fe85f613216a2dacc407c0a7 (patch)
tree1e873d3b0acd0628d6a96519e965ecbbef68c312 /ustream-ssl.h
downloadustream-ssl-fdbedf748f4c2654fe85f613216a2dacc407c0a7.tar.gz
Initial import
Diffstat (limited to 'ustream-ssl.h')
-rw-r--r--ustream-ssl.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/ustream-ssl.h b/ustream-ssl.h
new file mode 100644
index 0000000..5148843
--- /dev/null
+++ b/ustream-ssl.h
@@ -0,0 +1,27 @@
+#ifndef __USTREAM_SSL_H
+#define __USTREAM_SSL_H
+
+struct ustream_ssl {
+ struct ustream stream;
+ struct ustream *conn;
+ struct uloop_timeout error_timer;
+
+ void (*notify_connected)(struct ustream_ssl *us);
+ void (*notify_error)(struct ustream_ssl *us, int error, const char *str);
+
+ void *ctx;
+ void *ssl;
+
+ int error;
+ bool connected;
+ bool server;
+};
+
+void *ustream_ssl_context_new(bool server);
+int ustream_ssl_context_set_crt_file(void *ctx, const char *file);
+int ustream_ssl_context_set_key_file(void *ctx, const char *file);
+void ustream_ssl_context_free(void *ctx);
+
+int ustream_ssl_init(struct ustream_ssl *us, struct ustream *conn, void *ctx, bool server);
+
+#endif