Wireshark-dev: Re: [Wireshark-dev] Does lua provide something like range strings?
From: "Maynard, Chris" <Christopher.Maynard@xxxxxxx>
Date: Tue, 9 Oct 2018 15:57:35 +0000
> -----Original Message-----
> From: Wireshark-dev [mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] On
> Behalf Of Peter Wu
> Sent: Tuesday, October 9, 2018 10:14 AM
> To: Developer support list for Wireshark <wireshark-dev@xxxxxxxxxxxxx>
> Subject: Re: [Wireshark-dev] Does lua provide something like range strings?
>
> Hi Richard,
>
> On Mon, Oct 08, 2018 at 10:59:35AM -0700, Richard Sharpe wrote:
> > I am wondering if the Lua interp in Wireshark provides the equivalent
> > of range strings?
> >
> > Does anyone know?
> >
> > I guess I could make the indexes strings, since they are associative
> > arrays anyway but looking up a value in a range would be difficult.
>
> There does not seem to be support for range strings, but it could be added. See
> value_string_from_table in epan/wslua/wslua_proto_field.c for an example.
>
> I suppose that the natural syntax would be:
>
>     local your_range_string = {
>         { 0, 24, "First quarter" },
>         { 25, 54, "Second quarter" },
>     };

That would be a welcome addition!
- Chris











CONFIDENTIALITY NOTICE: This message is the property of International Game Technology PLC and/or its subsidiaries and may contain proprietary, confidential or trade secret information. This message is intended solely for the use of the addressee. If you are not the intended recipient and have received this message in error, please delete this message from your system. Any unauthorized reading, distribution, copying, or other use of this message or its attachments is strictly prohibited.