google / pdl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implement support for optional fields

hchataing opened this issue · comments

Optional fields are present in a number of binary packet specification; where a bit flag is used to determine the presence / absence of a field. This task aims to enable support for the following king of specification:

packet {
    a : 1,
    opt_a : A if a = 1,
}

The limitations are to be discussed:

  • limited to boolean flags or not ?
  • limited to typedef / scalar fields or not ? e.g. does it make sens to allow this flag for size fields.

Now supported from pdl v0.2.1