summaryrefslogtreecommitdiff
path: root/include/openssl
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2022-11-17 15:17:39 +0000
committerHugo Landau <hlandau@openssl.org>2023-01-13 13:20:14 +0000
commit68801bcb766806a04e95e8ef714a0b836b1d7069 (patch)
tree1ea4c0098636cc8241114e25f2761fccac618790 /include/openssl
parent4ed9e0a1e36eaa8f07a4a5371f9d13912a3f9da8 (diff)
downloadopenssl-new-68801bcb766806a04e95e8ef714a0b836b1d7069.tar.gz
Add BIO poll descriptors
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19703)
Diffstat (limited to 'include/openssl')
-rw-r--r--include/openssl/bio.h.in21
-rw-r--r--include/openssl/ssl.h.in4
2 files changed, 25 insertions, 0 deletions
diff --git a/include/openssl/bio.h.in b/include/openssl/bio.h.in
index 89c88c67e7..dbb65f50e4 100644
--- a/include/openssl/bio.h.in
+++ b/include/openssl/bio.h.in
@@ -187,6 +187,9 @@ extern "C" {
* # define BIO_CTRL_SET_KTLS_TX_ZEROCOPY_SENDFILE 90
*/
+# define BIO_CTRL_GET_RPOLL_DESCRIPTOR 90
+# define BIO_CTRL_GET_WPOLL_DESCRIPTOR 91
+
# define BIO_DGRAM_CAP_NONE 0U
# define BIO_DGRAM_CAP_HANDLES_SRC_ADDR (1U << 0)
# define BIO_DGRAM_CAP_HANDLES_DST_ADDR (1U << 1)
@@ -377,6 +380,22 @@ typedef struct bio_mmsg_cb_args_st {
size_t *msgs_processed;
} BIO_MMSG_CB_ARGS;
+#define BIO_POLL_DESCRIPTOR_TYPE_NONE 0
+#define BIO_POLL_DESCRIPTOR_TYPE_SOCK_FD 1
+#define BIO_POLL_DESCRIPTOR_CUSTOM_START 8192
+#define BIO_POLL_DESCRIPTOR_NUM_CUSTOM 4
+
+typedef struct bio_poll_descriptor_st {
+ int type;
+ union {
+ int fd;
+ union {
+ void *ptr;
+ uint64_t u64;
+ } custom[BIO_POLL_DESCRIPTOR_NUM_CUSTOM];
+ } value;
+} BIO_POLL_DESCRIPTOR;
+
/*
* #define BIO_CONN_get_param_hostname BIO_ctrl
*/
@@ -690,6 +709,8 @@ int BIO_write_ex(BIO *b, const void *data, size_t dlen, size_t *written);
__owur int BIO_sendmmsg(BIO *b, BIO_MSG *msg,
size_t stride, size_t num_msg, uint64_t flags,
size_t *msgs_processed);
+__owur int BIO_get_rpoll_descriptor(BIO *b, BIO_POLL_DESCRIPTOR *desc);
+__owur int BIO_get_wpoll_descriptor(BIO *b, BIO_POLL_DESCRIPTOR *desc);
int BIO_puts(BIO *bp, const char *buf);
int BIO_indent(BIO *b, int indent, int max);
long BIO_ctrl(BIO *bp, int cmd, long larg, void *parg);
diff --git a/include/openssl/ssl.h.in b/include/openssl/ssl.h.in
index 871ad265c5..b01147785c 100644
--- a/include/openssl/ssl.h.in
+++ b/include/openssl/ssl.h.in
@@ -2247,6 +2247,10 @@ size_t SSL_get_num_tickets(const SSL *s);
int SSL_CTX_set_num_tickets(SSL_CTX *ctx, size_t num_tickets);
size_t SSL_CTX_get_num_tickets(const SSL_CTX *ctx);
+/* QUIC support */
+__owur int SSL_get_rpoll_descriptor(SSL *s, BIO_POLL_DESCRIPTOR *desc);
+__owur int SSL_get_wpoll_descriptor(SSL *s, BIO_POLL_DESCRIPTOR *desc);
+
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
# define SSL_cache_hit(s) SSL_session_reused(s)
# endif