Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
nghttp2_hd_huffman.h
1/* @file
2 * nghttp2 - HTTP/2 C Library
3 *
4 * Copyright (c) 2013 Tatsuhiro Tsujikawa
5 *
6 * SPDX-License-Identifier: MIT
7 */
8#pragma once
9#include <stdlib.h>
10#include <stdint.h>
11
12typedef enum {
13 /* FSA accepts this state as the end of huffman encoding
14 sequence. */
15 NGHTTP2_HUFF_ACCEPTED = 1 << 14,
16 /* This state emits symbol */
17 NGHTTP2_HUFF_SYM = 1 << 15,
18} nghttp2_huff_decode_flag;
19
20typedef struct {
21 /* fstate is the current huffman decoding state, which is actually
22 the node ID of internal huffman tree with
23 nghttp2_huff_decode_flag OR-ed. We have 257 leaf nodes, but they
24 are identical to root node other than emitting a symbol, so we
25 have 256 internal nodes [1..255], inclusive. The node ID 256 is
26 a special node and it is a terminal state that means decoding
27 failed. */
28 uint16_t fstate;
29 /* symbol if NGHTTP2_HUFF_SYM flag set */
30 uint8_t sym;
32
33typedef nghttp2_huff_decode huff_decode_table_type[16];
34
35typedef struct {
36 /* fstate is the current huffman decoding state. */
37 uint16_t fstate;
39
40typedef struct {
41 /* The number of bits in this code */
42 uint32_t nbits;
43 /* Huffman code aligned to LSB */
44 uint32_t code;
46
47extern const nghttp2_huff_sym huff_sym_table[];
48extern const nghttp2_huff_decode huff_decode_table[][16];
Definition nghttp2_hd_huffman.h:35
Definition nghttp2_hd_huffman.h:20
Definition nghttp2_hd_huffman.h:40