"Fossies" - the Fresh Open Source Software Archive

Member "Pound-3.0.2/include/hpack.h" (28 Nov 2021, 25167 Bytes) of package /linux/www/Pound-3.0.2.tgz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "hpack.h" see the Fossies "Dox" file reference documentation.

    1 /*  $OpenBSD$   */
    2 
    3 /*
    4  * Copyright (c) 2019 Reyk Floeter <reyk@openbsd.org>
    5  *
    6  * Permission to use, copy, modify, and distribute this software for any
    7  * purpose with or without fee is hereby granted, provided that the above
    8  * copyright notice and this permission notice appear in all copies.
    9  *
   10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
   11  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
   12  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
   13  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
   14  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
   15  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
   16  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
   17  */
   18 
   19 #include <sys/queue.h>
   20 
   21 #ifndef HPACK_H
   22 #define HPACK_H
   23 
   24 struct hpack_table;
   25 
   26 enum hpack_header_index {
   27     HPACK_NO_INDEX = 0,
   28     HPACK_NEVER_INDEX,
   29     HPACK_INDEX,
   30 };
   31 
   32 struct hpack_header {
   33     char                *hdr_name;
   34     char                *hdr_value;
   35     enum hpack_header_index      hdr_index;
   36     TAILQ_ENTRY(hpack_header)    hdr_entry;
   37 };
   38 TAILQ_HEAD(hpack_headerblock, hpack_header);
   39 
   40 int  hpack_init(void);
   41 
   42 struct hpack_table
   43     *hpack_table_new(size_t);
   44 void     hpack_table_free(struct hpack_table *);
   45 size_t   hpack_table_size(struct hpack_table *);
   46 
   47 struct hpack_headerblock
   48     *hpack_decode(unsigned char *, size_t, struct hpack_table *);
   49 unsigned char
   50     *hpack_encode(struct hpack_headerblock *, size_t *,
   51         struct hpack_table *);
   52 
   53 struct hpack_header
   54     *hpack_header_new(void);
   55 struct hpack_header
   56     *hpack_header_add(struct hpack_headerblock *,
   57         const char *, const char *, enum hpack_header_index);
   58 void     hpack_header_free(struct hpack_header *);
   59 struct hpack_headerblock
   60     *hpack_headerblock_new(void);
   61 void     hpack_headerblock_free(struct hpack_headerblock *);
   62 
   63 unsigned char
   64     *hpack_huffman_decode(unsigned char *, size_t, size_t *);
   65 char    *hpack_huffman_decode_str(unsigned char *, size_t);
   66 unsigned char
   67     *hpack_huffman_encode(unsigned char *, size_t, size_t *);
   68 
   69 #ifdef HPACK_INTERNAL
   70 
   71 #ifndef DEBUG
   72 #define DPRINTF(x...)       do{} while(0)
   73 #else
   74 #define DPRINTF(fmt...)     logmsg(3, fmt)
   75 #endif
   76 
   77 /* from sys/param.h */
   78 #define MAX(a,b)        (((a)>(b))?(a):(b))
   79 
   80 #define HPACK_HUFFMAN_BUFSZ 256
   81 #define HPACK_MAX_TABLE_SIZE    4096
   82 
   83 struct hpack_huffman_node {
   84     struct hpack_huffman_node   *hpn_zero;
   85     struct hpack_huffman_node   *hpn_one;
   86     int              hpn_sym;
   87 };
   88 
   89 struct hpack {
   90     struct hpack_huffman_node   *hpack_huffman;
   91 };
   92 
   93 struct hpack_table {
   94     struct hpack_headerblock    *htb_dynamic;
   95     long                 htb_dynamic_size;
   96     long                 htb_dynamic_entries;
   97 
   98     long                 htb_table_size;
   99     long                 htb_max_table_size;
  100 
  101     struct hpack_headerblock    *htb_headers;
  102     struct hpack_header     *htb_next;
  103 };
  104 
  105 /* Simple internal buffer API */
  106 struct hbuf {
  107     unsigned char       *data;      /* data pointer */
  108     size_t           size;      /* data size */
  109     size_t           rpos;      /* read position */
  110     size_t           wpos;      /* write position */
  111     size_t           wbsz;      /* realloc buf size */
  112 };
  113 
  114 /* Masks, flags, and prefixes of the field types */
  115 #define HPACK_M_INDEX           0x80    /* 7-bit prefix */
  116 #define HPACK_F_INDEX           0x80    /* index flag */
  117 #define HPACK_M_LITERAL_INDEX       0xc0    /* 6-bit prefix */
  118 #define HPACK_F_LITERAL_INDEX       0x40    /* literal index flag */
  119 #define HPACK_M_LITERAL_NO_INDEX    0xf0    /* 4-bit prefix */
  120 #define HPACK_F_LITERAL_NO_INDEX    0x00    /* no index flag */
  121 #define HPACK_M_LITERAL_NEVER_INDEX 0xf0    /* 4-bit prefix */
  122 #define HPACK_F_LITERAL_NEVER_INDEX 0x10    /* never index flag */
  123 #define HPACK_M_TABLE_SIZE_UPDATE   0xe0    /* 5-bit prefix */
  124 #define HPACK_F_TABLE_SIZE_UPDATE   0x20    /* dynamic table size flag */
  125 #define HPACK_M_LITERAL         0x80    /* 7-bit index */
  126 #define HPACK_F_LITERAL         0x00    /* literal encoding */
  127 #define HPACK_F_LITERAL_HUFFMAN     0x80    /* huffman encoding */
  128 
  129 /*
  130  * Appendix A.  Static Table Definition
  131  */
  132 struct hpack_index {
  133     long             hpi_id;    /* Index */
  134     const char      *hpi_name;  /* Header Name */
  135     const char      *hpi_value; /* Value */
  136 };
  137 #define HPACK_STATIC_SIZE (sizeof(static_table) / sizeof(static_table[0]))
  138 static struct hpack_index static_table[] = {
  139     { 1,    ":authority",           NULL },         \
  140     { 2,    ":method",          "GET" },        \
  141     { 3,    ":method",          "POST" },       \
  142     { 4,    ":path",            "/" },          \
  143     { 5,    ":path",            "/index.html"},     \
  144     { 6,    ":scheme",          "http" },       \
  145     { 7,    ":scheme",          "https" },      \
  146     { 8,    ":status",          "200" },        \
  147     { 9,    ":status",          "204" },        \
  148     { 10,   ":status",          "206" },        \
  149     { 11,   ":status",          "304" },        \
  150     { 12,   ":status",          "400" },        \
  151     { 13,   ":status",          "404" },        \
  152     { 14,   ":status",          "500" },        \
  153     { 15,   "accept-charset",       NULL },         \
  154     { 16,   "accept-encoding",      "gzip, deflate" },  \
  155     { 17,   "accept-language",      NULL },         \
  156     { 18,   "accept-ranges",        NULL },         \
  157     { 19,   "accept",           NULL },         \
  158     { 20,   "access-control-allow-origin",  NULL },         \
  159     { 21,   "age",              NULL },         \
  160     { 22,   "allow",            NULL },         \
  161     { 23,   "authorization",        NULL },         \
  162     { 24,   "cache-control",        NULL },         \
  163     { 25,   "content-disposition",      NULL },         \
  164     { 26,   "content-encoding",     NULL },         \
  165     { 27,   "content-language",     NULL },         \
  166     { 28,   "content-length",       NULL },         \
  167     { 29,   "content-location",     NULL },         \
  168     { 30,   "content-range",        NULL },         \
  169     { 31,   "content-type",         NULL },         \
  170     { 32,   "cookie",           NULL },         \
  171     { 33,   "date",             NULL },         \
  172     { 34,   "etag",             NULL },         \
  173     { 35,   "expect",           NULL },         \
  174     { 36,   "expires",          NULL },         \
  175     { 37,   "from",             NULL },         \
  176     { 38,   "host",             NULL },         \
  177     { 39,   "if-match",         NULL },         \
  178     { 40,   "if-modified-since",        NULL },         \
  179     { 41,   "if-none-match",        NULL },         \
  180     { 42,   "if-range",         NULL },         \
  181     { 43,   "if-unmodified-since",      NULL },         \
  182     { 44,   "last-modified",        NULL },         \
  183     { 45,   "link",             NULL },         \
  184     { 46,   "location",         NULL },         \
  185     { 47,   "max-forwards",         NULL },         \
  186     { 48,   "proxy-authenticate",       NULL },         \
  187     { 49,   "proxy-authorization",      NULL },         \
  188     { 50,   "range",            NULL },         \
  189     { 51,   "referer",          NULL },         \
  190     { 52,   "refresh",          NULL },         \
  191     { 53,   "retry-after",          NULL },         \
  192     { 54,   "server",           NULL },         \
  193     { 55,   "set-cookie",           NULL },         \
  194     { 56,   "strict-transport-security",    NULL },         \
  195     { 57,   "transfer-encoding",        NULL },         \
  196     { 58,   "user-agent",           NULL },         \
  197     { 59,   "vary",             NULL },         \
  198     { 60,   "via",              NULL },         \
  199     { 61,   "www-authenticate",     NULL },         \
  200 };
  201 
  202 /*
  203  * Appendix B.  Huffman Code
  204  */
  205 struct hpack_huffman {
  206     /* (comment) */         /* ASCII symbol */
  207     /* (comment) */         /* code as bits aligned to MSB */
  208     unsigned int    hph_code;   /* code as hex aligned to LSB */
  209     unsigned int    hph_length; /* len in bits */
  210 };
  211 #define HPACK_HUFFMAN_SIZE (sizeof(huffman_table) / sizeof(huffman_table[0]))
  212 static struct hpack_huffman huffman_table[] = {
  213     { /*     (  0) |11111111|11000 */                        0x1ff8, 13 },
  214     { /*     (  1) |11111111|11111111|1011000 */           0x7fffd8, 23 },
  215     { /*     (  2) |11111111|11111111|11111110|0010 */    0xfffffe2, 28 },
  216     { /*     (  3) |11111111|11111111|11111110|0011 */    0xfffffe3, 28 },
  217     { /*     (  4) |11111111|11111111|11111110|0100 */    0xfffffe4, 28 },
  218     { /*     (  5) |11111111|11111111|11111110|0101 */    0xfffffe5, 28 },
  219     { /*     (  6) |11111111|11111111|11111110|0110 */    0xfffffe6, 28 },
  220     { /*     (  7) |11111111|11111111|11111110|0111 */    0xfffffe7, 28 },
  221     { /*     (  8) |11111111|11111111|11111110|1000 */    0xfffffe8, 28 },
  222     { /*     (  9) |11111111|11111111|11101010 */          0xffffea, 24 },
  223     { /*     ( 10) |11111111|11111111|11111111|111100 */ 0x3ffffffc, 30 },
  224     { /*     ( 11) |11111111|11111111|11111110|1001 */    0xfffffe9, 28 },
  225     { /*     ( 12) |11111111|11111111|11111110|1010 */    0xfffffea, 28 },
  226     { /*     ( 13) |11111111|11111111|11111111|111101 */ 0x3ffffffd, 30 },
  227     { /*     ( 14) |11111111|11111111|11111110|1011 */    0xfffffeb, 28 },
  228     { /*     ( 15) |11111111|11111111|11111110|1100 */    0xfffffec, 28 },
  229     { /*     ( 16) |11111111|11111111|11111110|1101 */    0xfffffed, 28 },
  230     { /*     ( 17) |11111111|11111111|11111110|1110 */    0xfffffee, 28 },
  231     { /*     ( 18) |11111111|11111111|11111110|1111 */    0xfffffef, 28 },
  232     { /*     ( 19) |11111111|11111111|11111111|0000 */    0xffffff0, 28 },
  233     { /*     ( 20) |11111111|11111111|11111111|0001 */    0xffffff1, 28 },
  234     { /*     ( 21) |11111111|11111111|11111111|0010 */    0xffffff2, 28 },
  235     { /*     ( 22) |11111111|11111111|11111111|111110 */ 0x3ffffffe, 30 },
  236     { /*     ( 23) |11111111|11111111|11111111|0011 */    0xffffff3, 28 },
  237     { /*     ( 24) |11111111|11111111|11111111|0100 */    0xffffff4, 28 },
  238     { /*     ( 25) |11111111|11111111|11111111|0101 */    0xffffff5, 28 },
  239     { /*     ( 26) |11111111|11111111|11111111|0110 */    0xffffff6, 28 },
  240     { /*     ( 27) |11111111|11111111|11111111|0111 */    0xffffff7, 28 },
  241     { /*     ( 28) |11111111|11111111|11111111|1000 */    0xffffff8, 28 },
  242     { /*     ( 29) |11111111|11111111|11111111|1001 */    0xffffff9, 28 },
  243     { /*     ( 30) |11111111|11111111|11111111|1010 */    0xffffffa, 28 },
  244     { /*     ( 31) |11111111|11111111|11111111|1011 */    0xffffffb, 28 },
  245     { /* ' ' ( 32) |010100 */                                  0x14,  6 },
  246     { /* '!' ( 33) |11111110|00 */                            0x3f8, 10 },
  247     { /* '"' ( 34) |11111110|01 */                            0x3f9, 10 },
  248     { /* '#' ( 35) |11111111|1010 */                          0xffa, 12 },
  249     { /* '$' ( 36) |11111111|11001 */                        0x1ff9, 13 },
  250     { /* '%' ( 37) |010101 */                                  0x15,  6 },
  251     { /* '&' ( 38) |11111000 */                                0xf8,  8 },
  252     { /* ''' ( 39) |11111111|010 */                           0x7fa, 11 },
  253     { /* '(' ( 40) |11111110|10 */                            0x3fa, 10 },
  254     { /* ')' ( 41) |11111110|11 */                            0x3fb, 10 },
  255     { /* '*' ( 42) |11111001 */                                0xf9,  8 },
  256     { /* '+' ( 43) |11111111|011 */                           0x7fb, 11 },
  257     { /* ',' ( 44) |11111010 */                                0xfa,  8 },
  258     { /* '-' ( 45) |010110 */                                  0x16,  6 },
  259     { /* '.' ( 46) |010111 */                                  0x17,  6 },
  260     { /* '/' ( 47) |011000 */                                  0x18,  6 },
  261     { /* '0' ( 48) |00000 */                                    0x0,  5 },
  262     { /* '1' ( 49) |00001 */                                    0x1,  5 },
  263     { /* '2' ( 50) |00010 */                                    0x2,  5 },
  264     { /* '3' ( 51) |011001 */                                  0x19,  6 },
  265     { /* '4' ( 52) |011010 */                                  0x1a,  6 },
  266     { /* '5' ( 53) |011011 */                                  0x1b,  6 },
  267     { /* '6' ( 54) |011100 */                                  0x1c,  6 },
  268     { /* '7' ( 55) |011101 */                                  0x1d,  6 },
  269     { /* '8' ( 56) |011110 */                                  0x1e,  6 },
  270     { /* '9' ( 57) |011111 */                                  0x1f,  6 },
  271     { /* ':' ( 58) |1011100 */                                 0x5c,  7 },
  272     { /* ';' ( 59) |11111011 */                                0xfb,  8 },
  273     { /* '<' ( 60) |11111111|1111100 */                      0x7ffc, 15 },
  274     { /* '=' ( 61) |100000 */                                  0x20,  6 },
  275     { /* '>' ( 62) |11111111|1011 */                          0xffb, 12 },
  276     { /* '?' ( 63) |11111111|00 */                            0x3fc, 10 },
  277     { /* '@' ( 64) |11111111|11010 */                        0x1ffa, 13 },
  278     { /* 'A' ( 65) |100001 */                                  0x21,  6 },
  279     { /* 'B' ( 66) |1011101 */                                 0x5d,  7 },
  280     { /* 'C' ( 67) |1011110 */                                 0x5e,  7 },
  281     { /* 'D' ( 68) |1011111 */                                 0x5f,  7 },
  282     { /* 'E' ( 69) |1100000 */                                 0x60,  7 },
  283     { /* 'F' ( 70) |1100001 */                                 0x61,  7 },
  284     { /* 'G' ( 71) |1100010 */                                 0x62,  7 },
  285     { /* 'H' ( 72) |1100011 */                                 0x63,  7 },
  286     { /* 'I' ( 73) |1100100 */                                 0x64,  7 },
  287     { /* 'J' ( 74) |1100101 */                                 0x65,  7 },
  288     { /* 'K' ( 75) |1100110 */                                 0x66,  7 },
  289     { /* 'L' ( 76) |1100111 */                                 0x67,  7 },
  290     { /* 'M' ( 77) |1101000 */                                 0x68,  7 },
  291     { /* 'N' ( 78) |1101001 */                                 0x69,  7 },
  292     { /* 'O' ( 79) |1101010 */                                 0x6a,  7 },
  293     { /* 'P' ( 80) |1101011 */                                 0x6b,  7 },
  294     { /* 'Q' ( 81) |1101100 */                                 0x6c,  7 },
  295     { /* 'R' ( 82) |1101101 */                                 0x6d,  7 },
  296     { /* 'S' ( 83) |1101110 */                                 0x6e,  7 },
  297     { /* 'T' ( 84) |1101111 */                                 0x6f,  7 },
  298     { /* 'U' ( 85) |1110000 */                                 0x70,  7 },
  299     { /* 'V' ( 86) |1110001 */                                 0x71,  7 },
  300     { /* 'W' ( 87) |1110010 */                                 0x72,  7 },
  301     { /* 'X' ( 88) |11111100 */                                0xfc,  8 },
  302     { /* 'Y' ( 89) |1110011 */                                 0x73,  7 },
  303     { /* 'Z' ( 90) |11111101 */                                0xfd,  8 },
  304     { /* '[' ( 91) |11111111|11011 */                        0x1ffb, 13 },
  305     { /* '\' ( 92) |11111111|11111110|000 */                0x7fff0, 19 },
  306     { /* '}' ( 93) |11111111|11100 */                        0x1ffc, 13 },
  307     { /* '^' ( 94) |11111111|111100 */                       0x3ffc, 14 },
  308     { /* '_' ( 95) |100010 */                                  0x22,  6 },
  309     { /* '`' ( 96) |11111111|1111101 */                      0x7ffd, 15 },
  310     { /* 'a' ( 97) |00011 */                                    0x3,  5 },
  311     { /* 'b' ( 98) |100011 */                                  0x23,  6 },
  312     { /* 'c' ( 99) |00100 */                                    0x4,  5 },
  313     { /* 'd' (100) |100100 */                                  0x24,  6 },
  314     { /* 'e' (101) |00101 */                                    0x5,  5 },
  315     { /* 'f' (102) |100101 */                                  0x25,  6 },
  316     { /* 'g' (103) |100110 */                                  0x26,  6 },
  317     { /* 'h' (104) |100111 */                                  0x27,  6 },
  318     { /* 'i' (105) |00110 */                                    0x6,  5 },
  319     { /* 'j' (106) |1110100 */                                 0x74,  7 },
  320     { /* 'k' (107) |1110101 */                                 0x75,  7 },
  321     { /* 'l' (108) |101000 */                                  0x28,  6 },
  322     { /* 'm' (109) |101001 */                                  0x29,  6 },
  323     { /* 'n' (110) |101010 */                                  0x2a,  6 },
  324     { /* 'o' (111) |00111 */                                    0x7,  5 },
  325     { /* 'p' (112) |101011 */                                  0x2b,  6 },
  326     { /* 'q' (113) |1110110 */                                 0x76,  7 },
  327     { /* 'r' (114) |101100 */                                  0x2c,  6 },
  328     { /* 's' (115) |01000 */                                    0x8,  5 },
  329     { /* 't' (116) |01001 */                                    0x9,  5 },
  330     { /* 'u' (117) |101101 */                                  0x2d,  6 },
  331     { /* 'v' (118) |1110111 */                                 0x77,  7 },
  332     { /* 'w' (119) |1111000 */                                 0x78,  7 },
  333     { /* 'x' (120) |1111001 */                                 0x79,  7 },
  334     { /* 'y' (121) |1111010 */                                 0x7a,  7 },
  335     { /* 'z' (122) |1111011 */                                 0x7b,  7 },
  336     { /* '{' (123) |11111111|1111110 */                      0x7ffe, 15 },
  337     { /* '|' (124) |11111111|100 */                           0x7fc, 11 },
  338     { /* '}' (125) |11111111|111101 */                       0x3ffd, 14 },
  339     { /* '~' (126) |11111111|11101 */                        0x1ffd, 13 },
  340     { /*     (127) |11111111|11111111|11111111|1100 */    0xffffffc, 28 },
  341     { /*     (128) |11111111|11111110|0110 */               0xfffe6, 20 },
  342     { /*     (129) |11111111|11111111|010010 */            0x3fffd2, 22 },
  343     { /*     (130) |11111111|11111110|0111 */               0xfffe7, 20 },
  344     { /*     (131) |11111111|11111110|1000 */               0xfffe8, 20 },
  345     { /*     (132) |11111111|11111111|010011 */            0x3fffd3, 22 },
  346     { /*     (133) |11111111|11111111|010100 */            0x3fffd4, 22 },
  347     { /*     (134) |11111111|11111111|010101 */            0x3fffd5, 22 },
  348     { /*     (135) |11111111|11111111|1011001 */           0x7fffd9, 23 },
  349     { /*     (136) |11111111|11111111|010110 */            0x3fffd6, 22 },
  350     { /*     (137) |11111111|11111111|1011010 */           0x7fffda, 23 },
  351     { /*     (138) |11111111|11111111|1011011 */           0x7fffdb, 23 },
  352     { /*     (139) |11111111|11111111|1011100 */           0x7fffdc, 23 },
  353     { /*     (140) |11111111|11111111|1011101 */           0x7fffdd, 23 },
  354     { /*     (141) |11111111|11111111|1011110 */           0x7fffde, 23 },
  355     { /*     (142) |11111111|11111111|11101011 */          0xffffeb, 24 },
  356     { /*     (143) |11111111|11111111|1011111 */           0x7fffdf, 23 },
  357     { /*     (144) |11111111|11111111|11101100 */          0xffffec, 24 },
  358     { /*     (145) |11111111|11111111|11101101 */          0xffffed, 24 },
  359     { /*     (146) |11111111|11111111|010111 */            0x3fffd7, 22 },
  360     { /*     (147) |11111111|11111111|1100000 */           0x7fffe0, 23 },
  361     { /*     (148) |11111111|11111111|11101110 */          0xffffee, 24 },
  362     { /*     (149) |11111111|11111111|1100001 */           0x7fffe1, 23 },
  363     { /*     (150) |11111111|11111111|1100010 */           0x7fffe2, 23 },
  364     { /*     (151) |11111111|11111111|1100011 */           0x7fffe3, 23 },
  365     { /*     (152) |11111111|11111111|1100100 */           0x7fffe4, 23 },
  366     { /*     (153) |11111111|11111110|11100 */             0x1fffdc, 21 },
  367     { /*     (154) |11111111|11111111|011000 */            0x3fffd8, 22 },
  368     { /*     (155) |11111111|11111111|1100101 */           0x7fffe5, 23 },
  369     { /*     (156) |11111111|11111111|011001 */            0x3fffd9, 22 },
  370     { /*     (157) |11111111|11111111|1100110 */           0x7fffe6, 23 },
  371     { /*     (158) |11111111|11111111|1100111 */           0x7fffe7, 23 },
  372     { /*     (159) |11111111|11111111|11101111 */          0xffffef, 24 },
  373     { /*     (160) |11111111|11111111|011010 */            0x3fffda, 22 },
  374     { /*     (161) |11111111|11111110|11101 */             0x1fffdd, 21 },
  375     { /*     (162) |11111111|11111110|1001 */               0xfffe9, 20 },
  376     { /*     (163) |11111111|11111111|011011 */            0x3fffdb, 22 },
  377     { /*     (164) |11111111|11111111|011100 */            0x3fffdc, 22 },
  378     { /*     (165) |11111111|11111111|1101000 */           0x7fffe8, 23 },
  379     { /*     (166) |11111111|11111111|1101001 */           0x7fffe9, 23 },
  380     { /*     (167) |11111111|11111110|11110 */             0x1fffde, 21 },
  381     { /*     (168) |11111111|11111111|1101010 */           0x7fffea, 23 },
  382     { /*     (169) |11111111|11111111|011101 */            0x3fffdd, 22 },
  383     { /*     (170) |11111111|11111111|011110 */            0x3fffde, 22 },
  384     { /*     (171) |11111111|11111111|11110000 */          0xfffff0, 24 },
  385     { /*     (172) |11111111|11111110|11111 */             0x1fffdf, 21 },
  386     { /*     (173) |11111111|11111111|011111 */            0x3fffdf, 22 },
  387     { /*     (174) |11111111|11111111|1101011 */           0x7fffeb, 23 },
  388     { /*     (175) |11111111|11111111|1101100 */           0x7fffec, 23 },
  389     { /*     (176) |11111111|11111111|00000 */             0x1fffe0, 21 },
  390     { /*     (177) |11111111|11111111|00001 */             0x1fffe1, 21 },
  391     { /*     (178) |11111111|11111111|100000 */            0x3fffe0, 22 },
  392     { /*     (179) |11111111|11111111|00010 */             0x1fffe2, 21 },
  393     { /*     (180) |11111111|11111111|1101101 */           0x7fffed, 23 },
  394     { /*     (181) |11111111|11111111|100001 */            0x3fffe1, 22 },
  395     { /*     (182) |11111111|11111111|1101110 */           0x7fffee, 23 },
  396     { /*     (183) |11111111|11111111|1101111 */           0x7fffef, 23 },
  397     { /*     (184) |11111111|11111110|1010 */               0xfffea, 20 },
  398     { /*     (185) |11111111|11111111|100010 */            0x3fffe2, 22 },
  399     { /*     (186) |11111111|11111111|100011 */            0x3fffe3, 22 },
  400     { /*     (187) |11111111|11111111|100100 */            0x3fffe4, 22 },
  401     { /*     (188) |11111111|11111111|1110000 */           0x7ffff0, 23 },
  402     { /*     (189) |11111111|11111111|100101 */            0x3fffe5, 22 },
  403     { /*     (190) |11111111|11111111|100110 */            0x3fffe6, 22 },
  404     { /*     (191) |11111111|11111111|1110001 */           0x7ffff1, 23 },
  405     { /*     (192) |11111111|11111111|11111000|00 */      0x3ffffe0, 26 },
  406     { /*     (193) |11111111|11111111|11111000|01 */      0x3ffffe1, 26 },
  407     { /*     (194) |11111111|11111110|1011 */               0xfffeb, 20 },
  408     { /*     (195) |11111111|11111110|001 */                0x7fff1, 19 },
  409     { /*     (196) |11111111|11111111|100111 */            0x3fffe7, 22 },
  410     { /*     (197) |11111111|11111111|1110010 */           0x7ffff2, 23 },
  411     { /*     (198) |11111111|11111111|101000 */            0x3fffe8, 22 },
  412     { /*     (199) |11111111|11111111|11110110|0 */       0x1ffffec, 25 },
  413     { /*     (200) |11111111|11111111|11111000|10 */      0x3ffffe2, 26 },
  414     { /*     (201) |11111111|11111111|11111000|11 */      0x3ffffe3, 26 },
  415     { /*     (202) |11111111|11111111|11111001|00 */      0x3ffffe4, 26 },
  416     { /*     (203) |11111111|11111111|11111011|110 */     0x7ffffde, 27 },
  417     { /*     (204) |11111111|11111111|11111011|111 */     0x7ffffdf, 27 },
  418     { /*     (205) |11111111|11111111|11111001|01 */      0x3ffffe5, 26 },
  419     { /*     (206) |11111111|11111111|11110001 */          0xfffff1, 24 },
  420     { /*     (207) |11111111|11111111|11110110|1 */       0x1ffffed, 25 },
  421     { /*     (208) |11111111|11111110|010 */                0x7fff2, 19 },
  422     { /*     (209) |11111111|11111111|00011 */             0x1fffe3, 21 },
  423     { /*     (210) |11111111|11111111|11111001|10 */      0x3ffffe6, 26 },
  424     { /*     (211) |11111111|11111111|11111100|000 */     0x7ffffe0, 27 },
  425     { /*     (212) |11111111|11111111|11111100|001 */     0x7ffffe1, 27 },
  426     { /*     (213) |11111111|11111111|11111001|11 */      0x3ffffe7, 26 },
  427     { /*     (214) |11111111|11111111|11111100|010 */     0x7ffffe2, 27 },
  428     { /*     (215) |11111111|11111111|11110010 */          0xfffff2, 24 },
  429     { /*     (216) |11111111|11111111|00100 */             0x1fffe4, 21 },
  430     { /*     (217) |11111111|11111111|00101 */             0x1fffe5, 21 },
  431     { /*     (218) |11111111|11111111|11111010|00 */      0x3ffffe8, 26 },
  432     { /*     (219) |11111111|11111111|11111010|01 */      0x3ffffe9, 26 },
  433     { /*     (220) |11111111|11111111|11111111|1101 */    0xffffffd, 28 },
  434     { /*     (221) |11111111|11111111|11111100|011 */     0x7ffffe3, 27 },
  435     { /*     (222) |11111111|11111111|11111100|100 */     0x7ffffe4, 27 },
  436     { /*     (223) |11111111|11111111|11111100|101 */     0x7ffffe5, 27 },
  437     { /*     (224) |11111111|11111110|1100 */               0xfffec, 20 },
  438     { /*     (225) |11111111|11111111|11110011 */          0xfffff3, 24 },
  439     { /*     (226) |11111111|11111110|1101 */               0xfffed, 20 },
  440     { /*     (227) |11111111|11111111|00110 */             0x1fffe6, 21 },
  441     { /*     (228) |11111111|11111111|101001 */            0x3fffe9, 22 },
  442     { /*     (229) |11111111|11111111|00111 */             0x1fffe7, 21 },
  443     { /*     (230) |11111111|11111111|01000 */             0x1fffe8, 21 },
  444     { /*     (231) |11111111|11111111|1110011 */           0x7ffff3, 23 },
  445     { /*     (232) |11111111|11111111|101010 */            0x3fffea, 22 },
  446     { /*     (233) |11111111|11111111|101011 */            0x3fffeb, 22 },
  447     { /*     (234) |11111111|11111111|11110111|0 */       0x1ffffee, 25 },
  448     { /*     (235) |11111111|11111111|11110111|1 */       0x1ffffef, 25 },
  449     { /*     (236) |11111111|11111111|11110100 */          0xfffff4, 24 },
  450     { /*     (237) |11111111|11111111|11110101 */          0xfffff5, 24 },
  451     { /*     (238) |11111111|11111111|11111010|10 */      0x3ffffea, 26 },
  452     { /*     (239) |11111111|11111111|1110100 */           0x7ffff4, 23 },
  453     { /*     (240) |11111111|11111111|11111010|11 */      0x3ffffeb, 26 },
  454     { /*     (241) |11111111|11111111|11111100|110 */     0x7ffffe6, 27 },
  455     { /*     (242) |11111111|11111111|11111011|00 */      0x3ffffec, 26 },
  456     { /*     (243) |11111111|11111111|11111011|01 */      0x3ffffed, 26 },
  457     { /*     (244) |11111111|11111111|11111100|111 */     0x7ffffe7, 27 },
  458     { /*     (245) |11111111|11111111|11111101|000 */     0x7ffffe8, 27 },
  459     { /*     (246) |11111111|11111111|11111101|001 */     0x7ffffe9, 27 },
  460     { /*     (247) |11111111|11111111|11111101|010 */     0x7ffffea, 27 },
  461     { /*     (248) |11111111|11111111|11111101|011 */     0x7ffffeb, 27 },
  462     { /*     (249) |11111111|11111111|11111111|1110 */    0xffffffe, 28 },
  463     { /*     (250) |11111111|11111111|11111101|100 */     0x7ffffec, 27 },
  464     { /*     (251) |11111111|11111111|11111101|101 */     0x7ffffed, 27 },
  465     { /*     (252) |11111111|11111111|11111101|110 */     0x7ffffee, 27 },
  466     { /*     (253) |11111111|11111111|11111101|111 */     0x7ffffef, 27 },
  467     { /*     (254) |11111111|11111111|11111110|000 */     0x7fffff0, 27 },
  468     { /*     (255) |11111111|11111111|11111011|10 */      0x3ffffee, 26 },
  469     { /* EOS (256) |11111111|11111111|11111111|111111 */ 0x3fffffff, 30 },
  470 };
  471 
  472 #endif /* HPACK_INTERNAL */
  473 #endif /* HPACK_H */