Commit Graph

13 Commits

Author SHA1 Message Date
Gerald Combs 775bbbcded Start using SPDX license identifiers.
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-09 20:03:51 +00:00
João Valverde 3996701183 Replace inet_addr() with our inet_pton() wrapper
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-11-09 16:08:25 +00:00
Jakub Zawadzki 15b6776992 sharkd: close server file descriptor in child.
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-24 20:35:44 +00:00
Jakub Zawadzki 21f6dca753 sharkd: don't go to background when using stdin and stdout.
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-09-24 13:51:34 +00:00
Michael Mann 3b588dffcf Check for return value of WSAStartup on all executables.
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-03-27 03:14:15 +00:00
Pascal Quantin 8bc29d187d sharkd: fix a memory leak on Windows introduced in gfe06aad
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-12 17:50:45 +00:00
Pascal Quantin fe06aad460 sharkd: fix warning C4090: 'function' : different 'const' qualifiers
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-03 02:39:46 +00:00
Guy Harris 28d7753972 Use INVALID_SOCKET for an invalid socket handle.
-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-01 19:05:21 +00:00
Guy Harris c46ea01374 Fix some more UN*X-vs-Windows issues.
Change-Id: Ie9ad31289f0572a7e7249fcb3305849673536f05
Reviewed-on: https://code.wireshark.org/review/19908
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-02-01 18:18:18 +00:00
Jakub Zawadzki 2b91f04008 sharkd: windows support
Change-Id: I6581bacdea49416cc26431f66b093f36b39c5a67
Reviewed-on: https://code.wireshark.org/review/19829
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-02-01 04:36:32 +00:00
Guy Harris 5fbcfd632a Clean up some UN*X-vs-Windows socket issues.
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-26 07:00:06 +00:00
Michael Mann 19028ebab4 Fix sharkd compiling on Windows
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-26 04:08:59 +00:00
Jakub Zawadzki e2930f3b78 Add sharkd - daemon variant
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>
2017-01-25 07:19:05 +00:00