Wireshark mailing list archives

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


From: Vincent Randal <vtrandal () gmail com>
Date: Tue, 22 Jun 2021 19:33:41 -0600

We are using PER per the foo example (Simple ASN.1-based dissector). Wow, I
never about all these different encodings.

Maybe we should be using something other than PER? We think we like PER
because the dissected values agree with what we can see in the raw UDP data.

On Tue, Jun 22, 2021 at 7:13 PM Guy Harris <gharris () sonic net> wrote:

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

___________________________________________________________________________
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: