[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wireshark-dev
Subject:    Re: [Wireshark-dev] Proper way to handle changes in the preferences
From:       Pascal Quantin <pascal () wireshark ! org>
Date:       2019-06-17 5:51:16
Message-ID: CAGka-808O0rYbhKrRGrS7sU0OgeO66GjbX0Y9ZgPd0Jtv-swZQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi Sake,

Le lun. 17 juin 2019 =C3=A0 07:10, Sake Blok | SYN-bit <sake.blok@syn-bit.n=
l> a
=C3=A9crit :

> 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 nam=
e
> of certain preferences and/or change the values of other preferences. Thi=
s
> will however break compatibility with older versions of Wireshark in
> reading/writing the preferences (in my case, settings in the "recent" fil=
e).
>
> 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?
>

You can find some code handling preferences rename in epan/prefs.c file,
set_pref() function. This is probably the right place to put some
conversion code between the old and new format.

Cheers,
Pascal.

[Attachment #5 (text/html)]

<div dir="ltr"><div>Hi Sake,<br></div><br><div class="gmail_quote"><div dir="ltr" \
class="gmail_attr">Le  lun. 17 juin 2019 Ã   07:10, Sake Blok | SYN-bit &lt;<a \
href="mailto:sake.blok@syn-bit.nl">sake.blok@syn-bit.nl</a>&gt; a écrit  \
:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br> <br>
I&#39;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 &quot;recent&quot; file).<br> <br>
Is there a way to add backwards compatibility in preference items by converting old \
preference settings into new ones?<br> 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?<br> <br>
Things that I might want to change are:<br>
<br>
# Timestamp display precision.<br>
# One of: AUTO, SEC, DSEC, CSEC, MSEC, USEC, NSEC<br>
gui.time_precision: MSEC<br>
<br>
to:<br>
<br>
# Timestamp display precision.<br>
# One of: AUTO, 0DECIMALS, 1DECIMAL, 2DECIMALS, 3DECIMALS, 6DECIMALS, 9DECIMALS<br>
gui.time_precision: AUTO<br>
<br>
and<br>
<br>
# Seconds display format.<br>
# One of: SECONDS, HOUR_MIN_SEC<br>
gui.seconds_format: SECONDS<br>
<br>
to<br>
<br>
# Seconds display format.<br>
# One of: SECONDS, MILLISECONDS, MICROSECONDS, HOUR_MIN_SEC<br>
gui.time_units: SECONDS<br>
<br>
Are there some guidelines available in handling preferences between wireshark \
versions?<br></blockquote><div><br></div><div>You can find some code handling \
preferences rename in epan/prefs.c file, set_pref() function. This is probably the \
right place to put some conversion code between the old and new format. \
<br></div><div><br></div><div>Cheers,<br></div><div>Pascal.</div></div></div>


[Attachment #6 (text/plain)]

___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@wireshark.org>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request@wireshark.org?subject=unsubscribe

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic