Import Mark's fake-hdrs.py
first implementation of mini-enc

This is a simple HPACK encoder supposed to implement draft-09. It
doesn't even emit output bytes right now, it only counts them and
reports statistics.
mini-enc: make the proposal number configurable

only draft09 is implemented for now.
mini-enc: implement proposal "option 3"

This was the proposal sent on the WG later called "option 3" :

     0   1   2   3   4   5   6   7
   +---+---+---+---+---+---+---+---+
   | 1 | D |     Index (6+)        |
   +---+---+---+---+---+---+---+---+

                      Figure 5: Indexed Header Field

     0   1   2   3   4   5   6   7
   +---+---+---+---+---+---+---+---+
   | 0 | 1 | D |  Index (5+)       |
   +---+---+---+-------------------+
   | H |     Value Length (7+)     |
   +---+---------------------------+
   | Value String (Length octets)  |
   +-------------------------------+

    Figure 6: Literal Header Field with Incremental Indexing - Indexed
                                   Name

     0   1   2   3   4   5   6   7
   +---+---+---+---+---+---+---+---+
   | 0 | 1 | 0 |       0           |
   +---+---+---+-------------------+
   | H |     Name Length (7+)      |
   +---+---------------------------+
   |  Name String (Length octets)  |
   +---+---------------------------+
   | H |     Value Length (7+)     |
   +---+---------------------------+
   | Value String (Length octets)  |
   +-------------------------------+

    Figure 7: Literal Header Field with Incremental Indexing - New Name

     0   1   2   3   4   5   6   7
   +---+---+---+---+---+---+---+---+
   | 0 | 0 | 0 | 0 | D | Index (3+)|
   +---+---+---+---+---+-----------+
   | H |     Value Length (7+)     |
   +---+---------------------------+
   | Value String (Length octets)  |
   +-------------------------------+

      Figure 8: Literal Header Field without Indexing - Indexed Name

     0   1   2   3   4   5   6   7
   +---+---+---+---+---+---+---+---+
   | 0 | 0 | 0 | 0 | 0 |     0     |
   +---+---+---+---+---+-----------+
   | H |     Name Length (7+)      |
   +---+---------------------------+
   |  Name String (Length octets)  |
   +---+---------------------------+
   | H |     Value Length (7+)     |
   +---+---------------------------+
   | Value String (Length octets)  |
   +-------------------------------+

        Figure 9: Literal Header Field without Indexing - New Name

     0   1   2   3   4   5   6   7
   +---+---+---+---+---+---+---+---+
   | 0 | 0 | 0 | 1 | D | Index (3+)|
   +---+---+---+---+---+-----------+
   | H |     Value Length (7+)     |
   +---+---------------------------+
   | Value String (Length octets)  |
   +-------------------------------+

       Figure 10: Literal Header Field never Indexed - Indexed Name

     0   1   2   3   4   5   6   7
   +---+---+---+---+---+---+---+---+
   | 0 | 0 | 0 | 1 | 0 |     0     |
   +---+---+---+---+---+-----------+
   | H |     Name Length (7+)      |
   +---+---------------------------+
   |  Name String (Length octets)  |
   +---+---------------------------+
   | H |     Value Length (7+)     |
   +---+---------------------------+
   | Value String (Length octets)  |
   +-------------------------------+

         Figure 11: Literal Header Field never Indexed - New Name

     0   1   2   3   4   5   6   7
   +---+---+---+---+---+---+---+---+
   | 0 | 0 | 1 |   Max size (5+)   |
   +---+---+---+-------------------+

               Figure 12: Maximum Dynamic Table Size Change
mini-enc: added proposal of Tue, 21 Oct 2014 11:40:32 +0200

http://lists.w3.org/Archives/Public/ietf-http-wg/2014OctDec/0268.html

For example something like this (CCing Greg who also has concerns about
all this), which supports a single-byte encoding for :
   - 14 or the 16 static headers with values
   - all 62 static headers for literals
   - 62 dynamic headers for literals

   +---+---+----------------------+
   | 1 | D |  index 6+            |      literal with incremetal indexing
   +---+---+----------------------+

   +---+---+----------------------+
   | 0 | 1 |  index 6+            |      indexed dynamic header
   +---+---+----------------------+

   +---+---+---+---+--------------+
   | 0 | 0 | 1 | 1 |  index 4+    |      indexed static header
   +---+---+---+---+--------------+

   +---+---+---+---+--------------+
   | 0 | 0 | 1 | 0 |  size 4+     |      max dynamic table size change
   +---+---+---+---+--------------+

   +---+---+---+---+---+----------+
   | 0 | 0 | 0 | 0 | D | index 3+ |      literal without indexing
   +---+---+---+---+---+----------+

   +---+---+---+---+---+----------+
   | 0 | 0 | 0 | 1 | D | index 3+ |      literal never indexed
   +---+---+---+---+---+----------+
mini-enc: implement Greg's proposal

http://lists.w3.org/Archives/Public/ietf-http-wg/2014OctDec/0278.html

I actually think that literal without/never indexed should be favoured over
literal indexed or at least on event footing, because by nature the literal
indexed headers are sent only once and then used by index, while the
literal without/never indexed headers are sent literally every time they
are used.

Thus I would think something like:

Indexed Header:
   +---+---+---+---+---+---+---+---+
   | 1 | D |    Index (6+)         |
   +---+---------------------------+

Literal Never Indexed:
   +---+---+---+---+---+---+---+---+
   | 0 | 0 | 0 | D | Index (4+)    |
   +---+---------------------------+

Literal Not Indexed:
   +---+---+---+---+---+---+---+---+
   | 0 | 0 | 1 | D | Index (4+)    |
   +---+---------------------------+

Literal Indexed:
   +---+---+---+---+---+---+---+---+
   | 0 | 1 | 0 | D | Index (4+)    |
   +---+---------------------------+

Max Dynamic Table size change:
   +---+---+---+---+---+---+---+---+
   | 0 | 1 | 1 |  Index (5+)       |
   +---+---------------------------+
Add a simple makefile
Write a bit of README.