Mercurial > hg > nginx
annotate src/event/quic/ngx_event_quic_transport.h @ 9250:55a5a40dccde
Reordered checks for Content-Length and Transfer-Encoding.
This ensures that r->headers_in.content_length_n is not set when both
Content-Length and Transfer-Encoding headers are present, making it slightly
safer to use complex processing for 400 (Bad Request) errors.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Sat, 27 Apr 2024 18:16:27 +0300 |
parents | ce1ff81e9b92 |
children |
rev | line source |
---|---|
8224
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 |
8677
c57b6fc90f90
QUIC: fixed header protection macro name.
Vladimir Homutov <vl@nginx.com>
parents:
8676
diff
changeset
|
7 #ifndef _NGX_EVENT_QUIC_TRANSPORT_H_INCLUDED_ |
c57b6fc90f90
QUIC: fixed header protection macro name.
Vladimir Homutov <vl@nginx.com>
parents:
8676
diff
changeset
|
8 #define _NGX_EVENT_QUIC_TRANSPORT_H_INCLUDED_ |
8224
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 |
8347
a5141e6b3214
Fixed includes in quic headers.
Roman Arutyunyan <arut@nginx.com>
parents:
8342
diff
changeset
|
11 #include <ngx_config.h> |
a5141e6b3214
Fixed includes in quic headers.
Roman Arutyunyan <arut@nginx.com>
parents:
8342
diff
changeset
|
12 #include <ngx_core.h> |
8224
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 |
8797
4715f3e669f1
QUIC: updated specification references.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8757
diff
changeset
|
15 /* |
4715f3e669f1
QUIC: updated specification references.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8757
diff
changeset
|
16 * RFC 9000, 17.2. Long Header Packets |
4715f3e669f1
QUIC: updated specification references.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8757
diff
changeset
|
17 * 17.3. Short Header Packets |
4715f3e669f1
QUIC: updated specification references.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8757
diff
changeset
|
18 * |
4715f3e669f1
QUIC: updated specification references.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8757
diff
changeset
|
19 * QUIC flags in first byte |
4715f3e669f1
QUIC: updated specification references.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8757
diff
changeset
|
20 */ |
8370
262396242352
Reworked macros for parsing/assembling packet types.
Vladimir Homutov <vl@nginx.com>
parents:
8347
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:
8347
diff
changeset
|
22 #define NGX_QUIC_PKT_FIXED_BIT 0x40 |
262396242352
Reworked macros for parsing/assembling packet types.
Vladimir Homutov <vl@nginx.com>
parents:
8347
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:
8347
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:
8347
diff
changeset
|
25 |
262396242352
Reworked macros for parsing/assembling packet types.
Vladimir Homutov <vl@nginx.com>
parents:
8347
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:
8347
diff
changeset
|
27 #define ngx_quic_short_pkt(flags) (((flags) & NGX_QUIC_PKT_LONG) == 0) |
8224
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
28 |
8251
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
29 /* Long packet types */ |
8370
262396242352
Reworked macros for parsing/assembling packet types.
Vladimir Homutov <vl@nginx.com>
parents:
8347
diff
changeset
|
30 #define NGX_QUIC_PKT_INITIAL 0x00 |
262396242352
Reworked macros for parsing/assembling packet types.
Vladimir Homutov <vl@nginx.com>
parents:
8347
diff
changeset
|
31 #define NGX_QUIC_PKT_ZRTT 0x10 |
262396242352
Reworked macros for parsing/assembling packet types.
Vladimir Homutov <vl@nginx.com>
parents:
8347
diff
changeset
|
32 #define NGX_QUIC_PKT_HANDSHAKE 0x20 |
262396242352
Reworked macros for parsing/assembling packet types.
Vladimir Homutov <vl@nginx.com>
parents:
8347
diff
changeset
|
33 #define NGX_QUIC_PKT_RETRY 0x30 |
8251
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
34 |
8370
262396242352
Reworked macros for parsing/assembling packet types.
Vladimir Homutov <vl@nginx.com>
parents:
8347
diff
changeset
|
35 #define ngx_quic_pkt_in(flags) \ |
262396242352
Reworked macros for parsing/assembling packet types.
Vladimir Homutov <vl@nginx.com>
parents:
8347
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:
8347
diff
changeset
|
37 #define ngx_quic_pkt_zrtt(flags) \ |
262396242352
Reworked macros for parsing/assembling packet types.
Vladimir Homutov <vl@nginx.com>
parents:
8347
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:
8347
diff
changeset
|
39 #define ngx_quic_pkt_hs(flags) \ |
262396242352
Reworked macros for parsing/assembling packet types.
Vladimir Homutov <vl@nginx.com>
parents:
8347
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:
8347
diff
changeset
|
41 #define ngx_quic_pkt_retry(flags) \ |
262396242352
Reworked macros for parsing/assembling packet types.
Vladimir Homutov <vl@nginx.com>
parents:
8347
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:
8347
diff
changeset
|
43 |
8643
5fdd0ef42232
QUIC: macros for manipulating header protection and reserved bits.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8642
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:
8642
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:
8642
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:
8642
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:
8642
diff
changeset
|
48 |
8641
fe53def49945
QUIC: refactored long header parsing.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8621
diff
changeset
|
49 #define ngx_quic_level_name(lvl) \ |
fe53def49945
QUIC: refactored long header parsing.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8621
diff
changeset
|
50 (lvl == ssl_encryption_application) ? "app" \ |
fe53def49945
QUIC: refactored long header parsing.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8621
diff
changeset
|
51 : (lvl == ssl_encryption_initial) ? "init" \ |
fe53def49945
QUIC: refactored long header parsing.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8621
diff
changeset
|
52 : (lvl == ssl_encryption_handshake) ? "hs" : "early" |
fe53def49945
QUIC: refactored long header parsing.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8621
diff
changeset
|
53 |
8747 | 54 #define NGX_QUIC_MAX_CID_LEN 20 |
55 #define NGX_QUIC_SERVER_CID_LEN NGX_QUIC_MAX_CID_LEN | |
8224
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 */ |
8251
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
58 #define NGX_QUIC_FT_PADDING 0x00 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
59 #define NGX_QUIC_FT_PING 0x01 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
60 #define NGX_QUIC_FT_ACK 0x02 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
61 #define NGX_QUIC_FT_ACK_ECN 0x03 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
62 #define NGX_QUIC_FT_RESET_STREAM 0x04 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
63 #define NGX_QUIC_FT_STOP_SENDING 0x05 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
64 #define NGX_QUIC_FT_CRYPTO 0x06 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
65 #define NGX_QUIC_FT_NEW_TOKEN 0x07 |
8820
4009f120cad4
QUIC: eliminated stream type from ngx_quic_stream_frame_t.
Roman Arutyunyan <arut@nginx.com>
parents:
8797
diff
changeset
|
66 #define NGX_QUIC_FT_STREAM 0x08 |
8251
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
67 #define NGX_QUIC_FT_STREAM1 0x09 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
68 #define NGX_QUIC_FT_STREAM2 0x0A |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
69 #define NGX_QUIC_FT_STREAM3 0x0B |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
70 #define NGX_QUIC_FT_STREAM4 0x0C |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
71 #define NGX_QUIC_FT_STREAM5 0x0D |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
72 #define NGX_QUIC_FT_STREAM6 0x0E |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
73 #define NGX_QUIC_FT_STREAM7 0x0F |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
74 #define NGX_QUIC_FT_MAX_DATA 0x10 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
75 #define NGX_QUIC_FT_MAX_STREAM_DATA 0x11 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
76 #define NGX_QUIC_FT_MAX_STREAMS 0x12 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
77 #define NGX_QUIC_FT_MAX_STREAMS2 0x13 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
78 #define NGX_QUIC_FT_DATA_BLOCKED 0x14 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
79 #define NGX_QUIC_FT_STREAM_DATA_BLOCKED 0x15 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
80 #define NGX_QUIC_FT_STREAMS_BLOCKED 0x16 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
81 #define NGX_QUIC_FT_STREAMS_BLOCKED2 0x17 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
82 #define NGX_QUIC_FT_NEW_CONNECTION_ID 0x18 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
83 #define NGX_QUIC_FT_RETIRE_CONNECTION_ID 0x19 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
84 #define NGX_QUIC_FT_PATH_CHALLENGE 0x1A |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
85 #define NGX_QUIC_FT_PATH_RESPONSE 0x1B |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
86 #define NGX_QUIC_FT_CONNECTION_CLOSE 0x1C |
8458
e0f92f68e018
QUIC: Introduced ngx_quic_finalize_connection().
Roman Arutyunyan <arut@nginx.com>
parents:
8447
diff
changeset
|
87 #define NGX_QUIC_FT_CONNECTION_CLOSE_APP 0x1D |
8251
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
88 #define NGX_QUIC_FT_HANDSHAKE_DONE 0x1E |
8224
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
89 |
8757
dcc57827098d
QUIC: fixed parsing of unknown frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8747
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:
8747
diff
changeset
|
91 |
8797
4715f3e669f1
QUIC: updated specification references.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8757
diff
changeset
|
92 /* 22.5. QUIC Transport Error Codes Registry */ |
8251
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
93 #define NGX_QUIC_ERR_NO_ERROR 0x00 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
94 #define NGX_QUIC_ERR_INTERNAL_ERROR 0x01 |
8440
f9592e804834
QUIC error SERVER_BUSY renamed to CONNECTION_REFUSED in draft-29.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8426
diff
changeset
|
95 #define NGX_QUIC_ERR_CONNECTION_REFUSED 0x02 |
8251
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
96 #define NGX_QUIC_ERR_FLOW_CONTROL_ERROR 0x03 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
97 #define NGX_QUIC_ERR_STREAM_LIMIT_ERROR 0x04 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
98 #define NGX_QUIC_ERR_STREAM_STATE_ERROR 0x05 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
99 #define NGX_QUIC_ERR_FINAL_SIZE_ERROR 0x06 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
100 #define NGX_QUIC_ERR_FRAME_ENCODING_ERROR 0x07 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
101 #define NGX_QUIC_ERR_TRANSPORT_PARAMETER_ERROR 0x08 |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
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:
8249
diff
changeset
|
103 #define NGX_QUIC_ERR_PROTOCOL_VIOLATION 0x0A |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
104 #define NGX_QUIC_ERR_INVALID_TOKEN 0x0B |
8426
6ea2f1daedb5
Introduced connection error APPLICATION_ERROR from draft-28.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8422
diff
changeset
|
105 #define NGX_QUIC_ERR_APPLICATION_ERROR 0x0C |
8251
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
106 #define NGX_QUIC_ERR_CRYPTO_BUFFER_EXCEEDED 0x0D |
8444
769d8bdeffb0
Define KEY_UPDATE_ERROR from quic-tls-24.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8440
diff
changeset
|
107 #define NGX_QUIC_ERR_KEY_UPDATE_ERROR 0x0E |
8743
168cc2a0f0b6
QUIC: added error codes and messages from latest drafts.
Vladimir Homutov <vl@nginx.com>
parents:
8698
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:
8698
diff
changeset
|
109 #define NGX_QUIC_ERR_NO_VIABLE_PATH 0x10 |
8224
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
110 |
8447
97adb87f149b
Get rid of hardcoded numbers used for quic handshake errors.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8444
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:
8444
diff
changeset
|
112 |
97adb87f149b
Get rid of hardcoded numbers used for quic handshake errors.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8444
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:
8444
diff
changeset
|
114 |
8224
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
115 |
8797
4715f3e669f1
QUIC: updated specification references.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8757
diff
changeset
|
116 /* 22.3. QUIC Transport Parameters Registry */ |
8417
6633f17044eb
QUIC draft-28 transport parameters support.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8415
diff
changeset
|
117 #define NGX_QUIC_TP_ORIGINAL_DCID 0x00 |
8247
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
8245
diff
changeset
|
118 #define NGX_QUIC_TP_MAX_IDLE_TIMEOUT 0x01 |
8562
b31c02454539
QUIC: added stateless reset support.
Vladimir Homutov <vl@nginx.com>
parents:
8560
diff
changeset
|
119 #define NGX_QUIC_TP_SR_TOKEN 0x02 |
8415
125cbfa77013
Renamed max_packet_size to max_udp_payload_size, from draft-28.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8387
diff
changeset
|
120 #define NGX_QUIC_TP_MAX_UDP_PAYLOAD_SIZE 0x03 |
8247
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
8245
diff
changeset
|
121 #define NGX_QUIC_TP_INITIAL_MAX_DATA 0x04 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
8245
diff
changeset
|
122 #define NGX_QUIC_TP_INITIAL_MAX_STREAM_DATA_BIDI_LOCAL 0x05 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
8245
diff
changeset
|
123 #define NGX_QUIC_TP_INITIAL_MAX_STREAM_DATA_BIDI_REMOTE 0x06 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
8245
diff
changeset
|
124 #define NGX_QUIC_TP_INITIAL_MAX_STREAM_DATA_UNI 0x07 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
8245
diff
changeset
|
125 #define NGX_QUIC_TP_INITIAL_MAX_STREAMS_BIDI 0x08 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
8245
diff
changeset
|
126 #define NGX_QUIC_TP_INITIAL_MAX_STREAMS_UNI 0x09 |
8251
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
127 #define NGX_QUIC_TP_ACK_DELAY_EXPONENT 0x0A |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
128 #define NGX_QUIC_TP_MAX_ACK_DELAY 0x0B |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
129 #define NGX_QUIC_TP_DISABLE_ACTIVE_MIGRATION 0x0C |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
130 #define NGX_QUIC_TP_PREFERRED_ADDRESS 0x0D |
c217a907ce42
Added checks for permitted frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8249
diff
changeset
|
131 #define NGX_QUIC_TP_ACTIVE_CONNECTION_ID_LIMIT 0x0E |
8417
6633f17044eb
QUIC draft-28 transport parameters support.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8415
diff
changeset
|
132 #define NGX_QUIC_TP_INITIAL_SCID 0x0F |
6633f17044eb
QUIC draft-28 transport parameters support.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8415
diff
changeset
|
133 #define NGX_QUIC_TP_RETRY_SCID 0x10 |
8247
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
8245
diff
changeset
|
134 |
8387
eebdda507ec3
Added tests for connection id lengths in initial packet.
Vladimir Homutov <vl@nginx.com>
parents:
8386
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:
8386
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:
8386
diff
changeset
|
137 |
8596
38c7dd720774
QUIC: added ACK frame range support.
Vladimir Homutov <vl@nginx.com>
parents:
8589
diff
changeset
|
138 #define NGX_QUIC_MAX_RANGES 10 |
38c7dd720774
QUIC: added ACK frame range support.
Vladimir Homutov <vl@nginx.com>
parents:
8589
diff
changeset
|
139 |
38c7dd720774
QUIC: added ACK frame range support.
Vladimir Homutov <vl@nginx.com>
parents:
8589
diff
changeset
|
140 |
38c7dd720774
QUIC: added ACK frame range support.
Vladimir Homutov <vl@nginx.com>
parents:
8589
diff
changeset
|
141 typedef struct { |
38c7dd720774
QUIC: added ACK frame range support.
Vladimir Homutov <vl@nginx.com>
parents:
8589
diff
changeset
|
142 uint64_t gap; |
38c7dd720774
QUIC: added ACK frame range support.
Vladimir Homutov <vl@nginx.com>
parents:
8589
diff
changeset
|
143 uint64_t range; |
38c7dd720774
QUIC: added ACK frame range support.
Vladimir Homutov <vl@nginx.com>
parents:
8589
diff
changeset
|
144 } ngx_quic_ack_range_t; |
38c7dd720774
QUIC: added ACK frame range support.
Vladimir Homutov <vl@nginx.com>
parents:
8589
diff
changeset
|
145 |
38c7dd720774
QUIC: added ACK frame range support.
Vladimir Homutov <vl@nginx.com>
parents:
8589
diff
changeset
|
146 |
8224
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; |
8326 | 152 uint64_t ect0; |
153 uint64_t ect1; | |
154 uint64_t ce; | |
8657
2dfc5ef29973
QUIC: introduced QUIC buffers.
Roman Arutyunyan <arut@nginx.com>
parents:
8643
diff
changeset
|
155 uint64_t ranges_length; |
8224
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; |
8240
1f002206a59b
Added boundaries checks into frame parser.
Vladimir Homutov <vl@nginx.com>
parents:
8237
diff
changeset
|
162 uint8_t len; |
8387
eebdda507ec3
Added tests for connection id lengths in initial packet.
Vladimir Homutov <vl@nginx.com>
parents:
8386
diff
changeset
|
163 u_char cid[NGX_QUIC_CID_LEN_MAX]; |
8562
b31c02454539
QUIC: added stateless reset support.
Vladimir Homutov <vl@nginx.com>
parents:
8560
diff
changeset
|
164 u_char srt[NGX_QUIC_SR_TOKEN_LEN]; |
8224
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 |
8384
52d0c4832570
Address validation using NEW_TOKEN frame.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8383
diff
changeset
|
168 typedef struct { |
52d0c4832570
Address validation using NEW_TOKEN frame.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8383
diff
changeset
|
169 uint64_t length; |
52d0c4832570
Address validation using NEW_TOKEN frame.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8383
diff
changeset
|
170 } ngx_quic_new_token_frame_t; |
52d0c4832570
Address validation using NEW_TOKEN frame.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8383
diff
changeset
|
171 |
8333
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
8326
diff
changeset
|
172 /* |
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
8326
diff
changeset
|
173 * common layout for CRYPTO and STREAM frames; |
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
8326
diff
changeset
|
174 * conceptually, CRYPTO frame is also a stream |
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
8326
diff
changeset
|
175 * frame lacking some properties |
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
8326
diff
changeset
|
176 */ |
8224
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
177 typedef struct { |
8333
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
8326
diff
changeset
|
178 uint64_t offset; |
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
8326
diff
changeset
|
179 uint64_t length; |
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
8326
diff
changeset
|
180 } ngx_quic_ordered_frame_t; |
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
8326
diff
changeset
|
181 |
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
8326
diff
changeset
|
182 typedef ngx_quic_ordered_frame_t ngx_quic_crypto_frame_t; |
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
8326
diff
changeset
|
183 |
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
8326
diff
changeset
|
184 |
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
8326
diff
changeset
|
185 typedef struct { |
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
8326
diff
changeset
|
186 /* initial fields same as in ngx_quic_ordered_frame_t */ |
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
8326
diff
changeset
|
187 uint64_t offset; |
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
8326
diff
changeset
|
188 uint64_t length; |
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
8326
diff
changeset
|
189 |
8224
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
190 uint64_t stream_id; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
191 unsigned off:1; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
192 unsigned len:1; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
193 unsigned fin:1; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
194 } ngx_quic_stream_frame_t; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
195 |
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 typedef struct { |
8237
ff540f13d95d
MAX_DATA frame parser/handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8236
diff
changeset
|
198 uint64_t max_data; |
ff540f13d95d
MAX_DATA frame parser/handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8236
diff
changeset
|
199 } ngx_quic_max_data_frame_t; |
ff540f13d95d
MAX_DATA frame parser/handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8236
diff
changeset
|
200 |
ff540f13d95d
MAX_DATA frame parser/handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8236
diff
changeset
|
201 |
ff540f13d95d
MAX_DATA frame parser/handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8236
diff
changeset
|
202 typedef struct { |
8224
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
203 uint64_t error_code; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
204 uint64_t frame_type; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
205 ngx_str_t reason; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
206 } ngx_quic_close_frame_t; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
207 |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
208 |
8231
78540e2160d0
Added parsing of RESET_STREAM and STOP_SENDING frames
Vladimir Homutov <vl@nginx.com>
parents:
8224
diff
changeset
|
209 typedef struct { |
78540e2160d0
Added parsing of RESET_STREAM and STOP_SENDING frames
Vladimir Homutov <vl@nginx.com>
parents:
8224
diff
changeset
|
210 uint64_t id; |
78540e2160d0
Added parsing of RESET_STREAM and STOP_SENDING frames
Vladimir Homutov <vl@nginx.com>
parents:
8224
diff
changeset
|
211 uint64_t error_code; |
78540e2160d0
Added parsing of RESET_STREAM and STOP_SENDING frames
Vladimir Homutov <vl@nginx.com>
parents:
8224
diff
changeset
|
212 uint64_t final_size; |
78540e2160d0
Added parsing of RESET_STREAM and STOP_SENDING frames
Vladimir Homutov <vl@nginx.com>
parents:
8224
diff
changeset
|
213 } ngx_quic_reset_stream_frame_t; |
78540e2160d0
Added parsing of RESET_STREAM and STOP_SENDING frames
Vladimir Homutov <vl@nginx.com>
parents:
8224
diff
changeset
|
214 |
78540e2160d0
Added parsing of RESET_STREAM and STOP_SENDING frames
Vladimir Homutov <vl@nginx.com>
parents:
8224
diff
changeset
|
215 |
78540e2160d0
Added parsing of RESET_STREAM and STOP_SENDING frames
Vladimir Homutov <vl@nginx.com>
parents:
8224
diff
changeset
|
216 typedef struct { |
78540e2160d0
Added parsing of RESET_STREAM and STOP_SENDING frames
Vladimir Homutov <vl@nginx.com>
parents:
8224
diff
changeset
|
217 uint64_t id; |
78540e2160d0
Added parsing of RESET_STREAM and STOP_SENDING frames
Vladimir Homutov <vl@nginx.com>
parents:
8224
diff
changeset
|
218 uint64_t error_code; |
78540e2160d0
Added parsing of RESET_STREAM and STOP_SENDING frames
Vladimir Homutov <vl@nginx.com>
parents:
8224
diff
changeset
|
219 } ngx_quic_stop_sending_frame_t; |
78540e2160d0
Added parsing of RESET_STREAM and STOP_SENDING frames
Vladimir Homutov <vl@nginx.com>
parents:
8224
diff
changeset
|
220 |
78540e2160d0
Added parsing of RESET_STREAM and STOP_SENDING frames
Vladimir Homutov <vl@nginx.com>
parents:
8224
diff
changeset
|
221 |
8236
d3b26c3bea22
Added parsing of STREAMS BLOCKED frames.
Vladimir Homutov <vl@nginx.com>
parents:
8231
diff
changeset
|
222 typedef struct { |
d3b26c3bea22
Added parsing of STREAMS BLOCKED frames.
Vladimir Homutov <vl@nginx.com>
parents:
8231
diff
changeset
|
223 uint64_t limit; |
d3b26c3bea22
Added parsing of STREAMS BLOCKED frames.
Vladimir Homutov <vl@nginx.com>
parents:
8231
diff
changeset
|
224 ngx_uint_t bidi; /* unsigned: bidi:1 */ |
d3b26c3bea22
Added parsing of STREAMS BLOCKED frames.
Vladimir Homutov <vl@nginx.com>
parents:
8231
diff
changeset
|
225 } ngx_quic_streams_blocked_frame_t; |
d3b26c3bea22
Added parsing of STREAMS BLOCKED frames.
Vladimir Homutov <vl@nginx.com>
parents:
8231
diff
changeset
|
226 |
d3b26c3bea22
Added parsing of STREAMS BLOCKED frames.
Vladimir Homutov <vl@nginx.com>
parents:
8231
diff
changeset
|
227 |
8245
a14afe21e692
Double MAX_STREAMS on STREAMS_BLOCKED.
Roman Arutyunyan <arut@nginx.com>
parents:
8241
diff
changeset
|
228 typedef struct { |
a14afe21e692
Double MAX_STREAMS on STREAMS_BLOCKED.
Roman Arutyunyan <arut@nginx.com>
parents:
8241
diff
changeset
|
229 uint64_t limit; |
a14afe21e692
Double MAX_STREAMS on STREAMS_BLOCKED.
Roman Arutyunyan <arut@nginx.com>
parents:
8241
diff
changeset
|
230 ngx_uint_t bidi; /* unsigned: bidi:1 */ |
a14afe21e692
Double MAX_STREAMS on STREAMS_BLOCKED.
Roman Arutyunyan <arut@nginx.com>
parents:
8241
diff
changeset
|
231 } ngx_quic_max_streams_frame_t; |
a14afe21e692
Double MAX_STREAMS on STREAMS_BLOCKED.
Roman Arutyunyan <arut@nginx.com>
parents:
8241
diff
changeset
|
232 |
a14afe21e692
Double MAX_STREAMS on STREAMS_BLOCKED.
Roman Arutyunyan <arut@nginx.com>
parents:
8241
diff
changeset
|
233 |
8257
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8251
diff
changeset
|
234 typedef struct { |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8251
diff
changeset
|
235 uint64_t id; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8251
diff
changeset
|
236 uint64_t limit; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8251
diff
changeset
|
237 } ngx_quic_max_stream_data_frame_t; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8251
diff
changeset
|
238 |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8251
diff
changeset
|
239 |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8251
diff
changeset
|
240 typedef struct { |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8251
diff
changeset
|
241 uint64_t limit; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8251
diff
changeset
|
242 } ngx_quic_data_blocked_frame_t; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8251
diff
changeset
|
243 |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8251
diff
changeset
|
244 |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8251
diff
changeset
|
245 typedef struct { |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8251
diff
changeset
|
246 uint64_t id; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8251
diff
changeset
|
247 uint64_t limit; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8251
diff
changeset
|
248 } ngx_quic_stream_data_blocked_frame_t; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8251
diff
changeset
|
249 |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8251
diff
changeset
|
250 |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8251
diff
changeset
|
251 typedef struct { |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8251
diff
changeset
|
252 uint64_t sequence_number; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8251
diff
changeset
|
253 } ngx_quic_retire_cid_frame_t; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8251
diff
changeset
|
254 |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8251
diff
changeset
|
255 |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8251
diff
changeset
|
256 typedef struct { |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8251
diff
changeset
|
257 u_char data[8]; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8251
diff
changeset
|
258 } ngx_quic_path_challenge_frame_t; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8251
diff
changeset
|
259 |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8251
diff
changeset
|
260 |
8224
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
261 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
|
262 |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
263 struct ngx_quic_frame_s { |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
264 ngx_uint_t type; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
265 enum ssl_encryption_level_t level; |
8308
e10b4c61420f
Implemented retransmission and retransmit queue.
Vladimir Homutov <vl@nginx.com>
parents:
8307
diff
changeset
|
266 ngx_queue_t queue; |
e10b4c61420f
Implemented retransmission and retransmit queue.
Vladimir Homutov <vl@nginx.com>
parents:
8307
diff
changeset
|
267 uint64_t pnum; |
8508
4604e6043657
QUIC: packet based bytes_in_flight accounting.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8476
diff
changeset
|
268 size_t plen; |
9193
ce1ff81e9b92
QUIC: ngx_quic_frame_t time fields cleanup.
Roman Arutyunyan <arut@nginx.com>
parents:
9192
diff
changeset
|
269 ngx_msec_t send_time; |
8476
f9fbeb4ee0de
QUIC: added limit of queued data.
Vladimir Homutov <vl@nginx.com>
parents:
8470
diff
changeset
|
270 ssize_t len; |
8698
9ed95726b99b
QUIC: send PING frames on PTO expiration.
Roman Arutyunyan <arut@nginx.com>
parents:
8692
diff
changeset
|
271 unsigned need_ack:1; |
8822
ad046179eb91
QUIC: handle EAGAIN properly on UDP sockets.
Vladimir Homutov <vl@nginx.com>
parents:
8820
diff
changeset
|
272 unsigned pkt_need_ack:1; |
9192
efcdaa66df2e
QUIC: congestion control in ngx_quic_frame_sendto().
Roman Arutyunyan <arut@nginx.com>
parents:
9191
diff
changeset
|
273 unsigned ignore_congestion:1; |
8308
e10b4c61420f
Implemented retransmission and retransmit queue.
Vladimir Homutov <vl@nginx.com>
parents:
8307
diff
changeset
|
274 |
8657
2dfc5ef29973
QUIC: introduced QUIC buffers.
Roman Arutyunyan <arut@nginx.com>
parents:
8643
diff
changeset
|
275 ngx_chain_t *data; |
8224
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
276 union { |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
277 ngx_quic_ack_frame_t ack; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
278 ngx_quic_crypto_frame_t crypto; |
8333
167d32476737
Crypto buffer frames reordering.
Vladimir Homutov <vl@nginx.com>
parents:
8326
diff
changeset
|
279 ngx_quic_ordered_frame_t ord; |
8224
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
280 ngx_quic_new_conn_id_frame_t ncid; |
8384
52d0c4832570
Address validation using NEW_TOKEN frame.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8383
diff
changeset
|
281 ngx_quic_new_token_frame_t token; |
8224
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
282 ngx_quic_stream_frame_t stream; |
8237
ff540f13d95d
MAX_DATA frame parser/handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8236
diff
changeset
|
283 ngx_quic_max_data_frame_t max_data; |
8224
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
284 ngx_quic_close_frame_t close; |
8231
78540e2160d0
Added parsing of RESET_STREAM and STOP_SENDING frames
Vladimir Homutov <vl@nginx.com>
parents:
8224
diff
changeset
|
285 ngx_quic_reset_stream_frame_t reset_stream; |
78540e2160d0
Added parsing of RESET_STREAM and STOP_SENDING frames
Vladimir Homutov <vl@nginx.com>
parents:
8224
diff
changeset
|
286 ngx_quic_stop_sending_frame_t stop_sending; |
8236
d3b26c3bea22
Added parsing of STREAMS BLOCKED frames.
Vladimir Homutov <vl@nginx.com>
parents:
8231
diff
changeset
|
287 ngx_quic_streams_blocked_frame_t streams_blocked; |
8245
a14afe21e692
Double MAX_STREAMS on STREAMS_BLOCKED.
Roman Arutyunyan <arut@nginx.com>
parents:
8241
diff
changeset
|
288 ngx_quic_max_streams_frame_t max_streams; |
8257
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8251
diff
changeset
|
289 ngx_quic_max_stream_data_frame_t max_stream_data; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8251
diff
changeset
|
290 ngx_quic_data_blocked_frame_t data_blocked; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8251
diff
changeset
|
291 ngx_quic_stream_data_blocked_frame_t stream_data_blocked; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8251
diff
changeset
|
292 ngx_quic_retire_cid_frame_t retire_cid; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8251
diff
changeset
|
293 ngx_quic_path_challenge_frame_t path_challenge; |
085fd6e68367
Implemented parsing of remaining frame types.
Vladimir Homutov <vl@nginx.com>
parents:
8251
diff
changeset
|
294 ngx_quic_path_challenge_frame_t path_response; |
8224
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
295 } u; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
296 }; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
297 |
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 typedef struct { |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
300 ngx_log_t *log; |
8971
1e2f4e9c8195
QUIC: reworked migration handling.
Vladimir Homutov <vl@nginx.com>
parents:
8924
diff
changeset
|
301 ngx_quic_path_t *path; |
8224
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
302 |
8621
9c3be23ddbe7
QUIC: refactored key handling.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8613
diff
changeset
|
303 ngx_quic_keys_t *keys; |
9c3be23ddbe7
QUIC: refactored key handling.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8613
diff
changeset
|
304 |
8603
c5ea341f705a
QUIC: optimized acknowledgement generation.
Vladimir Homutov <vl@nginx.com>
parents:
8596
diff
changeset
|
305 ngx_msec_t received; |
8307
dc7ac778aafe
Introduced packet namespace in QUIC connection.
Vladimir Homutov <vl@nginx.com>
parents:
8298
diff
changeset
|
306 uint64_t number; |
8315
fdda518d10ba
Proper handling of packet number in header.
Vladimir Homutov <vl@nginx.com>
parents:
8308
diff
changeset
|
307 uint8_t num_len; |
fdda518d10ba
Proper handling of packet number in header.
Vladimir Homutov <vl@nginx.com>
parents:
8308
diff
changeset
|
308 uint32_t trunc; |
8240
1f002206a59b
Added boundaries checks into frame parser.
Vladimir Homutov <vl@nginx.com>
parents:
8237
diff
changeset
|
309 uint8_t flags; |
8224
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
310 uint32_t version; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
311 ngx_str_t token; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
312 enum ssl_encryption_level_t level; |
8385
fb7422074258
Added generation of CC frames with error on connection termination.
Vladimir Homutov <vl@nginx.com>
parents:
8384
diff
changeset
|
313 ngx_uint_t error; |
8224
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
314 |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
315 /* filled in by parser */ |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
316 ngx_buf_t *raw; /* udp datagram */ |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
317 |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
318 u_char *data; /* quic packet */ |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
319 size_t len; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
320 |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
321 /* cleartext fields */ |
8383
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8371
diff
changeset
|
322 ngx_str_t odcid; /* retry packet tag */ |
9026
3550b00d9dc8
QUIC: avoided pool usage in token calculation.
Vladimir Homutov <vl@nginx.com>
parents:
8971
diff
changeset
|
323 u_char odcid_buf[NGX_QUIC_MAX_CID_LEN]; |
8224
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; |
8288
ebd5c71b9f02
Got rid of memory allocation in decryption.
Vladimir Homutov <vl@nginx.com>
parents:
8286
diff
changeset
|
327 u_char *plaintext; |
ebd5c71b9f02
Got rid of memory allocation in decryption.
Vladimir Homutov <vl@nginx.com>
parents:
8286
diff
changeset
|
328 ngx_str_t payload; /* decrypted data */ |
8308
e10b4c61420f
Implemented retransmission and retransmit queue.
Vladimir Homutov <vl@nginx.com>
parents:
8307
diff
changeset
|
329 |
8319
29354c6fc5f2
TLS Key Update in QUIC.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8315
diff
changeset
|
330 unsigned need_ack:1; |
29354c6fc5f2
TLS Key Update in QUIC.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8315
diff
changeset
|
331 unsigned key_phase:1; |
29354c6fc5f2
TLS Key Update in QUIC.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8315
diff
changeset
|
332 unsigned key_update:1; |
8580
07971f870879
QUIC: added debug message with final packet processing status.
Vladimir Homutov <vl@nginx.com>
parents:
8562
diff
changeset
|
333 unsigned parsed:1; |
07971f870879
QUIC: added debug message with final packet processing status.
Vladimir Homutov <vl@nginx.com>
parents:
8562
diff
changeset
|
334 unsigned decrypted:1; |
8686 | 335 unsigned validated:1; |
336 unsigned retried:1; | |
8912
50d73bf20e73
QUIC: refactored multiple QUIC packets handling.
Vladimir Homutov <vl@nginx.com>
parents:
8900
diff
changeset
|
337 unsigned first:1; |
8971
1e2f4e9c8195
QUIC: reworked migration handling.
Vladimir Homutov <vl@nginx.com>
parents:
8924
diff
changeset
|
338 unsigned rebound:1; |
9191
618132842e7c
QUIC: ignore duplicate PATH_CHALLENGE frames.
Roman Arutyunyan <arut@nginx.com>
parents:
9143
diff
changeset
|
339 unsigned path_challenged:1; |
8224
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
340 } ngx_quic_header_t; |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
341 |
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
342 |
8924
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8912
diff
changeset
|
343 typedef struct { |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8912
diff
changeset
|
344 ngx_msec_t max_idle_timeout; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8912
diff
changeset
|
345 ngx_msec_t max_ack_delay; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8912
diff
changeset
|
346 |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8912
diff
changeset
|
347 size_t max_udp_payload_size; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8912
diff
changeset
|
348 size_t initial_max_data; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8912
diff
changeset
|
349 size_t initial_max_stream_data_bidi_local; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8912
diff
changeset
|
350 size_t initial_max_stream_data_bidi_remote; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8912
diff
changeset
|
351 size_t initial_max_stream_data_uni; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8912
diff
changeset
|
352 ngx_uint_t initial_max_streams_bidi; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8912
diff
changeset
|
353 ngx_uint_t initial_max_streams_uni; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8912
diff
changeset
|
354 ngx_uint_t ack_delay_exponent; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8912
diff
changeset
|
355 ngx_uint_t active_connection_id_limit; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8912
diff
changeset
|
356 ngx_flag_t disable_active_migration; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8912
diff
changeset
|
357 |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8912
diff
changeset
|
358 ngx_str_t original_dcid; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8912
diff
changeset
|
359 ngx_str_t initial_scid; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8912
diff
changeset
|
360 ngx_str_t retry_scid; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8912
diff
changeset
|
361 u_char sr_token[NGX_QUIC_SR_TOKEN_LEN]; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8912
diff
changeset
|
362 |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8912
diff
changeset
|
363 /* TODO */ |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8912
diff
changeset
|
364 void *preferred_address; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8912
diff
changeset
|
365 } ngx_quic_tp_t; |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8912
diff
changeset
|
366 |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8912
diff
changeset
|
367 |
8560
d0d3fc0697a0
QUIC: packet processing refactoring.
Vladimir Homutov <vl@nginx.com>
parents:
8538
diff
changeset
|
368 ngx_int_t ngx_quic_parse_packet(ngx_quic_header_t *pkt); |
d0d3fc0697a0
QUIC: packet processing refactoring.
Vladimir Homutov <vl@nginx.com>
parents:
8538
diff
changeset
|
369 |
8522
fc89d02bdca2
QUIC: added version negotiation support.
Vladimir Homutov <vl@nginx.com>
parents:
8508
diff
changeset
|
370 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:
8508
diff
changeset
|
371 |
8894
de7b9af30fc6
QUIC: refactored packet creation.
Vladimir Homutov <vl@nginx.com>
parents:
8822
diff
changeset
|
372 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:
8822
diff
changeset
|
373 |
8642
05b1ee464350
QUIC: hide header creation internals in ngx_event_quic_transport.c.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8641
diff
changeset
|
374 size_t ngx_quic_create_header(ngx_quic_header_t *pkt, u_char *out, |
8894
de7b9af30fc6
QUIC: refactored packet creation.
Vladimir Homutov <vl@nginx.com>
parents:
8822
diff
changeset
|
375 u_char **pnp); |
8285
f85749b60e58
Removed memory allocations from encryption code.
Vladimir Homutov <vl@nginx.com>
parents:
8260
diff
changeset
|
376 |
8383
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8371
diff
changeset
|
377 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:
8371
diff
changeset
|
378 u_char **start); |
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8371
diff
changeset
|
379 |
8240
1f002206a59b
Added boundaries checks into frame parser.
Vladimir Homutov <vl@nginx.com>
parents:
8237
diff
changeset
|
380 ssize_t ngx_quic_parse_frame(ngx_quic_header_t *pkt, u_char *start, u_char *end, |
8224
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
381 ngx_quic_frame_t *frame); |
8308
e10b4c61420f
Implemented retransmission and retransmit queue.
Vladimir Homutov <vl@nginx.com>
parents:
8307
diff
changeset
|
382 ssize_t ngx_quic_create_frame(u_char *p, ngx_quic_frame_t *f); |
8224
ae35ccba7aa6
Extracted transport part of the code into separate file.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
383 |
8604
b3d9e57d0f62
QUIC: single function for frame debug logging.
Vladimir Homutov <vl@nginx.com>
parents:
8603
diff
changeset
|
384 ssize_t ngx_quic_parse_ack_range(ngx_log_t *log, u_char *start, |
8326 | 385 u_char *end, uint64_t *gap, uint64_t *range); |
8613
867c189f875d
QUIC: unified range format for rx and tx ACK frames.
Roman Arutyunyan <arut@nginx.com>
parents:
8604
diff
changeset
|
386 size_t ngx_quic_create_ack_range(u_char *p, uint64_t gap, uint64_t range); |
8326 | 387 |
8924
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8912
diff
changeset
|
388 ngx_int_t ngx_quic_init_transport_params(ngx_quic_tp_t *tp, |
d6ef13c5fd8e
QUIC: simplified configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8912
diff
changeset
|
389 ngx_quic_conf_t *qcf); |
8260
f388c0ad3477
Added processing of client transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
8257
diff
changeset
|
390 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:
8257
diff
changeset
|
391 ngx_quic_tp_t *tp, ngx_log_t *log); |
8247
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
8245
diff
changeset
|
392 ssize_t ngx_quic_create_transport_params(u_char *p, u_char *end, |
8422
90b02ff6b003
Compatibility with BoringSSL master branch.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8417
diff
changeset
|
393 ngx_quic_tp_t *tp, size_t *clen); |
8247
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
8245
diff
changeset
|
394 |
8676
7df607cb2d11
QUIC: ngx_quic_bpf module.
Vladimir Homutov <vl@nginx.com>
parents:
8673
diff
changeset
|
395 void ngx_quic_dcid_encode_key(u_char *dcid, uint64_t key); |
7df607cb2d11
QUIC: ngx_quic_bpf module.
Vladimir Homutov <vl@nginx.com>
parents:
8673
diff
changeset
|
396 |
8677
c57b6fc90f90
QUIC: fixed header protection macro name.
Vladimir Homutov <vl@nginx.com>
parents:
8676
diff
changeset
|
397 #endif /* _NGX_EVENT_QUIC_TRANSPORT_H_INCLUDED_ */ |