Wireshark-dev: [Wireshark-dev] Is it possible to create filterable field names based on parent

Date Prev · Date Next · Thread Prev · Thread Next
From: James Ko <jck@xxxxxxxxxx>
Date: Sat, 16 Nov 2024 18:18:30 -0800
In the Wi-SUN packet filters there are some information elements (IEs) with common/reused field names.

In the example tree below the US-IE and BS-IE both have Dwell Interval, Clock Drift, Timing Accuracy, Channel Control, Regulatory Domain, and Channel Plan ID.
The header_field_info for those fields were created using a [FIELDFILTERNAME] starting with wisun.usie.* and the dissector reused the same hfindex when adding the tree item to the different IE trees.
Some automated testing using the Python pyshark library would like to parse out those fields by the IE it appears in.  So the filtername wisun.usie.dwell would change to wisun.bsie.dwell.
There is also a LCP-IE which also has the same fields.

Can someone direct me to a way (or the recommended way) to modify the dissector to improve the filtering and correct the field names without creating duplicate hf table entries for every variant?

Thanks,
James

Payload IEs, Wi-SUN Payload IE
    Wi-SUN Payload IE
        IE Header: 0xa040, Type: Payload, Id: Wi-SUN IE, Length: 64
        Unicast Schedule IE
            Wi-SUN Sub IE: 0x8806, Type: Long, Sub ID: Unicast Schedule IE
            Dwell Interval: 100ms
            Clock Drift: Not provided (255)
            Timing Accuracy: 2.55ms
            Channel Control: 0x12, Channel Plan: Regulatory Domain and Channel Plan ID, Channel Function: Direct Hash Channel Function, Excluded Channels: None
                .... .010 = Channel Plan: Regulatory Domain and Channel Plan ID (2)
                ..01 0... = Channel Function: Direct Hash Channel Function (2)
                00.. .... = Excluded Channels: None (0)
            Regulatory Domain: North America (1)
            Channel Plan ID: 902_928_400 (2)
        BS-IE
            Wi-SUN Sub IE: 0x900c, Type: Long, Sub ID: Broadcast Schedule IE
            Broadcast Interval: 200ms
            Broadcast Schedule ID: 61243
            Dwell Interval: 40ms
            Clock Drift: Not provided (255)
            Timing Accuracy: 2.55ms
            Channel Control: 0x12, Channel Plan: Regulatory Domain and Channel Plan ID, Channel Function: Direct Hash Channel Function, Excluded Channels: None
                .... .010 = Channel Plan: Regulatory Domain and Channel Plan ID (2)
                ..01 0... = Channel Function: Direct Hash Channel Function (2)
                00.. .... = Excluded Channels: None (0)
            Regulatory Domain: North America (1)
            Channel Plan ID: 902_928_400 (2)
        PAN Version IE
        GTK Hash IE
        PAN Version IE