comparison src/event/quic/ngx_event_quic_connection.h @ 8748:e0cb1e58ca13 quic

QUIC: separate files for connection id related processing.
author Vladimir Homutov <vl@nginx.com>
date Tue, 13 Apr 2021 14:37:41 +0300
parents c8bda5e1e662
children 660c4a2f95f3
comparison
equal deleted inserted replaced
8747:c8bda5e1e662 8748:e0cb1e58ca13
15 #include <ngx_event_quic_protection.h> 15 #include <ngx_event_quic_protection.h>
16 16
17 typedef struct ngx_quic_connection_s ngx_quic_connection_t; 17 typedef struct ngx_quic_connection_s ngx_quic_connection_t;
18 18
19 #include <ngx_event_quic_migration.h> 19 #include <ngx_event_quic_migration.h>
20 #include <ngx_event_quic_connid.h>
20 21
21 22
22 #define NGX_QUIC_MAX_SHORT_HEADER 25 /* 1 flags + 20 dcid + 4 pn */ 23 #define NGX_QUIC_MAX_SHORT_HEADER 25 /* 1 flags + 20 dcid + 4 pn */
23 #define NGX_QUIC_MAX_LONG_HEADER 56 24 #define NGX_QUIC_MAX_LONG_HEADER 56
24 /* 1 flags + 4 version + 2 x (1 + 20) s/dcid + 4 pn + 4 len + token len */ 25 /* 1 flags + 4 version + 2 x (1 + 20) s/dcid + 4 pn + 4 len + token len */
42 #define NGX_QUIC_TIME_THR 1.125 43 #define NGX_QUIC_TIME_THR 1.125
43 #define NGX_QUIC_TIME_GRANULARITY 1 /* ms */ 44 #define NGX_QUIC_TIME_GRANULARITY 1 /* ms */
44 45
45 #define NGX_QUIC_CC_MIN_INTERVAL 1000 /* 1s */ 46 #define NGX_QUIC_CC_MIN_INTERVAL 1000 /* 1s */
46 47
47 #define NGX_QUIC_MAX_SERVER_IDS 8
48
49 #define NGX_QUIC_BUFFER_SIZE 4096 48 #define NGX_QUIC_BUFFER_SIZE 4096
49
50 #define NGX_QUIC_UNSET_PN (uint64_t) -1
50 51
51 #define NGX_QUIC_SEND_CTX_LAST (NGX_QUIC_ENCRYPTION_LAST - 1) 52 #define NGX_QUIC_SEND_CTX_LAST (NGX_QUIC_ENCRYPTION_LAST - 1)
52 53
53 /* 0-RTT and 1-RTT data exist in the same packet number space, 54 /* 0-RTT and 1-RTT data exist in the same packet number space,
54 * so we have 3 packet number spaces: 55 * so we have 3 packet number spaces:
221 ngx_quic_frame_t *ngx_quic_alloc_frame(ngx_connection_t *c); 222 ngx_quic_frame_t *ngx_quic_alloc_frame(ngx_connection_t *c);
222 void ngx_quic_queue_frame(ngx_quic_connection_t *qc, ngx_quic_frame_t *frame); 223 void ngx_quic_queue_frame(ngx_quic_connection_t *qc, ngx_quic_frame_t *frame);
223 void ngx_quic_close_connection(ngx_connection_t *c, ngx_int_t rc); 224 void ngx_quic_close_connection(ngx_connection_t *c, ngx_int_t rc);
224 ngx_msec_t ngx_quic_pto(ngx_connection_t *c, ngx_quic_send_ctx_t *ctx); 225 ngx_msec_t ngx_quic_pto(ngx_connection_t *c, ngx_quic_send_ctx_t *ctx);
225 226
227 ngx_int_t ngx_quic_new_sr_token(ngx_connection_t *c, ngx_str_t *cid,
228 u_char *secret, u_char *token);
229
226 /********************************* DEBUG *************************************/ 230 /********************************* DEBUG *************************************/
227 231
228 /* #define NGX_QUIC_DEBUG_PACKETS */ /* dump packet contents */ 232 /* #define NGX_QUIC_DEBUG_PACKETS */ /* dump packet contents */
229 /* #define NGX_QUIC_DEBUG_FRAMES */ /* dump frames contents */ 233 /* #define NGX_QUIC_DEBUG_FRAMES */ /* dump frames contents */
230 /* #define NGX_QUIC_DEBUG_ALLOC */ /* log frames and bufs alloc */ 234 /* #define NGX_QUIC_DEBUG_ALLOC */ /* log frames and bufs alloc */