[Wireshark-dev] Dissector functions and variables that could be static

2021-01-23 Thread Martin Mathieson via Wireshark-dev
Hi, I wrote a script to check whether variables and functions in dissector modules that were not static were: - not called by any other dissector modules (including dissectors.c) - mentioned in the header file corresponding to that dissector Reasons to clean up these cases could include: - it pol

Re: [Wireshark-dev] Dissector functions and variables that could be static

2021-01-23 Thread Moshe Kaplan
Would it also be possible to build this script into a GitLab CI job, to detect and prevent the issue from recurring? Moshe On Sat, Jan 23, 2021 at 11:45 AM Martin Mathieson via Wireshark-dev < wireshark-dev@wireshark.org> wrote: > Hi, > > I wrote a script to check whether variables and functions

Re: [Wireshark-dev] Dissector functions and variables that could be static

2021-01-24 Thread Martin Mathieson via Wireshark-dev
Hi Moshe, It would be possible. I would still like to hear from people if they think it is worth doing, and we would need to clear the current cases (perhaps with a list of agreed exemptions, like the PDCP key-setting functions I mentioned). I will likely start picking off issues when I have time

Re: [Wireshark-dev] Dissector functions and variables that could be static

2021-01-24 Thread Jirka Novak
Hi, I checked the code I know: > epan/dissectors/packet-rtp-events.c (01a0 D> > rtp_event_type_values_ext) is not referred to so could be static? (in> header) It is used in UI, outside of dissectors. Therefore it should be exported. > epan/dissectors/packet-rtp.c (06d0

Re: [Wireshark-dev] Dissector functions and variables that could be static

2021-01-24 Thread Martin Mathieson via Wireshark-dev
On Sun, Jan 24, 2021 at 8:27 PM Jirka Novak wrote: > Hi, > > I checked the code I know: > > > epan/dissectors/packet-rtp-events.c (01a0 D> > rtp_event_type_values_ext) is not referred to so could be static? (in> > header) > It is used in UI, outside of dissectors. Therefore it shoul

Re: [Wireshark-dev] Dissector functions and variables that could be static

2021-01-26 Thread Martin Mathieson via Wireshark-dev
I have done a bit more on this - I started picking off the ones at the end of the (alphabetical) list - 2nd one is https://gitlab.com/wireshark/wireshark/-/merge_requests/1817. Please feel free if anyone feels motivated to tackle some of the earlier ones. The script is much tidier now, and also ch

Re: [Wireshark-dev] Dissector functions and variables that could be static

2021-01-27 Thread Martin Mathieson via Wireshark-dev
My most recent MR ( https://gitlab.com/wireshark/wireshark/-/merge_requests/1829), has come across some symbols that don't appear to be in used by our repo. dpkg-gensymbols: error: some symbols or patterns disappeared in the symbols file: see diff output below 4934

Re: [Wireshark-dev] Dissector functions and variables that could be static

2021-01-27 Thread João Valverde via Wireshark-dev
Hi Martin, As you said some functions may only be used by third party plugins so indiscriminately removing every exported but not used function would be a bad policy. Even if they're not actually being used right now, who knows, they may be part of some public API for plugins, so for use as n

Re: [Wireshark-dev] Dissector functions and variables that could be static

2021-01-27 Thread Martin Mathieson via Wireshark-dev
Hi *João,* *I agree that every function / variable needs to be looked at carefully, but more so if they have *WS_DLL_PUBLIC in a header file. I will reinstate the XML functions in my change. Hopefully, in other places I will find clear comments saying that they are provided for calling from priv

Re: [Wireshark-dev] Dissector functions and variables that could be static

2021-01-27 Thread Anders Broman via Wireshark-dev
From: Wireshark-dev On Behalf Of Martin Mathieson via Wireshark-dev Sent: den 27 januari 2021 13:27 To: Developer support list for Wireshark Cc: Martin Mathieson Subject: Re: [Wireshark-dev] Dissector functions and variables that could be static Hi João, I agree that every function / variable

Re: [Wireshark-dev] Dissector functions and variables that could be static

2021-01-27 Thread Martin Mathieson via Wireshark-dev
v *On Behalf Of > *Martin Mathieson via Wireshark-dev > *Sent:* den 27 januari 2021 13:27 > *To:* Developer support list for Wireshark > *Cc:* Martin Mathieson > *Subject:* Re: [Wireshark-dev] Dissector functions and variables that > could be static > > > > Hi Joã