File tree 3 files changed +33
-0
lines changed
3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -674,6 +674,14 @@ extern "C" {
674
674
num : size_t ,
675
675
written : * mut size_t ,
676
676
) -> c_int ;
677
+ #[ cfg( ossl300) ]
678
+ pub fn SSL_sendfile (
679
+ ssl : * mut SSL ,
680
+ fd : c_int ,
681
+ offset : off_t ,
682
+ size : size_t ,
683
+ flags : c_int ,
684
+ ) -> ssize_t ;
677
685
#[ cfg( any( ossl111, libressl340) ) ]
678
686
pub fn SSL_write_early_data (
679
687
s : * mut SSL ,
Original file line number Diff line number Diff line change @@ -73,6 +73,8 @@ cfg_if! {
73
73
}
74
74
75
75
pub const SSL_OP_LEGACY_SERVER_CONNECT : ssl_op_type ! ( ) = 0x00000004 ;
76
+ #[ cfg( ossl300) ]
77
+ pub const SSL_OP_ENABLE_KTLS : ssl_op_type ! ( ) = 0x00000008 ;
76
78
cfg_if ! {
77
79
if #[ cfg( libressl261) ] {
78
80
pub const SSL_OP_TLSEXT_PADDING : ssl_op_type!( ) = 0x0 ;
@@ -169,6 +171,9 @@ cfg_if! {
169
171
}
170
172
}
171
173
174
+ #[ cfg( ossl320) ]
175
+ pub const SSL_OP_ENABLE_KTLS_TX_ZEROCOPY_SENDFILE : ssl_op_type ! ( ) = 0x400000000 ;
176
+
172
177
cfg_if ! {
173
178
if #[ cfg( ossl300) ] {
174
179
pub const SSL_OP_ALL : ssl_op_type!( ) = SSL_OP_CRYPTOPRO_TLSEXT_BUG
Original file line number Diff line number Diff line change @@ -281,6 +281,26 @@ bitflags! {
281
281
/// [`SslOptions::CIPHER_SERVER_PREFERENCE`]: struct.SslOptions.html#associatedconstant.CIPHER_SERVER_PREFERENCE
282
282
#[ cfg( ossl111) ]
283
283
const PRIORITIZE_CHACHA = ffi:: SSL_OP_PRIORITIZE_CHACHA as SslOptionsRepr ;
284
+
285
+ /// Enable the use of kernel TLS.
286
+ ///
287
+ /// In order to benefit from kernel TLS OpenSSL must have been compiled with support for it,
288
+ /// and it must be supported by the negotiated ciphersuites and extensions.
289
+ /// The specific ciphersuites and extensions that are supported may vary by platform and kernel version.
290
+ ///
291
+ /// Requires OpenSSL 3.0.0 or newer.
292
+ #[ cfg( ossl300) ]
293
+ const ENABLE_KTLS = ffi:: SSL_OP_ENABLE_KTLS as SslOptionsRepr ;
294
+
295
+ /// With this option, sendfile() will use the zerocopy mode, which gives a performance boost when used with KTLS hardware offload.
296
+ /// Note that invalid TLS records might be transmitted if the file is changed while being sent.
297
+ ///
298
+ /// Requires enable [`SslOptions::ENABLE_KTLS`].
299
+ /// Requires OpenSSL 3.2.0 or newer.
300
+ ///
301
+ /// [`SslOptions::ENABLE_KTLS`]: struct.SslOptions.html#associatedconstant.ENABLE_KTLS
302
+ #[ cfg( ossl320) ]
303
+ const ENABLE_KTLS_ZEROCOPY_SENDFILE = ffi:: SSL_OP_ENABLE_KTLS_TX_ZEROCOPY_SENDFILE as SslOptionsRepr ;
284
304
}
285
305
}
286
306
You can’t perform that action at this time.
0 commit comments