diff options
| author | Steven Fackler <[email protected]> | 2013-10-05 13:56:59 -0700 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2013-10-05 13:56:59 -0700 |
| commit | d4d5547a7990749b554cc8e2b8b42a172ee98e5e (patch) | |
| tree | 57439ff0d9357bb882e8f55e0730b2364fd4807a /src/ssl/ffi.rs | |
| parent | Create contexts (diff) | |
| download | rust-openssl-d4d5547a7990749b554cc8e2b8b42a172ee98e5e.tar.xz rust-openssl-d4d5547a7990749b554cc8e2b8b42a172ee98e5e.zip | |
SslStream sketch
Diffstat (limited to 'src/ssl/ffi.rs')
| -rw-r--r-- | src/ssl/ffi.rs | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/src/ssl/ffi.rs b/src/ssl/ffi.rs index 788765fb..c3144545 100644 --- a/src/ssl/ffi.rs +++ b/src/ssl/ffi.rs @@ -1,14 +1,29 @@ +#[doc(hidden)]; + use std::libc::{c_int, c_void}; pub type SSL_CTX = c_void; pub type SSL_METHOD = c_void; +pub type SSL = c_void; +pub type BIO = c_void; +pub type BIO_METHOD = c_void; #[link_args = "-lssl"] -extern "C" { - fn SSL_library_init() -> c_int; - fn SSL_load_error_strings(); - - fn SSL_CTX_new(method: *SSL_METHOD) -> *SSL_CTX; - fn SSLv23_method() -> *SSL_METHOD; - fn SSL_CTX_free(ctx: *SSL_CTX); -} +extern "C" { } + +externfn!(fn SSL_library_init() -> c_int) +externfn!(fn SSL_load_error_strings()) + +externfn!(fn SSLv23_method() -> *SSL_METHOD) +externfn!(fn SSL_CTX_new(method: *SSL_METHOD) -> *SSL_CTX) +externfn!(fn SSL_CTX_free(ctx: *SSL_CTX)) + +externfn!(fn SSL_new(ctx: *SSL_CTX) -> *SSL) +externfn!(fn SSL_free(ssl: *SSL)) +externfn!(fn SSL_set_bio(ssl: *SSL, rbio: *BIO, wbio: *BIO)) +externfn!(fn SSL_set_connect_state(ssl: *SSL)) +externfn!(fn SSL_do_handshake(ssl: *SSL)) + +externfn!(fn BIO_s_mem() -> *BIO_METHOD) +externfn!(fn BIO_new(type_: *BIO_METHOD) -> *BIO) +externfn!(fn BIO_free(a: *BIO) -> c_int) |