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
#ifndef NGHTTP2_HD_HUFFMAN_H
9
#define NGHTTP2_HD_HUFFMAN_H
10
11
#include <stdlib.h>
12
#include <stdint.h>
13
14
typedef
enum
{
15
/* FSA accepts this state as the end of huffman encoding
16
sequence. */
17
NGHTTP2_HUFF_ACCEPTED = 1 << 14,
18
/* This state emits symbol */
19
NGHTTP2_HUFF_SYM = 1 << 15,
20
} nghttp2_huff_decode_flag;
21
22
typedef
struct
{
23
/* fstate is the current huffman decoding state, which is actually
24
the node ID of internal huffman tree with
25
nghttp2_huff_decode_flag OR-ed. We have 257 leaf nodes, but they
26
are identical to root node other than emitting a symbol, so we
27
have 256 internal nodes [1..255], inclusive. The node ID 256 is
28
a special node and it is a terminal state that means decoding
29
failed. */
30
uint16_t fstate;
31
/* symbol if NGHTTP2_HUFF_SYM flag set */
32
uint8_t sym;
33
}
nghttp2_huff_decode
;
34
35
typedef
nghttp2_huff_decode
huff_decode_table_type[16];
36
37
typedef
struct
{
38
/* fstate is the current huffman decoding state. */
39
uint16_t fstate;
40
}
nghttp2_hd_huff_decode_context
;
41
42
typedef
struct
{
43
/* The number of bits in this code */
44
uint32_t nbits;
45
/* Huffman code aligned to LSB */
46
uint32_t code;
47
}
nghttp2_huff_sym
;
48
49
extern
const
nghttp2_huff_sym
huff_sym_table[];
50
extern
const
nghttp2_huff_decode
huff_decode_table[][16];
51
52
#endif
/* NGHTTP2_HD_HUFFMAN_H */
nghttp2_hd_huff_decode_context
Definition
nghttp2_hd_huffman.h:37
nghttp2_huff_decode
Definition
nghttp2_hd_huffman.h:22
nghttp2_huff_sym
Definition
nghttp2_hd_huffman.h:42
Generated by
1.9.8