Mercurial > hg > nginx
comparison src/event/ngx_event_quic_transport.h @ 8562:b31c02454539 quic
QUIC: added stateless reset support.
The new "quic_stateless_reset_token_key" directive is added. It sets the
endpoint key used to generate stateless reset tokens and enables feature.
If the endpoint receives short-header packet that can't be matched to
existing connection, a stateless reset packet is generated with
a proper token.
If a valid stateless reset token is found in the incoming packet,
the connection is closed.
Example configuration:
http {
quic_stateless_reset_token_key "foo";
...
}
author | Vladimir Homutov <vl@nginx.com> |
---|---|
date | Wed, 30 Sep 2020 20:54:46 +0300 |
parents | d0d3fc0697a0 |
children | 07971f870879 |
comparison
equal
deleted
inserted
replaced
8561:b4ef79ef1c23 | 8562:b31c02454539 |
---|---|
99 | 99 |
100 | 100 |
101 /* Transport parameters */ | 101 /* Transport parameters */ |
102 #define NGX_QUIC_TP_ORIGINAL_DCID 0x00 | 102 #define NGX_QUIC_TP_ORIGINAL_DCID 0x00 |
103 #define NGX_QUIC_TP_MAX_IDLE_TIMEOUT 0x01 | 103 #define NGX_QUIC_TP_MAX_IDLE_TIMEOUT 0x01 |
104 #define NGX_QUIC_TP_STATELESS_RESET_TOKEN 0x02 | 104 #define NGX_QUIC_TP_SR_TOKEN 0x02 |
105 #define NGX_QUIC_TP_MAX_UDP_PAYLOAD_SIZE 0x03 | 105 #define NGX_QUIC_TP_MAX_UDP_PAYLOAD_SIZE 0x03 |
106 #define NGX_QUIC_TP_INITIAL_MAX_DATA 0x04 | 106 #define NGX_QUIC_TP_INITIAL_MAX_DATA 0x04 |
107 #define NGX_QUIC_TP_INITIAL_MAX_STREAM_DATA_BIDI_LOCAL 0x05 | 107 #define NGX_QUIC_TP_INITIAL_MAX_STREAM_DATA_BIDI_LOCAL 0x05 |
108 #define NGX_QUIC_TP_INITIAL_MAX_STREAM_DATA_BIDI_REMOTE 0x06 | 108 #define NGX_QUIC_TP_INITIAL_MAX_STREAM_DATA_BIDI_REMOTE 0x06 |
109 #define NGX_QUIC_TP_INITIAL_MAX_STREAM_DATA_UNI 0x07 | 109 #define NGX_QUIC_TP_INITIAL_MAX_STREAM_DATA_UNI 0x07 |
118 #define NGX_QUIC_TP_RETRY_SCID 0x10 | 118 #define NGX_QUIC_TP_RETRY_SCID 0x10 |
119 | 119 |
120 #define NGX_QUIC_CID_LEN_MIN 8 | 120 #define NGX_QUIC_CID_LEN_MIN 8 |
121 #define NGX_QUIC_CID_LEN_MAX 20 | 121 #define NGX_QUIC_CID_LEN_MAX 20 |
122 | 122 |
123 #define NGX_QUIC_SRT_LEN 16 | |
124 | |
125 | |
126 typedef struct { | 123 typedef struct { |
127 uint64_t largest; | 124 uint64_t largest; |
128 uint64_t delay; | 125 uint64_t delay; |
129 uint64_t range_count; | 126 uint64_t range_count; |
130 uint64_t first_range; | 127 uint64_t first_range; |
139 typedef struct { | 136 typedef struct { |
140 uint64_t seqnum; | 137 uint64_t seqnum; |
141 uint64_t retire; | 138 uint64_t retire; |
142 uint8_t len; | 139 uint8_t len; |
143 u_char cid[NGX_QUIC_CID_LEN_MAX]; | 140 u_char cid[NGX_QUIC_CID_LEN_MAX]; |
144 u_char srt[NGX_QUIC_SRT_LEN]; | 141 u_char srt[NGX_QUIC_SR_TOKEN_LEN]; |
145 } ngx_quic_new_conn_id_frame_t; | 142 } ngx_quic_new_conn_id_frame_t; |
146 | 143 |
147 | 144 |
148 typedef struct { | 145 typedef struct { |
149 uint64_t length; | 146 uint64_t length; |