lsquic_headers.h revision a74702c6
1/* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc.  See LICENSE. */
2#ifndef LSQUIC_HEADERS_H
3#define LSQUIC_HEADERS_H 1
4
5/* When ea_hsi_if is not specified, the headers are converted to a C string
6 * that contains HTTP/1.x-like header structure.
7 */
8struct http1x_headers
9{
10    unsigned        h1h_size; /* Number of characters in h1h_buf, not
11                               * counting the NUL byte.
12                               */
13    unsigned        h1h_off;  /* Reading offset */
14    char           *h1h_buf;
15};
16
17
18/* This struct is used to return decoded HEADERS and PUSH_PROMISE frames.
19 * Some of the fields are only used for HEADERS frames.  They are marked
20 * with "H" comment below.
21 */
22struct uncompressed_headers
23{
24    lsquic_stream_id_t     uh_stream_id;
25    lsquic_stream_id_t     uh_oth_stream_id; /* For HEADERS frame, the ID of the
26                                              * stream that this stream depends
27                                              * on.  (Zero means unset.) For
28                                              * PUSH_PROMISE, the promised stream
29                                              * ID.
30                                              */
31    unsigned short /* H */ uh_weight;        /* 1 - 256; 0 means not set */
32    signed char    /* H */ uh_exclusive;     /* 0 or 1 when set; -1 means not set */
33    enum {
34                   /* H */ UH_FIN  = (1 << 0),
35                           UH_PP   = (1 << 1), /* Push promise */
36                           UH_H1H  = (1 << 2),  /* uh_hset points to http1x_headers */
37    }                      uh_flags:8;
38    void                  *uh_hset;
39    struct uncompressed_headers
40                          *uh_next;
41};
42
43#endif
44