1a74702c6SGeorge Wang/* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */ 23b55e6aeSDmitri Tikhonov#ifndef LSQUIC_HEADERS_H 33b55e6aeSDmitri Tikhonov#define LSQUIC_HEADERS_H 1 43b55e6aeSDmitri Tikhonov 53b55e6aeSDmitri Tikhonov/* When ea_hsi_if is not specified, the headers are converted to a C string 63b55e6aeSDmitri Tikhonov * that contains HTTP/1.x-like header structure. 73b55e6aeSDmitri Tikhonov */ 83b55e6aeSDmitri Tikhonovstruct http1x_headers 93b55e6aeSDmitri Tikhonov{ 103b55e6aeSDmitri Tikhonov unsigned h1h_size; /* Number of characters in h1h_buf, not 113b55e6aeSDmitri Tikhonov * counting the NUL byte. 123b55e6aeSDmitri Tikhonov */ 133b55e6aeSDmitri Tikhonov unsigned h1h_off; /* Reading offset */ 143b55e6aeSDmitri Tikhonov char *h1h_buf; 153b55e6aeSDmitri Tikhonov}; 163b55e6aeSDmitri Tikhonov 173b55e6aeSDmitri Tikhonov 183b55e6aeSDmitri Tikhonov/* This struct is used to return decoded HEADERS and PUSH_PROMISE frames. 193b55e6aeSDmitri Tikhonov * Some of the fields are only used for HEADERS frames. They are marked 203b55e6aeSDmitri Tikhonov * with "H" comment below. 213b55e6aeSDmitri Tikhonov */ 223b55e6aeSDmitri Tikhonovstruct uncompressed_headers 233b55e6aeSDmitri Tikhonov{ 245392f7a3SLiteSpeed Tech lsquic_stream_id_t uh_stream_id; 255392f7a3SLiteSpeed Tech lsquic_stream_id_t uh_oth_stream_id; /* For HEADERS frame, the ID of the 263b55e6aeSDmitri Tikhonov * stream that this stream depends 273b55e6aeSDmitri Tikhonov * on. (Zero means unset.) For 283b55e6aeSDmitri Tikhonov * PUSH_PROMISE, the promised stream 293b55e6aeSDmitri Tikhonov * ID. 303b55e6aeSDmitri Tikhonov */ 313b55e6aeSDmitri Tikhonov unsigned short /* H */ uh_weight; /* 1 - 256; 0 means not set */ 323b55e6aeSDmitri Tikhonov signed char /* H */ uh_exclusive; /* 0 or 1 when set; -1 means not set */ 333b55e6aeSDmitri Tikhonov enum { 343b55e6aeSDmitri Tikhonov /* H */ UH_FIN = (1 << 0), 353b55e6aeSDmitri Tikhonov UH_PP = (1 << 1), /* Push promise */ 363b55e6aeSDmitri Tikhonov UH_H1H = (1 << 2), /* uh_hset points to http1x_headers */ 373b55e6aeSDmitri Tikhonov } uh_flags:8; 383b55e6aeSDmitri Tikhonov void *uh_hset; 39293df8d6SGeorge Wang struct uncompressed_headers 40293df8d6SGeorge Wang *uh_next; 413b55e6aeSDmitri Tikhonov}; 423b55e6aeSDmitri Tikhonov 433b55e6aeSDmitri Tikhonov#endif 44