Wireshark
4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
epan
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
12
typedef
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
20
typedef
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;
31
}
nghttp2_huff_decode
;
32
33
typedef
nghttp2_huff_decode
huff_decode_table_type[16];
34
35
typedef
struct
{
36
/* fstate is the current huffman decoding state. */
37
uint16_t fstate;
38
}
nghttp2_hd_huff_decode_context
;
39
40
typedef
struct
{
41
/* The number of bits in this code */
42
uint32_t nbits;
43
/* Huffman code aligned to LSB */
44
uint32_t code;
45
}
nghttp2_huff_sym
;
46
47
extern
const
nghttp2_huff_sym
huff_sym_table[];
48
extern
const
nghttp2_huff_decode
huff_decode_table[][16];
nghttp2_hd_huff_decode_context
Definition
nghttp2_hd_huffman.h:35
nghttp2_huff_decode
Definition
nghttp2_hd_huffman.h:20
nghttp2_huff_sym
Definition
nghttp2_hd_huffman.h:40
Generated by
1.9.8