Wireshark-dev: Re: [Wireshark-dev] lua decoder accessing info from layers above
From: Guy Harris <gharris@xxxxxxxxx>
Date: Mon, 12 Oct 2020 17:55:06 -0700
On Oct 12, 2020, at 5:33 PM, John Thacker <johnthacker@xxxxxxxxx> wrote:

> If all you need to know is whether it was called from TCP or UDP, then a typical approach is to create slightly different dissector functions,

...or, in that particular case, slightly *less* different functions, given that UDP provides a packet-based service (so that packet boundaries are provided for you, unless you have to send packets that don't fit in a UDP datagram and add your own reassembly - but, even there, *fragment* boundaries would probably be provided by UDP), while TCP provides a byte-stream service (with *no* packet boundary information).