aboutsummaryrefslogtreecommitdiffstats
path: root/sharkd.h
AgeCommit message (Collapse)AuthorFilesLines
2021-07-11sharkd: various cleanups.Guy Harris1-2/+11
Extend sharkd_dissect_request() so that it can replace sharkd_dissect_columns(). Have it return a status indicating success, invalid frame number, or read error, so that the caller knows what the problem is. Pass it pointers to the wtap_rec and Buffer to use when reading packets from the file, so that if it's called in a loop iterating over all frames, those structures can be initialized once, before the loop, and cleaned up once, after the loop, rather than doing both once per loop iteration. Pass pointers to the read error code and additional read error information string pointer, so that, on a file read error, that information is available to the caller. Get rid of sharkd_dissect_columns(); instead, use sharkd_dissect_request(), with code from the loop body pulled into a callback routine. Fix that code to correctly determine whether the current frame has any comments, rather than just treating all frames that have blocks as having comments. Use _U_ to mark arguments as unused, rather than throwing in a (void) variablename; statement. Move some variables used only within a loop into the for() statement or the loop body.
2021-07-08Consistently refer to blocks that have been modified as "modified".Guy Harris1-2/+2
"User" sounds as if the blocks belong to the user; at most, the current user might have modified them directly, but they might also have, for example, run a Lua script that, unknown to them, modified comments. Also, a file might have "user comments" added by a previous user, who them wrote the file and and provided it to the current user. "Modified" seems a bit clearer than "changed".
2021-07-07Use wtap_blocks for packet commentsDavid Perry1-2/+5
Mostly functioning proof of concept for #14329. This work is intended to allow Wireshark to support multiple packet comments per packet. Uses and expands upon the `wtap_block` API in `wiretap/wtap_opttypes.h`. It attaches a `wtap_block` structure to `wtap_rec` in place of its current `opt_comment` and `packet_verdict` members to hold OPT_COMMENT and OPT_PKT_VERDICT option values.
2021-07-04sharkd: Prefer version_info.h instead of version.hJoão Valverde1-1/+0
2021-02-08sharkd: Add configuration profile and other optionsPaul Offord1-2/+7
This change adds code to allow the selection of a configuration profile during sharkd start by adding a -C command line option. A new -a option has been added to specify the api service endpoint e.g. tcp:127.0.0.1:4446 The change also adds version display (-v) and help display (-h) options. These additions have been made in a way to ensure that the original command line options still work correctly to maintain backward compatibility. The new options have been added using the getopt_long(...) function that is used by tshark to simplify the addition of further command line options. Closes #17222
2019-07-26HTTPS (almost) everywhere.Guy Harris1-1/+1
Change all wireshark.org URLs to use https. Fix some broken links while we're at it. Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c Reviewed-on: https://code.wireshark.org/review/34089 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-08-04sharkd: Return frame's color-filter colorsMichał Łabędzki1-1/+7
Return color-filter bg/fg colors for single frame if requested. Also return marked/ignored fields for frame. Change-Id: I4480b733f54991c72bea1664fa6e7337812e6231 Reviewed-on: https://code.wireshark.org/review/28304 Petri-Dish: Michal Labedzki <michal.labedzki@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Michal Labedzki <michal.labedzki@wireshark.org>
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-12-28sharkd: support for reference and previous displayed frame numberJakub Zawadzki1-2/+4
Change-Id: Iced96044a8fc414d4cb1c62bcc67f61cf44c4515 Reviewed-on: https://code.wireshark.org/review/25033 Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Jakub Zawadzki <darkjames-ws@darkjames.pl>
2017-12-08Have the frame_tvbuff.c routines not use the global cfile.Guy Harris1-1/+0
Have the routines that create them take a pointer to a struct packet_provider_data, store that in the tvbuff data, and use it to get the wtap from which packets are being read. While we're at it, don't include globals.h in any header files, and include it in source files iff the source file actually uses cfile. Add whatever includes that requires. Change-Id: I9f1ee391f951dc427ff62c80f67aa4877a37c229 Reviewed-on: https://code.wireshark.org/review/24733 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-08sharkd: add sharkd_get_frame() to get frame_data, optimize.Jakub Zawadzki1-1/+2
Add sharkd_get_frame() wrapper to limit number of cfile usage. Don't get frame_data when not needed. Change-Id: I24b96b5b184196e9dbf632c0891b2954c8281eed Reviewed-on: https://code.wireshark.org/review/24728 Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-06frame user comments: move to epan, add support for user comments in sharkd.Jakub Zawadzki1-0/+2
Change-Id: Id15edc60177b160fd09cae99de1c9e01e17d9421 Reviewed-on: https://code.wireshark.org/review/24714 Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
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-10-05sharkd: export field filter string.Jakub Zawadzki1-1/+1
This extra parameter allows to use wireshark functionality like: prepare as filter, and also apply quick filter in protocol tree (for instance show only TCP protocol fields: tcp.), Change-Id: I1f380b79e3802e6aaf646fdd4770c903ee9f3781 Reviewed-on: https://code.wireshark.org/review/23837 Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-02-24sharkd: fix redundant redeclaration of ‘cfile’ [-Wredundant-decls]Alexis La Goutte1-2/+1
Change-Id: I6ffe2d21cabfe326568b5f090c322d4dafd92d9d Reviewed-on: https://code.wireshark.org/review/20181 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> 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/+60
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>