aboutsummaryrefslogtreecommitdiffstats
path: root/sharkd_daemon.c
AgeCommit message (Collapse)AuthorFilesLines
2018-03-13Windows: Always assign newly-created processes to our job.Gerald Combs1-5/+3
Move ws_pipe_kill_child_on_exit to win32-utils. Add win32_create_process, which calls CreateProcess + AssignProcessToJobObject. Use win32_create_process instead of CreateProcess everywhere. Bug: 1419 Change-Id: I7a1f17dddf6a73f6973d54621f271b69311400d1 Reviewed-on: https://code.wireshark.org/review/26448 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-08replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.Dario Lombardo1-1/+1
The first is deprecated, as per https://spdx.org/licenses/. Change-Id: I8e21e1d32d09b8b94b93a2dc9fbdde5ffeba6bed Reviewed-on: https://code.wireshark.org/review/25661 Petri-Dish: Anders Broman <a.broman58@gmail.com> Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-09Start using SPDX license identifiers.Gerald Combs1-13/+1
A while back Graham pointed out the SPDX project (spdx.org), which is working on standardizing license specifications: https://www.wireshark.org/lists/wireshark-dev/201509/msg00119.html Appendix V of the specification describes a short identifier (SPDX-License-Identifier) that you can use in place of boilerplate in your source files: https://spdx.org/spdx-specification-21-web-version#h.twlc0ztnng3b Start the conversion process with our top-level C and C++ files. Change-Id: Iba1d835776714deb6285e2181e8ca17f95221878 Reviewed-on: https://code.wireshark.org/review/24302 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Balint Reczey <balint@balintreczey.hu> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-11-09Replace inet_addr() with our inet_pton() wrapperJoão Valverde1-5/+2
Error checking omitted like in original code. Change-Id: If8b4181d30ddf5717951aaf7ec61db25c0bc5322 Reviewed-on: https://code.wireshark.org/review/24309 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
2017-09-24sharkd: close server file descriptor in child.Jakub Zawadzki1-0/+1
Change-Id: I65713f6d49fccb2045a99636d0d2f1aa5be44b83 Reviewed-on: https://code.wireshark.org/review/23677 Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Jakub Zawadzki <darkjames-ws@darkjames.pl>
2017-09-24sharkd: don't go to background when using stdin and stdout.Jakub Zawadzki1-10/+13
Patch will allow to use stdin/stdout on other than windows platforms. Change-Id: I729ebd4efaa1675956b085e74b413805125a7d7a Reviewed-on: https://code.wireshark.org/review/23676 Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Jakub Zawadzki <darkjames-ws@darkjames.pl>
2017-03-27Check for return value of WSAStartup on all executables.Michael Mann1-1/+6
Windows vscodeanalysis complains even though the event is probably very unlikely. Change-Id: Iafe158eea5586908209d6bfe1e45540117558673 Reviewed-on: https://code.wireshark.org/review/20727 Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-12sharkd: fix a memory leak on Windows introduced in gfe06aadPascal Quantin1-0/+1
Change-Id: I907dbc924574b02d2f1b8d7668158b5b6d2c87cf Reviewed-on: https://code.wireshark.org/review/20073 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2017-02-03sharkd: fix warning C4090: 'function' : different 'const' qualifiersPascal Quantin1-2/+4
According to https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx the lpCommandLine argument must not be const as is may cause an access violation. Change-Id: Iedd77663cd21ca8df542595890fbc7023f2c9c2b Reviewed-on: https://code.wireshark.org/review/19922 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-01Use INVALID_SOCKET for an invalid socket handle.Guy Harris1-14/+14
-1 is fine on UN*X, but, on Windows, it's INVALID_SOCKET. We define INVALID_SOCKET as (-1) on UN*X, so it can be used on both platforms. Change-Id: Ib2269ddf98c352a1d3c85e44006cc49d80750a78 Reviewed-on: https://code.wireshark.org/review/19909 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-02-01Fix some more UN*X-vs-Windows issues.Guy Harris1-3/+3
Change-Id: Ie9ad31289f0572a7e7249fcb3305849673536f05 Reviewed-on: https://code.wireshark.org/review/19908 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-02-01sharkd: windows supportJakub Zawadzki1-23/+94
Change-Id: I6581bacdea49416cc26431f66b093f36b39c5a67 Reviewed-on: https://code.wireshark.org/review/19829 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-01-26Clean up some UN*X-vs-Windows socket issues.Guy Harris1-22/+3
Have a wsutil/socket.h file, for inclusion by everything that uses sockets, that contains the UN*X-vs-Windows #includes and #defines to hide some UN*X-sockets vs. Winsock API differences. That stuff mostly comes from from extcap/extcap-base.h; have that file just include wsutil/socket.h rather than defining that stuff itself. Include it in sharkd_daemon.c. Use socklen_t for the size of things to pass to bind() as the last argument; wsutil/socket.h defines it as int on Windows. Ignore sharkd in Git. Change-Id: I3f2171b7aa613717f52305f62bfd7d43e0172dc6 Reviewed-on: https://code.wireshark.org/review/19796 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-01-26Fix sharkd compiling on WindowsMichael Mann1-5/+40
Change-Id: I8c614189159f1263d9452d495cee34d1a2c1bfcb Reviewed-on: https://code.wireshark.org/review/19790 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-25Add sharkd - daemon variantJakub Zawadzki1-0/+223
sharkd listens on UNIX socket and allows external clients to run commands like: loading file, analysing frames or running TAP(s). Change-Id: I443b2865e4adfd1c11f4f57d09ff7fce6b1e8766 Reviewed-on: https://code.wireshark.org/review/18208 Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Jakub Zawadzki <darkjames-ws@darkjames.pl>