comparison src/http/v3/ngx_http_v3.h @ 8215:38c0898b6df7 quic

HTTP/3.
author Roman Arutyunyan <arut@nginx.com>
date Fri, 13 Mar 2020 19:36:33 +0300
parents
children 268f4389130d
comparison
equal deleted inserted replaced
8214:6fd2cce50fe2 8215:38c0898b6df7
1
2 /*
3 * Copyright (C) Roman Arutyunyan
4 * Copyright (C) Nginx, Inc.
5 */
6
7
8 #ifndef _NGX_HTTP_V3_H_INCLUDED_
9 #define _NGX_HTTP_V3_H_INCLUDED_
10
11
12 #include <ngx_config.h>
13 #include <ngx_core.h>
14 #include <ngx_http.h>
15
16
17 #define NGX_HTTP_V3_STREAM 0x48335354 /* "H3ST" */
18
19
20 #define NGX_HTTP_V3_VARLEN_INT_LEN 4
21 #define NGX_HTTP_V3_PREFIX_INT_LEN 11
22
23
24 typedef struct {
25 ngx_http_connection_t hc;
26
27 ngx_array_t *dynamic;
28
29 ngx_connection_t *client_encoder;
30 ngx_connection_t *client_decoder;
31 ngx_connection_t *server_encoder;
32 ngx_connection_t *server_decoder;
33 } ngx_http_v3_connection_t;
34
35
36 typedef struct {
37 ngx_str_t name;
38 ngx_str_t value;
39 } ngx_http_v3_header_t;
40
41
42 ngx_int_t ngx_http_v3_parse_header(ngx_http_request_t *r, ngx_buf_t *b,
43 ngx_uint_t pseudo);
44 ngx_chain_t *ngx_http_v3_create_header(ngx_http_request_t *r);
45
46
47 uintptr_t ngx_http_v3_encode_varlen_int(u_char *p, uint64_t value);
48 uintptr_t ngx_http_v3_encode_prefix_int(u_char *p, uint64_t value,
49 ngx_uint_t prefix);
50 uint64_t ngx_http_v3_decode_varlen_int(u_char *p);
51 int64_t ngx_http_v3_decode_prefix_int(u_char **src, size_t len,
52 ngx_uint_t prefix);
53 ngx_int_t ngx_http_v3_decode_huffman(ngx_connection_t *c, ngx_str_t *s);
54
55 void ngx_http_v3_handle_client_uni_stream(ngx_connection_t *c);
56
57 ngx_int_t ngx_http_v3_ref_insert(ngx_connection_t *c, ngx_uint_t dynamic,
58 ngx_uint_t index, ngx_str_t *value);
59 ngx_int_t ngx_http_v3_insert(ngx_connection_t *c, ngx_str_t *name,
60 ngx_str_t *value);
61 ngx_int_t ngx_http_v3_set_capacity(ngx_connection_t *c, ngx_uint_t capacity);
62 ngx_int_t ngx_http_v3_duplicate(ngx_connection_t *c, ngx_uint_t index);
63 ngx_int_t ngx_http_v3_ack_header(ngx_connection_t *c, ngx_uint_t stream_id);
64 ngx_int_t ngx_http_v3_cancel_stream(ngx_connection_t *c, ngx_uint_t stream_id);
65 ngx_int_t ngx_http_v3_inc_insert_count(ngx_connection_t *c, ngx_uint_t inc);
66 ngx_http_v3_header_t *ngx_http_v3_lookup_table(ngx_connection_t *c,
67 ngx_uint_t dynamic, ngx_uint_t index);
68 ngx_int_t ngx_http_v3_check_insert_count(ngx_connection_t *c,
69 ngx_uint_t insert_count);
70
71 ngx_int_t ngx_http_v3_client_ref_insert(ngx_connection_t *c, ngx_uint_t dynamic,
72 ngx_uint_t index, ngx_str_t *value);
73 ngx_int_t ngx_http_v3_client_insert(ngx_connection_t *c, ngx_str_t *name,
74 ngx_str_t *value);
75 ngx_int_t ngx_http_v3_client_set_capacity(ngx_connection_t *c,
76 ngx_uint_t capacity);
77 ngx_int_t ngx_http_v3_client_duplicate(ngx_connection_t *c, ngx_uint_t index);
78 ngx_int_t ngx_http_v3_client_ack_header(ngx_connection_t *c,
79 ngx_uint_t stream_id);
80 ngx_int_t ngx_http_v3_client_cancel_stream(ngx_connection_t *c,
81 ngx_uint_t stream_id);
82 ngx_int_t ngx_http_v3_client_inc_insert_count(ngx_connection_t *c,
83 ngx_uint_t inc);
84
85
86 extern ngx_module_t ngx_http_v3_module;
87
88
89 #endif /* _NGX_HTTP_V3_H_INCLUDED_ */