ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: [Wireshark-dev] Proper way to handle changes in the preferences

From: Sake Blok | SYN-bit <sake.blok@xxxxxxxxxx>
Date: Mon, 17 Jun 2019 07:10:32 +0200
Hi,

I'm working on a patch to add the possibility to show times in milli- or microsecond units. While working this out, I see a need to change the name of certain preferences and/or change the values of other preferences. This will however break compatibility with older versions of Wireshark in reading/writing the preferences (in my case, settings in the "recent" file).

Is there a way to add backwards compatibility in preference items by converting old preference settings into new ones?
And is there a way to add code to the current versions to do the reverse for forward compatibility, so at least future minor versions of old major versions will be able to handle this correctly?

Things that I might want to change are:

# Timestamp display precision.
# One of: AUTO, SEC, DSEC, CSEC, MSEC, USEC, NSEC
gui.time_precision: MSEC

to:

# Timestamp display precision.
# One of: AUTO, 0DECIMALS, 1DECIMAL, 2DECIMALS, 3DECIMALS, 6DECIMALS, 9DECIMALS
gui.time_precision: AUTO

and

# Seconds display format.
# One of: SECONDS, HOUR_MIN_SEC
gui.seconds_format: SECONDS

to

# Seconds display format.
# One of: SECONDS, MILLISECONDS, MICROSECONDS, HOUR_MIN_SEC
gui.time_units: SECONDS

Are there some guidelines available in handling preferences between wireshark versions?

Cheers,
Met vriendelijke groet,


Sake Blok
Relational therapist for computer systems

+31 (0)6 2181 4696
sake.blok@xxxxxxxxxx

SYN-bit
Deep Traffic Analysis
http://www.SYN-bit.nl