ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Wireshark-dev: [Wireshark-dev] Does it make sense to have an FT_BOOLEAN field and > 1 bit set i

From: Martin Mathieson <martin.r.mathieson@xxxxxxxxxxxxxx>
Date: Thu, 14 Oct 2021 13:52:31 +0100
I added this check to tools/check_typed_item_calls.py --mask

I am hoping that someone will recognise a protocol they know and check out what is reported, and to be able to work out if this check makes sense to do.

Quite a few of the current cases have to do with multi-bit reserved fields, where I guess you don't want to know the value the bits represent, but just to see if any were set...  Even then, it may be quicker to see a value that is zero or not rather than manually check each bit.

The first case (ansi_a_bsmap.hho_params.enc_mode), has 2 bits set but uses VALS(&tfs_enabled_disabled).  But looking at http://www.3gpp2.org/Public_html/Specs/A.S0014-0_v1.0.pdf, the only valid values are 00 and 01, so this is OK.

So in the case of packet-mac-nr.c, I would want to make the field a FT_UINT8 instead (the first 2 bits of byte are reserved).

For packet-zbee-zcl.c, it wants to show the values of all of the bits in a byte, and TFS(&tfs_true_false) is used.  I don't even know what the filter value would be here (the value of the whole byte?).

Here is the current output:

