Mercurial > hg > nginx-quic
annotate src/event/quic/ngx_event_quic_transport.h @ 8717:e06283038ec8 quic
QUIC: clear SSL_OP_ENABLE_MIDDLEBOX_COMPAT on SSL context switch.
The SSL_OP_ENABLE_MIDDLEBOX_COMPAT option is provided by QuicTLS and enabled
by default in the newly created SSL contexts. SSL_set_quic_method() is used
to clear it, which is required for SSL handshake to work on QUIC connections.
Switching context in the ngx_http_ssl_servername() SNI callback overrides SSL
options from the new SSL context. This results in the option set again.
Fix is to explicitly clear it when switching to another SSL context.
Initially reported here (in Russian):
http://mailman.nginx.org/pipermail/nginx-ru/2021-November/063989.html
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Tue, 07 Dec 2021 15:49:51 +0300 |
parents | d6ef13c5fd8e |
children | 1e2f4e9c8195 |
rev | line source |
---|---|
7690
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
1 |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
2 /* |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
3 * Copyright (C) Nginx, Inc. |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
4 */ |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
5 |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
6 |
8270
c57b6fc90f90
QUIC: fixed header protection macro name.
Vladimir Homutov <vl@nginx.com>
parents:
8269
diff
changeset
|
7 #ifndef _NGX_EVENT_QUIC_TRANSPORT_H_INCLUDED_ |
c57b6fc90f90
QUIC: fixed header protection macro name.
Vladimir Homutov <vl@nginx.com>
parents:
8269
diff
changeset
|
8 #define _NGX_EVENT_QUIC_TRANSPORT_H_INCLUDED_ |
7690
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
9 |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
10 |
7824
a5141e6b3214
Fixed includes in quic headers.
Roman Arutyunyan <arut@nginx.com>
parents:
7819
diff
changeset
|
11 #include <ngx_config.h> |
a5141e6b3214
Fixed includes in quic headers.
Roman Arutyunyan <arut@nginx.com>
parents:
7819
diff
changeset
|
12 #include <ngx_core.h> |
7690
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
13 |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
14 |
8498
4715f3e669f1
QUIC: updated specification references.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8417
diff
changeset
|
15 /* |
4715f3e669f1
QUIC: updated specification references.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8417
diff
changeset
|
16 * RFC 9000, 17.2. Long Header Packets |
4715f3e669f1
QUIC: updated specification references.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8417
diff
changeset
|
17 * 17.3. Short Header Packets |
4715f3e669f1
QUIC: updated specification references.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8417
diff
changeset
|
18 * |
4715f3e669f1
QUIC: updated specification references.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8417
diff
changeset
|
19 * QUIC flags in first byte |
4715f3e669f1
QUIC: updated specification references.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8417
diff
changeset
|
20 */ |
7847
262396242352
Reworked macros for parsing/assembling packet types.
Vladimir Homutov <vl@nginx.com>
parents:
7824
diff
changeset
|
21 #define NGX_QUIC_PKT_LONG 0x80 /* header form */ |
262396242352
Reworked macros for parsing/assembling packet types.
Vladimir Homutov <vl@nginx.com>
parents:
7824
diff
changeset
|
22 #define NGX_QUIC_PKT_FIXED_BIT 0x40 |
262396242352
Reworked macros for parsing/assembling packet types.
Vladimir Homutov <vl@nginx.com>
parents:
7824
diff
changeset
|
23 #define NGX_QUIC_PKT_TYPE 0x30 /* in long packet */ |
262396242352
Reworked macros for parsing/assembling packet types.
Vladimir Homutov <vl@nginx.com>
parents:
7824
diff
changeset
|
24 #define NGX_QUIC_PKT_KPHASE 0x04 /* in short packet */ |
262396242352
Reworked macros for parsing/assembling packet types.
Vladimir Homutov <vl@nginx.com>
parents:
7824
diff
changeset
|
25 |
262396242352
Reworked macros for parsing/assembling packet types.
Vladimir Homutov <vl@nginx.com>
parents:
7824
diff
changeset
|
26 #define ngx_quic_long_pkt(flags) ((flags) & NGX_QUIC_PKT_LONG) |
262396242352
Reworked macros for parsing/assembling packet types.
Vladimir Homutov <vl@nginx.com>
parents:
7824
diff
changeset
|
27 #define ngx_quic_short_pkt(flags) (((flags) & NGX_QUIC_PKT_LONG) == 0) |
7690
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
28 |
7717
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
29 /* Long packet types */ |
7847
262396242352
Reworked macros for parsing/assembling packet types.
Vladimir Homutov <vl@nginx.com>
parents:
7824
diff
changeset
|
30 #define NGX_QUIC_PKT_INITIAL 0x00 |
262396242352
Reworked macros for parsing/assembling packet types.
Vladimir Homutov <vl@nginx.com>
parents:
7824
diff
changeset
|
31 #define NGX_QUIC_PKT_ZRTT 0x10 |
262396242352
Reworked macros for parsing/assembling packet types.
Vladimir Homutov <vl@nginx.com>
parents:
7824
diff
changeset
|
32 #define NGX_QUIC_PKT_HANDSHAKE 0x20 |
262396242352
Reworked macros for parsing/assembling packet types.
Vladimir Homutov <vl@nginx.com>
parents:
7824
diff
changeset
|
33 #define NGX_QUIC_PKT_RETRY 0x30 |
7717
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
34 |
7847
262396242352
Reworked macros for parsing/assembling packet types.
Vladimir Homutov <vl@nginx.com>
parents:
7824
diff
changeset
|
35 #define ngx_quic_pkt_in(flags) \ |
262396242352
Reworked macros for parsing/assembling packet types.
Vladimir Homutov <vl@nginx.com>
parents:
7824
diff
changeset
|
36 (((flags) & NGX_QUIC_PKT_TYPE) == NGX_QUIC_PKT_INITIAL) |
262396242352
Reworked macros for parsing/assembling packet types.
Vladimir Homutov <vl@nginx.com>
parents:
7824
diff
changeset
|
37 #define ngx_quic_pkt_zrtt(flags) \ |
262396242352
Reworked macros for parsing/assembling packet types.
Vladimir Homutov <vl@nginx.com>
parents:
7824
diff
changeset
|
38 (((flags) & NGX_QUIC_PKT_TYPE) == NGX_QUIC_PKT_ZRTT) |
262396242352
Reworked macros for parsing/assembling packet types.
Vladimir Homutov <vl@nginx.com>
parents:
7824
diff
changeset
|
39 #define ngx_quic_pkt_hs(flags) \ |
262396242352
Reworked macros for parsing/assembling packet types.
Vladimir Homutov <vl@nginx.com>
parents:
7824
diff
changeset
|
40 (((flags) & NGX_QUIC_PKT_TYPE) == NGX_QUIC_PKT_HANDSHAKE) |
262396242352
Reworked macros for parsing/assembling packet types.
Vladimir Homutov <vl@nginx.com>
parents:
7824
diff
changeset
|
41 #define ngx_quic_pkt_retry(flags) \ |
262396242352
Reworked macros for parsing/assembling packet types.
Vladimir Homutov <vl@nginx.com>
parents:
7824
diff
changeset
|
42 (((flags) & NGX_QUIC_PKT_TYPE) == NGX_QUIC_PKT_RETRY) |
262396242352
Reworked macros for parsing/assembling packet types.
Vladimir Homutov <vl@nginx.com>
parents:
7824
diff
changeset
|
43 |
8213
5fdd0ef42232
QUIC: macros for manipulating header protection and reserved bits.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8212
diff
changeset
|
44 #define ngx_quic_pkt_rb_mask(flags) \ |
5fdd0ef42232
QUIC: macros for manipulating header protection and reserved bits.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8212
diff
changeset
|
45 (ngx_quic_long_pkt(flags) ? 0x0C : 0x18) |
5fdd0ef42232
QUIC: macros for manipulating header protection and reserved bits.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8212
diff
changeset
|
46 #define ngx_quic_pkt_hp_mask(flags) \ |
5fdd0ef42232
QUIC: macros for manipulating header protection and reserved bits.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8212
diff
changeset
|
47 (ngx_quic_long_pkt(flags) ? 0x0F : 0x1F) |
5fdd0ef42232
QUIC: macros for manipulating header protection and reserved bits.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8212
diff
changeset
|
48 |
8211
fe53def49945
QUIC: refactored long header parsing.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8191
diff
changeset
|
49 #define ngx_quic_level_name(lvl) \ |
fe53def49945
QUIC: refactored long header parsing.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8191
diff
changeset
|
50 (lvl == ssl_encryption_application) ? "app" \ |
fe53def49945
QUIC: refactored long header parsing.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8191
diff
changeset
|
51 : (lvl == ssl_encryption_initial) ? "init" \ |
fe53def49945
QUIC: refactored long header parsing.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8191
diff
changeset
|
52 : (lvl == ssl_encryption_handshake) ? "hs" : "early" |
fe53def49945
QUIC: refactored long header parsing.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8191
diff
changeset
|
53 |
8407 | 54 #define NGX_QUIC_MAX_CID_LEN 20 |
55 #define NGX_QUIC_SERVER_CID_LEN NGX_QUIC_MAX_CID_LEN | |
7690
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
56 |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
57 /* 12.4. Frames and Frame Types */ |
7717
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
58 #define NGX_QUIC_FT_PADDING 0x00 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
59 #define NGX_QUIC_FT_PING 0x01 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
60 #define NGX_QUIC_FT_ACK 0x02 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
61 #define NGX_QUIC_FT_ACK_ECN 0x03 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
62 #define NGX_QUIC_FT_RESET_STREAM 0x04 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
63 #define NGX_QUIC_FT_STOP_SENDING 0x05 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
64 #define NGX_QUIC_FT_CRYPTO 0x06 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
65 #define NGX_QUIC_FT_NEW_TOKEN 0x07 |
8545
4009f120cad4
QUIC: eliminated stream type from ngx_quic_stream_frame_t.
Roman Arutyunyan <arut@nginx.com>
parents:
8498
diff
changeset
|
66 #define NGX_QUIC_FT_STREAM 0x08 |
7717
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
67 #define NGX_QUIC_FT_STREAM1 0x09 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
68 #define NGX_QUIC_FT_STREAM2 0x0A |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
69 #define NGX_QUIC_FT_STREAM3 0x0B |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
70 #define NGX_QUIC_FT_STREAM4 0x0C |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
71 #define NGX_QUIC_FT_STREAM5 0x0D |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
72 #define NGX_QUIC_FT_STREAM6 0x0E |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
73 #define NGX_QUIC_FT_STREAM7 0x0F |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
74 #define NGX_QUIC_FT_MAX_DATA 0x10 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
75 #define NGX_QUIC_FT_MAX_STREAM_DATA 0x11 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
76 #define NGX_QUIC_FT_MAX_STREAMS 0x12 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
77 #define NGX_QUIC_FT_MAX_STREAMS2 0x13 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
78 #define NGX_QUIC_FT_DATA_BLOCKED 0x14 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
79 #define NGX_QUIC_FT_STREAM_DATA_BLOCKED 0x15 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
80 #define NGX_QUIC_FT_STREAMS_BLOCKED 0x16 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
81 #define NGX_QUIC_FT_STREAMS_BLOCKED2 0x17 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
82 #define NGX_QUIC_FT_NEW_CONNECTION_ID 0x18 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
83 #define NGX_QUIC_FT_RETIRE_CONNECTION_ID 0x19 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
84 #define NGX_QUIC_FT_PATH_CHALLENGE 0x1A |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
85 #define NGX_QUIC_FT_PATH_RESPONSE 0x1B |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
86 #define NGX_QUIC_FT_CONNECTION_CLOSE 0x1C |
7953
e0f92f68e018
QUIC: Introduced ngx_quic_finalize_connection().
Roman Arutyunyan <arut@nginx.com>
parents:
7942
diff
changeset
|
87 #define NGX_QUIC_FT_CONNECTION_CLOSE_APP 0x1D |
7717
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
88 #define NGX_QUIC_FT_HANDSHAKE_DONE 0x1E |
7690
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
89 |
8417
dcc57827098d
QUIC: fixed parsing of unknown frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8407
diff
changeset
|
90 #define NGX_QUIC_FT_LAST NGX_QUIC_FT_HANDSHAKE_DONE |
dcc57827098d
QUIC: fixed parsing of unknown frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8407
diff
changeset
|
91 |
8498
4715f3e669f1
QUIC: updated specification references.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8417
diff
changeset
|
92 /* 22.5. QUIC Transport Error Codes Registry */ |
7717
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
93 #define NGX_QUIC_ERR_NO_ERROR 0x00 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
94 #define NGX_QUIC_ERR_INTERNAL_ERROR 0x01 |
7935
f9592e804834
QUIC error SERVER_BUSY renamed to CONNECTION_REFUSED in draft-29.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7921
diff
changeset
|
95 #define NGX_QUIC_ERR_CONNECTION_REFUSED 0x02 |
7717
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
96 #define NGX_QUIC_ERR_FLOW_CONTROL_ERROR 0x03 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
97 #define NGX_QUIC_ERR_STREAM_LIMIT_ERROR 0x04 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
98 #define NGX_QUIC_ERR_STREAM_STATE_ERROR 0x05 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
99 #define NGX_QUIC_ERR_FINAL_SIZE_ERROR 0x06 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
100 #define NGX_QUIC_ERR_FRAME_ENCODING_ERROR 0x07 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
101 #define NGX_QUIC_ERR_TRANSPORT_PARAMETER_ERROR 0x08 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
102 #define NGX_QUIC_ERR_CONNECTION_ID_LIMIT_ERROR 0x09 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
103 #define NGX_QUIC_ERR_PROTOCOL_VIOLATION 0x0A |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
104 #define NGX_QUIC_ERR_INVALID_TOKEN 0x0B |
7921
6ea2f1daedb5
Introduced connection error APPLICATION_ERROR from draft-28.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7917
diff
changeset
|
105 #define NGX_QUIC_ERR_APPLICATION_ERROR 0x0C |
7717
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
106 #define NGX_QUIC_ERR_CRYPTO_BUFFER_EXCEEDED 0x0D |
7939
769d8bdeffb0
Define KEY_UPDATE_ERROR from quic-tls-24.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7935
diff
changeset
|
107 #define NGX_QUIC_ERR_KEY_UPDATE_ERROR 0x0E |
8403
168cc2a0f0b6
QUIC: added error codes and messages from latest drafts.
Vladimir Homutov <vl@nginx.com>
parents:
8291
diff
changeset
|
108 #define NGX_QUIC_ERR_AEAD_LIMIT_REACHED 0x0F |
168cc2a0f0b6
QUIC: added error codes and messages from latest drafts.
Vladimir Homutov <vl@nginx.com>
parents:
8291
diff
changeset
|
109 #define NGX_QUIC_ERR_NO_VIABLE_PATH 0x10 |
7690
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
110 |
7942
97adb87f149b
Get rid of hardcoded numbers used for quic handshake errors.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7939
diff
changeset
|
111 #define NGX_QUIC_ERR_CRYPTO_ERROR 0x100 |
97adb87f149b
Get rid of hardcoded numbers used for quic handshake errors.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7939
diff
changeset
|
112 |
97adb87f149b
Get rid of hardcoded numbers used for quic handshake errors.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7939
diff
changeset
|
113 #define NGX_QUIC_ERR_CRYPTO(e) (NGX_QUIC_ERR_CRYPTO_ERROR + (e)) |
97adb87f149b
Get rid of hardcoded numbers used for quic handshake errors.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7939
diff
changeset
|
114 |
7690
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
115 |
8498
4715f3e669f1
QUIC: updated specification references.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8417
diff
changeset
|
116 /* 22.3. QUIC Transport Parameters Registry */ |
7912
6633f17044eb
QUIC draft-28 transport parameters support.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7910
diff
changeset
|
117 #define NGX_QUIC_TP_ORIGINAL_DCID 0x00 |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7711
diff
changeset
|
118 #define NGX_QUIC_TP_MAX_IDLE_TIMEOUT 0x01 |
8100
b31c02454539
QUIC: added stateless reset support.
Vladimir Homutov <vl@nginx.com>
parents:
8098
diff
changeset
|
119 #define NGX_QUIC_TP_SR_TOKEN 0x02 |
7910
125cbfa77013
Renamed max_packet_size to max_udp_payload_size, from draft-28.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7864
diff
changeset
|
120 #define NGX_QUIC_TP_MAX_UDP_PAYLOAD_SIZE 0x03 |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7711
diff
changeset
|
121 #define NGX_QUIC_TP_INITIAL_MAX_DATA 0x04 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7711
diff
changeset
|
122 #define NGX_QUIC_TP_INITIAL_MAX_STREAM_DATA_BIDI_LOCAL 0x05 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7711
diff
changeset
|
123 #define NGX_QUIC_TP_INITIAL_MAX_STREAM_DATA_BIDI_REMOTE 0x06 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7711
diff
changeset
|
124 #define NGX_QUIC_TP_INITIAL_MAX_STREAM_DATA_UNI 0x07 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7711
diff
changeset
|
125 #define NGX_QUIC_TP_INITIAL_MAX_STREAMS_BIDI 0x08 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7711
diff
changeset
|
126 #define NGX_QUIC_TP_INITIAL_MAX_STREAMS_UNI 0x09 |
7717
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
127 #define NGX_QUIC_TP_ACK_DELAY_EXPONENT 0x0A |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
128 #define NGX_QUIC_TP_MAX_ACK_DELAY 0x0B |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
129 #define NGX_QUIC_TP_DISABLE_ACTIVE_MIGRATION 0x0C |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
130 #define NGX_QUIC_TP_PREFERRED_ADDRESS 0x0D |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7715
diff
changeset
|
131 #define NGX_QUIC_TP_ACTIVE_CONNECTION_ID_LIMIT 0x0E |
7912
6633f17044eb
QUIC draft-28 transport parameters support.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7910
diff
changeset
|
132 #define NGX_QUIC_TP_INITIAL_SCID 0x0F |
6633f17044eb
QUIC draft-28 transport parameters support.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7910
diff
changeset
|
133 #define NGX_QUIC_TP_RETRY_SCID 0x10 |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7711
diff
changeset
|
134 |
7864
eebdda507ec3
Added tests for connection id lengths in initial packet.
Vladimir Homutov <vl@nginx.com>
parents:
7863
diff
changeset
|
135 #define NGX_QUIC_CID_LEN_MIN 8 |
eebdda507ec3
Added tests for connection id lengths in initial packet.
Vladimir Homutov <vl@nginx.com>
parents:
7863
diff
changeset
|
136 #define NGX_QUIC_CID_LEN_MAX 20 |
eebdda507ec3
Added tests for connection id lengths in initial packet.
Vladimir Homutov <vl@nginx.com>
parents:
7863
diff
changeset
|
137 |
8155
38c7dd720774
QUIC: added ACK frame range support.
Vladimir Homutov <vl@nginx.com>
parents:
8148
diff
changeset
|
138 #define NGX_QUIC_MAX_RANGES 10 |
38c7dd720774
QUIC: added ACK frame range support.
Vladimir Homutov <vl@nginx.com>
parents:
8148
diff
changeset
|
139 |
38c7dd720774
QUIC: added ACK frame range support.
Vladimir Homutov <vl@nginx.com>
parents:
8148
diff
changeset
|
140 |
38c7dd720774
QUIC: added ACK frame range support.
Vladimir Homutov <vl@nginx.com>
parents:
8148
diff
changeset
|
141 typedef struct { |
38c7dd720774
QUIC: added ACK frame range support.
Vladimir Homutov <vl@nginx.com>
parents:
8148
diff
changeset
|
142 uint64_t gap; |
38c7dd720774
QUIC: added ACK frame range support.
Vladimir Homutov <vl@nginx.com>
parents:
8148
diff
changeset
|
143 uint64_t range; |
38c7dd720774
QUIC: added ACK frame range support.
Vladimir Homutov <vl@nginx.com>
parents:
8148
diff
changeset
|
144 } ngx_quic_ack_range_t; |
38c7dd720774
QUIC: added ACK frame range support.
Vladimir Homutov <vl@nginx.com>
parents:
8148
diff
changeset
|
145 |
38c7dd720774
QUIC: added ACK frame range support.
Vladimir Homutov <vl@nginx.com>
parents:
8148
diff
changeset
|
146 |
7690
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
147 typedef struct { |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
148 uint64_t largest; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
149 uint64_t delay; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
150 uint64_t range_count; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
151 uint64_t first_range; |
7792 | 152 uint64_t ect0; |
153 uint64_t ect1; | |
154 uint64_t ce; | |
8241
2dfc5ef29973
QUIC: introduced QUIC buffers.
Roman Arutyunyan <arut@nginx.com>
parents:
8213
diff
changeset
|
155 uint64_t ranges_length; |
7690
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
156 } ngx_quic_ack_frame_t; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
157 |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
158 |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
159 typedef struct { |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
160 uint64_t seqnum; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
161 uint64_t retire; |
7706
1f002206a59b
Added boundaries checks into frame parser.
Vladimir Homutov <vl@nginx.com>
parents:
7703
diff
changeset
|
162 uint8_t len; |
7864
eebdda507ec3
Added tests for connection id lengths in initial packet.
Vladimir Homutov <vl@nginx.com>
parents:
7863
diff
changeset
|
163 u_char cid[NGX_QUIC_CID_LEN_MAX]; |
8100
b31c02454539
QUIC: added stateless reset support.
Vladimir Homutov <vl@nginx.com>
parents:
8098
diff
changeset
|
164 u_char srt[NGX_QUIC_SR_TOKEN_LEN]; |
7690
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
165 } ngx_quic_new_conn_id_frame_t; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
166 |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
167 |
7861
52d0c4832570
Address validation using NEW_TOKEN frame.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7860
diff
changeset
|
168 typedef struct { |
52d0c4832570
Address validation using NEW_TOKEN frame.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7860
diff
changeset
|
169 uint64_t length; |
52d0c4832570
Address validation using NEW_TOKEN frame.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7860
diff
changeset
|
170 u_char *data; |
52d0c4832570
Address validation using NEW_TOKEN frame.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7860
diff
changeset
|
171 } ngx_quic_new_token_frame_t; |
52d0c4832570
Address validation using NEW_TOKEN frame.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7860
diff
changeset
|
172 |
7810
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
7792
diff
changeset
|
173 /* |
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
7792
diff
changeset
|
174 * common layout for CRYPTO and STREAM frames; |
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
7792
diff
changeset
|
175 * conceptually, CRYPTO frame is also a stream |
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
7792
diff
changeset
|
176 * frame lacking some properties |
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
7792
diff
changeset
|
177 */ |
7690
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
178 typedef struct { |
7810
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
7792
diff
changeset
|
179 uint64_t offset; |
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
7792
diff
changeset
|
180 uint64_t length; |
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
7792
diff
changeset
|
181 } ngx_quic_ordered_frame_t; |
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
7792
diff
changeset
|
182 |
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
7792
diff
changeset
|
183 typedef ngx_quic_ordered_frame_t ngx_quic_crypto_frame_t; |
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
7792
diff
changeset
|
184 |
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
7792
diff
changeset
|
185 |
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
7792
diff
changeset
|
186 typedef struct { |
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
7792
diff
changeset
|
187 /* initial fields same as in ngx_quic_ordered_frame_t */ |
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
7792
diff
changeset
|
188 uint64_t offset; |
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
7792
diff
changeset
|
189 uint64_t length; |
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
7792
diff
changeset
|
190 |
7690
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
191 uint64_t stream_id; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
192 unsigned off:1; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
193 unsigned len:1; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
194 unsigned fin:1; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
195 } ngx_quic_stream_frame_t; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
196 |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
197 |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
198 typedef struct { |
7703
ff540f13d95d
MAX_DATA frame parser/handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7702
diff
changeset
|
199 uint64_t max_data; |
ff540f13d95d
MAX_DATA frame parser/handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7702
diff
changeset
|
200 } ngx_quic_max_data_frame_t; |
ff540f13d95d
MAX_DATA frame parser/handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7702
diff
changeset
|
201 |
ff540f13d95d
MAX_DATA frame parser/handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7702
diff
changeset
|
202 |
ff540f13d95d
MAX_DATA frame parser/handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7702
diff
changeset
|
203 typedef struct { |
7690
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
204 uint64_t error_code; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
205 uint64_t frame_type; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
206 ngx_str_t reason; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
207 } ngx_quic_close_frame_t; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
208 |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
209 |
7697
78540e2160d0
Added parsing of RESET_STREAM and STOP_SENDING frames
Vladimir Homutov <vl@nginx.com>
parents:
7690
diff
changeset
|
210 typedef struct { |
78540e2160d0
Added parsing of RESET_STREAM and STOP_SENDING frames
Vladimir Homutov <vl@nginx.com>
parents:
7690
diff
changeset
|
211 uint64_t id; |
78540e2160d0
Added parsing of RESET_STREAM and STOP_SENDING frames
Vladimir Homutov <vl@nginx.com>
parents:
7690
diff
changeset
|
212 uint64_t error_code; |
78540e2160d0
Added parsing of RESET_STREAM and STOP_SENDING frames
Vladimir Homutov <vl@nginx.com>
parents:
7690
diff
changeset
|
213 uint64_t final_size; |
78540e2160d0
Added parsing of RESET_STREAM and STOP_SENDING frames
Vladimir Homutov <vl@nginx.com>
parents:
7690
diff
changeset
|
214 } ngx_quic_reset_stream_frame_t; |
78540e2160d0
Added parsing of RESET_STREAM and STOP_SENDING frames
Vladimir Homutov <vl@nginx.com>
parents:
7690
diff
changeset
|
215 |
78540e2160d0
Added parsing of RESET_STREAM and STOP_SENDING frames
Vladimir Homutov <vl@nginx.com>
parents:
7690
diff
changeset
|
216 |
78540e2160d0
Added parsing of RESET_STREAM and STOP_SENDING frames
Vladimir Homutov <vl@nginx.com>
parents:
7690
diff
changeset
|
217 typedef struct { |
78540e2160d0
Added parsing of RESET_STREAM and STOP_SENDING frames
Vladimir Homutov <vl@nginx.com>
parents:
7690
diff
changeset
|
218 uint64_t id; |
78540e2160d0
Added parsing of RESET_STREAM and STOP_SENDING frames
Vladimir Homutov <vl@nginx.com>
parents:
7690
diff
changeset
|
219 uint64_t error_code; |
78540e2160d0
Added parsing of RESET_STREAM and STOP_SENDING frames
Vladimir Homutov <vl@nginx.com>
parents:
7690
diff
changeset
|
220 } ngx_quic_stop_sending_frame_t; |
78540e2160d0
Added parsing of RESET_STREAM and STOP_SENDING frames
Vladimir Homutov <vl@nginx.com>
parents:
7690
diff
changeset
|
221 |
78540e2160d0
Added parsing of RESET_STREAM and STOP_SENDING frames
Vladimir Homutov <vl@nginx.com>
parents:
7690
diff
changeset
|
222 |
7702
d3b26c3bea22
Added parsing of STREAMS BLOCKED frames.
Vladimir Homutov <vl@nginx.com>
parents:
7697
diff
changeset
|
223 typedef struct { |
d3b26c3bea22
Added parsing of STREAMS BLOCKED frames.
Vladimir Homutov <vl@nginx.com>
parents:
7697
diff
changeset
|
224 uint64_t limit; |
d3b26c3bea22
Added parsing of STREAMS BLOCKED frames.
Vladimir Homutov <vl@nginx.com>
parents:
7697
diff
changeset
|
225 ngx_uint_t bidi; /* unsigned: bidi:1 */ |
d3b26c3bea22
Added parsing of STREAMS BLOCKED frames.
Vladimir Homutov <vl@nginx.com>
parents:
7697
diff
changeset
|
226 } ngx_quic_streams_blocked_frame_t; |
d3b26c3bea22
Added parsing of STREAMS BLOCKED frames.
Vladimir Homutov <vl@nginx.com>
parents:
7697
diff
changeset
|
227 |
d3b26c3bea22
Added parsing of STREAMS BLOCKED frames.
Vladimir Homutov <vl@nginx.com>
parents:
7697
diff
changeset
|
228 |
7711
a14afe21e692
Double MAX_STREAMS on STREAMS_BLOCKED.
Roman Arutyunyan <arut@nginx.com>
parents:
7707
diff
changeset
|
229 typedef struct { |
a14afe21e692
Double MAX_STREAMS on STREAMS_BLOCKED.
Roman Arutyunyan <arut@nginx.com>
parents:
7707
diff
changeset
|
230 uint64_t limit; |
a14afe21e692
Double MAX_STREAMS on STREAMS_BLOCKED.
Roman Arutyunyan <arut@nginx.com>
parents:
7707
diff
changeset
|
231 ngx_uint_t bidi; /* unsigned: bidi:1 */ |
a14afe21e692
Double MAX_STREAMS on STREAMS_BLOCKED.
Roman Arutyunyan <arut@nginx.com>
parents:
7707
diff
changeset
|
232 } ngx_quic_max_streams_frame_t; |
a14afe21e692
Double MAX_STREAMS on STREAMS_BLOCKED.
Roman Arutyunyan <arut@nginx.com>
parents:
7707
diff
changeset
|
233 |
a14afe21e692
Double MAX_STREAMS on STREAMS_BLOCKED.
Roman Arutyunyan <arut@nginx.com>
parents:
7707
diff
changeset
|
234 |
7723
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7717
diff
changeset
|
235 typedef struct { |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7717
diff
changeset
|
236 uint64_t id; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7717
diff
changeset
|
237 uint64_t limit; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7717
diff
changeset
|
238 } ngx_quic_max_stream_data_frame_t; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7717
diff
changeset
|
239 |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7717
diff
changeset
|
240 |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7717
diff
changeset
|
241 typedef struct { |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7717
diff
changeset
|
242 uint64_t limit; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7717
diff
changeset
|
243 } ngx_quic_data_blocked_frame_t; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7717
diff
changeset
|
244 |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7717
diff
changeset
|
245 |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7717
diff
changeset
|
246 typedef struct { |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7717
diff
changeset
|
247 uint64_t id; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7717
diff
changeset
|
248 uint64_t limit; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7717
diff
changeset
|
249 } ngx_quic_stream_data_blocked_frame_t; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7717
diff
changeset
|
250 |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7717
diff
changeset
|
251 |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7717
diff
changeset
|
252 typedef struct { |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7717
diff
changeset
|
253 uint64_t sequence_number; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7717
diff
changeset
|
254 } ngx_quic_retire_cid_frame_t; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7717
diff
changeset
|
255 |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7717
diff
changeset
|
256 |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7717
diff
changeset
|
257 typedef struct { |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7717
diff
changeset
|
258 u_char data[8]; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7717
diff
changeset
|
259 } ngx_quic_path_challenge_frame_t; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7717
diff
changeset
|
260 |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7717
diff
changeset
|
261 |
7690
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
262 typedef struct ngx_quic_frame_s ngx_quic_frame_t; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
263 |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
264 struct ngx_quic_frame_s { |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
265 ngx_uint_t type; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
266 enum ssl_encryption_level_t level; |
7774
e10b4c61420f
Implemented retransmission and retransmit queue.
Vladimir Homutov <vl@nginx.com>
parents:
7773
diff
changeset
|
267 ngx_queue_t queue; |
e10b4c61420f
Implemented retransmission and retransmit queue.
Vladimir Homutov <vl@nginx.com>
parents:
7773
diff
changeset
|
268 uint64_t pnum; |
8026
4604e6043657
QUIC: packet based bytes_in_flight accounting.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7994
diff
changeset
|
269 size_t plen; |
7774
e10b4c61420f
Implemented retransmission and retransmit queue.
Vladimir Homutov <vl@nginx.com>
parents:
7773
diff
changeset
|
270 ngx_msec_t first; |
e10b4c61420f
Implemented retransmission and retransmit queue.
Vladimir Homutov <vl@nginx.com>
parents:
7773
diff
changeset
|
271 ngx_msec_t last; |
7994
f9fbeb4ee0de
QUIC: added limit of queued data.
Vladimir Homutov <vl@nginx.com>
parents:
7988
diff
changeset
|
272 ssize_t len; |
8291
9ed95726b99b
QUIC: send PING frames on PTO expiration.
Roman Arutyunyan <arut@nginx.com>
parents:
8285
diff
changeset
|
273 unsigned need_ack:1; |
8547
ad046179eb91
QUIC: handle EAGAIN properly on UDP sockets.
Vladimir Homutov <vl@nginx.com>
parents:
8545
diff
changeset
|
274 unsigned pkt_need_ack:1; |
8291
9ed95726b99b
QUIC: send PING frames on PTO expiration.
Roman Arutyunyan <arut@nginx.com>
parents:
8285
diff
changeset
|
275 unsigned flush:1; |
7774
e10b4c61420f
Implemented retransmission and retransmit queue.
Vladimir Homutov <vl@nginx.com>
parents:
7773
diff
changeset
|
276 |
8241
2dfc5ef29973
QUIC: introduced QUIC buffers.
Roman Arutyunyan <arut@nginx.com>
parents:
8213
diff
changeset
|
277 ngx_chain_t *data; |
7690
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
278 union { |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
279 ngx_quic_ack_frame_t ack; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
280 ngx_quic_crypto_frame_t crypto; |
7810
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
7792
diff
changeset
|
281 ngx_quic_ordered_frame_t ord; |
7690
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
282 ngx_quic_new_conn_id_frame_t ncid; |
7861
52d0c4832570
Address validation using NEW_TOKEN frame.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7860
diff
changeset
|
283 ngx_quic_new_token_frame_t token; |
7690
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
284 ngx_quic_stream_frame_t stream; |
7703
ff540f13d95d
MAX_DATA frame parser/handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7702
diff
changeset
|
285 ngx_quic_max_data_frame_t max_data; |
7690
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
286 ngx_quic_close_frame_t close; |
7697
78540e2160d0
Added parsing of RESET_STREAM and STOP_SENDING frames
Vladimir Homutov <vl@nginx.com>
parents:
7690
diff
changeset
|
287 ngx_quic_reset_stream_frame_t reset_stream; |
78540e2160d0
Added parsing of RESET_STREAM and STOP_SENDING frames
Vladimir Homutov <vl@nginx.com>
parents:
7690
diff
changeset
|
288 ngx_quic_stop_sending_frame_t stop_sending; |
7702
d3b26c3bea22
Added parsing of STREAMS BLOCKED frames.
Vladimir Homutov <vl@nginx.com>
parents:
7697
diff
changeset
|
289 ngx_quic_streams_blocked_frame_t streams_blocked; |
7711
a14afe21e692
Double MAX_STREAMS on STREAMS_BLOCKED.
Roman Arutyunyan <arut@nginx.com>
parents:
7707
diff
changeset
|
290 ngx_quic_max_streams_frame_t max_streams; |
7723
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7717
diff
changeset
|
291 ngx_quic_max_stream_data_frame_t max_stream_data; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7717
diff
changeset
|
292 ngx_quic_data_blocked_frame_t data_blocked; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7717
diff
changeset
|
293 ngx_quic_stream_data_blocked_frame_t stream_data_blocked; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7717
diff
changeset
|
294 ngx_quic_retire_cid_frame_t retire_cid; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7717
diff
changeset
|
295 ngx_quic_path_challenge_frame_t path_challenge; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
7717
diff
changeset
|
296 ngx_quic_path_challenge_frame_t path_response; |
7690
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
297 } u; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
298 }; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
299 |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
300 |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
301 typedef struct { |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
302 ngx_log_t *log; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
303 |
8191
9c3be23ddbe7
QUIC: refactored key handling.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8172
diff
changeset
|
304 ngx_quic_keys_t *keys; |
9c3be23ddbe7
QUIC: refactored key handling.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8172
diff
changeset
|
305 |
8162
c5ea341f705a
QUIC: optimized acknowledgement generation.
Vladimir Homutov <vl@nginx.com>
parents:
8155
diff
changeset
|
306 ngx_msec_t received; |
7773
dc7ac778aafe
Introduced packet namespace in QUIC connection.
Vladimir Homutov <vl@nginx.com>
parents:
7764
diff
changeset
|
307 uint64_t number; |
7781
fdda518d10ba
Proper handling of packet number in header.
Vladimir Homutov <vl@nginx.com>
parents:
7774
diff
changeset
|
308 uint8_t num_len; |
fdda518d10ba
Proper handling of packet number in header.
Vladimir Homutov <vl@nginx.com>
parents:
7774
diff
changeset
|
309 uint32_t trunc; |
7706
1f002206a59b
Added boundaries checks into frame parser.
Vladimir Homutov <vl@nginx.com>
parents:
7703
diff
changeset
|
310 uint8_t flags; |
7690
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
311 uint32_t version; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
312 ngx_str_t token; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
313 enum ssl_encryption_level_t level; |
7862
fb7422074258
Added generation of CC frames with error on connection termination.
Vladimir Homutov <vl@nginx.com>
parents:
7861
diff
changeset
|
314 ngx_uint_t error; |
7690
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
315 |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
316 /* filled in by parser */ |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
317 ngx_buf_t *raw; /* udp datagram */ |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
318 |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
319 u_char *data; /* quic packet */ |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
320 size_t len; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
321 |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
322 /* cleartext fields */ |
7860
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7848
diff
changeset
|
323 ngx_str_t odcid; /* retry packet tag */ |
7690
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
324 ngx_str_t dcid; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
325 ngx_str_t scid; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
326 uint64_t pn; |
7754
ebd5c71b9f02
Got rid of memory allocation in decryption.
Vladimir Homutov <vl@nginx.com>
parents:
7752
diff
changeset
|
327 u_char *plaintext; |
ebd5c71b9f02
Got rid of memory allocation in decryption.
Vladimir Homutov <vl@nginx.com>
parents:
7752
diff
changeset
|
328 ngx_str_t payload; /* decrypted data */ |
7774
e10b4c61420f
Implemented retransmission and retransmit queue.
Vladimir Homutov <vl@nginx.com>
parents:
7773
diff
changeset
|
329 |
7785
29354c6fc5f2
TLS Key Update in QUIC.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7781
diff
changeset
|
330 unsigned need_ack:1; |
29354c6fc5f2
TLS Key Update in QUIC.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7781
diff
changeset
|
331 unsigned key_phase:1; |
29354c6fc5f2
TLS Key Update in QUIC.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7781
diff
changeset
|
332 unsigned key_update:1; |
8139
07971f870879
QUIC: added debug message with final packet processing status.
Vladimir Homutov <vl@nginx.com>
parents:
8100
diff
changeset
|
333 unsigned parsed:1; |
07971f870879
QUIC: added debug message with final packet processing status.
Vladimir Homutov <vl@nginx.com>
parents:
8100
diff
changeset
|
334 unsigned decrypted:1; |
8279 | 335 unsigned validated:1; |
336 unsigned retried:1; | |
8701
50d73bf20e73
QUIC: refactored multiple QUIC packets handling.
Vladimir Homutov <vl@nginx.com>
parents:
8689
diff
changeset
|
337 unsigned first:1; |
7690
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
338 } ngx_quic_header_t; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
339 |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
340 |
8713
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8701
diff
changeset
|
341 typedef struct { |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8701
diff
changeset
|
342 ngx_msec_t max_idle_timeout; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8701
diff
changeset
|
343 ngx_msec_t max_ack_delay; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8701
diff
changeset
|
344 |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8701
diff
changeset
|
345 size_t max_udp_payload_size; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8701
diff
changeset
|
346 size_t initial_max_data; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8701
diff
changeset
|
347 size_t initial_max_stream_data_bidi_local; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8701
diff
changeset
|
348 size_t initial_max_stream_data_bidi_remote; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8701
diff
changeset
|
349 size_t initial_max_stream_data_uni; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8701
diff
changeset
|
350 ngx_uint_t initial_max_streams_bidi; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8701
diff
changeset
|
351 ngx_uint_t initial_max_streams_uni; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8701
diff
changeset
|
352 ngx_uint_t ack_delay_exponent; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8701
diff
changeset
|
353 ngx_uint_t active_connection_id_limit; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8701
diff
changeset
|
354 ngx_flag_t disable_active_migration; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8701
diff
changeset
|
355 |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8701
diff
changeset
|
356 ngx_str_t original_dcid; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8701
diff
changeset
|
357 ngx_str_t initial_scid; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8701
diff
changeset
|
358 ngx_str_t retry_scid; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8701
diff
changeset
|
359 u_char sr_token[NGX_QUIC_SR_TOKEN_LEN]; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8701
diff
changeset
|
360 |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8701
diff
changeset
|
361 /* TODO */ |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8701
diff
changeset
|
362 void *preferred_address; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8701
diff
changeset
|
363 } ngx_quic_tp_t; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8701
diff
changeset
|
364 |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8701
diff
changeset
|
365 |
8098
d0d3fc0697a0
QUIC: packet processing refactoring.
Vladimir Homutov <vl@nginx.com>
parents:
8076
diff
changeset
|
366 ngx_int_t ngx_quic_parse_packet(ngx_quic_header_t *pkt); |
d0d3fc0697a0
QUIC: packet processing refactoring.
Vladimir Homutov <vl@nginx.com>
parents:
8076
diff
changeset
|
367 |
8060
fc89d02bdca2
QUIC: added version negotiation support.
Vladimir Homutov <vl@nginx.com>
parents:
8026
diff
changeset
|
368 size_t ngx_quic_create_version_negotiation(ngx_quic_header_t *pkt, u_char *out); |
fc89d02bdca2
QUIC: added version negotiation support.
Vladimir Homutov <vl@nginx.com>
parents:
8026
diff
changeset
|
369 |
8683
de7b9af30fc6
QUIC: refactored packet creation.
Vladimir Homutov <vl@nginx.com>
parents:
8547
diff
changeset
|
370 size_t ngx_quic_payload_size(ngx_quic_header_t *pkt, size_t pkt_len); |
de7b9af30fc6
QUIC: refactored packet creation.
Vladimir Homutov <vl@nginx.com>
parents:
8547
diff
changeset
|
371 |
8212
05b1ee464350
QUIC: hide header creation internals in ngx_event_quic_transport.c.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8211
diff
changeset
|
372 size_t ngx_quic_create_header(ngx_quic_header_t *pkt, u_char *out, |
8683
de7b9af30fc6
QUIC: refactored packet creation.
Vladimir Homutov <vl@nginx.com>
parents:
8547
diff
changeset
|
373 u_char **pnp); |
7751
f85749b60e58
Removed memory allocations from encryption code.
Vladimir Homutov <vl@nginx.com>
parents:
7726
diff
changeset
|
374 |
7860
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7848
diff
changeset
|
375 size_t ngx_quic_create_retry_itag(ngx_quic_header_t *pkt, u_char *out, |
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7848
diff
changeset
|
376 u_char **start); |
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7848
diff
changeset
|
377 |
7706
1f002206a59b
Added boundaries checks into frame parser.
Vladimir Homutov <vl@nginx.com>
parents:
7703
diff
changeset
|
378 ssize_t ngx_quic_parse_frame(ngx_quic_header_t *pkt, u_char *start, u_char *end, |
7690
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
379 ngx_quic_frame_t *frame); |
7774
e10b4c61420f
Implemented retransmission and retransmit queue.
Vladimir Homutov <vl@nginx.com>
parents:
7773
diff
changeset
|
380 ssize_t ngx_quic_create_frame(u_char *p, ngx_quic_frame_t *f); |
7690
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
381 |
8163
b3d9e57d0f62
QUIC: single function for frame debug logging.
Vladimir Homutov <vl@nginx.com>
parents:
8162
diff
changeset
|
382 ssize_t ngx_quic_parse_ack_range(ngx_log_t *log, u_char *start, |
7792 | 383 u_char *end, uint64_t *gap, uint64_t *range); |
8172
867c189f875d
QUIC: unified range format for rx and tx ACK frames.
Roman Arutyunyan <arut@nginx.com>
parents:
8163
diff
changeset
|
384 size_t ngx_quic_create_ack_range(u_char *p, uint64_t gap, uint64_t range); |
7792 | 385 |
8713
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8701
diff
changeset
|
386 ngx_int_t ngx_quic_init_transport_params(ngx_quic_tp_t *tp, |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8701
diff
changeset
|
387 ngx_quic_conf_t *qcf); |
7726
f388c0ad3477
Added processing of client transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7723
diff
changeset
|
388 ngx_int_t ngx_quic_parse_transport_params(u_char *p, u_char *end, |
f388c0ad3477
Added processing of client transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7723
diff
changeset
|
389 ngx_quic_tp_t *tp, ngx_log_t *log); |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7711
diff
changeset
|
390 ssize_t ngx_quic_create_transport_params(u_char *p, u_char *end, |
7917
90b02ff6b003
Compatibility with BoringSSL master branch.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7912
diff
changeset
|
391 ngx_quic_tp_t *tp, size_t *clen); |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7711
diff
changeset
|
392 |
8269
7df607cb2d11
QUIC: ngx_quic_bpf module.
Vladimir Homutov <vl@nginx.com>
parents:
8266
diff
changeset
|
393 void ngx_quic_dcid_encode_key(u_char *dcid, uint64_t key); |
7df607cb2d11
QUIC: ngx_quic_bpf module.
Vladimir Homutov <vl@nginx.com>
parents:
8266
diff
changeset
|
394 |
8270
c57b6fc90f90
QUIC: fixed header protection macro name.
Vladimir Homutov <vl@nginx.com>
parents:
8269
diff
changeset
|
395 #endif /* _NGX_EVENT_QUIC_TRANSPORT_H_INCLUDED_ */ |