| 1 |
use super::super::*; |
| 2 |
use libc::FILE; |
| 3 |
use std::ffi::{c_char, c_int, c_long, c_uint, c_void}; |
| 4 |
|
| 5 |
extern "C" { |
| 6 |
pub fn BIO_set_flags(b: *mut BIO, flags: c_int); |
| 7 |
pub fn BIO_clear_flags(b: *mut BIO, flags: c_int); |
| 8 |
} |
| 9 |
|
| 10 |
pub type bio_info_cb = |
| 11 |
Option<unsafe extern "C" fn(*mut BIO, c_int, *const c_char, c_int, c_long, c_long)>; |
| 12 |
|
| 13 |
pub enum BIO_METHOD {} |
| 14 |
|
| 15 |
extern "C" { |
| 16 |
pub fn BIO_s_file() -> *const BIO_METHOD; |
| 17 |
pub fn BIO_new(type_: *const BIO_METHOD) -> *mut BIO; |
| 18 |
} |
| 19 |
|
| 20 |
extern "C" { |
| 21 |
#[cfg(not(osslconf = "OPENSSL_NO_STDIO"))] |
| 22 |
pub fn BIO_new_fp(stream: *mut FILE, close_flag: c_int) -> *mut BIO; |
| 23 |
pub fn BIO_set_data(a: *mut BIO, data: *mut c_void); |
| 24 |
pub fn BIO_get_data(a: *mut BIO) -> *mut c_void; |
| 25 |
pub fn BIO_set_init(a: *mut BIO, init: c_int); |
| 26 |
pub fn BIO_write(b: *mut BIO, buf: *const c_void, len: c_int) -> c_int; |
| 27 |
pub fn BIO_read(b: *mut BIO, buf: *mut c_void, len: c_int) -> c_int; |
| 28 |
pub fn BIO_ctrl(b: *mut BIO, cmd: c_int, larg: c_long, parg: *mut c_void) -> c_long; |
| 29 |
pub fn BIO_free_all(b: *mut BIO); |
| 30 |
pub fn BIO_new_mem_buf(buf: *const c_void, len: c_int) -> *mut BIO; |
| 31 |
} |
| 32 |
|
| 33 |
extern "C" { |
| 34 |
pub fn BIO_s_mem() -> *const BIO_METHOD; |
| 35 |
} |
| 36 |
|
| 37 |
extern "C" { |
| 38 |
#[cfg(not(osslconf = "OPENSSL_NO_SOCK"))] |
| 39 |
pub fn BIO_new_socket(sock: c_int, close_flag: c_int) -> *mut BIO; |
| 40 |
|
| 41 |
pub fn BIO_meth_new(type_: c_int, name: *const c_char) -> *mut BIO_METHOD; |
| 42 |
pub fn BIO_meth_free(biom: *mut BIO_METHOD); |
| 43 |
} |
| 44 |
|
| 45 |
#[allow(clashing_extern_declarations)] |
| 46 |
extern "C" { |
| 47 |
#[link_name = "BIO_meth_set_write"] |
| 48 |
pub fn BIO_meth_set_write__fixed_rust( |
| 49 |
biom: *mut BIO_METHOD, |
| 50 |
write: Option<unsafe extern "C" fn(*mut BIO, *const c_char, c_int) -> c_int>, |
| 51 |
) -> c_int; |
| 52 |
#[link_name = "BIO_meth_set_read"] |
| 53 |
pub fn BIO_meth_set_read__fixed_rust( |
| 54 |
biom: *mut BIO_METHOD, |
| 55 |
read: Option<unsafe extern "C" fn(*mut BIO, *mut c_char, c_int) -> c_int>, |
| 56 |
) -> c_int; |
| 57 |
#[link_name = "BIO_meth_set_puts"] |
| 58 |
pub fn BIO_meth_set_puts__fixed_rust( |
| 59 |
biom: *mut BIO_METHOD, |
| 60 |
read: Option<unsafe extern "C" fn(*mut BIO, *const c_char) -> c_int>, |
| 61 |
) -> c_int; |
| 62 |
#[link_name = "BIO_meth_set_ctrl"] |
| 63 |
pub fn BIO_meth_set_ctrl__fixed_rust( |
| 64 |
biom: *mut BIO_METHOD, |
| 65 |
read: Option<unsafe extern "C" fn(*mut BIO, c_int, c_long, *mut c_void) -> c_long>, |
| 66 |
) -> c_int; |
| 67 |
#[link_name = "BIO_meth_set_create"] |
| 68 |
pub fn BIO_meth_set_create__fixed_rust( |
| 69 |
biom: *mut BIO_METHOD, |
| 70 |
create: Option<unsafe extern "C" fn(*mut BIO) -> c_int>, |
| 71 |
) -> c_int; |
| 72 |
#[link_name = "BIO_meth_set_destroy"] |
| 73 |
pub fn BIO_meth_set_destroy__fixed_rust( |
| 74 |
biom: *mut BIO_METHOD, |
| 75 |
destroy: Option<unsafe extern "C" fn(*mut BIO) -> c_int>, |
| 76 |
) -> c_int; |
| 77 |
} |
| 78 |
|
| 79 |
#[cfg(ossl320)] |
| 80 |
extern "C" { |
| 81 |
pub fn BIO_meth_set_sendmmsg( |
| 82 |
biom: *mut BIO_METHOD, |
| 83 |
f: Option< |
| 84 |
unsafe extern "C" fn( |
| 85 |
arg1: *mut BIO, |
| 86 |
arg2: *mut BIO_MSG, |
| 87 |
arg3: usize, |
| 88 |
arg4: usize, |
| 89 |
arg5: u64, |
| 90 |
arg6: *mut usize, |
| 91 |
) -> c_int, |
| 92 |
>, |
| 93 |
) -> c_int; |
| 94 |
pub fn BIO_meth_set_recvmmsg( |
| 95 |
biom: *mut BIO_METHOD, |
| 96 |
f: Option< |
| 97 |
unsafe extern "C" fn( |
| 98 |
arg1: *mut BIO, |
| 99 |
arg2: *mut BIO_MSG, |
| 100 |
arg3: usize, |
| 101 |
arg4: usize, |
| 102 |
arg5: u64, |
| 103 |
arg6: *mut usize, |
| 104 |
) -> c_int, |
| 105 |
>, |
| 106 |
) -> c_int; |
| 107 |
pub fn BIO_new_bio_dgram_pair( |
| 108 |
bio1: *mut *mut BIO, |
| 109 |
writebuf1: usize, |
| 110 |
bio2: *mut *mut BIO, |
| 111 |
writebuf2: usize, |
| 112 |
) -> c_int; |
| 113 |
pub fn BIO_s_dgram_pair() -> *const BIO_METHOD; |
| 114 |
pub fn BIO_s_datagram() -> *const BIO_METHOD; |
| 115 |
pub fn BIO_get_rpoll_descriptor(b: *mut BIO, desc: *mut BIO_POLL_DESCRIPTOR) -> c_int; |
| 116 |
pub fn BIO_get_wpoll_descriptor(b: *mut BIO, desc: *mut BIO_POLL_DESCRIPTOR) -> c_int; |
| 117 |
pub fn BIO_sendmmsg( |
| 118 |
b: *mut BIO, |
| 119 |
msg: *mut BIO_MSG, |
| 120 |
stride: usize, |
| 121 |
num_msg: usize, |
| 122 |
flags: u64, |
| 123 |
msgs_processed: *mut usize, |
| 124 |
) -> c_int; |
| 125 |
pub fn BIO_recvmmsg( |
| 126 |
b: *mut BIO, |
| 127 |
msg: *mut BIO_MSG, |
| 128 |
stride: usize, |
| 129 |
num_msg: usize, |
| 130 |
flags: u64, |
| 131 |
msgs_processed: *mut usize, |
| 132 |
) -> c_int; |
| 133 |
pub fn BIO_err_is_non_fatal(errcode: c_uint) -> c_int; |
| 134 |
} |