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