Mercurial > hg > nginx-quic
annotate src/http/v3/ngx_http_v3_parse.h @ 8103:0e12c4aca3ab quic
QUIC: fixed clang-ast asserts.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Thu, 01 Oct 2020 12:09:47 +0100 |
parents | d70a38acaea0 |
children | ab6aaa8e86b0 |
rev | line source |
---|---|
7692 | 1 |
2 /* | |
3 * Copyright (C) Roman Arutyunyan | |
4 * Copyright (C) Nginx, Inc. | |
5 */ | |
6 | |
7 | |
8 #ifndef _NGX_HTTP_V3_PARSE_H_INCLUDED_ | |
9 #define _NGX_HTTP_V3_PARSE_H_INCLUDED_ | |
10 | |
11 | |
12 #include <ngx_config.h> | |
13 #include <ngx_core.h> | |
14 #include <ngx_http.h> | |
15 | |
16 | |
17 typedef struct { | |
18 ngx_uint_t state; | |
19 uint64_t value; | |
20 } ngx_http_v3_parse_varlen_int_t; | |
21 | |
22 | |
23 typedef struct { | |
24 ngx_uint_t state; | |
7950
b0e81f49d7c0
HTTP/3: fixed prefixed integer encoding and decoding.
Roman Arutyunyan <arut@nginx.com>
parents:
7761
diff
changeset
|
25 ngx_uint_t shift; |
7692 | 26 uint64_t value; |
27 } ngx_http_v3_parse_prefix_int_t; | |
28 | |
29 | |
30 typedef struct { | |
31 ngx_uint_t state; | |
32 uint64_t id; | |
33 ngx_http_v3_parse_varlen_int_t vlint; | |
34 } ngx_http_v3_parse_settings_t; | |
35 | |
36 | |
37 typedef struct { | |
38 ngx_uint_t state; | |
39 ngx_uint_t insert_count; | |
40 ngx_uint_t delta_base; | |
41 ngx_uint_t sign; | |
42 ngx_uint_t base; | |
43 ngx_http_v3_parse_prefix_int_t pint; | |
44 } ngx_http_v3_parse_header_block_prefix_t; | |
45 | |
46 | |
47 typedef struct { | |
48 ngx_uint_t state; | |
49 ngx_uint_t length; | |
50 ngx_uint_t huffman; | |
51 ngx_str_t value; | |
52 u_char *last; | |
53 u_char huffstate; | |
54 } ngx_http_v3_parse_literal_t; | |
55 | |
56 | |
57 typedef struct { | |
58 ngx_uint_t state; | |
59 ngx_uint_t index; | |
60 ngx_uint_t base; | |
61 ngx_uint_t dynamic; | |
62 | |
63 ngx_str_t name; | |
64 ngx_str_t value; | |
65 | |
66 ngx_http_v3_parse_prefix_int_t pint; | |
67 ngx_http_v3_parse_literal_t literal; | |
68 } ngx_http_v3_parse_header_t; | |
69 | |
70 | |
71 typedef struct { | |
72 ngx_uint_t state; | |
73 ngx_http_v3_parse_header_t header; | |
74 } ngx_http_v3_parse_header_rep_t; | |
75 | |
76 | |
77 typedef struct { | |
78 ngx_uint_t state; | |
8087
d70a38acaea0
HTTP/3: skip unknown frames on request stream.
Roman Arutyunyan <arut@nginx.com>
parents:
7955
diff
changeset
|
79 ngx_uint_t type; |
7692 | 80 ngx_uint_t length; |
81 ngx_http_v3_parse_varlen_int_t vlint; | |
82 ngx_http_v3_parse_header_block_prefix_t prefix; | |
83 ngx_http_v3_parse_header_rep_t header_rep; | |
84 } ngx_http_v3_parse_headers_t; | |
85 | |
86 | |
87 typedef struct { | |
88 ngx_uint_t state; | |
89 ngx_http_v3_parse_header_t header; | |
90 ngx_http_v3_parse_prefix_int_t pint; | |
91 } ngx_http_v3_parse_encoder_t; | |
92 | |
93 | |
94 typedef struct { | |
95 ngx_uint_t state; | |
96 ngx_http_v3_parse_prefix_int_t pint; | |
97 } ngx_http_v3_parse_decoder_t; | |
98 | |
99 | |
100 typedef struct { | |
101 ngx_uint_t state; | |
102 ngx_uint_t type; | |
103 ngx_uint_t length; | |
104 ngx_http_v3_parse_varlen_int_t vlint; | |
105 ngx_http_v3_parse_settings_t settings; | |
106 } ngx_http_v3_parse_control_t; | |
107 | |
108 | |
7761
5649079a41f4
Parsing HTTP/3 request body.
Roman Arutyunyan <arut@nginx.com>
parents:
7692
diff
changeset
|
109 typedef struct { |
5649079a41f4
Parsing HTTP/3 request body.
Roman Arutyunyan <arut@nginx.com>
parents:
7692
diff
changeset
|
110 ngx_uint_t state; |
8087
d70a38acaea0
HTTP/3: skip unknown frames on request stream.
Roman Arutyunyan <arut@nginx.com>
parents:
7955
diff
changeset
|
111 ngx_uint_t type; |
7761
5649079a41f4
Parsing HTTP/3 request body.
Roman Arutyunyan <arut@nginx.com>
parents:
7692
diff
changeset
|
112 ngx_uint_t length; |
5649079a41f4
Parsing HTTP/3 request body.
Roman Arutyunyan <arut@nginx.com>
parents:
7692
diff
changeset
|
113 ngx_http_v3_parse_varlen_int_t vlint; |
5649079a41f4
Parsing HTTP/3 request body.
Roman Arutyunyan <arut@nginx.com>
parents:
7692
diff
changeset
|
114 } ngx_http_v3_parse_data_t; |
5649079a41f4
Parsing HTTP/3 request body.
Roman Arutyunyan <arut@nginx.com>
parents:
7692
diff
changeset
|
115 |
5649079a41f4
Parsing HTTP/3 request body.
Roman Arutyunyan <arut@nginx.com>
parents:
7692
diff
changeset
|
116 |
7955
72f9ff4e0a88
HTTP/3: close QUIC connection with HTTP/QPACK errors when needed.
Roman Arutyunyan <arut@nginx.com>
parents:
7950
diff
changeset
|
117 /* |
72f9ff4e0a88
HTTP/3: close QUIC connection with HTTP/QPACK errors when needed.
Roman Arutyunyan <arut@nginx.com>
parents:
7950
diff
changeset
|
118 * Parse functions return codes: |
72f9ff4e0a88
HTTP/3: close QUIC connection with HTTP/QPACK errors when needed.
Roman Arutyunyan <arut@nginx.com>
parents:
7950
diff
changeset
|
119 * NGX_DONE - parsing done |
72f9ff4e0a88
HTTP/3: close QUIC connection with HTTP/QPACK errors when needed.
Roman Arutyunyan <arut@nginx.com>
parents:
7950
diff
changeset
|
120 * NGX_OK - sub-element done |
72f9ff4e0a88
HTTP/3: close QUIC connection with HTTP/QPACK errors when needed.
Roman Arutyunyan <arut@nginx.com>
parents:
7950
diff
changeset
|
121 * NGX_AGAIN - more data expected |
72f9ff4e0a88
HTTP/3: close QUIC connection with HTTP/QPACK errors when needed.
Roman Arutyunyan <arut@nginx.com>
parents:
7950
diff
changeset
|
122 * NGX_BUSY - waiting for external event |
72f9ff4e0a88
HTTP/3: close QUIC connection with HTTP/QPACK errors when needed.
Roman Arutyunyan <arut@nginx.com>
parents:
7950
diff
changeset
|
123 * NGX_ERROR - internal error |
72f9ff4e0a88
HTTP/3: close QUIC connection with HTTP/QPACK errors when needed.
Roman Arutyunyan <arut@nginx.com>
parents:
7950
diff
changeset
|
124 * NGX_HTTP_V3_ERROR_XXX - HTTP/3 or QPACK error |
72f9ff4e0a88
HTTP/3: close QUIC connection with HTTP/QPACK errors when needed.
Roman Arutyunyan <arut@nginx.com>
parents:
7950
diff
changeset
|
125 */ |
72f9ff4e0a88
HTTP/3: close QUIC connection with HTTP/QPACK errors when needed.
Roman Arutyunyan <arut@nginx.com>
parents:
7950
diff
changeset
|
126 |
7692 | 127 ngx_int_t ngx_http_v3_parse_varlen_int(ngx_connection_t *c, |
128 ngx_http_v3_parse_varlen_int_t *st, u_char ch); | |
129 ngx_int_t ngx_http_v3_parse_prefix_int(ngx_connection_t *c, | |
130 ngx_http_v3_parse_prefix_int_t *st, ngx_uint_t prefix, u_char ch); | |
131 | |
132 ngx_int_t ngx_http_v3_parse_headers(ngx_connection_t *c, | |
133 ngx_http_v3_parse_headers_t *st, u_char ch); | |
134 ngx_int_t ngx_http_v3_parse_header_block_prefix(ngx_connection_t *c, | |
135 ngx_http_v3_parse_header_block_prefix_t *st, u_char ch); | |
136 ngx_int_t ngx_http_v3_parse_header_rep(ngx_connection_t *c, | |
137 ngx_http_v3_parse_header_rep_t *st, ngx_uint_t base, u_char ch); | |
138 ngx_int_t ngx_http_v3_parse_literal(ngx_connection_t *c, | |
139 ngx_http_v3_parse_literal_t *st, u_char ch); | |
140 ngx_int_t ngx_http_v3_parse_header_ri(ngx_connection_t *c, | |
141 ngx_http_v3_parse_header_t *st, u_char ch); | |
142 ngx_int_t ngx_http_v3_parse_header_lri(ngx_connection_t *c, | |
143 ngx_http_v3_parse_header_t *st, u_char ch); | |
144 ngx_int_t ngx_http_v3_parse_header_l(ngx_connection_t *c, | |
145 ngx_http_v3_parse_header_t *st, u_char ch); | |
146 ngx_int_t ngx_http_v3_parse_header_pbi(ngx_connection_t *c, | |
147 ngx_http_v3_parse_header_t *st, u_char ch); | |
148 ngx_int_t ngx_http_v3_parse_header_lpbi(ngx_connection_t *c, | |
149 ngx_http_v3_parse_header_t *st, u_char ch); | |
150 | |
151 ngx_int_t ngx_http_v3_parse_control(ngx_connection_t *c, void *data, u_char ch); | |
152 ngx_int_t ngx_http_v3_parse_settings(ngx_connection_t *c, | |
153 ngx_http_v3_parse_settings_t *st, u_char ch); | |
154 | |
155 ngx_int_t ngx_http_v3_parse_encoder(ngx_connection_t *c, void *data, u_char ch); | |
156 ngx_int_t ngx_http_v3_parse_header_inr(ngx_connection_t *c, | |
157 ngx_http_v3_parse_header_t *st, u_char ch); | |
158 ngx_int_t ngx_http_v3_parse_header_iwnr(ngx_connection_t *c, | |
159 ngx_http_v3_parse_header_t *st, u_char ch); | |
160 | |
161 ngx_int_t ngx_http_v3_parse_decoder(ngx_connection_t *c, void *data, u_char ch); | |
162 | |
7761
5649079a41f4
Parsing HTTP/3 request body.
Roman Arutyunyan <arut@nginx.com>
parents:
7692
diff
changeset
|
163 ngx_int_t ngx_http_v3_parse_data(ngx_connection_t *c, |
5649079a41f4
Parsing HTTP/3 request body.
Roman Arutyunyan <arut@nginx.com>
parents:
7692
diff
changeset
|
164 ngx_http_v3_parse_data_t *st, u_char ch); |
5649079a41f4
Parsing HTTP/3 request body.
Roman Arutyunyan <arut@nginx.com>
parents:
7692
diff
changeset
|
165 |
7692 | 166 |
167 #endif /* _NGX_HTTP_V3_PARSE_H_INCLUDED_ */ |