Ask Your Question
0

what is the best way to clean up in extcap?

asked 2021-01-05 02:50:29 +0000

wiresharkyyh gravatar image

Hi, I am learning extcap and need cleanup when stop capture. I debug the code a little bit, and seems Wireshark call TerminateProcess to force terminating the child extcap process. As a result, the extcap process has no chance to end (cleanup) gracefully.

I also read https://www.wireshark.org/docs/wsdg_h..., but it didn't mention how extcap process cleanup gracefully when stop capture.

Is there a recommended mechanism to archive this? Any help is appreciated, thanks.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2021-01-05 08:38:40 +0000

grahamb gravatar image

This issue came up last year on the Wireshark dev mailing list, see here, but there was apparently no conclusion found.

There doesn't seem to be an issue for this in the Issue Tracker.

edit flag offensive delete link more

Comments

Before I asked this question, I tried the same signal(). Unfortunately as what is described in the thread, the extcap child process doesn't get any signal when stop capture.

wiresharkyyh gravatar imagewiresharkyyh ( 2021-01-05 22:03:38 +0000 )edit

Issue 17131 is filed, please continue the discussion over there. I will close this question. Thanks

wiresharkyyh gravatar imagewiresharkyyh ( 2021-01-06 00:54:16 +0000 )edit
0

answered 2021-01-05 05:19:29 +0000

Guy Harris gravatar image

I assume the idea behind extcap was to make it possible to have a relatively simple extcap program, without, for example, a pipe from dumpcap or Wireshark to the extcap program to send it messages such as a "stop capturing" message. It supports a control pipe to, for example, support changing capture parameters in the middle of the capture, but it doesn't require one.

On UN*X, you can send a signal that the program captures and treats as a "stop capturing" indication. I guess the idea was that TerminateProcess() is the Windows equivalent of kill() - but it isn't, because UN*X signals other than SIGKILL can be caught, but TerminateProcess() just kills the process, SIGKILL-style, rather than SIGTERM-style.

This needs some cleanup work. Please file an issue on this on the Wireshark issue tracker.

edit flag offensive delete link more

Comments

Sure, I will file an issue

wiresharkyyh gravatar imagewiresharkyyh ( 2021-01-05 22:04:32 +0000 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-01-05 02:50:29 +0000

Seen: 1,116 times

Last updated: Jan 06 '21