]> git.ipfire.org Git - thirdparty/openssl.git/blame - include/internal/quic_ssl.h
Fix SSL_has_pending() for QUIC connections
[thirdparty/openssl.git] / include / internal / quic_ssl.h
CommitLineData
d5ab48a1
RL
1/*
2 * Copyright 2022 The OpenSSL Project Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
8 */
9
10#ifndef OSSL_QUIC_SSL_H
11# define OSSL_QUIC_SSL_H
12
13# include <openssl/ssl.h>
22d53c88 14# include <openssl/bio.h>
d5ab48a1
RL
15# include "internal/quic_record_rx.h" /* OSSL_QRX */
16# include "internal/quic_ackm.h" /* OSSL_ACKM */
17
6292519c
HL
18# ifndef OPENSSL_NO_QUIC
19
d5ab48a1
RL
20__owur SSL *ossl_quic_new(SSL_CTX *ctx);
21__owur int ossl_quic_init(SSL *s);
22void ossl_quic_deinit(SSL *s);
23void ossl_quic_free(SSL *s);
24int ossl_quic_reset(SSL *s);
25int ossl_quic_clear(SSL *s);
26__owur int ossl_quic_accept(SSL *s);
27__owur int ossl_quic_connect(SSL *s);
28__owur int ossl_quic_read(SSL *s, void *buf, size_t len, size_t *readbytes);
29__owur int ossl_quic_peek(SSL *s, void *buf, size_t len, size_t *readbytes);
30__owur int ossl_quic_write(SSL *s, const void *buf, size_t len, size_t *written);
d5ab48a1
RL
31__owur long ossl_quic_ctrl(SSL *s, int cmd, long larg, void *parg);
32__owur long ossl_quic_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg);
33__owur long ossl_quic_callback_ctrl(SSL *s, int cmd, void (*fp) (void));
34__owur long ossl_quic_ctx_callback_ctrl(SSL_CTX *ctx, int cmd, void (*fp) (void));
35__owur size_t ossl_quic_pending(const SSL *s);
d5ab48a1
RL
36__owur int ossl_quic_num_ciphers(void);
37__owur const SSL_CIPHER *ossl_quic_get_cipher(unsigned int u);
38int ossl_quic_renegotiate_check(SSL *ssl, int initok);
39
40typedef struct quic_conn_st QUIC_CONNECTION;
41
22d53c88
HL
42int ossl_quic_do_handshake(QUIC_CONNECTION *qc);
43void ossl_quic_set_connect_state(QUIC_CONNECTION *qc);
44void ossl_quic_set_accept_state(QUIC_CONNECTION *qc);
45
560470b5 46__owur int ossl_quic_has_pending(const QUIC_CONNECTION *qc);
22d53c88
HL
47__owur int ossl_quic_tick(QUIC_CONNECTION *qc);
48__owur int ossl_quic_get_tick_timeout(QUIC_CONNECTION *qc, struct timeval *tv);
49__owur int ossl_quic_get_rpoll_descriptor(QUIC_CONNECTION *qc, BIO_POLL_DESCRIPTOR *d);
50__owur int ossl_quic_get_wpoll_descriptor(QUIC_CONNECTION *qc, BIO_POLL_DESCRIPTOR *d);
b639475a
HL
51__owur int ossl_quic_get_net_read_desired(QUIC_CONNECTION *qc);
52__owur int ossl_quic_get_net_write_desired(QUIC_CONNECTION *qc);
22d53c88
HL
53__owur int ossl_quic_get_error(const QUIC_CONNECTION *qc, int i);
54__owur int ossl_quic_conn_get_blocking_mode(const QUIC_CONNECTION *qc);
55__owur int ossl_quic_conn_set_blocking_mode(QUIC_CONNECTION *qc, int blocking);
e8043229
HL
56__owur int ossl_quic_conn_shutdown(QUIC_CONNECTION *qc, uint64_t flags,
57 const SSL_SHUTDOWN_EX_ARGS *args,
58 size_t args_len);
59__owur int ossl_quic_conn_stream_conclude(QUIC_CONNECTION *qc);
22d53c88
HL
60void ossl_quic_conn_set0_net_rbio(QUIC_CONNECTION *qc, BIO *net_wbio);
61void ossl_quic_conn_set0_net_wbio(QUIC_CONNECTION *qc, BIO *net_wbio);
62BIO *ossl_quic_conn_get_net_rbio(const QUIC_CONNECTION *qc);
63BIO *ossl_quic_conn_get_net_wbio(const QUIC_CONNECTION *qc);
64__owur int ossl_quic_conn_set_initial_peer_addr(QUIC_CONNECTION *qc,
65 const BIO_ADDR *peer_addr);
d5ab48a1 66
6292519c
HL
67# endif
68
d5ab48a1 69#endif