Wireshark mailing list archives

Re: ASN.1-based dissector decoding by port number vs switch/case using 1st octet


From: Guy Harris <gharris () sonic net>
Date: Tue, 22 Jun 2021 18:12:55 -0700

On Jun 21, 2021, at 11:54 PM, Vincent Randal <vtrandal () gmail com> 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?
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe

Current thread: