glasgow-ipl/draft-mcquistin-augmented-ascii-diagrams

Support for constraints on field values

Closed this issue · 1 comments

It is sometimes necessary to constraint the value of fields.

Proposed syntax:

2.  Long Header Packets

   A long header packet is formatted as follows:

       0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+
      |1|1| T |   X   |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                             Version                           |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |    DCID Len   |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                   Destination Connection ID                 ...
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |    SCID Len   |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                      Source Connection ID                   ...
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

   where:

   Header Form (HF): 1 bit; HF == 1.  The most significant bit (0x80) of
      byte 0 (the first byte) is set to 1 for long headers.

   Fixed Bit (FB): 1 bit; FB == 1.  The next bit (0x40) of byte 0 is set
      to 1.  Packets containing a zero value for this bit are not valid
      packets in this version and MUST be discarded.

...

Here, the value itself is shown in the diagram, and expressed using the existing constraint syntax in the description list. It should be noted that the constraints are not limited to equality; specifying a bound, for example, is also possible.

From call: be clear that the order of the description list matches the diagram (so no need for name in the diagram).