Preference not working in Wireshark 4.0
Using Wireshark 4.0.2 on Windows 11.
I have a protocol preference defined as:
local tx_antennas_enum = {
{ 32, "32", 32 },
{ 64, "64", 64 }
}
xran_protocol.prefs.tx_antennas_cnt = Pref.enum("Tx antennas", 0, "Tx antenna count", tx_antennas_enum, false)
This worked fine in Wireshark 3 (the returned value was 32 or 64), but when I access xran_protocol.prefs.tx_antennas_cnt in Wireshark 4.0.2, that value comes back as zero.
Is there a problem with my code?
WSDG - 11.3.3. Pref:
Should the default value be a valid value from the enum table?
dissector.lua
andfpm.lua
have preference example code (linked to on the Wiki - https://wiki.wireshark.org/Lua/Examples)fileshark_pcap.lua
on the Wiki Contrib page is another example.Thanks for your answer. That fixed my problem.