Proposed solution Particularly the pcapng “Interface Statistics Block” is always lost, which probably is why none of the built-in extcaps in Wireshark supports the Interface Statistics block at the moment:
They can’t.
From: Wireshark-dev <wireshark-dev-bounces@xxxxxxxxxxxxx>
On Behalf Of Timmy Brolin > Windows Console applications have a handler to respond to console events, the default handler simply exits the process.
Sending the console events is a little tricky, but there are workarounds, see here: https://blog.codetitans.pl/post/sending-ctrl-c-signal-to-another-application-on-windows.
> Without having done any of this, I imagine the extcap "controller" would send a console event to indicate the extcap should close the capture, e.g. the Ctrl + C or Ctrl + Break events, and if the extcap process has
a handler to catch the event, do whatever it wishes before exiting. Making the extcap "controller" keep the pipe open for the appropriate amount of time might also require work. Reading through capchild/capture_sync.c I came across this function: /* tell the child through the signal pipe that we want to quit the capture */ static void signal_pipe_capquit_to_child(capture_session *cap_session) { const char quit_msg[] = "QUIT"; int ret; g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG, "signal_pipe_capquit_to_child"); /* it doesn't matter *what* we send here, the first byte will stop the capture */ /* simply sending a "QUIT" string */ /*pipe_write_block(cap_session->signal_pipe_write_fd, SP_QUIT, quit_msg);*/ ret = ws_write(cap_session->signal_pipe_write_fd, quit_msg, sizeof quit_msg); if(ret == -1) { g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_WARNING, "signal_pipe_capquit_to_child: %d header: error %s", cap_session->signal_pipe_write_fd, g_strerror(errno)); } } It seems wireshark is supposed to send a “QUIT” string to extcap to gracefully stop a capture, 500ms before killing extcap? I have tried having the extcap listening to “kbhit()” for stdin input, but I get nothing. Is this “QUIT” message from Wireshark not piped to extcap stdin? Or am I reading the code completely wrong? On Tue, 24 Nov 2020 at 08:44, Timmy Brolin <tib@xxxxxx> wrote:
-- Graham Bloice |
- Prev by Date: Re: [Wireshark-dev] Fwd: [Season of Docs - Announcements] The 2021 Season of Docs application for organizations is open!
- Next by Date: Re: [Wireshark-dev] pcapng decoding error when preamble is shortened
- Previous by thread: [Wireshark-dev] Remote Developer Den, February 2021
- Next by thread: [Wireshark-dev] Help finding the link layer dissector call (netmon_802_11)
- Index(es):