]>
Commit | Line | Data |
---|---|---|
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); | |
22 | void ossl_quic_deinit(SSL *s); | |
23 | void ossl_quic_free(SSL *s); | |
24 | int ossl_quic_reset(SSL *s); | |
25 | int 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); | |
38 | int ossl_quic_renegotiate_check(SSL *ssl, int initok); | |
39 | ||
40 | typedef struct quic_conn_st QUIC_CONNECTION; | |
f8636c7e | 41 | typedef struct quic_xso_st QUIC_XSO; |
d5ab48a1 | 42 | |
072328dd HL |
43 | int ossl_quic_do_handshake(SSL *s); |
44 | void ossl_quic_set_connect_state(SSL *s); | |
45 | void ossl_quic_set_accept_state(SSL *s); | |
22d53c88 | 46 | |
072328dd HL |
47 | __owur int ossl_quic_has_pending(const SSL *s); |
48 | __owur int ossl_quic_tick(SSL *s); | |
49 | __owur int ossl_quic_get_tick_timeout(SSL *s, struct timeval *tv); | |
50 | OSSL_TIME ossl_quic_get_tick_deadline(SSL *s); | |
51 | __owur int ossl_quic_get_rpoll_descriptor(SSL *s, BIO_POLL_DESCRIPTOR *d); | |
52 | __owur int ossl_quic_get_wpoll_descriptor(SSL *s, BIO_POLL_DESCRIPTOR *d); | |
53 | __owur int ossl_quic_get_net_read_desired(SSL *s); | |
54 | __owur int ossl_quic_get_net_write_desired(SSL *s); | |
55 | __owur int ossl_quic_get_error(const SSL *s, int i); | |
56 | __owur int ossl_quic_conn_get_blocking_mode(const SSL *s); | |
57 | __owur int ossl_quic_conn_set_blocking_mode(SSL *s, int blocking); | |
58 | __owur int ossl_quic_conn_shutdown(SSL *s, uint64_t flags, | |
e8043229 HL |
59 | const SSL_SHUTDOWN_EX_ARGS *args, |
60 | size_t args_len); | |
072328dd HL |
61 | __owur int ossl_quic_conn_stream_conclude(SSL *s); |
62 | void ossl_quic_conn_set0_net_rbio(SSL *s, BIO *net_wbio); | |
63 | void ossl_quic_conn_set0_net_wbio(SSL *s, BIO *net_wbio); | |
64 | BIO *ossl_quic_conn_get_net_rbio(const SSL *s); | |
65 | BIO *ossl_quic_conn_get_net_wbio(const SSL *s); | |
66 | __owur int ossl_quic_conn_set_initial_peer_addr(SSL *s, | |
22d53c88 | 67 | const BIO_ADDR *peer_addr); |
cb5c208b | 68 | __owur SSL *ossl_quic_conn_stream_new(SSL *s, uint64_t flags); |
020d0389 | 69 | __owur SSL *ossl_quic_get0_connection(SSL *s); |
1bca3f1b | 70 | __owur int ossl_quic_get_stream_type(SSL *s); |
d5ab48a1 | 71 | |
b212d554 HL |
72 | /* |
73 | * Used to override ossl_time_now() for debug purposes. Must be called before | |
74 | * connecting. | |
75 | */ | |
76 | void ossl_quic_conn_set_override_now_cb(SSL *s, | |
77 | OSSL_TIME (*now_cb)(void *arg), | |
78 | void *now_cb_arg); | |
79 | ||
3b1ab5a3 HL |
80 | /* |
81 | * Condvar waiting in the assist thread doesn't support time faking as it relies | |
82 | * on the OS's notion of time, thus this is used in test code to force a | |
83 | * spurious wakeup instead. | |
84 | */ | |
85 | void ossl_quic_conn_force_assist_thread_wake(SSL *s); | |
86 | ||
6292519c HL |
87 | # endif |
88 | ||
d5ab48a1 | 89 | #endif |