return ret;
}
+int BIO_get_rpoll_descriptor(BIO *b, BIO_POLL_DESCRIPTOR *desc)
+{
+ return BIO_ctrl(b, BIO_CTRL_GET_RPOLL_DESCRIPTOR, 0, desc);
+}
+
+int BIO_get_wpoll_descriptor(BIO *b, BIO_POLL_DESCRIPTOR *desc)
+{
+ return BIO_ctrl(b, BIO_CTRL_GET_WPOLL_DESCRIPTOR, 0, desc);
+}
+
int BIO_puts(BIO *b, const char *buf)
{
int ret;
*(int *)ptr = data->local_addr_enabled;
break;
+ case BIO_CTRL_GET_RPOLL_DESCRIPTOR:
+ case BIO_CTRL_GET_WPOLL_DESCRIPTOR:
+ {
+ BIO_POLL_DESCRIPTOR *pd = ptr;
+
+ pd->type = BIO_POLL_DESCRIPTOR_TYPE_SOCK_FD;
+ pd->value.fd = b->num;
+ }
+ break;
+
default:
ret = 0;
break;
* # 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)
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
*/
__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);
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
case BIO_CTRL_SET_CALLBACK:
ret = 0; /* use callback ctrl */
break;
+ case BIO_CTRL_GET_RPOLL_DESCRIPTOR:
+ if (!SSL_get_rpoll_descriptor(ssl, (BIO_POLL_DESCRIPTOR *)ptr))
+ ret = 0;
+ break;
+ case BIO_CTRL_GET_WPOLL_DESCRIPTOR:
+ if (!SSL_get_wpoll_descriptor(ssl, (BIO_POLL_DESCRIPTOR *)ptr))
+ ret = 0;
+ break;
default:
ret = BIO_ctrl(sc->rbio, cmd, num, ptr);
break;
ctx->cert->dh_tmp = dhpkey;
return 1;
}
+
+int SSL_get_rpoll_descriptor(SSL *s, BIO_POLL_DESCRIPTOR *desc)
+{
+#ifndef OPENSSL_NO_QUIC
+ QUIC_CONNECTION *qc = QUIC_CONNECTION_FROM_SSL(s);
+
+ if (qc == NULL)
+ return -1;
+
+ return -1; /* TODO(QUIC) */
+#else
+ return -1;
+#endif
+}
+
+int SSL_get_wpoll_descriptor(SSL *s, BIO_POLL_DESCRIPTOR *desc)
+{
+#ifndef OPENSSL_NO_QUIC
+ QUIC_CONNECTION *qc = QUIC_CONNECTION_FROM_SSL(s);
+
+ if (qc == NULL)
+ return -1;
+
+ return -1; /* TODO(QUIC) */
+#else
+ return -1;
+#endif
+}