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