Warning: epan/dissectors/packet-ansi_a.c: - filter "ansi_a_bsmap.hho_params.enc_mode" label "Encryption Mode" - type is FT_BOOLEAN but has 2 bits set! 0x06
Warning: epan/dissectors/packet-ansi_a.c: - filter "ansi_a_bsmap.amps_hho_params.enc_mode" label "Encryption Mode" - type is FT_BOOLEAN but has 2 bits set! 0x03
Warning: epan/dissectors/packet-btatt.c: - filter "btatt.location_and_speed.flags.heading_source" label "Heading Source" - type is FT_BOOLEAN but has 2 bits set! 0x3000
Warning: epan/dissectors/packet-bthci_cmd.c: - filter "btcommon.eir_ad.entry.3ds.reserved" label "Reserved" - type is FT_BOOLEAN but has 4 bits set! 0x78
Warning: epan/dissectors/packet-bthci_evt.c: - filter "bthci_evt.lmp_features.reserved.59_62" label "Reserved" - type is FT_BOOLEAN but has 4 bits set! 0x78
Warning: epan/dissectors/packet-dhcpv6.c: - filter "dhcpv6.failover.connect.flags.reserved" label "Reserved" - type is FT_BOOLEAN but has 15 bits set! 0xfffe
Warning: epan/dissectors/packet-dhcpv6.c: - filter "dhcpv6.failover.dns.flags.reserved" label "Reserved" - type is FT_BOOLEAN but has 12 bits set! 0xfff0
Warning: epan/dissectors/packet-dhcpv6.c: - filter "dhcpv6.failover.server.flags.reserved" label "Reserved" - type is FT_BOOLEAN but has 5 bits set! 0xf8
Warning: epan/dissectors/packet-dhcpv6.c: - filter "dhcpv6.s46_rule.flags.reserved" label "Reserved" - type is FT_BOOLEAN but has 7 bits set! 0xfe
Warning: epan/dissectors/packet-diameter_3gpp.c: - filter "diameter.3gpp.pla_flags_spare_bits" label "Spare" - type is FT_BOOLEAN but has 28 bits set! 0xfffffff0
Warning: epan/dissectors/packet-docsis-tlv.c: - filter "docsis_tlv.mcap.up_ofdma_chan_subc_qam_mod_sup.reserved" label "Reserved" - type is FT_BOOLEAN but has 3 bits set! 0x8003
Warning: epan/dissectors/packet-ehs.c: - filter "ehs2.tdm_obt_reserved" label "OBT Reserved" - type is FT_BOOLEAN but has 2 bits set! 0x1800
Warning: epan/dissectors/packet-erldp.c: - filter "erldp.dist_header.new_cache" label "LongAtoms" - type is FT_BOOLEAN but has 2 bits set! 0x12
Warning: epan/dissectors/packet-glusterfs.c: - filter "glusterfs.flags.rdonly" label "O_RDONLY" - type is FT_BOOLEAN but has 32 bits set! 0xffffffff
Warning: epan/dissectors/packet-glusterfs.c: - filter "glusterfs.flags.reserved" label "Unused" - type is FT_BOOLEAN but has 16 bits set! 037774000074
Warning: epan/dissectors/packet-ieee80211.c: - filter "wlan.ext_tag.he_phy_cap.max_nc" label "Max Nc" - type is FT_BOOLEAN but has 3 bits set! 0x0038
Warning: epan/dissectors/packet-isis-hello.c: - filter "isis.hello.vlan_flags.reserved" label "Reserved" - type is FT_BOOLEAN but has 3 bits set! 0x7000
Warning: epan/dissectors/packet-isis-hello.c: - filter "isis.hello.trill.unassigned_1" label "Unassigned" - type is FT_BOOLEAN but has 2 bits set! 0x60000000
Warning: epan/dissectors/packet-isis-hello.c: - filter "isis.hello.trill.hop_by_hop_flags" label "Hop-by-hop Extended Header Flags" - type is FT_BOOLEAN but has 11 bits set! 0x1ffc0000
Warning: epan/dissectors/packet-isis-hello.c: - filter "isis.hello.trill.unassigned_2" label "Unassigned" - type is FT_BOOLEAN but has 18 bits set! 0x0003ffff
Warning: epan/dissectors/packet-isis-lsp.c: - filter "isis.lsp.rt_capable.trill.caps" label "Other Capabilities" - type is FT_BOOLEAN but has 12 bits set! 0x3ffc0000
Warning: epan/dissectors/packet-isis-lsp.c: - filter "isis.lsp.rt_capable.trill.flags" label "Extended Header Flags" - type is FT_BOOLEAN but has 18 bits set! 0x0003ffff
Warning: epan/dissectors/packet-mac-nr.c: - filter "mac-nr.control.me-phr.reserved" label "Reserved" - type is FT_BOOLEAN but has 2 bits set! 0xc0
Warning: epan/dissectors/packet-mbim.c: - filter "mbim.control.data_class.reserved_gsm" label "Reserved for future GSM classes" - type is FT_BOOLEAN but has 9 bits set! 0x0000ff80
Warning: epan/dissectors/packet-mbim.c: - filter "mbim.control.data_class.reserved_cdma" label "Reserved for future CDMA classes" - type is FT_BOOLEAN but has 8 bits set! 0x7f800000
Warning: epan/dissectors/packet-nvme.c: - filter "nvme.cmd.set_features.dword11.irqv.cd" label "Coalescing Disable" - type is FT_BOOLEAN but has 17 bits set! 0x1ffff
Warning: epan/dissectors/packet-nvme.c: - filter "nvme.cmd.get_logpage.selftest.res.vdi.rsvd" label "Reserved" - type is FT_BOOLEAN but has 4 bits set! 0xf0
Warning: epan/dissectors/packet-nvme.c: - filter "nvme.cmd.get_logpage.egroup.cw.rsvd1" label "Reserved" - type is FT_BOOLEAN but has 4 bits set! 0xf0
Warning: epan/dissectors/packet-opensafety.c: - filter "opensafety.ssdo.preload.error" label "Wrong/missing segment" - type is FT_BOOLEAN but has 2 bits set! 0x30
Warning: epan/dissectors/packet-skinny.c: - filter "skinny.RestrictInformationType.BitsReserved" label "BitsReserved" - type is FT_BOOLEAN but has 24 bits set! 0xffffff00
Warning: epan/dissectors/packet-skinny.c: - filter "skinny.RestrictInformationType.CalledParty" label "CalledParty" - type is FT_BOOLEAN but has 2 bits set! 0x000c
Warning: epan/dissectors/packet-skinny.c: - filter "skinny.RestrictInformationType.CallingParty" label "CallingParty" - type is FT_BOOLEAN but has 2 bits set! 0x0003
Warning: epan/dissectors/packet-skinny.c: - filter "skinny.RestrictInformationType.LastRedirectParty" label "LastRedirectParty" - type is FT_BOOLEAN but has 2 bits set! 0x00c0
Warning: epan/dissectors/packet-skinny.c: - filter "skinny.RestrictInformationType.OriginalCalledParty" label "OriginalCalledParty" - type is FT_BOOLEAN but has 2 bits set! 0x0030
Warning: epan/dissectors/packet-smb2.c: - filter "smb2.query_quota_info.single" label "ReturnSingle" - type is FT_BOOLEAN but has 8 bits set! 0xff
Warning: epan/dissectors/packet-smb2.c: - filter "smb2.query_quota_info.restart" label "RestartScan" - type is FT_BOOLEAN but has 8 bits set! 0xff
Warning: epan/dissectors/packet-synphasor.c: - filter "synphasor.conf.phasor_user_flags" label "Binary format" - type is FT_BOOLEAN but has 8 bits set! 0xff
Warning: epan/dissectors/packet-tds.c: - filter "tds.colmetadata.flags.updateable" label "Updateable" - type is FT_BOOLEAN but has 2 bits set! 0x3000
Warning: epan/dissectors/packet-tds.c: - filter "tds.colmetadata.flags.reservedodbc" label "Reserved ODBC" - type is FT_BOOLEAN but has 2 bits set! 0x0300
Warning: epan/dissectors/packet-wassp.c: - filter "wassp.priority" label "Priority bit" - type is FT_BOOLEAN but has 8 bits set! 0xff
Warning: epan/dissectors/packet-zbee-zcl.c: - filter "zbee_zcl.attr.boolean" label "Boolean" - type is FT_BOOLEAN but has 8 bits set! 0xff
Warning: plugins/epan/unistim/packet-unistim.c: - filter "unistim.bit.fields" label "FLAGS" - type is FT_BOOLEAN but has 8 bits set! 0xff