Re: [Wireshark-dev] Future of extcap "API"

2022-08-28 Thread Jirka Novak
Hi, I drawn attached diagram. It can became part of developers doc when finished. Please, comment it. Wireshark is the one who creates command line for extcap - name of binary and its parameters. This information should be passed to helper and it will run command line. How to pass this info

Re: [Wireshark-dev] Future of extcap "API"

2022-08-24 Thread Tomasz Moń
On Wed, Aug 24, 2022 at 12:15 PM Jirka Novak wrote: > There is my view of discussed proposal: > > wireshark(1) - something(2) - helper(3) - signals(4) - extcap(5) > > (1) Wireshark should be able to start extcap. Wireshark must be able to > query for parameters of a extcap and should support contr

Re: [Wireshark-dev] Future of extcap "API"

2022-08-24 Thread Jirka Novak
Hi, On Tue, Aug 23, 2022 at 6:24 PM Jirka Novak wrote: The problem with GenerateConsoleCtrlEvent() is that the caller has to be attached to the target process console. While we could technically do so, it requires freeing any already open console because process can be attached to at most one

Re: [Wireshark-dev] Future of extcap "API"

2022-08-23 Thread Tomasz Moń
On Tue, Aug 23, 2022 at 6:24 PM Jirka Novak wrote: > > The problem with GenerateConsoleCtrlEvent() is that the caller has to > > be attached to the target process console. While we could technically > > do so, it requires freeing any already open console because process > > can be attached to at m

Re: [Wireshark-dev] Future of extcap "API"

2022-08-23 Thread Jirka Novak
Hi, Adding another helper may be helpful, as it would probably gives us greater control, and maybe also solve the "helper-script" issue in the future by putting that stuff inside Wireshark? I am just wondering if it is worth the effort. We can obviously strive for a perfect - no user interact

Re: [Wireshark-dev] Future of extcap "API"

2022-08-23 Thread Jirka Novak
Hi, What do you think about that options? I have no idea why you didn't even consider sending CTRL_BREAK_EVENT using GenerateConsoleCtrlEvent() as a graceful shutdown mechanism on Windows. Wireshark creates all extcaps with a hidden console window (CREATE_NEW_CONSOLE and SW_HIDE flags set). C

Re: [Wireshark-dev] Future of extcap "API"

2022-08-23 Thread Roland Knall
Adding another helper may be helpful, as it would probably gives us greater control, and maybe also solve the "helper-script" issue in the future by putting that stuff inside Wireshark? I am just wondering if it is worth the effort. We can obviously strive for a perfect - no user interaction requir

Re: [Wireshark-dev] Future of extcap "API"

2022-08-23 Thread Tomasz Moń
On Mon, Aug 22, 2022 at 9:37 PM Jirka Novak wrote: > >> What do you think about that options? > > > > I have no idea why you didn't even consider sending CTRL_BREAK_EVENT > > using GenerateConsoleCtrlEvent() as a graceful shutdown mechanism on > > Windows. Wireshark creates all extcaps with a hidd

Re: [Wireshark-dev] Future of extcap "API"

2022-08-22 Thread Jirka Novak
Hi, 3) It makes sense to me even I didn't tried it yet. My understanding of documentation is that 3) is more preferred in Win32 world. I see important that name of event must be agreed between wireshark and extcap. E.g. if generic "Wireshark_shutdown" is used, it shutdowns every extcap including

Re: [Wireshark-dev] Future of extcap "API"

2022-08-21 Thread Tomasz Moń
On Sun, 2022-08-21 at 15:53 +0200, Jirka Novak wrote: > My goal is to prepare library calls (at least for C) which will hide > details for developer and there will be just callback and/or global flag > that extcap should finish its work. Extcap author can use it if graceful > shutdown is require

Re: [Wireshark-dev] Future of extcap "API"

2022-08-21 Thread Jirka Novak
Hi, One of the benefits of the extcap-cli is, that we can and currently do, send an API version to the extcap utility which would allow breaking changes while still enabling a compatibility mode for older versions. Because of that, I think 2 would be an ideal scenario, just define the respons

Re: [Wireshark-dev] Future of extcap "API"

2022-08-21 Thread Roland Knall
One of the benefits of the extcap-cli is, that we can and currently do, send an API version to the extcap utility which would allow breaking changes while still enabling a compatibility mode for older versions. Because of that, I think 2 would be an ideal scenario, just define the response to th

Re: [Wireshark-dev] Future of extcap "API"

2022-08-21 Thread Jirka Novak
Hi, On Sat, Aug 6, 2022 at 1:09 PM Jirka Novak wrote: Extcap API: i) When extcap is started, dumpcap pass name of pipe to it and where it expects captured data. ii) STDOUT/STDERR is used to report messages/errors of extcap to wireshark, but it is shown/evaluated at the end of capture whi