On Jun 21, 2021, at 11:54 PM, Vincent Randal <vtrandal@xxxxxxxxx> wrote:
> The primary question in this email (but I think it requires some explanation below): How does one write an ASN.1-based dissector such that the generated code (per "make asn1") does indeed decode the first octet as the message type using C-style switch/case construct?
"ASN.1-based" in what sense?
If the data to be dissected is *entirely* specified by an ASN.1 specification, using one of the representations for ASN.1, then the way it should decode the first octet depends on the representation - BER or one of its derived variants (DER, CER), PER or one of its derived variants (CPER), XER, OER, etc..
> In May I sat in (online) at an online Wireshark Developer Den meeting. I asked about encoding schemes like that in IEEE 1451.0 where the first octet is used to decode the message.
...and which does not appear to use any ASN.1 encoding, so it may not be relevant in your case.
So what is the encoding of this protocol/data format?