* https://www.openssl.org/source/license.html
*/
-#ifndef HEADER_BIO_H
-# define HEADER_BIO_H
+#ifndef OPENSSL_BIO_H
+# define OPENSSL_BIO_H
+# pragma once
+
+# include <openssl/macros.h>
+# ifndef OPENSSL_NO_DEPRECATED_3_0
+# define HEADER_BIO_H
+# endif
# include <openssl/e_os2.h>
# define BIO_CTRL_DGRAM_SET_PEEK_MODE 71
/*
- * internal BIO see include/internal/bio.h:
+ * internal BIO:
* # define BIO_CTRL_SET_KTLS_SEND 72
* # define BIO_CTRL_SET_KTLS_SEND_CTRL_MSG 74
* # define BIO_CTRL_CLEAR_KTLS_CTRL_MSG 75
# define BIO_CTRL_GET_KTLS_SEND 73
# define BIO_CTRL_GET_KTLS_RECV 76
+# define BIO_CTRL_DGRAM_SCTP_WAIT_FOR_DRY 77
+# define BIO_CTRL_DGRAM_SCTP_MSG_WAITING 78
+
+/* BIO_f_prefix controls */
+# define BIO_CTRL_SET_PREFIX 79
+# define BIO_CTRL_SET_INDENT 80
+# define BIO_CTRL_GET_INDENT 81
+
# ifndef OPENSSL_NO_KTLS
# define BIO_get_ktls_send(b) \
- (BIO_method_type(b) == BIO_TYPE_SOCKET \
- && BIO_ctrl(b, BIO_CTRL_GET_KTLS_SEND, 0, NULL))
+ BIO_ctrl(b, BIO_CTRL_GET_KTLS_SEND, 0, NULL)
# define BIO_get_ktls_recv(b) \
- (BIO_method_type(b) == BIO_TYPE_SOCKET \
- && BIO_ctrl(b, BIO_CTRL_GET_KTLS_RECV, 0, NULL))
+ BIO_ctrl(b, BIO_CTRL_GET_KTLS_RECV, 0, NULL)
# else
# define BIO_get_ktls_send(b) (0)
# define BIO_get_ktls_recv(b) (0)
# define BIO_FLAGS_IO_SPECIAL 0x04
# define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
# define BIO_FLAGS_SHOULD_RETRY 0x08
-# if !OPENSSL_API_3
+# ifndef OPENSSL_NO_DEPRECATED_3_0
/* This #define was replaced by an internal constant and should not be used. */
# define BIO_FLAGS_UPLINK 0
# endif
*/
# define BIO_FLAGS_MEM_RDONLY 0x200
# define BIO_FLAGS_NONCLEAR_RST 0x400
+# define BIO_FLAGS_IN_EOF 0x800
typedef union bio_addr_st BIO_ADDR;
typedef struct bio_addrinfo_st BIO_ADDRINFO;
typedef int asn1_ps_func (BIO *b, unsigned char **pbuf, int *plen,
void *parg);
+typedef void (*BIO_dgram_sctp_notification_handler_fn) (BIO *b,
+ void *context,
+ void *buf);
# ifndef OPENSSL_NO_SCTP
/* SCTP parameter structs */
struct bio_dgram_sctp_sndinfo {
# define BIO_dgram_get_mtu_overhead(b) \
(unsigned int)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_MTU_OVERHEAD, 0, NULL)
+/* ctrl macros for BIO_f_prefix */
+# define BIO_set_prefix(b,p) BIO_ctrl((b), BIO_CTRL_SET_PREFIX, 0, (void *)(p))
+# define BIO_set_indent(b,i) BIO_ctrl((b), BIO_CTRL_SET_INDENT, (i), NULL)
+# define BIO_get_indent(b) BIO_ctrl((b), BIO_CTRL_GET_INDENT, 0, NULL)
+
#define BIO_get_ex_new_index(l, p, newf, dupf, freef) \
CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_BIO, l, p, newf, dupf, freef)
int BIO_set_ex_data(BIO *bio, int idx, void *data);
const BIO_METHOD *BIO_f_buffer(void);
const BIO_METHOD *BIO_f_linebuffer(void);
const BIO_METHOD *BIO_f_nbio_test(void);
+const BIO_METHOD *BIO_f_prefix(void);
# ifndef OPENSSL_NO_DGRAM
const BIO_METHOD *BIO_s_datagram(void);
int BIO_dgram_non_fatal_error(int error);
BIO *BIO_new_dgram_sctp(int fd, int close_flag);
int BIO_dgram_is_sctp(BIO *bio);
int BIO_dgram_sctp_notification_cb(BIO *b,
- void (*handle_notifications) (BIO *bio,
- void *context,
- void *buf),
- void *context);
+ BIO_dgram_sctp_notification_handler_fn handle_notifications,
+ void *context);
int BIO_dgram_sctp_wait_for_dry(BIO *b);
int BIO_dgram_sctp_msg_waiting(BIO *b);
# endif
# ifndef OPENSSL_NO_SOCK
int BIO_sock_should_retry(int i);
int BIO_sock_non_fatal_error(int error);
+int BIO_socket_wait(int fd, int for_read, time_t max_time);
# endif
+int BIO_wait(BIO *bio, time_t max_time, unsigned int milliseconds);
+int BIO_connect_retry(BIO *bio, int timeout);
int BIO_fd_should_retry(int i);
int BIO_fd_non_fatal_error(int error);
int BIO_socket_ioctl(int fd, long type, void *arg);
int BIO_socket_nbio(int fd, int mode);
int BIO_sock_init(void);
-# if !OPENSSL_API_1_1_0
+# ifndef OPENSSL_NO_DEPRECATED_1_1_0
# define BIO_sock_cleanup() while(0) continue
# endif
int BIO_set_tcp_ndelay(int sock, int turn_on);